ihevc_buf_mgr_init:
   75|  55.3k|{
   76|  55.3k|    WORD32 id;
   77|       |
   78|  55.3k|    ps_buf_mgr->u4_max_buf_cnt = BUF_MGR_MAX_CNT;
  ------------------
  |  |   37|  55.3k|#define BUF_MGR_MAX_CNT 64
  ------------------
   79|  55.3k|    ps_buf_mgr->u4_active_buf_cnt = 0;
   80|       |
   81|  3.59M|    for(id = 0; id < BUF_MGR_MAX_CNT; id++)
  ------------------
  |  |   37|  3.59M|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (81:17): [True: 3.54M, False: 55.3k]
  ------------------
   82|  3.54M|    {
   83|  3.54M|        ps_buf_mgr->au4_status[id] = 0;
   84|       |        ps_buf_mgr->apv_ptr[id] = NULL;
   85|  3.54M|    }
   86|  55.3k|}
ihevc_buf_mgr_add:
  116|   170k|{
  117|       |
  118|       |    /* Check if buffer ID is within allowed range */
  119|   170k|    if(buf_id >= (WORD32)ps_buf_mgr->u4_max_buf_cnt)
  ------------------
  |  Branch (119:8): [True: 0, False: 170k]
  ------------------
  120|      0|    {
  121|      0|        return (-1);
  122|      0|    }
  123|       |
  124|       |    /* Check if the current ID is being used to hold some other buffer */
  125|   170k|    if((ps_buf_mgr->apv_ptr[buf_id] != NULL) &&
  ------------------
  |  Branch (125:8): [True: 1.97k, False: 168k]
  ------------------
  126|  1.97k|       (ps_buf_mgr->apv_ptr[buf_id] != pv_ptr))
  ------------------
  |  Branch (126:8): [True: 0, False: 1.97k]
  ------------------
  127|      0|    {
  128|      0|        return (-1);
  129|      0|    }
  130|   170k|    ps_buf_mgr->apv_ptr[buf_id] = pv_ptr;
  131|       |
  132|   170k|    return 0;
  133|   170k|}
ihevc_buf_mgr_get_next_free:
  162|   140k|{
  163|   140k|    WORD32 id;
  164|   140k|    void *pv_ret_ptr;
  165|       |
  166|   140k|    pv_ret_ptr = NULL;
  167|   220k|    for(id = 0; id < (WORD32)ps_buf_mgr->u4_max_buf_cnt; id++)
  ------------------
  |  Branch (167:17): [True: 219k, False: 635]
  ------------------
  168|   219k|    {
  169|   219k|        ASSERT(ps_buf_mgr->au4_status[id] != 2);
  ------------------
  |  |   55|   219k|#define ASSERT(x) {}
  ------------------
  170|       |
  171|       |        /* Check if the buffer is non-null and status is zero */
  172|   219k|        if((ps_buf_mgr->au4_status[id] == 0) && (ps_buf_mgr->apv_ptr[id]))
  ------------------
  |  Branch (172:12): [True: 178k, False: 40.8k]
  |  Branch (172:49): [True: 139k, False: 38.8k]
  ------------------
  173|   139k|        {
  174|   139k|            *pi4_buf_id = id;
  175|       |            /* DEC is set to 1 */
  176|   139k|            ps_buf_mgr->au4_status[id] = 1;
  177|   139k|            pv_ret_ptr = ps_buf_mgr->apv_ptr[id];
  178|   139k|            break;
  179|   139k|        }
  180|   219k|    }
  181|       |
  182|   140k|    return pv_ret_ptr;
  183|   140k|}
ihevc_buf_mgr_release:
  256|   161k|{
  257|       |    /* If the given id is pointing to an id which is not yet added */
  258|   161k|    if(buf_id >= (WORD32)ps_buf_mgr->u4_max_buf_cnt)
  ------------------
  |  Branch (258:8): [True: 0, False: 161k]
  ------------------
  259|      0|    {
  260|      0|        return (-1);
  261|      0|    }
  262|       |
  263|   161k|    ps_buf_mgr->au4_status[buf_id] &= ~mask;
  264|   161k|    ASSERT(ps_buf_mgr->au4_status[buf_id] != 2);
  ------------------
  |  |   55|   161k|#define ASSERT(x) {}
  ------------------
  265|       |
  266|       |    /* If both the REF and DISP are zero, DEC is set to zero */
  267|   161k|    if(ps_buf_mgr->au4_status[buf_id] == 1)
  ------------------
  |  Branch (267:8): [True: 92.1k, False: 69.0k]
  ------------------
  268|  92.1k|    {
  269|  92.1k|        ps_buf_mgr->au4_status[buf_id] = 0;
  270|  92.1k|    }
  271|       |
  272|   161k|    return 0;
  273|   161k|}
ihevc_buf_mgr_set_status:
  308|   209k|{
  309|   209k|    if(buf_id >= (WORD32)ps_buf_mgr->u4_max_buf_cnt)
  ------------------
  |  Branch (309:8): [True: 0, False: 209k]
  ------------------
  310|      0|    {
  311|      0|        return (-1);
  312|      0|    }
  313|       |
  314|       |
  315|   209k|    if((ps_buf_mgr->au4_status[buf_id] & mask) != 0)
  ------------------
  |  Branch (315:8): [True: 0, False: 209k]
  ------------------
  316|      0|    {
  317|      0|        return (-1);
  318|      0|    }
  319|       |
  320|   209k|    ps_buf_mgr->au4_status[buf_id] |= mask;
  321|   209k|    ASSERT(ps_buf_mgr->au4_status[buf_id] != 2);
  ------------------
  |  |   55|   209k|#define ASSERT(x) {}
  ------------------
  322|   209k|    return 0;
  323|   209k|}

ihevc_intra_pred_chroma_ref_substitution:
  135|  3.38M|{
  136|  3.38M|    UWORD8 pu1_ref_u, pu1_ref_v;
  137|  3.38M|    WORD32 dc_val, i, j;
  138|  3.38M|    WORD32 total_samples = (4 * nt) + 1;
  139|  3.38M|    WORD32 get_bits;
  140|  3.38M|    WORD32 next;
  141|  3.38M|    WORD32 bot_left, left, top, tp_right, tp_left;
  142|  3.38M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  143|  3.38M|    WORD32 a_nbr_flag[5];
  144|  3.38M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  3.38M|#define UNUSED(x) ((void)(x))
  ------------------
  145|       |    /* Neighbor Flag Structure*/
  146|       |    /* WORD32 nbr_flags MSB-->LSB   TOP LEFT | TOP-RIGHT |  TOP   | LEFT    | BOTTOM LEFT*/
  147|       |    /*                              (1 bit)     (4 bits)  (4 bits) (4 bits)  (4 bits)  */
  148|       |
  149|  3.38M|    if(nbr_flags == 0)
  ------------------
  |  Branch (149:8): [True: 33.5k, False: 3.35M]
  ------------------
  150|  33.5k|    {
  151|       |/* If no neighbor flags are present, fill the neighbor samples with DC value */
  152|       |        /*dc_val = 1 << (BIT_DEPTH - 1);*/
  153|  33.5k|        dc_val = 1 << (8 - 1);
  154|  2.46M|        for(i = 0; i < (2 * total_samples); i++)
  ------------------
  |  Branch (154:20): [True: 2.43M, False: 33.5k]
  ------------------
  155|  2.43M|        {
  156|  2.43M|            pu1_dst[i] = dc_val;
  157|  2.43M|        }
  158|  33.5k|    }
  159|  3.35M|    else
  160|  3.35M|    {
  161|       |        /* Else fill the corresponding samples */
  162|       |
  163|       |        /* Check for the neighbors availibility */
  164|  3.35M|        tp_left     = (nbr_flags & 0x10000);
  165|  3.35M|        tp_right    = (nbr_flags & 0x0f000);
  166|  3.35M|        top         = (nbr_flags & 0x00f00);
  167|  3.35M|        left        = (nbr_flags & 0x000f0);
  168|  3.35M|        bot_left    = (nbr_flags & 0x0000f);
  169|       |
  170|       |        /* Fill nbrs depending on avalibility */
  171|       |        /* Top -Left nbrs  */
  172|  3.35M|        if(0 != tp_left)
  ------------------
  |  Branch (172:12): [True: 2.91M, False: 433k]
  ------------------
  173|  2.91M|        {
  174|  2.91M|            pu1_dst[(4 * nt)] = *pu1_top_left; // U top-left sample
  175|  2.91M|            pu1_dst[(4 * nt) + 1] = *(pu1_top_left + 1); // V top-left sample
  176|  2.91M|        }
  177|       |        /* Left nbrs  */
  178|  3.35M|        if(0 != left)
  ------------------
  |  Branch (178:12): [True: 3.22M, False: 125k]
  ------------------
  179|  3.22M|        {
  180|  33.5M|            for(i = 0, j = 0; i < (2 * nt); i += 2)
  ------------------
  |  Branch (180:31): [True: 30.3M, False: 3.22M]
  ------------------
  181|  30.3M|            {
  182|  30.3M|                pu1_dst[(4 * nt) - 2 - i] = pu1_left[j * src_strd]; // U left samples
  183|  30.3M|                pu1_dst[(4 * nt) - 1 - i] = pu1_left[(j * src_strd) + 1]; // V left samples
  184|  30.3M|                j++;
  185|  30.3M|            }
  186|  3.22M|        }
  187|       |        /* Bottom - Left nbrs  */
  188|  3.35M|        if(0 != bot_left)
  ------------------
  |  Branch (188:12): [True: 968k, False: 2.38M]
  ------------------
  189|   968k|        {
  190|  9.49M|            for(i = (2 * nt), j = nt; i < (4 * nt); i += 2)
  ------------------
  |  Branch (190:39): [True: 8.52M, False: 968k]
  ------------------
  191|  8.52M|            {
  192|  8.52M|                pu1_dst[(4 * nt) - 2 - i] = pu1_left[j * src_strd]; // U left samples
  193|  8.52M|                pu1_dst[(4 * nt) - 1 - i] = pu1_left[(j * src_strd) + 1]; // V left samples
  194|  8.52M|                j++;
  195|  8.52M|            }
  196|   968k|        }
  197|       |        /* Top nbrs  */
  198|  3.35M|        if(0 != top)
  ------------------
  |  Branch (198:12): [True: 3.05M, False: 299k]
  ------------------
  199|  3.05M|        {
  200|  3.05M|            memcpy(&pu1_dst[(4 * nt) + 2], pu1_top, 2 * nt);
  201|       |            // U-V interleaved Top-top right samples
  202|  3.05M|        }
  203|       |
  204|       |        /* Top - Right nbrs  */
  205|  3.35M|        if(0 != tp_right)
  ------------------
  |  Branch (205:12): [True: 1.98M, False: 1.37M]
  ------------------
  206|  1.98M|        {
  207|  1.98M|            memcpy(&pu1_dst[(4 * nt) + 2 + 2 * nt], pu1_top + 2 * nt, 2 * nt);
  208|       |            // U-V interleaved Top-top right samples
  209|  1.98M|        }
  210|       |
  211|  3.35M|        if(nt == 4 || (nt == 8 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (211:12): [True: 1.19M, False: 2.15M]
  |  Branch (211:24): [True: 956k, False: 1.19M]
  |  Branch (211:35): [True: 0, False: 956k]
  ------------------
  212|  1.22M|        {
  213|       |            /* 1 bit extraction for all the neighboring blocks */
  214|  1.22M|            tp_left = (nbr_flags & 0x10000) >> 16;
  215|  1.22M|            bot_left = (nbr_flags & 0x8) >> 3;
  216|  1.22M|            left = (nbr_flags & 0x80) >> 7;
  217|  1.22M|            top = (nbr_flags & 0x100) >> 8;
  218|  1.22M|            tp_right = (nbr_flags & 0x1000) >> 12;
  219|       |
  220|  1.22M|            next = 1;
  221|  1.22M|            a_nbr_flag[0] = bot_left;
  222|  1.22M|            a_nbr_flag[1] = left;
  223|  1.22M|            a_nbr_flag[2] = tp_left;
  224|  1.22M|            a_nbr_flag[3] = top;
  225|  1.22M|            a_nbr_flag[4] = tp_right;
  226|       |
  227|       |            /* If bottom -left is not available, reverse substitution process*/
  228|  1.22M|            if(bot_left == 0)
  ------------------
  |  Branch (228:16): [True: 859k, False: 366k]
  ------------------
  229|   859k|            {
  230|       |                /* Check for the 1st available sample from bottom-left*/
  231|   975k|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (231:23): [True: 116k, False: 859k]
  ------------------
  232|   116k|                    next++;
  233|       |
  234|       |                /* If Left, top-left are available*/
  235|   859k|                if(next <= 2)
  ------------------
  |  Branch (235:20): [True: 801k, False: 57.7k]
  ------------------
  236|   801k|                {
  237|   801k|                    UWORD16 *pu2_dst;
  238|   801k|                    idx = (nt * next);
  239|   801k|                    pu2_dst = (UWORD16 *)&pu1_dst[2 * idx];
  240|   801k|                    ihevc_memset_16bit((UWORD16 *)pu1_dst, pu2_dst[0], idx);
  241|   801k|                }
  242|  57.7k|                else /* If top, top-right are available */
  243|  57.7k|                {
  244|  57.7k|                    UWORD16 *pu2_dst;
  245|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available*/
  246|  57.7k|                    idx = (nt * (next - 1)) + 1;
  247|  57.7k|                    pu2_dst = (UWORD16 *)&pu1_dst[2 * idx];
  248|  57.7k|                    ihevc_memset_16bit((UWORD16 *)pu1_dst, pu2_dst[0], idx);
  249|  57.7k|                }
  250|   859k|            }
  251|       |
  252|  1.22M|            if(left == 0)
  ------------------
  |  Branch (252:16): [True: 58.1k, False: 1.16M]
  ------------------
  253|  58.1k|            {
  254|  58.1k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(2 * nt) - 2];
  255|  58.1k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(2 * nt)], pu2_dst[0], nt);
  256|       |
  257|       |
  258|  58.1k|            }
  259|  1.22M|            if(tp_left == 0)
  ------------------
  |  Branch (259:16): [True: 143k, False: 1.08M]
  ------------------
  260|   143k|            {
  261|   143k|                pu1_dst[4 * nt] = pu1_dst[(4 * nt) - 2];
  262|   143k|                pu1_dst[(4 * nt) + 1] = pu1_dst[(4 * nt) - 1];
  263|   143k|            }
  264|  1.22M|            if(top == 0)
  ------------------
  |  Branch (264:16): [True: 85.8k, False: 1.13M]
  ------------------
  265|  85.8k|            {
  266|  85.8k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(4 * nt)];
  267|  85.8k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(4 * nt) + 2], pu2_dst[0], nt);
  268|       |
  269|       |
  270|  85.8k|            }
  271|  1.22M|            if(tp_right == 0)
  ------------------
  |  Branch (271:16): [True: 523k, False: 701k]
  ------------------
  272|   523k|            {
  273|   523k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(6 * nt)];
  274|   523k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(6 * nt) + 2], pu2_dst[0], nt);
  275|       |
  276|       |
  277|   523k|            }
  278|  1.22M|        }
  279|  2.12M|        else if(nt == 8 || (nt == 16 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (279:17): [True: 923k, False: 1.20M]
  |  Branch (279:29): [True: 1.20M, False: 18.4E]
  |  Branch (279:41): [True: 0, False: 1.20M]
  ------------------
  280|   956k|        {
  281|   956k|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (281:33): [True: 0, False: 956k]
  ------------------
  282|   956k|            WORD32 nbr_flags_temp = 0;
  283|   956k|            nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4)
  284|   956k|                            + ((nbr_flags & 0x300) >> 4)
  285|   956k|                            + ((nbr_flags & 0x3000) >> 6)
  286|   956k|                            + ((nbr_flags & 0x10000) >> 8);
  287|       |
  288|       |            /* compute trailing zeors based on nbr_flag for substitution process of below left see section .*/
  289|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  290|   956k|            {
  291|   956k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * (4 * sub_sample); /* for bottom left and left */
  ------------------
  |  |   43|   956k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 36.7k, False: 919k]
  |  |  ------------------
  ------------------
  292|   956k|                if(nbr_id_from_bl == 32 * sub_sample)
  ------------------
  |  Branch (292:20): [True: 36.7k, False: 919k]
  ------------------
  293|  36.7k|                    nbr_id_from_bl = 16 * sub_sample;
  294|   956k|                if(nbr_id_from_bl == 16 * sub_sample)
  ------------------
  |  Branch (294:20): [True: 36.7k, False: 919k]
  ------------------
  295|  36.7k|                {
  296|       |                    /* for top left : 1 pel per nbr bit */
  297|  36.7k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (297:24): [True: 36.5k, False: 213]
  ------------------
  298|  36.5k|                    {
  299|  36.5k|                        nbr_id_from_bl++;
  300|  36.5k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 4 * sub_sample; /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  36.5k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 36.5k]
  |  |  ------------------
  ------------------
  301|       |
  302|  36.5k|                    }
  303|  36.7k|                }
  304|       |                /* Reverse Substitution Process*/
  305|   956k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (305:20): [True: 645k, False: 310k]
  ------------------
  306|   645k|                {
  307|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  308|   645k|                    pu1_ref_u = pu1_dst[2 * nbr_id_from_bl];
  309|   645k|                    pu1_ref_v = pu1_dst[(2 * nbr_id_from_bl) + 1];
  310|  6.13M|                    for(i = 2 * (nbr_id_from_bl - 1); i >= 0; i -= 2)
  ------------------
  |  Branch (310:55): [True: 5.48M, False: 645k]
  ------------------
  311|  5.48M|                    {
  312|  5.48M|                        pu1_dst[i] = pu1_ref_u;
  313|  5.48M|                        pu1_dst[i + 1] = pu1_ref_v;
  314|  5.48M|                    }
  315|   645k|                }
  316|   956k|            }
  317|       |
  318|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  319|  8.14M|            while(nbr_id_from_bl < ((T8C_4NT * sub_sample)+1))
  ------------------
  |  |   84|  8.14M|#define T8C_4NT 32
  ------------------
  |  Branch (319:19): [True: 7.18M, False: 956k]
  ------------------
  320|  7.18M|            {
  321|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  322|       |                /* Divide by 8 to obtain the original index */
  323|  7.18M|                frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2)); /*+ (nbr_id_from_bl & 0x1);*/
  ------------------
  |  Branch (323:53): [True: 0, False: 7.18M]
  ------------------
  324|       |
  325|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  326|  7.18M|                if(nbr_id_from_bl == (T8C_4NT * sub_sample / 2))
  ------------------
  |  |   84|  7.18M|#define T8C_4NT 32
  ------------------
  |  Branch (326:20): [True: 917k, False: 6.26M]
  ------------------
  327|   917k|                {
  328|   917k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   917k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  329|       |
  330|       |                    /* only pel substitution for TL */
  331|   917k|                    if(!get_bits)
  ------------------
  |  Branch (331:24): [True: 56.7k, False: 861k]
  ------------------
  332|  56.7k|                    {
  333|  56.7k|                        pu1_dst[2 * nbr_id_from_bl] = pu1_dst[(2 * nbr_id_from_bl) - 2];
  334|  56.7k|                        pu1_dst[(2 * nbr_id_from_bl) + 1] = pu1_dst[(2 * nbr_id_from_bl) - 1];
  335|  56.7k|                    }
  336|   917k|                }
  337|  6.26M|                else
  338|  6.26M|                {
  339|  6.26M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  6.26M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  340|  6.26M|                    if(!get_bits)
  ------------------
  |  Branch (340:24): [True: 936k, False: 5.33M]
  ------------------
  341|   936k|                    {
  342|   936k|                        UWORD16 *pu2_dst;
  343|       |                        /* 8 pel substitution (other than TL) */
  344|   936k|                        pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2];
  345|   936k|                        ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample);
  346|   936k|                    }
  347|       |
  348|  6.26M|                }
  349|  7.18M|                nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   84|  7.18M|#define T8C_4NT 32
  ------------------
  |  Branch (349:35): [True: 917k, False: 6.26M]
  ------------------
  350|  7.18M|            }
  351|       |
  352|   956k|        }
  353|  1.16M|        else if(nt == 16 || (nt == 32 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (353:17): [True: 1.16M, False: 0]
  |  Branch (353:30): [True: 0, False: 0]
  |  Branch (353:42): [True: 0, False: 0]
  ------------------
  354|  1.20M|        {
  355|  1.20M|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (355:33): [True: 0, False: 1.20M]
  ------------------
  356|       |            /* compute trailing ones based on mbr_flag for substitution process of below left see section .*/
  357|       |            /* as each bit in nbr flags corresponds to 4 pels for bot_left, left, top and topright but 1 pel for topleft */
  358|  1.20M|            {
  359|  1.20M|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4 * sub_sample; /* for bottom left and left */
  ------------------
  |  |   43|  1.20M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 28.4k, False: 1.17M]
  |  |  ------------------
  ------------------
  360|       |
  361|  1.20M|                if(nbr_id_from_bl == 32 * sub_sample)
  ------------------
  |  Branch (361:20): [True: 28.4k, False: 1.17M]
  ------------------
  362|  28.4k|                {
  363|       |                    /* for top left : 1 pel per nbr bit */
  364|  28.4k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (364:24): [True: 28.1k, False: 324]
  ------------------
  365|  28.1k|                    {
  366|       |                        /* top left not available */
  367|  28.1k|                        nbr_id_from_bl++;
  368|       |                        /* top and top right;  4 pels per nbr bit */
  369|  28.1k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4 * sub_sample;
  ------------------
  |  |   43|  28.1k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 28.1k]
  |  |  ------------------
  ------------------
  370|  28.1k|                    }
  371|  28.4k|                }
  372|       |                /* Reverse Substitution Process*/
  373|  1.20M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (373:20): [True: 918k, False: 283k]
  ------------------
  374|   918k|                {
  375|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  376|   918k|                    pu1_ref_u = pu1_dst[2 * nbr_id_from_bl];
  377|   918k|                    pu1_ref_v = pu1_dst[2 * nbr_id_from_bl + 1];
  378|  16.0M|                    for(i = (2 * (nbr_id_from_bl - 1)); i >= 0; i -= 2)
  ------------------
  |  Branch (378:57): [True: 15.1M, False: 918k]
  ------------------
  379|  15.1M|                    {
  380|  15.1M|                        pu1_dst[i] = pu1_ref_u;
  381|  15.1M|                        pu1_dst[i + 1] = pu1_ref_v;
  382|  15.1M|                    }
  383|   918k|                }
  384|  1.20M|            }
  385|       |
  386|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  387|  17.7M|            while(nbr_id_from_bl < ((T16C_4NT * sub_sample)+1))
  ------------------
  |  |   83|  17.7M|#define T16C_4NT 64
  ------------------
  |  Branch (387:19): [True: 16.5M, False: 1.20M]
  ------------------
  388|  16.5M|            {
  389|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  390|       |                /* Devide by 4 to obtain the original index */
  391|  16.5M|                frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2)); /*+ (nbr_id_from_bl & 0x1);*/
  ------------------
  |  Branch (391:53): [True: 0, False: 16.5M]
  ------------------
  392|       |
  393|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  394|  16.5M|                if(nbr_id_from_bl == (T16C_4NT * sub_sample / 2))
  ------------------
  |  |   83|  16.5M|#define T16C_4NT 64
  ------------------
  |  Branch (394:20): [True: 1.17M, False: 15.3M]
  ------------------
  395|  1.17M|                {
  396|  1.17M|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|  1.17M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  397|       |                    /* only pel substitution for TL */
  398|  1.17M|                    if(!get_bits)
  ------------------
  |  Branch (398:24): [True: 173k, False: 1.00M]
  ------------------
  399|   173k|                    {
  400|   173k|                        pu1_dst[2 * nbr_id_from_bl] = pu1_dst[(2 * nbr_id_from_bl) - 2];
  401|   173k|                        pu1_dst[(2 * nbr_id_from_bl) + 1] = pu1_dst[(2 * nbr_id_from_bl) - 1];
  402|   173k|                    }
  403|  1.17M|                }
  404|  15.3M|                else
  405|  15.3M|                {
  406|  15.3M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  15.3M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  407|  15.3M|                    if(!get_bits)
  ------------------
  |  Branch (407:24): [True: 2.58M, False: 12.7M]
  ------------------
  408|  2.58M|                    {
  409|  2.58M|                        UWORD16 *pu2_dst;
  410|       |                        /* 4 pel substitution (other than TL) */
  411|  2.58M|                        pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2];
  412|  2.58M|                        ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample);
  413|  2.58M|                    }
  414|       |
  415|  15.3M|                }
  416|  16.5M|                nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   83|  16.5M|#define T16C_4NT 64
  ------------------
  |  Branch (416:35): [True: 1.17M, False: 15.3M]
  ------------------
  417|  16.5M|            }
  418|  1.20M|        }
  419|  3.35M|    }
  420|  3.38M|}
ihevc_intra_pred_chroma_planar:
  560|   424k|{
  561|       |
  562|   424k|    WORD32 row, col;
  563|   424k|    WORD32 log2nt = 5;
  564|   424k|    WORD32 two_nt, three_nt;
  565|   424k|    UNUSED(src_strd);
  ------------------
  |  |   38|   424k|#define UNUSED(x) ((void)(x))
  ------------------
  566|   424k|    UNUSED(mode);
  ------------------
  |  |   38|   424k|#define UNUSED(x) ((void)(x))
  ------------------
  567|   424k|    switch(nt)
  568|   424k|    {
  569|   118k|        case 16:
  ------------------
  |  Branch (569:9): [True: 118k, False: 305k]
  ------------------
  570|   118k|            log2nt = 4;
  571|   118k|            break;
  572|   177k|        case 8:
  ------------------
  |  Branch (572:9): [True: 177k, False: 247k]
  ------------------
  573|   177k|            log2nt = 3;
  574|   177k|            break;
  575|   129k|        case 4:
  ------------------
  |  Branch (575:9): [True: 129k, False: 295k]
  ------------------
  576|   129k|            log2nt = 2;
  577|   129k|            break;
  578|      0|        default:
  ------------------
  |  Branch (578:9): [True: 0, False: 424k]
  ------------------
  579|      0|            break;
  580|   424k|    }
  581|   424k|    two_nt = 2 * nt;
  582|   424k|    three_nt = 3 * nt;
  583|       |    /* Planar filtering */
  584|  4.19M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (584:18): [True: 3.77M, False: 424k]
  ------------------
  585|  3.77M|    {
  586|  46.7M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (586:22): [True: 42.9M, False: 3.77M]
  ------------------
  587|  42.9M|        {
  588|  42.9M|            pu1_dst[row * dst_strd + col] = ((nt - 1 - col / 2)
  589|  42.9M|                            * pu1_ref[2 * (two_nt - 1 - row)]
  590|  42.9M|                            + (col / 2 + 1) * pu1_ref[2 * (three_nt + 1)]
  591|  42.9M|                            + (nt - 1 - row) * pu1_ref[2 * (two_nt + 1) + col]
  592|  42.9M|                            + (row + 1) * pu1_ref[2 * (nt - 1)] + nt) >> (log2nt + 1);
  593|       |
  594|  42.9M|            pu1_dst[row * dst_strd + col + 1] = ((nt - 1 - col / 2)
  595|  42.9M|                            * pu1_ref[2 * (two_nt - 1 - row) + 1]
  596|  42.9M|                            + (col / 2 + 1) * pu1_ref[2 * (three_nt + 1) + 1]
  597|  42.9M|                            + (nt - 1 - row) * pu1_ref[2 * (two_nt + 1) + col + 1]
  598|  42.9M|                            + (row + 1) * pu1_ref[2 * (nt - 1) + 1] + nt) >> (log2nt + 1);
  599|  42.9M|        }
  600|  3.77M|    }
  601|   424k|}
ihevc_intra_pred_chroma_dc:
  648|   174k|{
  649|       |
  650|   174k|    WORD32 acc_dc_u, acc_dc_v;
  651|   174k|    WORD32 dc_val_u, dc_val_v;
  652|   174k|    WORD32 i;
  653|   174k|    WORD32 row, col;
  654|   174k|    WORD32 log2nt = 5;
  655|   174k|    UNUSED(mode);
  ------------------
  |  |   38|   174k|#define UNUSED(x) ((void)(x))
  ------------------
  656|   174k|    UNUSED(src_strd);
  ------------------
  |  |   38|   174k|#define UNUSED(x) ((void)(x))
  ------------------
  657|   174k|    switch(nt)
  658|   174k|    {
  659|      0|        case 32:
  ------------------
  |  Branch (659:9): [True: 0, False: 174k]
  ------------------
  660|      0|            log2nt = 5;
  661|      0|            break;
  662|  33.9k|        case 16:
  ------------------
  |  Branch (662:9): [True: 33.9k, False: 140k]
  ------------------
  663|  33.9k|            log2nt = 4;
  664|  33.9k|            break;
  665|  59.6k|        case 8:
  ------------------
  |  Branch (665:9): [True: 59.6k, False: 114k]
  ------------------
  666|  59.6k|            log2nt = 3;
  667|  59.6k|            break;
  668|  80.6k|        case 4:
  ------------------
  |  Branch (668:9): [True: 80.6k, False: 93.3k]
  ------------------
  669|  80.6k|            log2nt = 2;
  670|  80.6k|            break;
  671|      0|        default:
  ------------------
  |  Branch (671:9): [True: 0, False: 174k]
  ------------------
  672|      0|            break;
  673|   174k|    }
  674|       |
  675|       |
  676|   174k|    acc_dc_u = 0;
  677|   174k|    acc_dc_v = 0;
  678|       |    /* Calculate DC value for the transform block */
  679|  1.51M|    for(i = (2 * nt); i < (4 * nt); i += 2)
  ------------------
  |  Branch (679:23): [True: 1.34M, False: 174k]
  ------------------
  680|  1.34M|    {
  681|  1.34M|        acc_dc_u += pu1_ref[i];
  682|  1.34M|        acc_dc_v += pu1_ref[i + 1];
  683|  1.34M|    }
  684|  1.51M|    for(i = ((4 * nt) + 2); i < ((6 * nt) + 2); i += 2)
  ------------------
  |  Branch (684:29): [True: 1.34M, False: 174k]
  ------------------
  685|  1.34M|    {
  686|  1.34M|        acc_dc_u += pu1_ref[i];
  687|  1.34M|        acc_dc_v += pu1_ref[i + 1];
  688|  1.34M|    }
  689|       |
  690|       |
  691|   174k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  692|   174k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  693|       |
  694|       |
  695|       |    /* Fill the remaining rows with DC value*/
  696|  1.51M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (696:18): [True: 1.33M, False: 174k]
  ------------------
  697|  1.33M|    {
  698|  15.0M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (698:22): [True: 13.7M, False: 1.33M]
  ------------------
  699|  13.7M|        {
  700|  13.7M|            pu1_dst[(row * dst_strd) + col] = dc_val_u;
  701|  13.7M|            pu1_dst[(row * dst_strd) + col + 1] = dc_val_v;
  702|  13.7M|        }
  703|  1.33M|    }
  704|       |
  705|   174k|}
ihevc_intra_pred_chroma_horz:
  752|  50.9k|{
  753|       |
  754|  50.9k|    WORD32 row, col;
  755|  50.9k|    UNUSED(mode);
  ------------------
  |  |   38|  50.9k|#define UNUSED(x) ((void)(x))
  ------------------
  756|  50.9k|    UNUSED(src_strd);
  ------------------
  |  |   38|  50.9k|#define UNUSED(x) ((void)(x))
  ------------------
  757|       |    /* Replication to next rows*/
  758|   381k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (758:18): [True: 330k, False: 50.9k]
  ------------------
  759|   330k|    {
  760|  3.20M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (760:22): [True: 2.87M, False: 330k]
  ------------------
  761|  2.87M|        {
  762|  2.87M|            pu1_dst[(row * dst_strd) + col] = pu1_ref[(4 * nt) - 2 - 2 * row];
  763|  2.87M|            pu1_dst[(row * dst_strd) + col + 1] = pu1_ref[(4 * nt) - 1 - 2 * row];
  764|  2.87M|        }
  765|   330k|    }
  766|  50.9k|}
ihevc_intra_pred_chroma_ver:
  814|   216k|{
  815|   216k|    WORD32 row, col;
  816|   216k|    UNUSED(mode);
  ------------------
  |  |   38|   216k|#define UNUSED(x) ((void)(x))
  ------------------
  817|   216k|    UNUSED(src_strd);
  ------------------
  |  |   38|   216k|#define UNUSED(x) ((void)(x))
  ------------------
  818|       |    /* Replication to next columns*/
  819|  2.00M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (819:18): [True: 1.79M, False: 216k]
  ------------------
  820|  1.79M|    {
  821|  20.8M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (821:22): [True: 19.0M, False: 1.79M]
  ------------------
  822|  19.0M|        {
  823|  19.0M|            pu1_dst[(row * dst_strd) + col] = pu1_ref[(4 * nt) + 2 + col];
  824|  19.0M|            pu1_dst[(row * dst_strd) + col + 1] = pu1_ref[(4 * nt) + 3 + col];
  825|  19.0M|        }
  826|  1.79M|    }
  827|   216k|}
ihevc_intra_pred_chroma_mode2:
  874|  48.6k|{
  875|  48.6k|    WORD32 row, col;
  876|       |
  877|  48.6k|    WORD32 intra_pred_ang = 32;
  878|  48.6k|    WORD32 idx_u, idx_v;
  879|  48.6k|    UNUSED(src_strd);
  ------------------
  |  |   38|  48.6k|#define UNUSED(x) ((void)(x))
  ------------------
  880|  48.6k|    UNUSED(mode);
  ------------------
  |  |   38|  48.6k|#define UNUSED(x) ((void)(x))
  ------------------
  881|       |    /* For the angle 45, replication is done from the corresponding angle */
  882|       |    /* intra_pred_ang = tan(angle) in q5 format */
  883|   587k|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (883:18): [True: 539k, False: 48.6k]
  ------------------
  884|   539k|    {
  885|   539k|        idx_u = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  886|   539k|        idx_v = (((col + 1) + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  887|  8.02M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (887:22): [True: 7.48M, False: 539k]
  ------------------
  888|  7.48M|        {
  889|  7.48M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[(4 * nt) - 2 * row - idx_u - 3];
  890|  7.48M|            pu1_dst[(col + 1) + (row * dst_strd)] = pu1_ref[(4 * nt) - 2 * row - idx_v - 1];
  891|  7.48M|        }
  892|   539k|    }
  893|       |
  894|  48.6k|}
ihevc_intra_pred_chroma_mode_18_34:
  941|  48.8k|{
  942|  48.8k|    WORD32 row, col;
  943|  48.8k|    WORD32 intra_pred_ang;
  944|  48.8k|    WORD32 idx = 0;
  945|  48.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  48.8k|#define UNUSED(x) ((void)(x))
  ------------------
  946|  48.8k|    intra_pred_ang = 32; /*Default value*/
  947|       |    /* For mode 18, angle is -45degree */
  948|  48.8k|    if(mode == 18)
  ------------------
  |  Branch (948:8): [True: 11.4k, False: 37.3k]
  ------------------
  949|  11.4k|        intra_pred_ang = -32;
  950|       |    /* For mode 34, angle is 45degree */
  951|  37.3k|    else if(mode == 34)
  ------------------
  |  Branch (951:13): [True: 37.3k, False: 18.4E]
  ------------------
  952|  37.3k|        intra_pred_ang = 32;
  953|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
  954|       |    /* No interpolation is done for 45 degree*/
  955|   375k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (955:18): [True: 327k, False: 48.8k]
  ------------------
  956|   327k|    {
  957|   327k|        idx = ((row + 1) * intra_pred_ang) >> 5;
  958|       |
  959|  3.16M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (959:22): [True: 2.83M, False: 327k]
  ------------------
  960|  2.83M|        {
  961|  2.83M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[(4 * nt) + col + 2 * idx + 2];
  962|  2.83M|            pu1_dst[(col + 1) + (row * dst_strd)] = pu1_ref[(4 * nt) + (col + 1) + 2 * idx + 2];
  963|  2.83M|        }
  964|       |
  965|   327k|    }
  966|       |
  967|  48.8k|}
ihevc_intra_pred_chroma_mode_3_to_9:
 1014|  92.9k|{
 1015|  92.9k|    WORD32 row, col;
 1016|       |
 1017|  92.9k|    WORD32 intra_pred_ang;
 1018|  92.9k|    WORD32 idx_u, ref_main_idx_u;
 1019|  92.9k|    WORD32 idx_v, ref_main_idx_v;
 1020|  92.9k|    WORD32 pos_u, fract_u;
 1021|  92.9k|    WORD32 pos_v, fract_v;
 1022|  92.9k|    UNUSED(src_strd);
  ------------------
  |  |   38|  92.9k|#define UNUSED(x) ((void)(x))
  ------------------
 1023|       |    /* Intra Pred Angle according to the mode */
 1024|  92.9k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1025|       |
 1026|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1027|       |    /* samples dependent on distance to obtain destination sample */
 1028|       |
 1029|   914k|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1029:18): [True: 821k, False: 92.9k]
  ------------------
 1030|   821k|    {
 1031|   821k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1032|   821k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1033|       |
 1034|   821k|        idx_u = pos_u >> 5;
 1035|   821k|        fract_u = pos_u & (31);
 1036|       |
 1037|   821k|        idx_v = pos_v >> 5;
 1038|   821k|        fract_v = pos_v & (31);
 1039|       |        // Do linear filtering
 1040|  10.5M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1040:22): [True: 9.71M, False: 821k]
  ------------------
 1041|  9.71M|        {
 1042|  9.71M|            ref_main_idx_u = (4 * nt) - 2 * row - 2 * idx_u - 2;
 1043|  9.71M|            ref_main_idx_v = (4 * nt) - 2 * row - 2 * idx_v - 1;
 1044|       |
 1045|  9.71M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract_u)
 1046|  9.71M|                            * pu1_ref[ref_main_idx_u]
 1047|  9.71M|                            + fract_u * pu1_ref[ref_main_idx_u - 2] + 16) >> 5);
 1048|       |
 1049|  9.71M|            pu1_dst[(col + 1) + (row * dst_strd)] = (((32 - fract_v)
 1050|  9.71M|                            * pu1_ref[ref_main_idx_v]
 1051|  9.71M|                            + fract_v * pu1_ref[ref_main_idx_v - 2] + 16) >> 5);
 1052|  9.71M|        }
 1053|       |
 1054|   821k|    }
 1055|       |
 1056|  92.9k|}
ihevc_intra_pred_chroma_mode_11_to_17:
 1103|  67.6k|{
 1104|       |    /* This function and ihevc_intra_pred_CHROMA_mode_19_to_25 are same except*/
 1105|       |    /* for ref main & side samples assignment,can be combined for */
 1106|       |    /* optimzation*/
 1107|       |
 1108|  67.6k|    WORD32 row, col, k;
 1109|  67.6k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1110|  67.6k|    WORD32 idx_u, idx_v, ref_main_idx_u, ref_main_idx_v, ref_idx;
 1111|  67.6k|    WORD32 pos_u, pos_v, fract_u, fract_v;
 1112|       |
 1113|  67.6k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 2];
 1114|  67.6k|    UWORD8 *ref_main;
 1115|  67.6k|    UNUSED(src_strd);
  ------------------
  |  |   38|  67.6k|#define UNUSED(x) ((void)(x))
  ------------------
 1116|  67.6k|    inv_ang_sum = 128;
 1117|       |
 1118|  67.6k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1119|       |
 1120|  67.6k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1121|       |    /* Intermediate reference samples for negative angle modes */
 1122|       |    /* This have to be removed during optimization*/
 1123|       |
 1124|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1125|       |
 1126|       |
 1127|  67.6k|    ref_main = ref_temp + 2 * nt;
 1128|   605k|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1128:16): [True: 537k, False: 67.6k]
  ------------------
 1129|   537k|    {
 1130|   537k|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k];
 1131|   537k|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k + 1];
 1132|   537k|    }
 1133|       |
 1134|  67.6k|    ref_main = ref_temp + (2 * (nt - 1));
 1135|  67.6k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1136|       |
 1137|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1138|       |    /* For negative angled derive the main reference samples from side */
 1139|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1140|   239k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1140:17): [True: 171k, False: 67.6k]
  ------------------
 1141|   171k|    {
 1142|   171k|        inv_ang_sum += inv_ang;
 1143|   171k|        ref_main[k] = pu1_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1144|   171k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1145|   171k|    }
 1146|       |
 1147|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1148|       |    /* samples dependent on distance to obtain destination sample */
 1149|   537k|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1149:18): [True: 469k, False: 67.6k]
  ------------------
 1150|   469k|    {
 1151|   469k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1152|   469k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1153|   469k|        idx_u = pos_u >> 5;
 1154|   469k|        idx_v = pos_v >> 5;
 1155|   469k|        fract_u = pos_u & (31);
 1156|   469k|        fract_v = pos_v & (31);
 1157|       |
 1158|       |        // Do linear filtering
 1159|  4.93M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1159:22): [True: 4.46M, False: 469k]
  ------------------
 1160|  4.46M|        {
 1161|  4.46M|            ref_main_idx_u = 2 * (row + idx_u + 1);
 1162|  4.46M|            ref_main_idx_v = 2 * (row + idx_v + 1) + 1;
 1163|       |
 1164|  4.46M|            pu1_dst[col + (dst_strd * row)] = (UWORD8)(((32 - fract_u)
 1165|  4.46M|                            * ref_main[ref_main_idx_u]
 1166|  4.46M|                            + fract_u * ref_main[ref_main_idx_u + 2] + 16) >> 5);
 1167|  4.46M|            pu1_dst[(col + 1) + (dst_strd * row)] = (UWORD8)(((32 - fract_v)
 1168|  4.46M|                            * ref_main[ref_main_idx_v]
 1169|  4.46M|                            + fract_v * ref_main[ref_main_idx_v + 2] + 16) >> 5);
 1170|       |
 1171|  4.46M|        }
 1172|       |
 1173|   469k|    }
 1174|       |
 1175|  67.6k|}
ihevc_intra_pred_chroma_mode_19_to_25:
 1223|  85.0k|{
 1224|       |
 1225|  85.0k|    WORD32 row, col, k;
 1226|  85.0k|    WORD32 intra_pred_ang, idx;
 1227|  85.0k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1228|  85.0k|    WORD32 ref_main_idx_u, ref_main_idx_v, ref_idx;
 1229|  85.0k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 2];
 1230|  85.0k|    UWORD8 *ref_main;
 1231|  85.0k|    UNUSED(src_strd);
  ------------------
  |  |   38|  85.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1232|       |
 1233|       |
 1234|  85.0k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1235|  85.0k|    inv_ang = gai4_ihevc_inv_ang_table_chroma[mode - 12];
 1236|       |
 1237|       |    /* Intermediate reference samples for negative angle modes */
 1238|       |    /* This have to be removed during optimization*/
 1239|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1240|  85.0k|    ref_main = ref_temp + 2 * nt;
 1241|   739k|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1241:16): [True: 654k, False: 85.0k]
  ------------------
 1242|   654k|    {
 1243|   654k|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k];
 1244|   654k|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k + 1];
 1245|   654k|    }
 1246|       |
 1247|       |
 1248|  85.0k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1249|  85.0k|    inv_ang_sum = 128;
 1250|  85.0k|    ref_main = ref_temp + (2 * (nt - 1));
 1251|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1252|       |    /* For negative angled derive the main reference samples from side */
 1253|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1254|   273k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1254:17): [True: 188k, False: 85.0k]
  ------------------
 1255|   188k|    {
 1256|   188k|        inv_ang_sum += inv_ang;
 1257|   188k|        ref_main[k] = pu1_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 1258|   188k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 1259|   188k|    }
 1260|       |
 1261|   654k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1261:18): [True: 569k, False: 85.0k]
  ------------------
 1262|   569k|    {
 1263|   569k|        pos = ((row + 1) * intra_pred_ang);
 1264|   569k|        idx = pos >> 5;
 1265|   569k|        fract = pos & (31);
 1266|       |
 1267|       |        // Do linear filtering
 1268|  5.53M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1268:22): [True: 4.96M, False: 569k]
  ------------------
 1269|  4.96M|        {
 1270|  4.96M|            ref_main_idx_u = col + 2 * idx + 2;
 1271|  4.96M|            ref_main_idx_v = (col + 1) + 2 * idx + 2;
 1272|  4.96M|            pu1_dst[(row * dst_strd) + col] = (UWORD8)(((32 - fract)
 1273|  4.96M|                            * ref_main[ref_main_idx_u]
 1274|  4.96M|                            + fract * ref_main[ref_main_idx_u + 2] + 16) >> 5);
 1275|  4.96M|            pu1_dst[(row * dst_strd) + (col + 1)] = (UWORD8)(((32 - fract)
 1276|  4.96M|                            * ref_main[ref_main_idx_v]
 1277|  4.96M|                            + fract * ref_main[ref_main_idx_v + 2] + 16) >> 5);
 1278|       |
 1279|  4.96M|        }
 1280|       |
 1281|   569k|    }
 1282|       |
 1283|  85.0k|}
ihevc_intra_pred_chroma_mode_27_to_33:
 1331|  76.8k|{
 1332|  76.8k|    WORD32 row, col;
 1333|  76.8k|    WORD32 pos, fract;
 1334|  76.8k|    WORD32 intra_pred_ang;
 1335|  76.8k|    WORD32 idx, ref_main_idx_u, ref_main_idx_v;
 1336|  76.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  76.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1337|       |
 1338|       |
 1339|  76.8k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1340|       |
 1341|   621k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1341:18): [True: 544k, False: 76.8k]
  ------------------
 1342|   544k|    {
 1343|   544k|        pos = ((row + 1) * intra_pred_ang);
 1344|   544k|        idx = pos >> 5;
 1345|   544k|        fract = pos & (31);
 1346|       |
 1347|       |
 1348|       |        // Do linear filtering
 1349|  5.72M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1349:22): [True: 5.18M, False: 544k]
  ------------------
 1350|  5.18M|        {
 1351|  5.18M|            ref_main_idx_u = (4 * nt) + col + 2 * idx + 2;
 1352|  5.18M|            ref_main_idx_v = (4 * nt) + (col + 1) + 2 * idx + 2;
 1353|  5.18M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1354|  5.18M|                            * pu1_ref[ref_main_idx_u]
 1355|  5.18M|                            + fract * pu1_ref[ref_main_idx_u + 2] + 16) >> 5);
 1356|  5.18M|            pu1_dst[(col + 1) + (row * dst_strd)] = (((32 - fract)
 1357|  5.18M|                            * pu1_ref[ref_main_idx_v]
 1358|  5.18M|                            + fract * pu1_ref[ref_main_idx_v + 2] + 16) >> 5);
 1359|       |
 1360|  5.18M|        }
 1361|   544k|    }
 1362|       |
 1363|  76.8k|}

ihevc_chroma_itrans_recon_4x4:
  115|   240k|{
  116|   240k|    WORD32 j;
  117|   240k|    WORD32 e[2], o[2];
  118|   240k|    WORD32 add;
  119|   240k|    WORD32 shift;
  120|   240k|    WORD16 *pi2_tmp_orig;
  121|   240k|    WORD32 trans_size;
  122|   240k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   240k|#define UNUSED(x) ((void)(x))
  ------------------
  123|   240k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   240k|#define TRANS_SIZE_4   4
  ------------------
  124|       |
  125|   240k|    pi2_tmp_orig = pi2_tmp;
  126|       |
  127|       |    /* Inverse Transform 1st stage */
  128|   240k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   240k|#define IT_SHIFT_STAGE_1 7
  ------------------
  129|   240k|    add = 1 << (shift - 1);
  130|       |
  131|  1.20M|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (131:16): [True: 962k, False: 240k]
  ------------------
  132|   962k|    {
  133|       |        /* Checking for Zero Cols */
  134|   962k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (134:12): [True: 435k, False: 527k]
  ------------------
  135|   435k|        {
  136|   435k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  137|   435k|        }
  138|   527k|        else
  139|   527k|        {
  140|       |
  141|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  142|   527k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  143|   527k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  144|   527k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  145|   527k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  146|   527k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  147|   527k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  148|   527k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  149|   527k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  150|       |
  151|   527k|            pi2_tmp[0] =
  152|   527k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|   527k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   527k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.48k, False: 521k]
  |  |  |  |  |  Branch (40:53): [True: 3.09k, False: 518k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   527k|            pi2_tmp[1] =
  154|   527k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|   527k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   527k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.44k, False: 524k]
  |  |  |  |  |  Branch (40:53): [True: 2.55k, False: 522k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|   527k|            pi2_tmp[2] =
  156|   527k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|   527k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   527k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.66k, False: 524k]
  |  |  |  |  |  Branch (40:53): [True: 1.88k, False: 522k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   527k|            pi2_tmp[3] =
  158|   527k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|   527k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   527k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.87k, False: 524k]
  |  |  |  |  |  Branch (40:53): [True: 2.73k, False: 521k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|       |
  160|   527k|        }
  161|   962k|        pi2_src++;
  162|   962k|        pi2_tmp += trans_size;
  163|   962k|        zero_cols = zero_cols >> 1;
  164|   962k|    }
  165|       |
  166|   240k|    pi2_tmp = pi2_tmp_orig;
  167|       |
  168|       |    /* Inverse Transform 2nd stage */
  169|   240k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   240k|#define IT_SHIFT_STAGE_2 12
  ------------------
  170|   240k|    add = 1 << (shift - 1);
  171|       |
  172|  1.20M|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (172:16): [True: 960k, False: 240k]
  ------------------
  173|   960k|    {
  174|   960k|        WORD32 itrans_out;
  175|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  176|   960k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  177|   960k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  178|   960k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  179|   960k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  180|   960k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  181|   960k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  182|   960k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  183|   960k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  184|       |
  185|   960k|        itrans_out =
  186|   960k|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|   960k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 960k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 960k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|   960k|        pu1_dst[0 * 2] = CLIP_U8((itrans_out + pu1_pred[0 * 2]));
  ------------------
  |  |   40|   960k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 143k, False: 817k]
  |  |  |  |  |  Branch (40:53): [True: 131k, False: 686k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|   960k|        itrans_out =
  189|   960k|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|   960k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 960k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 960k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|   960k|        pu1_dst[1 * 2] = CLIP_U8((itrans_out + pu1_pred[1 * 2]));
  ------------------
  |  |   40|   960k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 121k, False: 839k]
  |  |  |  |  |  Branch (40:53): [True: 127k, False: 711k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   960k|        itrans_out =
  192|   960k|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|   960k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 960k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 960k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|   960k|        pu1_dst[2 * 2] = CLIP_U8((itrans_out + pu1_pred[2 * 2]));
  ------------------
  |  |   40|   960k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 114k, False: 846k]
  |  |  |  |  |  Branch (40:53): [True: 137k, False: 709k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|   960k|        itrans_out =
  195|   960k|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|   960k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 960k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 960k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|   960k|        pu1_dst[3 * 2] = CLIP_U8((itrans_out + pu1_pred[3 * 2]));
  ------------------
  |  |   40|   960k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   960k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 120k, False: 840k]
  |  |  |  |  |  Branch (40:53): [True: 161k, False: 678k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |
  198|   960k|        pi2_tmp++;
  199|   960k|        pu1_pred += pred_strd;
  200|   960k|        pu1_dst += dst_strd;
  201|       |
  202|   960k|    }
  203|   240k|}

ihevc_chroma_itrans_recon_16x16:
  116|   505k|{
  117|   505k|    WORD32 j, k;
  118|   505k|    WORD32 e[8], o[8];
  119|   505k|    WORD32 ee[4], eo[4];
  120|   505k|    WORD32 eee[2], eeo[2];
  121|   505k|    WORD32 add;
  122|   505k|    WORD32 shift;
  123|   505k|    WORD16 *pi2_tmp_orig;
  124|   505k|    WORD32 trans_size;
  125|   505k|    WORD32 row_limit_2nd_stage, zero_rows_2nd_stage = zero_cols;
  126|       |
  127|   505k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   505k|#define TRANS_SIZE_16 16
  ------------------
  128|   505k|    pi2_tmp_orig = pi2_tmp;
  129|       |
  130|   505k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (130:8): [True: 289k, False: 215k]
  ------------------
  131|   289k|        row_limit_2nd_stage = 4;
  132|   215k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (132:13): [True: 188k, False: 26.6k]
  ------------------
  133|   188k|        row_limit_2nd_stage = 8;
  134|  26.6k|    else
  135|  26.6k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  26.6k|#define TRANS_SIZE_16 16
  ------------------
  136|       |
  137|   505k|    if((zero_rows & 0xFFF0) == 0xFFF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (137:8): [True: 245k, False: 259k]
  ------------------
  138|   245k|    {
  139|       |        /************************************************************************************************/
  140|       |        /**********************************START - IT_RECON_16x16****************************************/
  141|       |        /************************************************************************************************/
  142|       |
  143|       |        /* Inverse Transform 1st stage */
  144|   245k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   245k|#define IT_SHIFT_STAGE_1 7
  ------------------
  145|   245k|        add = 1 << (shift - 1);
  146|       |
  147|  1.66M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (147:20): [True: 1.42M, False: 245k]
  ------------------
  148|  1.42M|        {
  149|       |            /* Checking for Zero Cols */
  150|  1.42M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (150:16): [True: 758k, False: 665k]
  ------------------
  151|   758k|            {
  152|   758k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  153|   758k|            }
  154|   665k|            else
  155|   665k|            {
  156|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  157|  6.06M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (157:28): [True: 5.39M, False: 665k]
  ------------------
  158|  5.39M|                {
  159|  5.39M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  160|  5.39M|                                    + g_ai2_ihevc_trans_16[3][k]
  161|  5.39M|                                                    * pi2_src[3 * src_strd];
  162|  5.39M|                }
  163|  3.36M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (163:28): [True: 2.69M, False: 665k]
  ------------------
  164|  2.69M|                {
  165|  2.69M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  166|  2.69M|                }
  167|   665k|                eeo[0] = 0;
  168|   665k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  169|   665k|                eeo[1] = 0;
  170|   665k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  171|       |
  172|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  173|  2.01M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (173:28): [True: 1.35M, False: 665k]
  ------------------
  174|  1.35M|                {
  175|  1.35M|                    ee[k] = eee[k] + eeo[k];
  176|  1.35M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  177|  1.35M|                }
  178|  3.36M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (178:28): [True: 2.70M, False: 665k]
  ------------------
  179|  2.70M|                {
  180|  2.70M|                    e[k] = ee[k] + eo[k];
  181|  2.70M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  182|  2.70M|                }
  183|  6.06M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (183:28): [True: 5.40M, False: 665k]
  ------------------
  184|  5.40M|                {
  185|  5.40M|                    pi2_tmp[k] =
  186|  5.40M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.40M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.40M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.45k, False: 5.40M]
  |  |  |  |  |  Branch (40:53): [True: 977, False: 5.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  5.40M|                    pi2_tmp[k + 8] =
  188|  5.40M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  5.40M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.40M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.24k, False: 5.40M]
  |  |  |  |  |  Branch (40:53): [True: 857, False: 5.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|  5.40M|                }
  190|   665k|            }
  191|  1.42M|            pi2_src++;
  192|  1.42M|            pi2_tmp += trans_size;
  193|  1.42M|            zero_cols = zero_cols >> 1;
  194|  1.42M|        }
  195|       |
  196|   245k|        pi2_tmp = pi2_tmp_orig;
  197|       |
  198|       |        /* Inverse Transform 2nd stage */
  199|   245k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   245k|#define IT_SHIFT_STAGE_2 12
  ------------------
  200|   245k|        add = 1 << (shift - 1);
  201|   245k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (201:12): [True: 153k, False: 91.5k]
  ------------------
  202|   153k|        {
  203|  2.57M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (203:24): [True: 2.42M, False: 153k]
  ------------------
  204|  2.42M|            {
  205|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  206|  21.7M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (206:28): [True: 19.3M, False: 2.42M]
  ------------------
  207|  19.3M|                {
  208|  19.3M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  209|  19.3M|                                    + g_ai2_ihevc_trans_16[3][k]
  210|  19.3M|                                                    * pi2_tmp[3 * trans_size];
  211|  19.3M|                }
  212|  12.1M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (212:28): [True: 9.68M, False: 2.42M]
  ------------------
  213|  9.68M|                {
  214|  9.68M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  215|  9.68M|                }
  216|  2.42M|                eeo[0] = 0;
  217|  2.42M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  218|  2.42M|                eeo[1] = 0;
  219|  2.42M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  220|       |
  221|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  222|  7.26M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (222:28): [True: 4.84M, False: 2.42M]
  ------------------
  223|  4.84M|                {
  224|  4.84M|                    ee[k] = eee[k] + eeo[k];
  225|  4.84M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  226|  4.84M|                }
  227|  12.1M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (227:28): [True: 9.67M, False: 2.42M]
  ------------------
  228|  9.67M|                {
  229|  9.67M|                    e[k] = ee[k] + eo[k];
  230|  9.67M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  231|  9.67M|                }
  232|  21.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (232:28): [True: 19.2M, False: 2.42M]
  ------------------
  233|  19.2M|                {
  234|  19.2M|                    WORD32 itrans_out;
  235|  19.2M|                    itrans_out =
  236|  19.2M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  19.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  19.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 19.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 19.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  19.2M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  19.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  19.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 619k, False: 18.6M]
  |  |  |  |  |  Branch (40:53): [True: 687k, False: 17.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  19.2M|                    itrans_out =
  239|  19.2M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  19.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  19.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 19.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 19.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  19.2M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  19.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  19.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 598k, False: 18.6M]
  |  |  |  |  |  Branch (40:53): [True: 826k, False: 17.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  19.2M|                }
  242|  2.42M|                pi2_tmp++;
  243|  2.42M|                pu1_pred += pred_strd;
  244|  2.42M|                pu1_dst += dst_strd;
  245|  2.42M|            }
  246|   153k|        }
  247|  91.5k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (247:17): [True: 81.8k, False: 9.72k]
  ------------------
  248|  81.8k|        {
  249|  1.31M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (249:24): [True: 1.22M, False: 81.8k]
  ------------------
  250|  1.22M|            {
  251|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  252|  11.0M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (252:28): [True: 9.79M, False: 1.22M]
  ------------------
  253|  9.79M|                {
  254|  9.79M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  255|  9.79M|                                    + g_ai2_ihevc_trans_16[3][k]
  256|  9.79M|                                                    * pi2_tmp[3 * trans_size]
  257|  9.79M|                                    + g_ai2_ihevc_trans_16[5][k]
  258|  9.79M|                                                    * pi2_tmp[5 * trans_size]
  259|  9.79M|                                    + g_ai2_ihevc_trans_16[7][k]
  260|  9.79M|                                                    * pi2_tmp[7 * trans_size];
  261|  9.79M|                }
  262|  6.15M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (262:28): [True: 4.93M, False: 1.22M]
  ------------------
  263|  4.93M|                {
  264|  4.93M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  265|  4.93M|                                    + g_ai2_ihevc_trans_16[6][k]
  266|  4.93M|                                                    * pi2_tmp[6 * trans_size];
  267|  4.93M|                }
  268|  1.22M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  269|  1.22M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  270|  1.22M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  271|  1.22M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  272|       |
  273|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  274|  3.69M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (274:28): [True: 2.46M, False: 1.22M]
  ------------------
  275|  2.46M|                {
  276|  2.46M|                    ee[k] = eee[k] + eeo[k];
  277|  2.46M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  278|  2.46M|                }
  279|  6.17M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (279:28): [True: 4.94M, False: 1.22M]
  ------------------
  280|  4.94M|                {
  281|  4.94M|                    e[k] = ee[k] + eo[k];
  282|  4.94M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  283|  4.94M|                }
  284|  10.8M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (284:28): [True: 9.65M, False: 1.22M]
  ------------------
  285|  9.65M|                {
  286|  9.65M|                    WORD32 itrans_out;
  287|  9.65M|                    itrans_out =
  288|  9.65M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  9.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  9.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 9.65M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 9.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|  9.65M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  9.65M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.54M, False: 8.11M]
  |  |  |  |  |  Branch (40:53): [True: 668k, False: 7.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|  9.65M|                    itrans_out =
  291|  9.65M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  9.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  9.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 9.65M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 9.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|  9.65M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  9.65M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  9.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.50M, False: 8.15M]
  |  |  |  |  |  Branch (40:53): [True: 568k, False: 7.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|  9.65M|                }
  294|  1.22M|                pi2_tmp++;
  295|  1.22M|                pu1_pred += pred_strd;
  296|  1.22M|                pu1_dst += dst_strd;
  297|  1.22M|            }
  298|  81.8k|        }
  299|  9.72k|        else /* All rows of output of 1st stage are non-zero */
  300|  9.72k|        {
  301|   182k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (301:24): [True: 172k, False: 9.72k]
  ------------------
  302|   172k|            {
  303|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  304|  1.55M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (304:28): [True: 1.37M, False: 172k]
  ------------------
  305|  1.37M|                {
  306|  1.37M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  307|  1.37M|                                    + g_ai2_ihevc_trans_16[3][k]
  308|  1.37M|                                                    * pi2_tmp[3 * trans_size]
  309|  1.37M|                                    + g_ai2_ihevc_trans_16[5][k]
  310|  1.37M|                                                    * pi2_tmp[5 * trans_size]
  311|  1.37M|                                    + g_ai2_ihevc_trans_16[7][k]
  312|  1.37M|                                                    * pi2_tmp[7 * trans_size]
  313|  1.37M|                                    + g_ai2_ihevc_trans_16[9][k]
  314|  1.37M|                                                    * pi2_tmp[9 * trans_size]
  315|  1.37M|                                    + g_ai2_ihevc_trans_16[11][k]
  316|  1.37M|                                                    * pi2_tmp[11 * trans_size]
  317|  1.37M|                                    + g_ai2_ihevc_trans_16[13][k]
  318|  1.37M|                                                    * pi2_tmp[13 * trans_size]
  319|  1.37M|                                    + g_ai2_ihevc_trans_16[15][k]
  320|  1.37M|                                                    * pi2_tmp[15 * trans_size];
  321|  1.37M|                }
  322|   860k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (322:28): [True: 688k, False: 172k]
  ------------------
  323|   688k|                {
  324|   688k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  325|   688k|                                    + g_ai2_ihevc_trans_16[6][k]
  326|   688k|                                                    * pi2_tmp[6 * trans_size]
  327|   688k|                                    + g_ai2_ihevc_trans_16[10][k]
  328|   688k|                                                    * pi2_tmp[10 * trans_size]
  329|   688k|                                    + g_ai2_ihevc_trans_16[14][k]
  330|   688k|                                                    * pi2_tmp[14 * trans_size];
  331|   688k|                }
  332|   172k|                eeo[0] =
  333|   172k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  334|   172k|                                                + g_ai2_ihevc_trans_16[12][0]
  335|   172k|                                                                * pi2_tmp[12
  336|   172k|                                                                                * trans_size];
  337|   172k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  338|   172k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  339|   172k|                eeo[1] =
  340|   172k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  341|   172k|                                                + g_ai2_ihevc_trans_16[12][1]
  342|   172k|                                                                * pi2_tmp[12
  343|   172k|                                                                                * trans_size];
  344|   172k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  345|   172k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  346|       |
  347|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  348|   516k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (348:28): [True: 344k, False: 172k]
  ------------------
  349|   344k|                {
  350|   344k|                    ee[k] = eee[k] + eeo[k];
  351|   344k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  352|   344k|                }
  353|   861k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (353:28): [True: 688k, False: 172k]
  ------------------
  354|   688k|                {
  355|   688k|                    e[k] = ee[k] + eo[k];
  356|   688k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  357|   688k|                }
  358|  1.54M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (358:28): [True: 1.37M, False: 172k]
  ------------------
  359|  1.37M|                {
  360|  1.37M|                    WORD32 itrans_out;
  361|  1.37M|                    itrans_out =
  362|  1.37M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.37M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.37M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|  1.37M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  1.37M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 132k, False: 1.24M]
  |  |  |  |  |  Branch (40:53): [True: 330k, False: 910k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  1.37M|                    itrans_out =
  365|  1.37M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.37M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.37M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  366|  1.37M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  1.37M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 123k, False: 1.25M]
  |  |  |  |  |  Branch (40:53): [True: 345k, False: 905k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  1.37M|                }
  368|   172k|                pi2_tmp++;
  369|   172k|                pu1_pred += pred_strd;
  370|   172k|                pu1_dst += dst_strd;
  371|   172k|            }
  372|  9.72k|        }
  373|       |        /************************************************************************************************/
  374|       |        /************************************END - IT_RECON_16x16****************************************/
  375|       |        /************************************************************************************************/
  376|   245k|    }
  377|   259k|    else if((zero_rows & 0xFF00) == 0xFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (377:13): [True: 195k, False: 64.1k]
  ------------------
  378|   195k|    {
  379|       |        /************************************************************************************************/
  380|       |        /**********************************START - IT_RECON_16x16****************************************/
  381|       |        /************************************************************************************************/
  382|       |
  383|       |        /* Inverse Transform 1st stage */
  384|   195k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   195k|#define IT_SHIFT_STAGE_1 7
  ------------------
  385|   195k|        add = 1 << (shift - 1);
  386|       |
  387|  1.33M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (387:20): [True: 1.13M, False: 195k]
  ------------------
  388|  1.13M|        {
  389|       |            /* Checking for Zero Cols */
  390|  1.13M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (390:16): [True: 492k, False: 647k]
  ------------------
  391|   492k|            {
  392|   492k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  393|   492k|            }
  394|   647k|            else
  395|   647k|            {
  396|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  397|  6.02M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (397:28): [True: 5.37M, False: 647k]
  ------------------
  398|  5.37M|                {
  399|  5.37M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  400|  5.37M|                                    + g_ai2_ihevc_trans_16[3][k]
  401|  5.37M|                                                    * pi2_src[3 * src_strd]
  402|  5.37M|                                    + g_ai2_ihevc_trans_16[5][k]
  403|  5.37M|                                                    * pi2_src[5 * src_strd]
  404|  5.37M|                                    + g_ai2_ihevc_trans_16[7][k]
  405|  5.37M|                                                    * pi2_src[7 * src_strd];
  406|  5.37M|                }
  407|  3.34M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (407:28): [True: 2.69M, False: 647k]
  ------------------
  408|  2.69M|                {
  409|  2.69M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  410|  2.69M|                                    + g_ai2_ihevc_trans_16[6][k]
  411|  2.69M|                                                    * pi2_src[6 * src_strd];
  412|  2.69M|                }
  413|   647k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  414|   647k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  415|   647k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  416|   647k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  417|       |
  418|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  419|  1.99M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (419:28): [True: 1.34M, False: 647k]
  ------------------
  420|  1.34M|                {
  421|  1.34M|                    ee[k] = eee[k] + eeo[k];
  422|  1.34M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  423|  1.34M|                }
  424|  3.34M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (424:28): [True: 2.69M, False: 647k]
  ------------------
  425|  2.69M|                {
  426|  2.69M|                    e[k] = ee[k] + eo[k];
  427|  2.69M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  428|  2.69M|                }
  429|  6.05M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (429:28): [True: 5.40M, False: 647k]
  ------------------
  430|  5.40M|                {
  431|  5.40M|                    pi2_tmp[k] =
  432|  5.40M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.40M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.40M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.76k, False: 5.40M]
  |  |  |  |  |  Branch (40:53): [True: 4.41k, False: 5.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  5.40M|                    pi2_tmp[k + 8] =
  434|  5.40M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  5.40M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.40M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.59k, False: 5.40M]
  |  |  |  |  |  Branch (40:53): [True: 3.94k, False: 5.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|  5.40M|                }
  436|   647k|            }
  437|  1.13M|            pi2_src++;
  438|  1.13M|            pi2_tmp += trans_size;
  439|  1.13M|            zero_cols = zero_cols >> 1;
  440|  1.13M|        }
  441|       |
  442|   195k|        pi2_tmp = pi2_tmp_orig;
  443|       |
  444|       |        /* Inverse Transform 2nd stage */
  445|   195k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   195k|#define IT_SHIFT_STAGE_2 12
  ------------------
  446|   195k|        add = 1 << (shift - 1);
  447|   195k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (447:12): [True: 104k, False: 90.6k]
  ------------------
  448|   104k|        {
  449|  1.58M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (449:24): [True: 1.47M, False: 104k]
  ------------------
  450|  1.47M|            {
  451|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  452|  13.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (452:28): [True: 11.7M, False: 1.47M]
  ------------------
  453|  11.7M|                {
  454|  11.7M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  455|  11.7M|                                    + g_ai2_ihevc_trans_16[3][k]
  456|  11.7M|                                                    * pi2_tmp[3 * trans_size];
  457|  11.7M|                }
  458|  7.38M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (458:28): [True: 5.91M, False: 1.47M]
  ------------------
  459|  5.91M|                {
  460|  5.91M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  461|  5.91M|                }
  462|  1.47M|                eeo[0] = 0;
  463|  1.47M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  464|  1.47M|                eeo[1] = 0;
  465|  1.47M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  466|       |
  467|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  468|  4.44M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (468:28): [True: 2.97M, False: 1.47M]
  ------------------
  469|  2.97M|                {
  470|  2.97M|                    ee[k] = eee[k] + eeo[k];
  471|  2.97M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  472|  2.97M|                }
  473|  7.46M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (473:28): [True: 5.98M, False: 1.47M]
  ------------------
  474|  5.98M|                {
  475|  5.98M|                    e[k] = ee[k] + eo[k];
  476|  5.98M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  477|  5.98M|                }
  478|  12.9M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (478:28): [True: 11.4M, False: 1.47M]
  ------------------
  479|  11.4M|                {
  480|  11.4M|                    WORD32 itrans_out;
  481|  11.4M|                    itrans_out =
  482|  11.4M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  11.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  11.4M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  11.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.83M, False: 9.62M]
  |  |  |  |  |  Branch (40:53): [True: 1.04M, False: 8.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  11.4M|                    itrans_out =
  485|  11.4M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  11.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|  11.4M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  11.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.72M, False: 9.73M]
  |  |  |  |  |  Branch (40:53): [True: 1.58M, False: 8.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  11.4M|                }
  488|  1.47M|                pi2_tmp++;
  489|  1.47M|                pu1_pred += pred_strd;
  490|  1.47M|                pu1_dst += dst_strd;
  491|  1.47M|            }
  492|   104k|        }
  493|  90.6k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (493:17): [True: 88.7k, False: 1.87k]
  ------------------
  494|  88.7k|        {
  495|  1.23M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (495:24): [True: 1.15M, False: 88.7k]
  ------------------
  496|  1.15M|            {
  497|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  498|  10.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (498:28): [True: 9.18M, False: 1.15M]
  ------------------
  499|  9.18M|                {
  500|  9.18M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  501|  9.18M|                                    + g_ai2_ihevc_trans_16[3][k]
  502|  9.18M|                                                    * pi2_tmp[3 * trans_size]
  503|  9.18M|                                    + g_ai2_ihevc_trans_16[5][k]
  504|  9.18M|                                                    * pi2_tmp[5 * trans_size]
  505|  9.18M|                                    + g_ai2_ihevc_trans_16[7][k]
  506|  9.18M|                                                    * pi2_tmp[7 * trans_size];
  507|  9.18M|                }
  508|  5.81M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (508:28): [True: 4.66M, False: 1.15M]
  ------------------
  509|  4.66M|                {
  510|  4.66M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  511|  4.66M|                                    + g_ai2_ihevc_trans_16[6][k]
  512|  4.66M|                                                    * pi2_tmp[6 * trans_size];
  513|  4.66M|                }
  514|  1.15M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  515|  1.15M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  516|  1.15M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  517|  1.15M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  518|       |
  519|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  520|  3.49M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (520:28): [True: 2.34M, False: 1.15M]
  ------------------
  521|  2.34M|                {
  522|  2.34M|                    ee[k] = eee[k] + eeo[k];
  523|  2.34M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  524|  2.34M|                }
  525|  5.85M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (525:28): [True: 4.70M, False: 1.15M]
  ------------------
  526|  4.70M|                {
  527|  4.70M|                    e[k] = ee[k] + eo[k];
  528|  4.70M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  529|  4.70M|                }
  530|  9.92M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (530:28): [True: 8.77M, False: 1.15M]
  ------------------
  531|  8.77M|                {
  532|  8.77M|                    WORD32 itrans_out;
  533|  8.77M|                    itrans_out =
  534|  8.77M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  8.77M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.77M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.77M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|  8.77M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  8.77M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.13M, False: 6.63M]
  |  |  |  |  |  Branch (40:53): [True: 464k, False: 6.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  536|  8.77M|                    itrans_out =
  537|  8.77M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  8.77M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.77M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.77M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  538|  8.77M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  8.77M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.97M, False: 6.80M]
  |  |  |  |  |  Branch (40:53): [True: 417k, False: 6.38M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  539|  8.77M|                }
  540|  1.15M|                pi2_tmp++;
  541|  1.15M|                pu1_pred += pred_strd;
  542|  1.15M|                pu1_dst += dst_strd;
  543|  1.15M|            }
  544|  88.7k|        }
  545|  1.87k|        else /* All rows of output of 1st stage are non-zero */
  546|  1.87k|        {
  547|  63.4k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (547:24): [True: 61.5k, False: 1.87k]
  ------------------
  548|  61.5k|            {
  549|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  550|   553k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (550:28): [True: 492k, False: 61.5k]
  ------------------
  551|   492k|                {
  552|   492k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  553|   492k|                                    + g_ai2_ihevc_trans_16[3][k]
  554|   492k|                                                    * pi2_tmp[3 * trans_size]
  555|   492k|                                    + g_ai2_ihevc_trans_16[5][k]
  556|   492k|                                                    * pi2_tmp[5 * trans_size]
  557|   492k|                                    + g_ai2_ihevc_trans_16[7][k]
  558|   492k|                                                    * pi2_tmp[7 * trans_size]
  559|   492k|                                    + g_ai2_ihevc_trans_16[9][k]
  560|   492k|                                                    * pi2_tmp[9 * trans_size]
  561|   492k|                                    + g_ai2_ihevc_trans_16[11][k]
  562|   492k|                                                    * pi2_tmp[11 * trans_size]
  563|   492k|                                    + g_ai2_ihevc_trans_16[13][k]
  564|   492k|                                                    * pi2_tmp[13 * trans_size]
  565|   492k|                                    + g_ai2_ihevc_trans_16[15][k]
  566|   492k|                                                    * pi2_tmp[15 * trans_size];
  567|   492k|                }
  568|   308k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (568:28): [True: 246k, False: 61.5k]
  ------------------
  569|   246k|                {
  570|   246k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  571|   246k|                                    + g_ai2_ihevc_trans_16[6][k]
  572|   246k|                                                    * pi2_tmp[6 * trans_size]
  573|   246k|                                    + g_ai2_ihevc_trans_16[10][k]
  574|   246k|                                                    * pi2_tmp[10 * trans_size]
  575|   246k|                                    + g_ai2_ihevc_trans_16[14][k]
  576|   246k|                                                    * pi2_tmp[14 * trans_size];
  577|   246k|                }
  578|  61.5k|                eeo[0] =
  579|  61.5k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  580|  61.5k|                                                + g_ai2_ihevc_trans_16[12][0]
  581|  61.5k|                                                                * pi2_tmp[12
  582|  61.5k|                                                                                * trans_size];
  583|  61.5k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  584|  61.5k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  585|  61.5k|                eeo[1] =
  586|  61.5k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  587|  61.5k|                                                + g_ai2_ihevc_trans_16[12][1]
  588|  61.5k|                                                                * pi2_tmp[12
  589|  61.5k|                                                                                * trans_size];
  590|  61.5k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  591|  61.5k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  592|       |
  593|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  594|   184k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (594:28): [True: 123k, False: 61.5k]
  ------------------
  595|   123k|                {
  596|   123k|                    ee[k] = eee[k] + eeo[k];
  597|   123k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  598|   123k|                }
  599|   307k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (599:28): [True: 245k, False: 61.5k]
  ------------------
  600|   245k|                {
  601|   245k|                    e[k] = ee[k] + eo[k];
  602|   245k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  603|   245k|                }
  604|   551k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (604:28): [True: 490k, False: 61.5k]
  ------------------
  605|   490k|                {
  606|   490k|                    WORD32 itrans_out;
  607|   490k|                    itrans_out =
  608|   490k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   490k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   490k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 490k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 490k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  609|   490k|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|   490k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   490k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 61.1k, False: 428k]
  |  |  |  |  |  Branch (40:53): [True: 133k, False: 294k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|   490k|                    itrans_out =
  611|   490k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   490k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   490k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 490k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 490k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|   490k|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|   490k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   490k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 62.5k, False: 427k]
  |  |  |  |  |  Branch (40:53): [True: 133k, False: 294k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|   490k|                }
  614|  61.5k|                pi2_tmp++;
  615|  61.5k|                pu1_pred += pred_strd;
  616|  61.5k|                pu1_dst += dst_strd;
  617|  61.5k|            }
  618|  1.87k|        }
  619|       |        /************************************************************************************************/
  620|       |        /************************************END - IT_RECON_16x16****************************************/
  621|       |        /************************************************************************************************/
  622|   195k|    }
  623|  64.1k|    else /* All rows of input are non-zero */
  624|  64.1k|    {
  625|       |        /************************************************************************************************/
  626|       |        /**********************************START - IT_RECON_16x16****************************************/
  627|       |        /************************************************************************************************/
  628|       |
  629|       |        /* Inverse Transform 1st stage */
  630|  64.1k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  64.1k|#define IT_SHIFT_STAGE_1 7
  ------------------
  631|  64.1k|        add = 1 << (shift - 1);
  632|       |
  633|   581k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (633:20): [True: 517k, False: 64.1k]
  ------------------
  634|   517k|        {
  635|       |            /* Checking for Zero Cols */
  636|   517k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (636:16): [True: 341k, False: 176k]
  ------------------
  637|   341k|            {
  638|   341k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  639|   341k|            }
  640|   176k|            else
  641|   176k|            {
  642|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  643|  1.62M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (643:28): [True: 1.44M, False: 176k]
  ------------------
  644|  1.44M|                {
  645|  1.44M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  646|  1.44M|                                    + g_ai2_ihevc_trans_16[3][k]
  647|  1.44M|                                                    * pi2_src[3 * src_strd]
  648|  1.44M|                                    + g_ai2_ihevc_trans_16[5][k]
  649|  1.44M|                                                    * pi2_src[5 * src_strd]
  650|  1.44M|                                    + g_ai2_ihevc_trans_16[7][k]
  651|  1.44M|                                                    * pi2_src[7 * src_strd]
  652|  1.44M|                                    + g_ai2_ihevc_trans_16[9][k]
  653|  1.44M|                                                    * pi2_src[9 * src_strd]
  654|  1.44M|                                    + g_ai2_ihevc_trans_16[11][k]
  655|  1.44M|                                                    * pi2_src[11 * src_strd]
  656|  1.44M|                                    + g_ai2_ihevc_trans_16[13][k]
  657|  1.44M|                                                    * pi2_src[13 * src_strd]
  658|  1.44M|                                    + g_ai2_ihevc_trans_16[15][k]
  659|  1.44M|                                                    * pi2_src[15 * src_strd];
  660|  1.44M|                }
  661|   902k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (661:28): [True: 726k, False: 176k]
  ------------------
  662|   726k|                {
  663|   726k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  664|   726k|                                    + g_ai2_ihevc_trans_16[6][k]
  665|   726k|                                                    * pi2_src[6 * src_strd]
  666|   726k|                                    + g_ai2_ihevc_trans_16[10][k]
  667|   726k|                                                    * pi2_src[10 * src_strd]
  668|   726k|                                    + g_ai2_ihevc_trans_16[14][k]
  669|   726k|                                                    * pi2_src[14 * src_strd];
  670|   726k|                }
  671|   176k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  672|   176k|                                + g_ai2_ihevc_trans_16[12][0]
  673|   176k|                                                * pi2_src[12 * src_strd];
  674|   176k|                eee[0] =
  675|   176k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  676|   176k|                                                + g_ai2_ihevc_trans_16[8][0]
  677|   176k|                                                                * pi2_src[8
  678|   176k|                                                                                * src_strd];
  679|   176k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  680|   176k|                                + g_ai2_ihevc_trans_16[12][1]
  681|   176k|                                                * pi2_src[12 * src_strd];
  682|   176k|                eee[1] =
  683|   176k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  684|   176k|                                                + g_ai2_ihevc_trans_16[8][1]
  685|   176k|                                                                * pi2_src[8
  686|   176k|                                                                                * src_strd];
  687|       |
  688|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  689|   538k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (689:28): [True: 362k, False: 176k]
  ------------------
  690|   362k|                {
  691|   362k|                    ee[k] = eee[k] + eeo[k];
  692|   362k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  693|   362k|                }
  694|   901k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (694:28): [True: 724k, False: 176k]
  ------------------
  695|   724k|                {
  696|   724k|                    e[k] = ee[k] + eo[k];
  697|   724k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  698|   724k|                }
  699|  1.62M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (699:28): [True: 1.44M, False: 176k]
  ------------------
  700|  1.44M|                {
  701|  1.44M|                    pi2_tmp[k] =
  702|  1.44M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.85k, False: 1.44M]
  |  |  |  |  |  Branch (40:53): [True: 5.18k, False: 1.43M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  703|  1.44M|                    pi2_tmp[k + 8] =
  704|  1.44M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.17k, False: 1.44M]
  |  |  |  |  |  Branch (40:53): [True: 3.95k, False: 1.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|  1.44M|                }
  706|   176k|            }
  707|   517k|            pi2_src++;
  708|   517k|            pi2_tmp += trans_size;
  709|   517k|            zero_cols = zero_cols >> 1;
  710|   517k|        }
  711|       |
  712|  64.1k|        pi2_tmp = pi2_tmp_orig;
  713|       |
  714|       |        /* Inverse Transform 2nd stage */
  715|  64.1k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  64.1k|#define IT_SHIFT_STAGE_2 12
  ------------------
  716|  64.1k|        add = 1 << (shift - 1);
  717|  64.1k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (717:12): [True: 32.8k, False: 31.3k]
  ------------------
  718|  32.8k|        {
  719|   474k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (719:24): [True: 441k, False: 32.8k]
  ------------------
  720|   441k|            {
  721|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  722|  3.96M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (722:28): [True: 3.52M, False: 441k]
  ------------------
  723|  3.52M|                {
  724|  3.52M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  725|  3.52M|                                    + g_ai2_ihevc_trans_16[3][k]
  726|  3.52M|                                                    * pi2_tmp[3 * trans_size];
  727|  3.52M|                }
  728|  2.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (728:28): [True: 1.77M, False: 441k]
  ------------------
  729|  1.77M|                {
  730|  1.77M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  731|  1.77M|                }
  732|   441k|                eeo[0] = 0;
  733|   441k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  734|   441k|                eeo[1] = 0;
  735|   441k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  736|       |
  737|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  738|  1.33M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (738:28): [True: 891k, False: 441k]
  ------------------
  739|   891k|                {
  740|   891k|                    ee[k] = eee[k] + eeo[k];
  741|   891k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  742|   891k|                }
  743|  2.23M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (743:28): [True: 1.79M, False: 441k]
  ------------------
  744|  1.79M|                {
  745|  1.79M|                    e[k] = ee[k] + eo[k];
  746|  1.79M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  747|  1.79M|                }
  748|  3.80M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (748:28): [True: 3.36M, False: 441k]
  ------------------
  749|  3.36M|                {
  750|  3.36M|                    WORD32 itrans_out;
  751|  3.36M|                    itrans_out =
  752|  3.36M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.36M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.36M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|  3.36M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  3.36M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.01M, False: 2.35M]
  |  |  |  |  |  Branch (40:53): [True: 250k, False: 2.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|  3.36M|                    itrans_out =
  755|  3.36M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.36M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.36M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  756|  3.36M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  3.36M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.05M, False: 2.31M]
  |  |  |  |  |  Branch (40:53): [True: 214k, False: 2.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|  3.36M|                }
  758|   441k|                pi2_tmp++;
  759|   441k|                pu1_pred += pred_strd;
  760|   441k|                pu1_dst += dst_strd;
  761|   441k|            }
  762|  32.8k|        }
  763|  31.3k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (763:17): [True: 21.3k, False: 10.0k]
  ------------------
  764|  21.3k|        {
  765|   311k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (765:24): [True: 290k, False: 21.3k]
  ------------------
  766|   290k|            {
  767|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  768|  2.57M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (768:28): [True: 2.28M, False: 290k]
  ------------------
  769|  2.28M|                {
  770|  2.28M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  771|  2.28M|                                    + g_ai2_ihevc_trans_16[3][k]
  772|  2.28M|                                                    * pi2_tmp[3 * trans_size]
  773|  2.28M|                                    + g_ai2_ihevc_trans_16[5][k]
  774|  2.28M|                                                    * pi2_tmp[5 * trans_size]
  775|  2.28M|                                    + g_ai2_ihevc_trans_16[7][k]
  776|  2.28M|                                                    * pi2_tmp[7 * trans_size];
  777|  2.28M|                }
  778|  1.45M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (778:28): [True: 1.16M, False: 290k]
  ------------------
  779|  1.16M|                {
  780|  1.16M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  781|  1.16M|                                    + g_ai2_ihevc_trans_16[6][k]
  782|  1.16M|                                                    * pi2_tmp[6 * trans_size];
  783|  1.16M|                }
  784|   290k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  785|   290k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  786|   290k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  787|   290k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  788|       |
  789|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  790|   869k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (790:28): [True: 578k, False: 290k]
  ------------------
  791|   578k|                {
  792|   578k|                    ee[k] = eee[k] + eeo[k];
  793|   578k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  794|   578k|                }
  795|  1.45M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (795:28): [True: 1.16M, False: 290k]
  ------------------
  796|  1.16M|                {
  797|  1.16M|                    e[k] = ee[k] + eo[k];
  798|  1.16M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  799|  1.16M|                }
  800|  2.51M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (800:28): [True: 2.22M, False: 290k]
  ------------------
  801|  2.22M|                {
  802|  2.22M|                    WORD32 itrans_out;
  803|  2.22M|                    itrans_out =
  804|  2.22M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.22M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.22M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|  2.22M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  2.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 517k, False: 1.70M]
  |  |  |  |  |  Branch (40:53): [True: 142k, False: 1.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  806|  2.22M|                    itrans_out =
  807|  2.22M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.22M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.22M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|  2.22M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  2.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 546k, False: 1.67M]
  |  |  |  |  |  Branch (40:53): [True: 135k, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  809|  2.22M|                }
  810|   290k|                pi2_tmp++;
  811|   290k|                pu1_pred += pred_strd;
  812|   290k|                pu1_dst += dst_strd;
  813|   290k|            }
  814|  21.3k|        }
  815|  10.0k|        else /* All rows of output of 1st stage are non-zero */
  816|  10.0k|        {
  817|   223k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (817:24): [True: 213k, False: 10.0k]
  ------------------
  818|   213k|            {
  819|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  820|  1.92M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (820:28): [True: 1.70M, False: 213k]
  ------------------
  821|  1.70M|                {
  822|  1.70M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  823|  1.70M|                                    + g_ai2_ihevc_trans_16[3][k]
  824|  1.70M|                                                    * pi2_tmp[3 * trans_size]
  825|  1.70M|                                    + g_ai2_ihevc_trans_16[5][k]
  826|  1.70M|                                                    * pi2_tmp[5 * trans_size]
  827|  1.70M|                                    + g_ai2_ihevc_trans_16[7][k]
  828|  1.70M|                                                    * pi2_tmp[7 * trans_size]
  829|  1.70M|                                    + g_ai2_ihevc_trans_16[9][k]
  830|  1.70M|                                                    * pi2_tmp[9 * trans_size]
  831|  1.70M|                                    + g_ai2_ihevc_trans_16[11][k]
  832|  1.70M|                                                    * pi2_tmp[11 * trans_size]
  833|  1.70M|                                    + g_ai2_ihevc_trans_16[13][k]
  834|  1.70M|                                                    * pi2_tmp[13 * trans_size]
  835|  1.70M|                                    + g_ai2_ihevc_trans_16[15][k]
  836|  1.70M|                                                    * pi2_tmp[15 * trans_size];
  837|  1.70M|                }
  838|  1.07M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (838:28): [True: 860k, False: 213k]
  ------------------
  839|   860k|                {
  840|   860k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  841|   860k|                                    + g_ai2_ihevc_trans_16[6][k]
  842|   860k|                                                    * pi2_tmp[6 * trans_size]
  843|   860k|                                    + g_ai2_ihevc_trans_16[10][k]
  844|   860k|                                                    * pi2_tmp[10 * trans_size]
  845|   860k|                                    + g_ai2_ihevc_trans_16[14][k]
  846|   860k|                                                    * pi2_tmp[14 * trans_size];
  847|   860k|                }
  848|   213k|                eeo[0] =
  849|   213k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  850|   213k|                                                + g_ai2_ihevc_trans_16[12][0]
  851|   213k|                                                                * pi2_tmp[12
  852|   213k|                                                                                * trans_size];
  853|   213k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  854|   213k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  855|   213k|                eeo[1] =
  856|   213k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  857|   213k|                                                + g_ai2_ihevc_trans_16[12][1]
  858|   213k|                                                                * pi2_tmp[12
  859|   213k|                                                                                * trans_size];
  860|   213k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  861|   213k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  862|       |
  863|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  864|   642k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (864:28): [True: 428k, False: 213k]
  ------------------
  865|   428k|                {
  866|   428k|                    ee[k] = eee[k] + eeo[k];
  867|   428k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  868|   428k|                }
  869|  1.07M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (869:28): [True: 858k, False: 213k]
  ------------------
  870|   858k|                {
  871|   858k|                    e[k] = ee[k] + eo[k];
  872|   858k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  873|   858k|                }
  874|  1.91M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (874:28): [True: 1.69M, False: 213k]
  ------------------
  875|  1.69M|                {
  876|  1.69M|                    WORD32 itrans_out;
  877|  1.69M|                    itrans_out =
  878|  1.69M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.69M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.69M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.69M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.69M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  879|  1.69M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  1.69M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.69M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 589k, False: 1.10M]
  |  |  |  |  |  Branch (40:53): [True: 89.9k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  880|  1.69M|                    itrans_out =
  881|  1.69M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.69M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.69M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.69M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.69M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|  1.69M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  1.69M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.69M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 590k, False: 1.10M]
  |  |  |  |  |  Branch (40:53): [True: 82.0k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  883|  1.69M|                }
  884|   213k|                pi2_tmp++;
  885|   213k|                pu1_pred += pred_strd;
  886|   213k|                pu1_dst += dst_strd;
  887|   213k|            }
  888|  10.0k|        }
  889|       |        /************************************************************************************************/
  890|       |        /************************************END - IT_RECON_16x16****************************************/
  891|       |        /************************************************************************************************/
  892|  64.1k|    }
  893|   505k|}

ihevc_chroma_itrans_recon_8x8:
  115|   145k|{
  116|   145k|    WORD32 j, k;
  117|   145k|    WORD32 e[4], o[4];
  118|   145k|    WORD32 ee[2], eo[2];
  119|   145k|    WORD32 add;
  120|   145k|    WORD32 shift;
  121|   145k|    WORD16 *pi2_tmp_orig;
  122|   145k|    WORD32 trans_size;
  123|   145k|    WORD32 zero_rows_2nd_stage = zero_cols;
  124|   145k|    WORD32 row_limit_2nd_stage;
  125|   145k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   145k|#define UNUSED(x) ((void)(x))
  ------------------
  126|   145k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   145k|#define TRANS_SIZE_8   8
  ------------------
  127|       |
  128|   145k|    pi2_tmp_orig = pi2_tmp;
  129|       |
  130|   145k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (130:8): [True: 134k, False: 10.8k]
  ------------------
  131|   134k|        row_limit_2nd_stage = 4;
  132|  10.8k|    else
  133|  10.8k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  10.8k|#define TRANS_SIZE_8   8
  ------------------
  134|       |
  135|       |    /* Inverse Transform 1st stage */
  136|   145k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   145k|#define IT_SHIFT_STAGE_1 7
  ------------------
  137|   145k|    add = 1 << (shift - 1);
  138|   145k|    {
  139|       |        /************************************************************************************************/
  140|       |        /**********************************START - IT_RECON_8x8******************************************/
  141|       |        /************************************************************************************************/
  142|       |
  143|   768k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (143:20): [True: 623k, False: 145k]
  ------------------
  144|   623k|        {
  145|       |            /* Checking for Zero Cols */
  146|   623k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (146:16): [True: 351k, False: 271k]
  ------------------
  147|   351k|            {
  148|   351k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  149|   351k|            }
  150|   271k|            else
  151|   271k|            {
  152|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  153|  1.36M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (153:28): [True: 1.09M, False: 271k]
  ------------------
  154|  1.09M|                {
  155|  1.09M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  156|  1.09M|                                    + g_ai2_ihevc_trans_8[3][k]
  157|  1.09M|                                                    * pi2_src[3 * src_strd]
  158|  1.09M|                                    + g_ai2_ihevc_trans_8[5][k]
  159|  1.09M|                                                    * pi2_src[5 * src_strd]
  160|  1.09M|                                    + g_ai2_ihevc_trans_8[7][k]
  161|  1.09M|                                                    * pi2_src[7 * src_strd];
  162|  1.09M|                }
  163|       |
  164|   271k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  165|   271k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  166|   271k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  167|   271k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  168|   271k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  169|   271k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  170|   271k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  171|   271k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd];
  172|       |
  173|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  174|   271k|                e[0] = ee[0] + eo[0];
  175|   271k|                e[3] = ee[0] - eo[0];
  176|   271k|                e[1] = ee[1] + eo[1];
  177|   271k|                e[2] = ee[1] - eo[1];
  178|  1.37M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (178:28): [True: 1.09M, False: 271k]
  ------------------
  179|  1.09M|                {
  180|  1.09M|                    pi2_tmp[k] =
  181|  1.09M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.09M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.30k, False: 1.09M]
  |  |  |  |  |  Branch (40:53): [True: 3.17k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.09M|                    pi2_tmp[k + 4] =
  183|  1.09M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.09M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.35k, False: 1.09M]
  |  |  |  |  |  Branch (40:53): [True: 2.28k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  184|  1.09M|                }
  185|   271k|            }
  186|   623k|            pi2_src++;
  187|   623k|            pi2_tmp += trans_size;
  188|   623k|            zero_cols = zero_cols >> 1;
  189|   623k|        }
  190|       |
  191|   145k|        pi2_tmp = pi2_tmp_orig;
  192|       |
  193|       |        /* Inverse Transform 2nd stage */
  194|   145k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   145k|#define IT_SHIFT_STAGE_2 12
  ------------------
  195|   145k|        add = 1 << (shift - 1);
  196|       |
  197|   145k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (197:12): [True: 134k, False: 10.5k]
  ------------------
  198|   134k|        {
  199|  1.20M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (199:24): [True: 1.07M, False: 134k]
  ------------------
  200|  1.07M|            {
  201|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  202|  5.35M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (202:28): [True: 4.28M, False: 1.07M]
  ------------------
  203|  4.28M|                {
  204|  4.28M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  205|  4.28M|                                    + g_ai2_ihevc_trans_8[3][k]
  206|  4.28M|                                                    * pi2_tmp[3 * trans_size];
  207|  4.28M|                }
  208|  1.07M|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  209|  1.07M|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  210|  1.07M|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  211|  1.07M|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  212|       |
  213|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  214|  1.07M|                e[0] = ee[0] + eo[0];
  215|  1.07M|                e[3] = ee[0] - eo[0];
  216|  1.07M|                e[1] = ee[1] + eo[1];
  217|  1.07M|                e[2] = ee[1] - eo[1];
  218|  5.35M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (218:28): [True: 4.28M, False: 1.07M]
  ------------------
  219|  4.28M|                {
  220|  4.28M|                    WORD32 itrans_out;
  221|  4.28M|                    itrans_out =
  222|  4.28M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.28M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.28M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  4.28M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  4.28M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 583k, False: 3.69M]
  |  |  |  |  |  Branch (40:53): [True: 344k, False: 3.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  4.28M|                    itrans_out =
  225|  4.28M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  4.28M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.28M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  4.28M|                    pu1_dst[(k + 4) * 2] =
  227|  4.28M|                                    CLIP_U8((itrans_out + pu1_pred[(k + 4) * 2]));
  ------------------
  |  |   40|  4.28M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 581k, False: 3.69M]
  |  |  |  |  |  Branch (40:53): [True: 359k, False: 3.33M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  4.28M|                }
  229|  1.07M|                pi2_tmp++;
  230|  1.07M|                pu1_pred += pred_strd;
  231|  1.07M|                pu1_dst += dst_strd;
  232|  1.07M|            }
  233|   134k|        }
  234|  10.5k|        else /* All rows of output of 1st stage are non-zero */
  235|  10.5k|        {
  236|  97.5k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (236:24): [True: 86.9k, False: 10.5k]
  ------------------
  237|  86.9k|            {
  238|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  239|   434k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (239:28): [True: 347k, False: 86.9k]
  ------------------
  240|   347k|                {
  241|   347k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  242|   347k|                                    + g_ai2_ihevc_trans_8[3][k]
  243|   347k|                                                    * pi2_tmp[3 * trans_size]
  244|   347k|                                    + g_ai2_ihevc_trans_8[5][k]
  245|   347k|                                                    * pi2_tmp[5 * trans_size]
  246|   347k|                                    + g_ai2_ihevc_trans_8[7][k]
  247|   347k|                                                    * pi2_tmp[7 * trans_size];
  248|   347k|                }
  249|       |
  250|  86.9k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  251|  86.9k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  252|  86.9k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  253|  86.9k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  254|  86.9k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  255|  86.9k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  256|  86.9k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  257|  86.9k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  258|       |
  259|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  260|  86.9k|                e[0] = ee[0] + eo[0];
  261|  86.9k|                e[3] = ee[0] - eo[0];
  262|  86.9k|                e[1] = ee[1] + eo[1];
  263|  86.9k|                e[2] = ee[1] - eo[1];
  264|   434k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (264:28): [True: 347k, False: 86.9k]
  ------------------
  265|   347k|                {
  266|   347k|                    WORD32 itrans_out;
  267|   347k|                    itrans_out =
  268|   347k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   347k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   347k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 347k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 347k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|   347k|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|   347k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   347k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 75.9k, False: 271k]
  |  |  |  |  |  Branch (40:53): [True: 62.6k, False: 209k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|   347k|                    itrans_out =
  271|   347k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   347k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   347k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 347k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 347k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|   347k|                    pu1_dst[(k + 4) * 2] =
  273|   347k|                                    CLIP_U8((itrans_out + pu1_pred[(k + 4) * 2]));
  ------------------
  |  |   40|   347k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   347k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 65.8k, False: 281k]
  |  |  |  |  |  Branch (40:53): [True: 63.8k, False: 218k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|   347k|                }
  275|  86.9k|                pi2_tmp++;
  276|  86.9k|                pu1_pred += pred_strd;
  277|  86.9k|                pu1_dst += dst_strd;
  278|  86.9k|            }
  279|  10.5k|        }
  280|       |        /************************************************************************************************/
  281|       |        /************************************END - IT_RECON_8x8******************************************/
  282|       |        /************************************************************************************************/
  283|   145k|    }
  284|   145k|}

ihevc_chroma_recon_4x4:
  109|   292k|{
  110|   292k|    WORD32 i, j;
  111|   292k|    WORD32 trans_size;
  112|       |
  113|   292k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   292k|#define TRANS_SIZE_4   4
  ------------------
  114|       |
  115|       |    /* Reconstruction */
  116|       |
  117|  1.46M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (117:16): [True: 1.16M, False: 292k]
  ------------------
  118|  1.16M|    {
  119|       |        /* Checking for Zero Cols */
  120|  1.16M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (120:12): [True: 711k, False: 456k]
  ------------------
  121|   711k|        {
  122|  3.55M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (122:24): [True: 2.84M, False: 711k]
  ------------------
  123|  2.84M|            {
  124|  2.84M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  125|  2.84M|            }
  126|   711k|        }
  127|   456k|        else
  128|   456k|        {
  129|  2.28M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (129:24): [True: 1.82M, False: 456k]
  ------------------
  130|  1.82M|            {
  131|  1.82M|                pu1_dst[j * dst_strd] =
  132|  1.82M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  1.82M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 129k, False: 1.69M]
  |  |  |  |  |  Branch (40:53): [True: 138k, False: 1.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|  1.82M|            }
  134|   456k|        }
  135|  1.16M|        pi2_src++;
  136|  1.16M|        pu1_dst += 2;
  137|  1.16M|        pu1_pred += 2;
  138|  1.16M|        zero_cols = zero_cols >> 1;
  139|  1.16M|    }
  140|   292k|}
ihevc_chroma_recon_8x8:
  192|  3.87k|{
  193|  3.87k|    WORD32 i, j;
  194|  3.87k|    WORD32 trans_size;
  195|       |
  196|  3.87k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  3.87k|#define TRANS_SIZE_8   8
  ------------------
  197|       |
  198|       |    /* Reconstruction */
  199|       |
  200|  34.7k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (200:16): [True: 30.9k, False: 3.87k]
  ------------------
  201|  30.9k|    {
  202|       |        /* Checking for Zero Cols */
  203|  30.9k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (203:12): [True: 24.8k, False: 6.09k]
  ------------------
  204|  24.8k|        {
  205|   223k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (205:24): [True: 198k, False: 24.8k]
  ------------------
  206|   198k|            {
  207|   198k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  208|   198k|            }
  209|  24.8k|        }
  210|  6.09k|        else
  211|  6.09k|        {
  212|  54.9k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (212:24): [True: 48.8k, False: 6.09k]
  ------------------
  213|  48.8k|            {
  214|  48.8k|                pu1_dst[j * dst_strd] =
  215|  48.8k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  48.8k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  48.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 440, False: 48.4k]
  |  |  |  |  |  Branch (40:53): [True: 1.08k, False: 47.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  48.8k|            }
  217|  6.09k|        }
  218|  30.9k|        pi2_src++;
  219|  30.9k|        pu1_dst += 2;
  220|  30.9k|        pu1_pred += 2;
  221|  30.9k|        zero_cols = zero_cols >> 1;
  222|  30.9k|    }
  223|  3.87k|}
ihevc_chroma_recon_16x16:
  275|  3.77k|{
  276|  3.77k|    WORD32 i, j;
  277|  3.77k|    WORD32 trans_size;
  278|       |
  279|  3.77k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  3.77k|#define TRANS_SIZE_16 16
  ------------------
  280|       |
  281|       |    /* Reconstruction */
  282|       |
  283|  64.1k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (283:16): [True: 60.3k, False: 3.77k]
  ------------------
  284|  60.3k|    {
  285|       |        /* Checking for Zero Cols */
  286|  60.3k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (286:12): [True: 50.7k, False: 9.66k]
  ------------------
  287|  50.7k|        {
  288|   861k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (288:24): [True: 811k, False: 50.7k]
  ------------------
  289|   811k|            {
  290|   811k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  291|   811k|            }
  292|  50.7k|        }
  293|  9.66k|        else
  294|  9.66k|        {
  295|   164k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (295:24): [True: 154k, False: 9.66k]
  ------------------
  296|   154k|            {
  297|   154k|                pu1_dst[j * dst_strd] =
  298|   154k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|   154k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   154k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.10k, False: 152k]
  |  |  |  |  |  Branch (40:53): [True: 1.15k, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  299|   154k|            }
  300|  9.66k|        }
  301|  60.3k|        pi2_src++;
  302|  60.3k|        pu1_dst += 2;
  303|  60.3k|        pu1_pred += 2;
  304|  60.3k|        zero_cols = zero_cols >> 1;
  305|  60.3k|    }
  306|  3.77k|}
ihevc_chroma_recon_nxn_ccp:
  446|   184k|{
  447|   184k|    WORD32 i, j;
  448|       |
  449|  1.61M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (449:16): [True: 1.42M, False: 184k]
  ------------------
  450|  1.42M|    {
  451|  14.8M|        for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (451:20): [True: 13.4M, False: 1.42M]
  ------------------
  452|  13.4M|        {
  453|  13.4M|            WORD32 res = (alpha * pi2_luma_res[j]) >> 3;
  454|  13.4M|            pu1_dst[j * 2] = CLIP_U8(pu1_pred[j * 2] + (pi2_chroma_res[j] + res));
  ------------------
  |  |   40|  13.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  13.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 249k, False: 13.1M]
  |  |  |  |  |  Branch (40:53): [True: 283k, False: 12.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  455|  13.4M|        }
  456|  1.42M|        pi2_luma_res += luma_res_stride;
  457|  1.42M|        pi2_chroma_res += chroma_res_stride;
  458|  1.42M|        pu1_dst += dst_stride;
  459|  1.42M|        pu1_pred += pred_stride;
  460|  1.42M|    }
  461|   184k|}

ihevc_deblk_luma_vert:
  107|  21.8M|{
  108|  21.8M|    WORD32 qp_luma, beta_indx, tc_indx;
  109|  21.8M|    WORD32 beta, tc;
  110|  21.8M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  111|  21.8M|    WORD32 d_sam0, d_sam3;
  112|  21.8M|    WORD32 de, dep, deq;
  113|  21.8M|    WORD32 row;
  114|  21.8M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  115|  21.8M|    WORD32 delta, delta_p, delta_q;
  116|       |
  117|  21.8M|    ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  21.8M|#define ASSERT(x) {}
  ------------------
  118|  21.8M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  21.8M|#define ASSERT(x) {}
  ------------------
  119|       |
  120|  21.8M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  121|  21.8M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  21.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 72.5k, False: 21.7M]
  |  |  |  Branch (40:53): [True: 2.39k, False: 21.7M]
  |  |  ------------------
  ------------------
  122|       |
  123|       |    /* BS based on implementation can take value 3 if it is intra/inter egde          */
  124|       |    /* based on BS, tc index is calcuated by adding 2 * ( bs - 1) to QP and tc_offset */
  125|       |    /* for BS = 1 adding factor is (0*2), BS = 2 or 3 adding factor is (1*2)          */
  126|       |    /* the above desired functionallity is achieved by doing (2*(bs>>1))              */
  127|       |
  128|  21.8M|    tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  21.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.95k, False: 21.8M]
  |  |  |  Branch (40:53): [True: 2.38k, False: 21.8M]
  |  |  ------------------
  ------------------
  129|       |
  130|  21.8M|    beta = gai4_ihevc_beta_table[beta_indx];
  131|  21.8M|    tc = gai4_ihevc_tc_table[tc_indx];
  132|  21.8M|    if(0 == tc)
  ------------------
  |  Branch (132:8): [True: 640k, False: 21.1M]
  ------------------
  133|   640k|    {
  134|   640k|        return;
  135|   640k|    }
  136|       |
  137|  21.1M|    dq0 = ABS(pu1_src[2] - 2 * pu1_src[1] + pu1_src[0]);
  ------------------
  |  |   45|  21.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.25M, False: 19.9M]
  |  |  ------------------
  ------------------
  138|  21.1M|    dq3 = ABS(pu1_src[3 * src_strd + 2] - 2 * pu1_src[3 * src_strd + 1]
  ------------------
  |  |   45|  21.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.21M, False: 19.9M]
  |  |  ------------------
  ------------------
  139|  21.1M|                    + pu1_src[3 * src_strd + 0]);
  140|  21.1M|    dp0 = ABS(pu1_src[-3] - 2 * pu1_src[-2] + pu1_src[-1]);
  ------------------
  |  |   45|  21.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.23M, False: 19.9M]
  |  |  ------------------
  ------------------
  141|  21.1M|    dp3 = ABS(pu1_src[3 * src_strd - 3] - 2 * pu1_src[3 * src_strd - 2]
  ------------------
  |  |   45|  21.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.21M, False: 19.9M]
  |  |  ------------------
  ------------------
  142|  21.1M|                    + pu1_src[3 * src_strd - 1]);
  143|       |
  144|  21.1M|    d0 = dp0 + dq0;
  145|  21.1M|    d3 = dp3 + dq3;
  146|       |
  147|  21.1M|    dp = dp0 + dp3;
  148|  21.1M|    dq = dq0 + dq3;
  149|       |
  150|  21.1M|    d = d0 + d3;
  151|       |
  152|  21.1M|    de = 0;
  153|  21.1M|    dep = 0;
  154|  21.1M|    deq = 0;
  155|       |
  156|  21.1M|    if(d < beta)
  ------------------
  |  Branch (156:8): [True: 20.2M, False: 950k]
  ------------------
  157|  20.2M|    {
  158|  20.2M|        d_sam0 = 0;
  159|  20.2M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (159:12): [True: 19.4M, False: 744k]
  ------------------
  160|  19.4M|                        && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  19.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 633k, False: 18.8M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  19.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 787k, False: 18.6M]
  |  |  ------------------
  ------------------
  |  Branch (160:28): [True: 18.7M, False: 764k]
  ------------------
  161|  19.4M|                                        < (beta >> 3))
  162|  18.6M|                        && ABS(pu1_src[0] - pu1_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  18.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 593k, False: 18.0M]
  |  |  ------------------
  ------------------
  |  Branch (162:28): [True: 18.4M, False: 256k]
  ------------------
  163|  18.3M|        {
  164|  18.3M|            d_sam0 = 1;
  165|  18.3M|        }
  166|       |
  167|  20.2M|        pu1_src += 3 * src_strd;
  168|  20.2M|        d_sam3 = 0;
  169|  20.2M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (169:12): [True: 19.2M, False: 978k]
  ------------------
  170|  19.2M|                        && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  19.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 647k, False: 18.6M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  19.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 803k, False: 18.4M]
  |  |  ------------------
  ------------------
  |  Branch (170:28): [True: 18.4M, False: 787k]
  ------------------
  171|  19.2M|                                        < (beta >> 3))
  172|  18.4M|                        && ABS(pu1_src[0] - pu1_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  18.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 588k, False: 17.8M]
  |  |  ------------------
  ------------------
  |  Branch (172:28): [True: 18.2M, False: 210k]
  ------------------
  173|  18.2M|        {
  174|  18.2M|            d_sam3 = 1;
  175|  18.2M|        }
  176|  20.2M|        pu1_src -= 3 * src_strd;
  177|       |
  178|  20.2M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (178:15): [True: 18.1M, False: 2.04M]
  |  Branch (178:30): [True: 17.9M, False: 229k]
  ------------------
  179|  20.2M|        dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (179:15): [True: 19.0M, False: 1.20M]
  ------------------
  180|  20.2M|        deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (180:15): [True: 18.9M, False: 1.23M]
  ------------------
  181|  20.2M|        if(tc <= 1)
  ------------------
  |  Branch (181:12): [True: 420k, False: 19.8M]
  ------------------
  182|   420k|        {
  183|   420k|            dep = 0;
  184|   420k|            deq = 0;
  185|   420k|        }
  186|  20.2M|    }
  187|       |
  188|  21.1M|    if(de != 0)
  ------------------
  |  Branch (188:8): [True: 19.5M, False: 1.63M]
  ------------------
  189|  19.5M|    {
  190|  91.5M|        for(row = 0; row < 4; row++)
  ------------------
  |  Branch (190:22): [True: 71.9M, False: 19.5M]
  ------------------
  191|  71.9M|        {
  192|  71.9M|            tmp_p0 = pu1_src[-1];
  193|  71.9M|            tmp_p1 = pu1_src[-2];
  194|  71.9M|            tmp_p2 = pu1_src[-3];
  195|       |
  196|  71.9M|            tmp_q0 = pu1_src[0];
  197|  71.9M|            tmp_q1 = pu1_src[1];
  198|  71.9M|            tmp_q2 = pu1_src[2];
  199|       |
  200|  71.9M|            if(de == 2)
  ------------------
  |  Branch (200:16): [True: 65.0M, False: 6.92M]
  ------------------
  201|  65.0M|            {
  202|  65.0M|                tmp_q0 = CLIP3((pu1_src[2] + 2 * pu1_src[1] +
  ------------------
  |  |   40|  65.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.71k, False: 65.0M]
  |  |  |  Branch (40:53): [True: 6.73k, False: 65.0M]
  |  |  ------------------
  ------------------
  203|  65.0M|                                2 * pu1_src[0] + 2 * pu1_src[-1] +
  204|  65.0M|                                pu1_src[-2] + 4) >> 3,
  205|  65.0M|                                pu1_src[0] - 2 * tc,
  206|  65.0M|                                pu1_src[0] + 2 * tc);
  207|       |
  208|  65.0M|                tmp_q1 = CLIP3((pu1_src[2] + pu1_src[1] + pu1_src[0] +
  ------------------
  |  |   40|  65.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.18k, False: 65.0M]
  |  |  |  Branch (40:53): [True: 5.53k, False: 65.0M]
  |  |  ------------------
  ------------------
  209|  65.0M|                                pu1_src[-1] + 2) >> 2,
  210|  65.0M|                                pu1_src[1] - 2 * tc,
  211|  65.0M|                                pu1_src[1] + 2 * tc);
  212|       |
  213|  65.0M|                tmp_q2 = CLIP3((2 * pu1_src[3] + 3 * pu1_src[2] +
  ------------------
  |  |   40|  65.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.98k, False: 65.0M]
  |  |  |  Branch (40:53): [True: 3.76k, False: 65.0M]
  |  |  ------------------
  ------------------
  214|  65.0M|                                pu1_src[1] + pu1_src[0] +
  215|  65.0M|                                pu1_src[-1] + 4) >> 3,
  216|  65.0M|                                pu1_src[2] - 2 * tc,
  217|  65.0M|                                pu1_src[2] + 2 * tc);
  218|       |
  219|  65.0M|                tmp_p0 = CLIP3((pu1_src[1] + 2 * pu1_src[0] +
  ------------------
  |  |   40|  65.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.16k, False: 65.0M]
  |  |  |  Branch (40:53): [True: 5.54k, False: 65.0M]
  |  |  ------------------
  ------------------
  220|  65.0M|                                2 * pu1_src[-1] + 2 * pu1_src[-2] +
  221|  65.0M|                                pu1_src[-3] + 4) >> 3,
  222|  65.0M|                                pu1_src[-1] - 2 * tc,
  223|  65.0M|                                pu1_src[-1] + 2 * tc);
  224|       |
  225|  65.0M|                tmp_p1 = CLIP3((pu1_src[0] + pu1_src[-1] +
  ------------------
  |  |   40|  65.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.22k, False: 65.0M]
  |  |  |  Branch (40:53): [True: 5.43k, False: 65.0M]
  |  |  ------------------
  ------------------
  226|  65.0M|                                pu1_src[-2] + pu1_src[-3] + 2) >> 2,
  227|  65.0M|                                pu1_src[-2] - 2 * tc,
  228|  65.0M|                                pu1_src[-2] + 2 * tc);
  229|       |
  230|  65.0M|                tmp_p2 = CLIP3((pu1_src[0] + pu1_src[-1] +
  ------------------
  |  |   40|  65.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.28k, False: 65.0M]
  |  |  |  Branch (40:53): [True: 2.76k, False: 65.0M]
  |  |  ------------------
  ------------------
  231|  65.0M|                                pu1_src[-2] + 3 * pu1_src[-3] +
  232|  65.0M|                                2 * pu1_src[-4] + 4) >> 3,
  233|  65.0M|                                pu1_src[-3] - 2 * tc,
  234|  65.0M|                                pu1_src[-3] + 2 * tc);
  235|  65.0M|            }
  236|  6.92M|            else
  237|  6.92M|            {
  238|  6.92M|                delta = (9 * (pu1_src[0] - pu1_src[-1]) -
  239|  6.92M|                                3 * (pu1_src[1] - pu1_src[-2]) + 8) >> 4;
  240|  6.92M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  6.92M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.18M, False: 3.73M]
  |  |  ------------------
  ------------------
  |  Branch (240:20): [True: 7.51M, False: 18.4E]
  ------------------
  241|  7.51M|                {
  242|  7.51M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  7.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 739k, False: 6.77M]
  |  |  |  Branch (40:53): [True: 644k, False: 6.13M]
  |  |  ------------------
  ------------------
  243|       |
  244|  7.51M|                    tmp_p0 = CLIP_U8(pu1_src[-1] + delta);
  ------------------
  |  |   40|  7.51M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 36.2k, False: 7.47M]
  |  |  |  |  |  Branch (40:53): [True: 15.5k, False: 7.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  7.51M|                    tmp_q0 = CLIP_U8(pu1_src[0] - delta);
  ------------------
  |  |   40|  7.51M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 341k, False: 7.17M]
  |  |  |  |  |  Branch (40:53): [True: 13.6k, False: 7.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|       |
  247|  7.51M|                    if(dep == 1)
  ------------------
  |  Branch (247:24): [True: 5.22M, False: 2.28M]
  ------------------
  248|  5.22M|                    {
  249|  5.22M|                        delta_p = CLIP3((((pu1_src[-3] + pu1_src[-1] + 1) >> 1)
  ------------------
  |  |   40|  5.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 54.8k, False: 5.17M]
  |  |  |  Branch (40:53): [True: 131k, False: 5.03M]
  |  |  ------------------
  ------------------
  250|  5.22M|                                        - pu1_src[-2] + delta) >> 1,
  251|  5.22M|                                        -(tc >> 1),
  252|  5.22M|                                        (tc >> 1));
  253|  5.22M|                        tmp_p1 = CLIP_U8(pu1_src[-2] + delta_p);
  ------------------
  |  |   40|  5.22M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 12.4k, False: 5.21M]
  |  |  |  |  |  Branch (40:53): [True: 11.3k, False: 5.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  5.22M|                    }
  255|       |
  256|  7.51M|                    if(deq == 1)
  ------------------
  |  Branch (256:24): [True: 5.09M, False: 2.42M]
  ------------------
  257|  5.09M|                    {
  258|  5.09M|                        delta_q = CLIP3((((pu1_src[2] + pu1_src[0] + 1) >> 1)
  ------------------
  |  |   40|  5.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 57.5k, False: 5.03M]
  |  |  |  Branch (40:53): [True: 137k, False: 4.89M]
  |  |  ------------------
  ------------------
  259|  5.09M|                                        - pu1_src[1] - delta) >> 1,
  260|  5.09M|                                        -(tc >> 1),
  261|  5.09M|                                        (tc >> 1));
  262|  5.09M|                        tmp_q1 = CLIP_U8(pu1_src[1] + delta_q);
  ------------------
  |  |   40|  5.09M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 274k, False: 4.81M]
  |  |  |  |  |  Branch (40:53): [True: 9.69k, False: 4.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|  5.09M|                    }
  264|  7.51M|                }
  265|  6.92M|            }
  266|       |
  267|  71.9M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (267:16): [True: 71.8M, False: 120k]
  ------------------
  268|  71.8M|            {
  269|  71.8M|                pu1_src[-3] = tmp_p2;
  270|  71.8M|                pu1_src[-2] = tmp_p1;
  271|  71.8M|                pu1_src[-1] = tmp_p0;
  272|  71.8M|            }
  273|       |
  274|  71.9M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (274:16): [True: 71.9M, False: 96.5k]
  ------------------
  275|  71.9M|            {
  276|  71.9M|                pu1_src[0] = tmp_q0;
  277|  71.9M|                pu1_src[1] = tmp_q1;
  278|  71.9M|                pu1_src[2] = tmp_q2;
  279|  71.9M|            }
  280|       |
  281|  71.9M|            pu1_src += src_strd;
  282|  71.9M|        }
  283|  19.5M|    }
  284|       |
  285|  21.1M|}
ihevc_deblk_luma_horz:
  344|  20.6M|{
  345|  20.6M|    WORD32 qp_luma, beta_indx, tc_indx;
  346|  20.6M|    WORD32 beta, tc;
  347|  20.6M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  348|  20.6M|    WORD32 d_sam0, d_sam3;
  349|  20.6M|    WORD32 de, dep, deq;
  350|  20.6M|    WORD32 col;
  351|  20.6M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  352|  20.6M|    WORD32 delta, delta_p, delta_q;
  353|       |
  354|  20.6M|    ASSERT((bs > 0));
  ------------------
  |  |   55|  20.6M|#define ASSERT(x) {}
  ------------------
  355|  20.6M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  20.6M|#define ASSERT(x) {}
  ------------------
  356|       |
  357|  20.6M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  358|  20.6M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  20.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 18.2k, False: 20.6M]
  |  |  |  Branch (40:53): [True: 2.08k, False: 20.6M]
  |  |  ------------------
  ------------------
  359|       |
  360|       |    /* BS based on implementation can take value 3 if it is intra/inter egde          */
  361|       |    /* based on BS, tc index is calcuated by adding 2 * ( bs - 1) to QP and tc_offset */
  362|       |    /* for BS = 1 adding factor is (0*2), BS = 2 or 3 adding factor is (1*2)          */
  363|       |    /* the above desired functionallity is achieved by doing (2*(bs>>1))              */
  364|       |
  365|  20.6M|    tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  20.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.62k, False: 20.6M]
  |  |  |  Branch (40:53): [True: 2.06k, False: 20.6M]
  |  |  ------------------
  ------------------
  366|       |
  367|  20.6M|    beta = gai4_ihevc_beta_table[beta_indx];
  368|  20.6M|    tc = gai4_ihevc_tc_table[tc_indx];
  369|  20.6M|    if(0 == tc)
  ------------------
  |  Branch (369:8): [True: 846k, False: 19.8M]
  ------------------
  370|   846k|    {
  371|   846k|        return;
  372|   846k|    }
  373|       |
  374|  19.8M|    dq0 = ABS(pu1_src[2 * src_strd] - 2 * pu1_src[1 * src_strd] +
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.13M, False: 18.6M]
  |  |  ------------------
  ------------------
  375|  19.8M|                    pu1_src[0 * src_strd]);
  376|       |
  377|  19.8M|    dq3 = ABS(pu1_src[3 + 2 * src_strd] - 2 * pu1_src[3 + 1 * src_strd] +
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.09M, False: 18.7M]
  |  |  ------------------
  ------------------
  378|  19.8M|                    pu1_src[3 + 0 * src_strd]);
  379|       |
  380|  19.8M|    dp0 = ABS(pu1_src[-3 * src_strd] - 2 * pu1_src[-2 * src_strd] +
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.09M, False: 18.7M]
  |  |  ------------------
  ------------------
  381|  19.8M|                    pu1_src[-1 * src_strd]);
  382|       |
  383|  19.8M|    dp3 = ABS(pu1_src[3 - 3 * src_strd] - 2 * pu1_src[3 - 2 * src_strd] +
  ------------------
  |  |   45|  19.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.09M, False: 18.7M]
  |  |  ------------------
  ------------------
  384|  19.8M|                    pu1_src[3 - 1 * src_strd]);
  385|       |
  386|  19.8M|    d0 = dp0 + dq0;
  387|  19.8M|    d3 = dp3 + dq3;
  388|       |
  389|  19.8M|    dp = dp0 + dp3;
  390|  19.8M|    dq = dq0 + dq3;
  391|       |
  392|  19.8M|    d = d0 + d3;
  393|       |
  394|  19.8M|    de = 0;
  395|  19.8M|    dep = 0;
  396|  19.8M|    deq = 0;
  397|       |
  398|  19.8M|    if(d < beta)
  ------------------
  |  Branch (398:8): [True: 18.7M, False: 1.11M]
  ------------------
  399|  18.7M|    {
  400|  18.7M|        d_sam0 = 0;
  401|  18.7M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (401:12): [True: 18.2M, False: 504k]
  ------------------
  402|  18.2M|                        && (ABS(pu1_src[3 * src_strd] - pu1_src[0 * src_strd]) +
  ------------------
  |  |   45|  18.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 743k, False: 17.4M]
  |  |  ------------------
  ------------------
  |  Branch (402:28): [True: 17.4M, False: 762k]
  ------------------
  403|  18.2M|                                        ABS(pu1_src[-1 * src_strd] - pu1_src[-4 * src_strd])
  ------------------
  |  |   45|  18.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 821k, False: 17.3M]
  |  |  ------------------
  ------------------
  404|  18.2M|                                        < (beta >> 3))
  405|  17.4M|                        && ABS(pu1_src[0 * src_strd] - pu1_src[-1 * src_strd])
  ------------------
  |  |   45|  17.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 619k, False: 16.8M]
  |  |  ------------------
  ------------------
  |  Branch (405:28): [True: 17.4M, False: 74.6k]
  ------------------
  406|  17.4M|                        < ((5 * tc + 1) >> 1))
  407|  17.7M|        {
  408|  17.7M|            d_sam0 = 1;
  409|  17.7M|        }
  410|       |
  411|  18.7M|        pu1_src += 3;
  412|  18.7M|        d_sam3 = 0;
  413|  18.7M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (413:12): [True: 18.7M, False: 18.4E]
  ------------------
  414|  18.7M|                        && (ABS(pu1_src[3 * src_strd] - pu1_src[0 * src_strd]) +
  ------------------
  |  |   45|  18.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 742k, False: 18.0M]
  |  |  ------------------
  ------------------
  |  Branch (414:28): [True: 17.9M, False: 793k]
  ------------------
  415|  18.7M|                                        ABS(pu1_src[-1 * src_strd] - pu1_src[-4 * src_strd])
  ------------------
  |  |   45|  18.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 818k, False: 17.9M]
  |  |  ------------------
  ------------------
  416|  18.7M|                                        < (beta >> 3))
  417|  17.9M|                        && ABS(pu1_src[0 * src_strd] - pu1_src[-1 * src_strd])
  ------------------
  |  |   45|  17.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 625k, False: 17.3M]
  |  |  ------------------
  ------------------
  |  Branch (417:28): [True: 17.7M, False: 192k]
  ------------------
  418|  17.9M|                        < ((5 * tc + 1) >> 1))
  419|  17.7M|        {
  420|  17.7M|            d_sam3 = 1;
  421|  17.7M|        }
  422|  18.7M|        pu1_src -= 3;
  423|       |
  424|  18.7M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (424:15): [True: 17.7M, False: 990k]
  |  Branch (424:30): [True: 17.5M, False: 165k]
  ------------------
  425|  18.4E|        dep = (dp < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (425:15): [True: 19.9M, False: 18.4E]
  ------------------
  426|  18.4E|        deq = (dq < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (426:15): [True: 19.8M, False: 18.4E]
  ------------------
  427|  18.7M|        if(tc <= 1)
  ------------------
  |  Branch (427:12): [True: 628k, False: 18.0M]
  ------------------
  428|   628k|        {
  429|   628k|            dep = 0;
  430|   628k|            deq = 0;
  431|   628k|        }
  432|  18.7M|    }
  433|       |
  434|  19.8M|    if(de != 0)
  ------------------
  |  Branch (434:8): [True: 20.1M, False: 18.4E]
  ------------------
  435|  20.1M|    {
  436|  92.0M|        for(col = 0; col < 4; col++)
  ------------------
  |  Branch (436:22): [True: 71.9M, False: 20.1M]
  ------------------
  437|  71.9M|        {
  438|  71.9M|            tmp_p0 = pu1_src[-1 * src_strd];
  439|  71.9M|            tmp_p1 = pu1_src[-2 * src_strd];
  440|  71.9M|            tmp_p2 = pu1_src[-3 * src_strd];
  441|       |
  442|  71.9M|            tmp_q0 = pu1_src[0 * src_strd];
  443|  71.9M|            tmp_q1 = pu1_src[1 * src_strd];
  444|  71.9M|            tmp_q2 = pu1_src[2 * src_strd];
  445|  71.9M|            if(de == 2)
  ------------------
  |  Branch (445:16): [True: 65.5M, False: 6.39M]
  ------------------
  446|  65.5M|            {
  447|  65.5M|                tmp_q0 = CLIP3((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  65.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.22k, False: 65.5M]
  |  |  |  Branch (40:53): [True: 3.33k, False: 65.5M]
  |  |  ------------------
  ------------------
  448|  65.5M|                                2 * pu1_src[1 * src_strd] +
  449|  65.5M|                                2 * pu1_src[0 * src_strd] +
  450|  65.5M|                                2 * pu1_src[-1 * src_strd] +
  451|  65.5M|                                pu1_src[-2 * src_strd] + 4) >> 3,
  452|  65.5M|                                pu1_src[0 * src_strd] - 2 * tc,
  453|  65.5M|                                pu1_src[0 * src_strd] + 2 * tc);
  454|       |
  455|  65.5M|                tmp_q1 = CLIP3((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  65.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.08k, False: 65.5M]
  |  |  |  Branch (40:53): [True: 4.01k, False: 65.5M]
  |  |  ------------------
  ------------------
  456|  65.5M|                                pu1_src[1 * src_strd] +
  457|  65.5M|                                pu1_src[0 * src_strd] +
  458|  65.5M|                                pu1_src[-1 * src_strd] + 2) >> 2,
  459|  65.5M|                                pu1_src[1 * src_strd] - 2 * tc,
  460|  65.5M|                                pu1_src[1 * src_strd] + 2 * tc);
  461|       |
  462|  65.5M|                tmp_q2 = CLIP3((2 * pu1_src[3 * src_strd] +
  ------------------
  |  |   40|  65.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.39k, False: 65.5M]
  |  |  |  Branch (40:53): [True: 2.63k, False: 65.5M]
  |  |  ------------------
  ------------------
  463|  65.5M|                                3 * pu1_src[2 * src_strd] +
  464|  65.5M|                                pu1_src[1 * src_strd] +
  465|  65.5M|                                pu1_src[0 * src_strd] +
  466|  65.5M|                                pu1_src[-1 * src_strd] + 4) >> 3,
  467|  65.5M|                                pu1_src[2 * src_strd] - 2 * tc,
  468|  65.5M|                                pu1_src[2 * src_strd] + 2 * tc);
  469|       |
  470|  65.5M|                tmp_p0 = CLIP3((pu1_src[1 * src_strd] +
  ------------------
  |  |   40|  65.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.72k, False: 65.5M]
  |  |  |  Branch (40:53): [True: 3.99k, False: 65.5M]
  |  |  ------------------
  ------------------
  471|  65.5M|                                2 * pu1_src[0 * src_strd] +
  472|  65.5M|                                2 * pu1_src[-1 * src_strd] +
  473|  65.5M|                                2 * pu1_src[-2 * src_strd] +
  474|  65.5M|                                pu1_src[-3 * src_strd] + 4) >> 3,
  475|  65.5M|                                pu1_src[-1 * src_strd] - 2 * tc,
  476|  65.5M|                                pu1_src[-1 * src_strd] + 2 * tc);
  477|       |
  478|  65.5M|                tmp_p1 = CLIP3((pu1_src[0 * src_strd] +
  ------------------
  |  |   40|  65.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.98k, False: 65.5M]
  |  |  |  Branch (40:53): [True: 3.56k, False: 65.5M]
  |  |  ------------------
  ------------------
  479|  65.5M|                                pu1_src[-1 * src_strd] +
  480|  65.5M|                                pu1_src[-2 * src_strd] +
  481|  65.5M|                                pu1_src[-3 * src_strd] + 2) >> 2,
  482|  65.5M|                                pu1_src[-2 * src_strd] - 2 * tc,
  483|  65.5M|                                pu1_src[-2 * src_strd] + 2 * tc);
  484|       |
  485|  65.5M|                tmp_p2 = CLIP3((pu1_src[0 * src_strd] +
  ------------------
  |  |   40|  65.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.85k, False: 65.5M]
  |  |  |  Branch (40:53): [True: 3.56k, False: 65.5M]
  |  |  ------------------
  ------------------
  486|  65.5M|                                pu1_src[-1 * src_strd] +
  487|  65.5M|                                pu1_src[-2 * src_strd] +
  488|  65.5M|                                3 * pu1_src[-3 * src_strd] +
  489|  65.5M|                                2 * pu1_src[-4 * src_strd] + 4) >> 3,
  490|  65.5M|                                pu1_src[-3 * src_strd] - 2 * tc,
  491|  65.5M|                                pu1_src[-3 * src_strd] + 2 * tc);
  492|  65.5M|            }
  493|  6.39M|            else
  494|  6.39M|            {
  495|  6.39M|                delta = (9 * (pu1_src[0 * src_strd] - pu1_src[-1 * src_strd]) -
  496|  6.39M|                                3 * (pu1_src[1 * src_strd] - pu1_src[-2 * src_strd]) +
  497|  6.39M|                                8) >> 4;
  498|  6.39M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  6.39M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.10M, False: 3.29M]
  |  |  ------------------
  ------------------
  |  Branch (498:20): [True: 6.98M, False: 18.4E]
  ------------------
  499|  6.98M|                {
  500|  6.98M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  6.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 807k, False: 6.18M]
  |  |  |  Branch (40:53): [True: 966k, False: 5.21M]
  |  |  ------------------
  ------------------
  501|       |
  502|  6.98M|                    tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|  6.98M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 24.9k, False: 6.96M]
  |  |  |  |  |  Branch (40:53): [True: 10.1k, False: 6.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  503|  6.98M|                    tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|  6.98M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 48.5k, False: 6.93M]
  |  |  |  |  |  Branch (40:53): [True: 11.3k, False: 6.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  504|       |
  505|  6.98M|                    if(dep == 1)
  ------------------
  |  Branch (505:24): [True: 5.28M, False: 1.70M]
  ------------------
  506|  5.28M|                    {
  507|  5.28M|                        delta_p = CLIP3((((pu1_src[-3 * src_strd] +
  ------------------
  |  |   40|  5.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 51.0k, False: 5.23M]
  |  |  |  Branch (40:53): [True: 188k, False: 5.04M]
  |  |  ------------------
  ------------------
  508|  5.28M|                                        pu1_src[-1 * src_strd] + 1) >> 1) -
  509|  5.28M|                                        pu1_src[-2 * src_strd] + delta) >> 1,
  510|  5.28M|                                        -(tc >> 1),
  511|  5.28M|                                        (tc >> 1));
  512|  5.28M|                        tmp_p1 = CLIP_U8(pu1_src[-2 * src_strd] + delta_p);
  ------------------
  |  |   40|  5.28M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.28M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.48k, False: 5.27M]
  |  |  |  |  |  Branch (40:53): [True: 8.01k, False: 5.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  5.28M|                    }
  514|       |
  515|  6.98M|                    if(deq == 1)
  ------------------
  |  Branch (515:24): [True: 4.88M, False: 2.10M]
  ------------------
  516|  4.88M|                    {
  517|  4.88M|                        delta_q = CLIP3((((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  4.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 64.6k, False: 4.81M]
  |  |  |  Branch (40:53): [True: 149k, False: 4.66M]
  |  |  ------------------
  ------------------
  518|  4.88M|                                        pu1_src[0 * src_strd] + 1) >> 1) -
  519|  4.88M|                                        pu1_src[1 * src_strd] - delta) >> 1,
  520|  4.88M|                                        -(tc >> 1),
  521|  4.88M|                                        (tc >> 1));
  522|  4.88M|                        tmp_q1 = CLIP_U8(pu1_src[1 * src_strd] + delta_q);
  ------------------
  |  |   40|  4.88M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.6k, False: 4.86M]
  |  |  |  |  |  Branch (40:53): [True: 8.71k, False: 4.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  523|  4.88M|                    }
  524|  6.98M|                }
  525|  6.39M|            }
  526|       |
  527|  71.9M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (527:16): [True: 71.8M, False: 78.5k]
  ------------------
  528|  71.8M|            {
  529|  71.8M|                pu1_src[-3 * src_strd] = tmp_p2;
  530|  71.8M|                pu1_src[-2 * src_strd] = tmp_p1;
  531|  71.8M|                pu1_src[-1 * src_strd] = tmp_p0;
  532|  71.8M|            }
  533|       |
  534|  71.9M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (534:16): [True: 71.8M, False: 93.7k]
  ------------------
  535|  71.8M|            {
  536|  71.8M|                pu1_src[0 * src_strd] = tmp_q0;
  537|  71.8M|                pu1_src[1 * src_strd] = tmp_q1;
  538|  71.8M|                pu1_src[2 * src_strd] = tmp_q2;
  539|  71.8M|            }
  540|       |
  541|  71.9M|            pu1_src += 1;
  542|  71.9M|        }
  543|  20.1M|    }
  544|       |
  545|  19.8M|}
ihevc_deblk_chroma_vert:
  603|  7.42M|{
  604|  7.42M|    WORD32 qp_indx_u, qp_chroma_u;
  605|  7.42M|    WORD32 qp_indx_v, qp_chroma_v;
  606|  7.42M|    WORD32 tc_indx_u, tc_u;
  607|  7.42M|    WORD32 tc_indx_v, tc_v;
  608|  7.42M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  609|  7.42M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  610|  7.42M|    WORD32 row;
  611|       |
  612|  7.42M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  7.42M|#define ASSERT(x) {}
  ------------------
  613|       |
  614|       |    /* chroma processing is done only if BS is 2             */
  615|       |    /* this function is assumed to be called only if BS is 2 */
  616|  7.42M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  617|  7.42M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  618|       |
  619|       |    /* 8.7.2.5.5 Filtering process for chroma block edges */
  620|  7.42M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (620:8): [True: 0, False: 7.42M]
  ------------------
  621|      0|    {
  622|      0|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  623|      0|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  624|      0|    }
  625|  7.42M|    else
  626|  7.42M|    {
  627|  7.42M|        qp_chroma_u = qp_indx_u < 0 ? qp_indx_u : (qp_indx_u > 57 ? qp_indx_u - 6 : gai4_ihevc_qp_table[qp_indx_u]);
  ------------------
  |  Branch (627:23): [True: 3.90k, False: 7.41M]
  |  Branch (627:52): [True: 2.19k, False: 7.41M]
  ------------------
  628|  7.42M|        qp_chroma_v = qp_indx_v < 0 ? qp_indx_v : (qp_indx_v > 57 ? qp_indx_v - 6 : gai4_ihevc_qp_table[qp_indx_v]);
  ------------------
  |  Branch (628:23): [True: 7.05k, False: 7.41M]
  |  Branch (628:52): [True: 2.07k, False: 7.41M]
  ------------------
  629|  7.42M|    }
  630|       |
  631|  7.42M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.42M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.19k, False: 7.42M]
  |  |  |  Branch (40:53): [True: 1.07k, False: 7.42M]
  |  |  ------------------
  ------------------
  632|  7.42M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  633|       |
  634|  7.42M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.42M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.06k, False: 7.42M]
  |  |  |  Branch (40:53): [True: 2.57k, False: 7.41M]
  |  |  ------------------
  ------------------
  635|  7.42M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  636|       |
  637|  7.42M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (637:8): [True: 179k, False: 7.24M]
  |  Branch (637:21): [True: 179k, False: 595]
  ------------------
  638|   179k|    {
  639|   179k|        return;
  640|   179k|    }
  641|       |
  642|  36.1M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (642:18): [True: 28.9M, False: 7.24M]
  ------------------
  643|  28.9M|    {
  644|  28.9M|        delta_u = CLIP3((((pu1_src[0] - pu1_src[-2]) << 2) +
  ------------------
  |  |   40|  28.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 467k, False: 28.4M]
  |  |  |  Branch (40:53): [True: 414k, False: 28.0M]
  |  |  ------------------
  ------------------
  645|  28.9M|                        pu1_src[-4] - pu1_src[2] + 4) >> 3,
  646|  28.9M|                        -tc_u, tc_u);
  647|       |
  648|  28.9M|        tmp_p0_u = CLIP_U8(pu1_src[-2] + delta_u);
  ------------------
  |  |   40|  28.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  28.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.1k, False: 28.9M]
  |  |  |  |  |  Branch (40:53): [True: 10.9k, False: 28.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  649|  28.9M|        tmp_q0_u = CLIP_U8(pu1_src[0] - delta_u);
  ------------------
  |  |   40|  28.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  28.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.33k, False: 28.9M]
  |  |  |  |  |  Branch (40:53): [True: 10.1k, False: 28.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  650|       |
  651|  28.9M|        delta_v = CLIP3((((pu1_src[1] - pu1_src[-1]) << 2) +
  ------------------
  |  |   40|  28.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 481k, False: 28.4M]
  |  |  |  Branch (40:53): [True: 407k, False: 28.0M]
  |  |  ------------------
  ------------------
  652|  28.9M|                        pu1_src[-3] - pu1_src[3] + 4) >> 3,
  653|  28.9M|                        -tc_v, tc_v);
  654|       |
  655|  28.9M|        tmp_p0_v = CLIP_U8(pu1_src[-1] + delta_v);
  ------------------
  |  |   40|  28.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  28.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 10.2k, False: 28.9M]
  |  |  |  |  |  Branch (40:53): [True: 9.39k, False: 28.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|  28.9M|        tmp_q0_v = CLIP_U8(pu1_src[1] - delta_v);
  ------------------
  |  |   40|  28.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  28.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.04k, False: 28.9M]
  |  |  |  |  |  Branch (40:53): [True: 10.6k, False: 28.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  657|       |
  658|  28.9M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (658:12): [True: 28.9M, False: 14.3k]
  ------------------
  659|  28.9M|        {
  660|  28.9M|            pu1_src[-2] = tmp_p0_u;
  661|  28.9M|            pu1_src[-1] = tmp_p0_v;
  662|  28.9M|        }
  663|       |
  664|  28.9M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (664:12): [True: 28.9M, False: 16.0k]
  ------------------
  665|  28.9M|        {
  666|  28.9M|            pu1_src[0] = tmp_q0_u;
  667|  28.9M|            pu1_src[1] = tmp_q0_v;
  668|  28.9M|        }
  669|       |
  670|  28.9M|        pu1_src += src_strd;
  671|  28.9M|    }
  672|       |
  673|  7.24M|}
ihevc_deblk_chroma_horz:
  733|  7.33M|{
  734|  7.33M|    WORD32 qp_indx_u, qp_chroma_u;
  735|  7.33M|    WORD32 qp_indx_v, qp_chroma_v;
  736|  7.33M|    WORD32 tc_indx_u, tc_u;
  737|  7.33M|    WORD32 tc_indx_v, tc_v;
  738|  7.33M|    WORD32 tc;
  739|       |
  740|  7.33M|    WORD32 delta, tmp_p0, tmp_q0;
  741|  7.33M|    WORD32 col;
  742|       |
  743|  7.33M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  7.33M|#define ASSERT(x) {}
  ------------------
  744|       |
  745|       |    /* chroma processing is done only if BS is 2             */
  746|       |    /* this function is assumed to be called only if BS is 2 */
  747|  7.33M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  748|  7.33M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  749|       |
  750|       |    /* 8.7.2.5.5. Filtering process for chroma block edges */
  751|  7.33M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (751:8): [True: 0, False: 7.33M]
  ------------------
  752|      0|    {
  753|      0|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  754|      0|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  755|      0|    }
  756|  7.33M|    else
  757|  7.33M|    {
  758|  7.33M|        qp_chroma_u = qp_indx_u < 0 ? qp_indx_u : (qp_indx_u > 57 ? qp_indx_u - 6 : gai4_ihevc_qp_table[qp_indx_u]);
  ------------------
  |  Branch (758:23): [True: 4.80k, False: 7.32M]
  |  Branch (758:52): [True: 2.20k, False: 7.32M]
  ------------------
  759|  7.33M|        qp_chroma_v = qp_indx_v < 0 ? qp_indx_v : (qp_indx_v > 57 ? qp_indx_v - 6 : gai4_ihevc_qp_table[qp_indx_v]);
  ------------------
  |  Branch (759:23): [True: 8.77k, False: 7.32M]
  |  Branch (759:52): [True: 1.98k, False: 7.32M]
  ------------------
  760|  7.33M|    }
  761|       |
  762|  7.33M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.33M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.20k, False: 7.32M]
  |  |  |  Branch (40:53): [True: 1.31k, False: 7.32M]
  |  |  ------------------
  ------------------
  763|  7.33M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  764|       |
  765|  7.33M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  7.33M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.98k, False: 7.32M]
  |  |  |  Branch (40:53): [True: 2.70k, False: 7.32M]
  |  |  ------------------
  ------------------
  766|  7.33M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  767|       |
  768|  7.33M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (768:8): [True: 205k, False: 7.12M]
  |  Branch (768:21): [True: 204k, False: 1.04k]
  ------------------
  769|   204k|    {
  770|   204k|        return;
  771|   204k|    }
  772|       |
  773|  63.7M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (773:18): [True: 56.6M, False: 7.12M]
  ------------------
  774|  56.6M|    {
  775|  56.6M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (775:14): [True: 28.3M, False: 28.3M]
  ------------------
  776|  56.6M|        delta = CLIP3((((pu1_src[0 * src_strd] -
  ------------------
  |  |   40|  56.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.32M, False: 55.2M]
  |  |  |  Branch (40:53): [True: 959k, False: 54.3M]
  |  |  ------------------
  ------------------
  777|  56.6M|                      pu1_src[-1 * src_strd]) << 2) +
  778|  56.6M|                      pu1_src[-2 * src_strd] -
  779|  56.6M|                      pu1_src[1 * src_strd] + 4) >> 3,
  780|  56.6M|                      -tc, tc);
  781|       |
  782|  56.6M|        tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|  56.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  56.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 24.3k, False: 56.6M]
  |  |  |  |  |  Branch (40:53): [True: 16.2k, False: 56.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  783|  56.6M|        tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|  56.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  56.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 20.1k, False: 56.6M]
  |  |  |  |  |  Branch (40:53): [True: 23.6k, False: 56.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  784|       |
  785|  56.6M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (785:12): [True: 56.5M, False: 34.1k]
  ------------------
  786|  56.5M|        {
  787|  56.5M|            pu1_src[-1 * src_strd] = tmp_p0;
  788|  56.5M|        }
  789|       |
  790|  56.6M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (790:12): [True: 56.5M, False: 40.8k]
  ------------------
  791|  56.5M|        {
  792|  56.5M|            pu1_src[0 * src_strd] = tmp_q0;
  793|  56.5M|        }
  794|       |
  795|  56.6M|        pu1_src += 1;
  796|  56.6M|    }
  797|       |
  798|  7.12M|}

ihevc_disp_mgr_init:
   66|  27.6k|{
   67|  27.6k|    WORD32 id;
   68|       |
   69|  27.6k|    ps_disp_mgr->u4_last_abs_poc = DEFAULT_POC;
  ------------------
  |  |   39|  27.6k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
   70|       |
   71|  1.79M|    for(id = 0; id < DISP_MGR_MAX_CNT; id++)
  ------------------
  |  |   38|  1.79M|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (71:17): [True: 1.77M, False: 27.6k]
  ------------------
   72|  1.77M|    {
   73|  1.77M|        ps_disp_mgr->ai4_abs_poc[id] = DEFAULT_POC;
  ------------------
  |  |   39|  1.77M|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
   74|       |        ps_disp_mgr->apv_ptr[id] = NULL;
   75|  1.77M|    }
   76|  27.6k|}
ihevc_disp_mgr_add:
  111|  69.8k|{
  112|  69.8k|    if(buf_id >= DISP_MGR_MAX_CNT)
  ------------------
  |  |   38|  69.8k|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (112:8): [True: 0, False: 69.8k]
  ------------------
  113|      0|    {
  114|      0|        return (-1);
  115|      0|    }
  116|       |
  117|  69.8k|    if(ps_disp_mgr->apv_ptr[buf_id] != NULL)
  ------------------
  |  Branch (117:8): [True: 0, False: 69.8k]
  ------------------
  118|      0|    {
  119|      0|        return (-1);
  120|      0|    }
  121|       |
  122|  69.8k|    ps_disp_mgr->apv_ptr[buf_id] = pv_ptr;
  123|  69.8k|    ps_disp_mgr->ai4_abs_poc[buf_id] = abs_poc;
  124|  69.8k|    return 0;
  125|  69.8k|}
ihevc_disp_mgr_get:
  153|  68.2k|{
  154|  68.2k|    WORD32 id;
  155|  68.2k|    void *pv_ret_ptr;
  156|  68.2k|    WORD32 i4_min_poc;
  157|  68.2k|    WORD32 min_poc_id;
  158|       |
  159|       |
  160|  68.2k|    pv_ret_ptr = NULL;
  161|  68.2k|    i4_min_poc = 0x7FFFFFFF;
  162|  68.2k|    min_poc_id = -1;
  163|       |
  164|       |    /* Find minimum POC */
  165|  4.43M|    for(id = 0; id < DISP_MGR_MAX_CNT; id++)
  ------------------
  |  |   38|  4.43M|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (165:17): [True: 4.36M, False: 68.2k]
  ------------------
  166|  4.36M|    {
  167|  4.36M|        if((DEFAULT_POC != ps_disp_mgr->ai4_abs_poc[id]) &&
  ------------------
  |  |   39|  4.36M|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
  |  Branch (167:12): [True: 84.5k, False: 4.28M]
  ------------------
  168|  84.5k|                        (ps_disp_mgr->ai4_abs_poc[id] <= i4_min_poc))
  ------------------
  |  Branch (168:25): [True: 72.4k, False: 12.1k]
  ------------------
  169|  72.4k|        {
  170|  72.4k|            i4_min_poc = ps_disp_mgr->ai4_abs_poc[id];
  171|  72.4k|            min_poc_id = id;
  172|  72.4k|        }
  173|  4.36M|    }
  174|  68.2k|    *pi4_buf_id = min_poc_id;
  175|       |    /* If all pocs are still default_poc then return NULL */
  176|  68.2k|    if(-1 == min_poc_id)
  ------------------
  |  Branch (176:8): [True: 535, False: 67.7k]
  ------------------
  177|    535|    {
  178|    535|        return NULL;
  179|    535|    }
  180|       |
  181|  67.7k|    pv_ret_ptr = ps_disp_mgr->apv_ptr[min_poc_id];
  182|       |
  183|       |    /* Set abs poc to default and apv_ptr to null so that the buffer is not returned again */
  184|  67.7k|    ps_disp_mgr->apv_ptr[min_poc_id] = NULL;
  185|  67.7k|    ps_disp_mgr->ai4_abs_poc[min_poc_id] = DEFAULT_POC;
  ------------------
  |  |   39|  67.7k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
  186|  67.7k|    return pv_ret_ptr;
  187|  68.2k|}

ihevc_dpb_mgr_init:
   75|  27.6k|{
   76|  27.6k|    UWORD32 i;
   77|  27.6k|    dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
   78|  1.79M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  1.79M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  1.79M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (78:16): [True: 1.77M, False: 27.6k]
  ------------------
   79|  1.77M|    {
   80|  1.77M|        ps_dpb_info[i].ps_prev_dpb = NULL;
   81|  1.77M|        ps_dpb_info[i].ps_pic_buf = NULL;
   82|       |
   83|  1.77M|    }
   84|       |
   85|  27.6k|    ps_dpb_mgr->u1_num_ref_bufs = 0;
   86|  27.6k|    ps_dpb_mgr->ps_dpb_head = NULL;
   87|       |
   88|  27.6k|}
ihevc_dpb_mgr_insert_ref:
  121|  69.8k|{
  122|  69.8k|    int i;
  123|  69.8k|    dpb_info_t *ps_dpb_info;
  124|       |
  125|  69.8k|    ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  126|       |
  127|       |    /* Return error if buffer is already present in the DPB */
  128|  4.54M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  4.54M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  4.54M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (128:16): [True: 4.47M, False: 69.8k]
  ------------------
  129|  4.47M|    {
  130|  4.47M|        if((ps_dpb_info[i].ps_pic_buf == ps_pic_buf)
  ------------------
  |  Branch (130:12): [True: 0, False: 4.47M]
  ------------------
  131|      0|                        && (ps_dpb_info[i].ps_pic_buf->u1_used_as_ref))
  ------------------
  |  Branch (131:28): [True: 0, False: 0]
  ------------------
  132|      0|        {
  133|      0|            return (-1);
  134|      0|        }
  135|       |
  136|       |
  137|  4.47M|    }
  138|       |
  139|       |    /* Find an unused DPB location */
  140|  84.5k|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  84.5k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  84.5k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (140:16): [True: 84.5k, False: 0]
  ------------------
  141|  84.5k|    {
  142|  84.5k|        if(NULL == ps_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (142:12): [True: 69.8k, False: 14.6k]
  ------------------
  143|  69.8k|        {
  144|  69.8k|            break;
  145|  69.8k|        }
  146|  84.5k|    }
  147|  69.8k|    if(i == MAX_DPB_BUFS)
  ------------------
  |  |   41|  69.8k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  69.8k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (147:8): [True: 0, False: 69.8k]
  ------------------
  148|      0|    {
  149|      0|        return (-1);
  150|      0|    }
  151|       |
  152|       |    /* Create DPB info */
  153|  69.8k|    ps_dpb_info[i].ps_pic_buf = ps_pic_buf;
  154|  69.8k|    ps_dpb_info[i].ps_prev_dpb = ps_dpb_mgr->ps_dpb_head;
  155|  69.8k|    ps_dpb_info[i].ps_pic_buf->u1_buf_id = buf_id;
  156|  69.8k|    ps_dpb_info[i].ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  157|       |
  158|       |    /* update the head node of linked list to point to the current picture */
  159|  69.8k|    ps_dpb_mgr->ps_dpb_head = ps_dpb_info + i;
  160|       |
  161|       |    /* Increment Short term buffer count */
  162|  69.8k|    ps_dpb_mgr->u1_num_ref_bufs++;
  163|       |
  164|  69.8k|    return 0;
  165|  69.8k|}
ihevc_dpb_mgr_del_ref:
  198|  46.6k|{
  199|  46.6k|    int i;
  200|  46.6k|    dpb_info_t *ps_next_dpb;
  201|       |
  202|  46.6k|    dpb_info_t *ps_unmark_node;
  203|  46.6k|    UWORD8 u1_del_node;
  204|  46.6k|    UNUSED(u1_del_node);
  ------------------
  |  |   38|  46.6k|#define UNUSED(x) ((void)(x))
  ------------------
  205|  46.6k|    u1_del_node = 0;
  206|       |
  207|       |    /* Find the node with matching absolute POC */
  208|  46.6k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_head;
  209|  46.6k|    if(ps_next_dpb->ps_pic_buf->i4_abs_poc == i4_abs_poc)
  ------------------
  |  Branch (209:8): [True: 43.6k, False: 3.04k]
  ------------------
  210|  43.6k|    {
  211|  43.6k|        ps_unmark_node = ps_next_dpb;
  212|  43.6k|    }
  213|  3.04k|    else
  214|  3.04k|    {
  215|  3.58k|        for(i = 1; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (215:20): [True: 3.58k, False: 0]
  ------------------
  216|  3.58k|        {
  217|  3.58k|            if(ps_next_dpb->ps_prev_dpb->ps_pic_buf->i4_abs_poc == i4_abs_poc)
  ------------------
  |  Branch (217:16): [True: 3.04k, False: 542]
  ------------------
  218|  3.04k|                break;
  219|    542|            ps_next_dpb = ps_next_dpb->ps_prev_dpb;
  220|    542|        }
  221|       |
  222|  3.04k|        if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (222:12): [True: 0, False: 3.04k]
  ------------------
  223|      0|        {
  224|      0|            return;
  225|      0|        }
  226|  3.04k|        else
  227|  3.04k|            ps_unmark_node = ps_next_dpb->ps_prev_dpb;
  228|  3.04k|    }
  229|       |
  230|  46.6k|    if(ps_unmark_node == ps_dpb_mgr->ps_dpb_head)
  ------------------
  |  Branch (230:8): [True: 43.6k, False: 3.04k]
  ------------------
  231|  43.6k|    {
  232|  43.6k|        ps_dpb_mgr->ps_dpb_head = ps_unmark_node->ps_prev_dpb;
  233|  43.6k|    }
  234|  3.04k|    else
  235|  3.04k|    {
  236|  3.04k|        ps_next_dpb->ps_prev_dpb = ps_unmark_node->ps_prev_dpb; //update link
  237|  3.04k|        ps_unmark_node->ps_prev_dpb = NULL;
  238|  3.04k|    }
  239|  46.6k|    ps_dpb_mgr->u1_num_ref_bufs--; //decrement buffer count
  240|       |
  241|       |    /* Release the physical buffer */
  242|  46.6k|    ihevc_buf_mgr_release((buf_mgr_t *)ps_buf_mgr, ps_unmark_node->ps_pic_buf->u1_buf_id,
  243|  46.6k|                          BUF_MGR_REF);
  ------------------
  |  |   40|  46.6k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  244|  46.6k|    ps_unmark_node->ps_prev_dpb = NULL;
  245|       |    ps_unmark_node->ps_pic_buf = NULL;
  246|  46.6k|}
ihevc_dpb_mgr_get_ref_by_nearest_poc:
  275|   131k|{
  276|   131k|    WORD32 i;
  277|   131k|    WORD32 min_diff = 0x7FFFFFFF;
  278|   131k|    pic_buf_t *ps_pic_buf = NULL;
  279|       |
  280|  8.56M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  8.56M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  8.56M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (280:16): [True: 8.43M, False: 131k]
  ------------------
  281|  8.43M|    {
  282|  8.43M|        if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) &&
  ------------------
  |  Branch (282:12): [True: 132k, False: 8.29M]
  ------------------
  283|   132k|                        (ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref != UNUSED_FOR_REF))
  ------------------
  |  Branch (283:25): [True: 107k, False: 24.7k]
  ------------------
  284|   107k|        {
  285|   107k|            WORD32 poc_diff = cur_abs_poc - ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->i4_abs_poc;
  286|   107k|            if((poc_diff > 0) && (poc_diff < min_diff))
  ------------------
  |  Branch (286:16): [True: 64.5k, False: 43.3k]
  |  Branch (286:34): [True: 45.5k, False: 18.9k]
  ------------------
  287|  45.5k|            {
  288|  45.5k|                min_diff = poc_diff;
  289|  45.5k|                ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  290|  45.5k|            }
  291|   107k|        }
  292|  8.43M|    }
  293|       |
  294|   131k|    if(NULL == ps_pic_buf)
  ------------------
  |  Branch (294:8): [True: 95.0k, False: 36.6k]
  ------------------
  295|  95.0k|    {
  296|  95.0k|        min_diff = 0x7FFFFFFF;
  297|  6.17M|        for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  6.17M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  6.17M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (297:20): [True: 6.08M, False: 95.0k]
  ------------------
  298|  6.08M|        {
  299|  6.08M|            if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) &&
  ------------------
  |  Branch (299:16): [True: 45.4k, False: 6.03M]
  ------------------
  300|  45.4k|                            (ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref != UNUSED_FOR_REF))
  ------------------
  |  Branch (300:29): [True: 32.2k, False: 13.1k]
  ------------------
  301|  32.2k|            {
  302|  32.2k|                WORD32 poc_diff = cur_abs_poc - ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->i4_abs_poc;
  303|  32.2k|                if(ABS(poc_diff) < min_diff)
  ------------------
  |  |   45|  32.2k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 32.2k]
  |  |  ------------------
  ------------------
  |  Branch (303:20): [True: 27.8k, False: 4.35k]
  ------------------
  304|  27.8k|                {
  305|  27.8k|                    min_diff = ABS(poc_diff);
  ------------------
  |  |   45|  27.8k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 27.8k]
  |  |  ------------------
  ------------------
  306|  27.8k|                    ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  307|  27.8k|                }
  308|  32.2k|            }
  309|  6.08M|        }
  310|  95.0k|    }
  311|       |
  312|   131k|    return ps_pic_buf;
  313|   131k|}
ihevc_dpb_mgr_get_ref_by_poc:
  342|  99.8k|{
  343|  99.8k|    UWORD32 i;
  344|  99.8k|    dpb_info_t *ps_next_ref;
  345|  99.8k|    pic_buf_t *ps_pic_buf = NULL;
  346|       |
  347|       |
  348|  99.8k|    ps_next_ref = ps_dpb_mgr->ps_dpb_head;
  349|   281k|    for(i = 0; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (349:16): [True: 215k, False: 65.9k]
  ------------------
  350|   215k|    {
  351|   215k|        if(ps_next_ref->ps_pic_buf->i4_abs_poc == abs_poc)
  ------------------
  |  Branch (351:12): [True: 33.9k, False: 181k]
  ------------------
  352|  33.9k|        {
  353|  33.9k|            ps_pic_buf = ps_next_ref->ps_pic_buf;
  354|  33.9k|            break;
  355|  33.9k|        }
  356|       |
  357|   181k|        ps_next_ref = ps_next_ref->ps_prev_dpb;
  358|   181k|    }
  359|       |
  360|  99.8k|    if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (360:8): [True: 65.9k, False: 33.9k]
  ------------------
  361|  65.9k|    {
  362|  65.9k|        ps_pic_buf = NULL;
  363|  65.9k|    }
  364|       |
  365|  99.8k|    return ps_pic_buf;
  366|  99.8k|}
ihevc_dpb_mgr_get_ref_by_poc_lsb:
  395|  11.0k|{
  396|  11.0k|    pic_buf_t *ps_pic_buf = NULL;
  397|  11.0k|    UWORD32 i;
  398|  11.0k|    dpb_info_t *ps_next_ref;
  399|       |
  400|  11.0k|    ps_next_ref = ps_dpb_mgr->ps_dpb_head;
  401|  20.7k|    for(i = 0; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (401:16): [True: 12.8k, False: 7.91k]
  ------------------
  402|  12.8k|    {
  403|  12.8k|        if(ps_next_ref->ps_pic_buf->i4_poc_lsb == poc_lsb)
  ------------------
  |  Branch (403:12): [True: 3.09k, False: 9.75k]
  ------------------
  404|  3.09k|        {
  405|  3.09k|            ps_pic_buf = ps_next_ref->ps_pic_buf;
  406|  3.09k|            break;
  407|  3.09k|        }
  408|       |
  409|  9.75k|        ps_next_ref = ps_next_ref->ps_prev_dpb;
  410|  9.75k|    }
  411|       |
  412|  11.0k|    if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (412:8): [True: 7.91k, False: 3.09k]
  ------------------
  413|  7.91k|    {
  414|  7.91k|        ps_pic_buf = NULL;
  415|  7.91k|    }
  416|       |
  417|  11.0k|    return ps_pic_buf;
  418|  11.0k|}

ihevc_hbd_intra_pred_chroma_ref_substitution:
  231|  2.47M|{
  232|  2.47M|    UWORD16 pu2_ref_u, pu2_ref_v;
  233|  2.47M|    WORD32 dc_val, i, j;
  234|  2.47M|    WORD32 total_samples = (4 * nt) + 1;
  235|  2.47M|    WORD32 get_bits;
  236|  2.47M|    WORD32 next;
  237|  2.47M|    WORD32 bot_left, left, top, tp_right, tp_left;
  238|  2.47M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  239|  2.47M|    WORD32 a_nbr_flag[5];
  240|       |    /* Neighbor Flag Structure */
  241|       |    /* WORD32 nbr_flags MSB-->LSB   TOP LEFT | TOP-RIGHT |  TOP   | LEFT    | BOTTOM LEFT */
  242|       |    /*                              (1 bit)     (4 bits)  (4 bits) (4 bits)  (4 bits)  */
  243|       |    /* If no neighbor flags are present, fill the neighbor samples with DC value */
  244|  2.47M|    dc_val = 1 << (bit_depth - 1);
  245|  2.47M|    if(nbr_flags == 0)
  ------------------
  |  Branch (245:8): [True: 23.9k, False: 2.44M]
  ------------------
  246|  23.9k|    {
  247|  2.22M|        for(i = 0; i < (2 * total_samples); i++)
  ------------------
  |  Branch (247:20): [True: 2.20M, False: 23.9k]
  ------------------
  248|  2.20M|        {
  249|  2.20M|            pu2_dst[i] = dc_val;
  250|  2.20M|        }
  251|  23.9k|    }
  252|  2.44M|    else
  253|  2.44M|    {
  254|       |        /* Else fill the corresponding samples */
  255|       |
  256|       |        /* Check for the neighbors availibility */
  257|  2.44M|        tp_left     = (nbr_flags & 0x10000);
  258|  2.44M|        tp_right    = (nbr_flags & 0x0f000);
  259|  2.44M|        top         = (nbr_flags & 0x00f00);
  260|  2.44M|        left        = (nbr_flags & 0x000f0);
  261|  2.44M|        bot_left    = (nbr_flags & 0x0000f);
  262|       |
  263|       |        /* Fill nbrs depending on avalibility */
  264|       |        /* Top -Left nbrs  */
  265|  2.44M|        if(0 != tp_left)
  ------------------
  |  Branch (265:12): [True: 2.07M, False: 373k]
  ------------------
  266|  2.07M|        {
  267|  2.07M|            pu2_dst[(4 * nt )] = *pu2_top_left ; // U top-left sample
  268|  2.07M|            pu2_dst[(4 * nt ) + 1] = *(pu2_top_left + 1 ) ; // V top-left sample
  269|  2.07M|        }
  270|       |        /* Left nbrs  */
  271|  2.44M|        if(0 != left)
  ------------------
  |  Branch (271:12): [True: 2.24M, False: 198k]
  ------------------
  272|  2.24M|        {
  273|  20.3M|            for(i = 0, j=0; i < (2 * nt ); i+=2)
  ------------------
  |  Branch (273:29): [True: 18.1M, False: 2.24M]
  ------------------
  274|  18.1M|            {
  275|  18.1M|                pu2_dst[(4 * nt ) - 2 - i] = pu2_left[j * src_strd]; // U left samples
  276|  18.1M|                pu2_dst[(4 * nt ) - 1 - i] = pu2_left[(j * src_strd) + 1]; // V left samples
  277|  18.1M|                j++;
  278|  18.1M|            }
  279|  2.24M|        }
  280|       |        /* Bottom - Left nbrs  */
  281|  2.44M|        if(0 != bot_left)
  ------------------
  |  Branch (281:12): [True: 1.29M, False: 1.14M]
  ------------------
  282|  1.29M|        {
  283|  11.7M|            for(i = (2 * nt), j=nt; i < (4 * nt ); i+=2)
  ------------------
  |  Branch (283:37): [True: 10.4M, False: 1.29M]
  ------------------
  284|  10.4M|            {
  285|  10.4M|                 pu2_dst[(4 * nt ) - 2 - i] = pu2_left[j * src_strd]; // U left samples
  286|  10.4M|                 pu2_dst[(4 * nt ) - 1 - i] = pu2_left[(j * src_strd) + 1]; // V left samples
  287|  10.4M|                 j++;
  288|  10.4M|            }
  289|  1.29M|        }
  290|       |        /* Top nbrs  */
  291|  2.44M|        if(0 != top)
  ------------------
  |  Branch (291:12): [True: 2.27M, False: 174k]
  ------------------
  292|  2.27M|        {
  293|  37.7M|            for(i = 0; i < (2 * nt ); i++)
  ------------------
  |  Branch (293:24): [True: 35.4M, False: 2.27M]
  ------------------
  294|  35.4M|            {
  295|  35.4M|                pu2_dst[(4 * nt ) + 2 + i] = pu2_top[i]; // U-V interleaved Top-top right samples
  296|  35.4M|            }
  297|  2.27M|        }
  298|       |        /* Top - Right nbrs  */
  299|  2.44M|        if(0 != tp_right)
  ------------------
  |  Branch (299:12): [True: 783k, False: 1.66M]
  ------------------
  300|   783k|        {
  301|  12.6M|            for(i = (2 * nt); i < (4 * nt ); i++)
  ------------------
  |  Branch (301:31): [True: 11.8M, False: 783k]
  ------------------
  302|  11.8M|            {
  303|  11.8M|                pu2_dst[(4 * nt ) + 2 + i] = pu2_top[i]; // U-V interleaved Top-top right samples
  304|  11.8M|            }
  305|   783k|        }
  306|  2.44M|        if(nt == 4 || (nt == 8 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (306:12): [True: 1.24M, False: 1.19M]
  |  Branch (306:24): [True: 550k, False: 648k]
  |  Branch (306:35): [True: 0, False: 550k]
  ------------------
  307|  1.25M|        {
  308|       |            /* 1 bit extraction for all the neighboring blocks */
  309|  1.25M|            tp_left = (nbr_flags & 0x10000) >> 16;
  310|  1.25M|            bot_left = (nbr_flags & 0x8)>>3;
  311|  1.25M|            left = (nbr_flags & 0x80) >> 7;
  312|  1.25M|            top = (nbr_flags & 0x100) >> 8;
  313|  1.25M|            tp_right = (nbr_flags & 0x1000) >> 12;
  314|       |
  315|  1.25M|            next = 1;
  316|  1.25M|            a_nbr_flag[0] = bot_left;
  317|  1.25M|            a_nbr_flag[1] = left;
  318|  1.25M|            a_nbr_flag[2] = tp_left;
  319|  1.25M|            a_nbr_flag[3] = top;
  320|  1.25M|            a_nbr_flag[4] = tp_right;
  321|       |
  322|       |            /* If bottom -left is not available, reverse substitution process */
  323|  1.25M|            if(bot_left == 0)
  ------------------
  |  Branch (323:16): [True: 533k, False: 721k]
  ------------------
  324|   533k|            {
  325|       |                /* Check for the 1st available sample from bottom-left */
  326|   700k|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (326:23): [True: 166k, False: 533k]
  ------------------
  327|   166k|                    next++;
  328|       |
  329|       |                /* If Left, top-left are available */
  330|   533k|                if(next <= 2)
  ------------------
  |  Branch (330:20): [True: 450k, False: 82.9k]
  ------------------
  331|   450k|                {
  332|   450k|                    idx = (nt * next);
  333|   450k|                    pu2_ref_u = pu2_dst[2 * idx];
  334|   450k|                    pu2_ref_v = pu2_dst[(2 * idx) + 1];
  335|  2.25M|                    for(i = 0; i < (2 * idx); i+=2)
  ------------------
  |  Branch (335:32): [True: 1.80M, False: 450k]
  ------------------
  336|  1.80M|                    {
  337|  1.80M|                        pu2_dst[i] = pu2_ref_u;
  338|  1.80M|                        pu2_dst[i + 1 ] = pu2_ref_v;
  339|  1.80M|                    }
  340|   450k|                }
  341|  82.9k|                else /* If top, top-right are available */
  342|  82.9k|                {
  343|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available */
  344|  82.9k|                    idx = (nt * (next - 1)) + 1;
  345|  82.9k|                    pu2_ref_u = pu2_dst[2 * idx];
  346|  82.9k|                    pu2_ref_v = pu2_dst[(2 * idx) + 1];
  347|   832k|                    for(i = 0; i < (2 * idx); i+=2)
  ------------------
  |  Branch (347:32): [True: 749k, False: 82.9k]
  ------------------
  348|   749k|                    {
  349|   749k|                        pu2_dst[i] = pu2_ref_u;
  350|   749k|                        pu2_dst[i + 1] = pu2_ref_v;
  351|   749k|                    }
  352|  82.9k|                }
  353|   533k|            }
  354|       |
  355|  1.25M|            if(left == 0)
  ------------------
  |  Branch (355:16): [True: 83.3k, False: 1.17M]
  ------------------
  356|  83.3k|            {
  357|   416k|                for(i = 0; i < (2 * nt); i+=2)
  ------------------
  |  Branch (357:28): [True: 333k, False: 83.3k]
  ------------------
  358|   333k|                {
  359|   333k|                    pu2_dst[(2 * nt) + i] = pu2_dst[(2 * nt) - 2];
  360|   333k|                    pu2_dst[(2 * nt) + 1 + i] = pu2_dst[(2 * nt) - 1];
  361|   333k|                }
  362|  83.3k|            }
  363|  1.25M|            if(tp_left == 0)
  ------------------
  |  Branch (363:16): [True: 129k, False: 1.12M]
  ------------------
  364|   129k|            {
  365|   129k|                pu2_dst[4 * nt] = pu2_dst[(4 * nt) - 2];
  366|   129k|                pu2_dst[(4 * nt) + 1] = pu2_dst[(4 * nt) - 1];
  367|   129k|            }
  368|  1.25M|            if(top == 0)
  ------------------
  |  Branch (368:16): [True: 45.5k, False: 1.20M]
  ------------------
  369|  45.5k|            {
  370|   227k|                for(i = 0; i < (2 * nt); i+=2)
  ------------------
  |  Branch (370:28): [True: 182k, False: 45.5k]
  ------------------
  371|   182k|                {
  372|   182k|                    pu2_dst[(4 * nt) + 2 + i] = pu2_dst[(4 * nt)];
  373|   182k|                    pu2_dst[(4 * nt) + 3 + i] = pu2_dst[(4 * nt) + 1];
  374|   182k|                }
  375|  45.5k|            }
  376|  1.25M|            if(tp_right == 0)
  ------------------
  |  Branch (376:16): [True: 865k, False: 389k]
  ------------------
  377|   865k|            {
  378|  4.32M|                for(i = 0; i < (2 * nt); i+=2)
  ------------------
  |  Branch (378:28): [True: 3.46M, False: 865k]
  ------------------
  379|  3.46M|                {
  380|  3.46M|                    pu2_dst[(6 * nt) + 2 + i] = pu2_dst[(6 * nt)];
  381|  3.46M|                    pu2_dst[(6 * nt) + 3 + i] = pu2_dst[(6 * nt) + 1];
  382|  3.46M|                }
  383|   865k|            }
  384|  1.25M|        }
  385|  1.19M|        else if(nt == 8 || (nt == 16 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (385:17): [True: 541k, False: 650k]
  |  Branch (385:29): [True: 650k, False: 18.4E]
  |  Branch (385:41): [True: 0, False: 650k]
  ------------------
  386|   550k|        {
  387|   550k|            WORD32 nbr_flags_temp = 0;
  388|   550k|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (388:33): [True: 0, False: 550k]
  ------------------
  389|   550k|            nbr_flags_temp = ((nbr_flags & 0xC)>>2) + ((nbr_flags & 0xC0) >> 4)
  390|   550k|                            + ((nbr_flags & 0x300) >> 4)
  391|   550k|                            + ((nbr_flags & 0x3000) >> 6)
  392|   550k|                            + ((nbr_flags & 0x10000) >> 8);
  393|       |
  394|       |            /* compute trailing zeors based on nbr_flag for substitution process of below left see section . */
  395|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  396|   550k|            {
  397|   550k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * (4 * sub_sample); /* for bottom left and left */
  ------------------
  |  |   43|   550k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 72.9k, False: 477k]
  |  |  ------------------
  ------------------
  398|   550k|                if(nbr_id_from_bl == (32 * sub_sample))
  ------------------
  |  Branch (398:20): [True: 72.9k, False: 477k]
  ------------------
  399|  72.9k|                {
  400|  72.9k|                    nbr_id_from_bl = (16 * sub_sample);
  401|  72.9k|                }
  402|   550k|                if(nbr_id_from_bl == (16 * sub_sample))
  ------------------
  |  Branch (402:20): [True: 72.9k, False: 477k]
  ------------------
  403|  72.9k|                {
  404|       |                    /* for top left : 1 pel per nbr bit */
  405|  72.9k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (405:24): [True: 72.7k, False: 215]
  ------------------
  406|  72.7k|                    {
  407|  72.7k|                        nbr_id_from_bl++;
  408|  72.7k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * (4 * sub_sample); /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  72.7k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 72.7k]
  |  |  ------------------
  ------------------
  409|       |
  410|  72.7k|                    }
  411|  72.9k|                }
  412|       |                /* Reverse Substitution Process */
  413|   550k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (413:20): [True: 342k, False: 207k]
  ------------------
  414|   342k|                {
  415|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  416|   342k|                    pu2_ref_u = pu2_dst[2 * nbr_id_from_bl];
  417|   342k|                    pu2_ref_v = pu2_dst[(2 * nbr_id_from_bl) + 1];
  418|  3.73M|                    for(i = 2 * (nbr_id_from_bl - 1); i >= 0; i-=2)
  ------------------
  |  Branch (418:55): [True: 3.39M, False: 342k]
  ------------------
  419|  3.39M|                    {
  420|  3.39M|                        pu2_dst[i] = pu2_ref_u;
  421|  3.39M|                        pu2_dst[i + 1] = pu2_ref_v;
  422|  3.39M|                    }
  423|   342k|                }
  424|   550k|            }
  425|       |
  426|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  427|  4.60M|            while(nbr_id_from_bl < ((T8C_4NT * sub_sample) + 1))
  ------------------
  |  |   81|  4.60M|#define T8C_4NT 32
  ------------------
  |  Branch (427:19): [True: 4.04M, False: 550k]
  ------------------
  428|  4.04M|            {
  429|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  430|       |                /* Divide by 8 to obtain the original index */
  431|  4.04M|                frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2));
  ------------------
  |  Branch (431:53): [True: 0, False: 4.04M]
  ------------------
  432|       |
  433|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  434|  4.04M|                if(nbr_id_from_bl == (T8C_4NT * sub_sample / 2))
  ------------------
  |  |   81|  4.04M|#define T8C_4NT 32
  ------------------
  |  Branch (434:20): [True: 477k, False: 3.57M]
  ------------------
  435|   477k|                {
  436|   477k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   477k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  437|       |
  438|       |                    /* only pel substitution for TL */
  439|   477k|                    if(!get_bits)
  ------------------
  |  Branch (439:24): [True: 37.2k, False: 440k]
  ------------------
  440|  37.2k|                    {
  441|  37.2k|                        pu2_dst[2 * nbr_id_from_bl] = pu2_dst[(2 * nbr_id_from_bl) - 2];
  442|  37.2k|                        pu2_dst[(2 * nbr_id_from_bl) + 1] = pu2_dst[(2 * nbr_id_from_bl) - 1];
  443|  37.2k|                    }
  444|   477k|                }
  445|  3.57M|                else
  446|  3.57M|                {
  447|  3.57M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  3.57M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  448|  3.57M|                    if(!get_bits)
  ------------------
  |  Branch (448:24): [True: 699k, False: 2.87M]
  ------------------
  449|   699k|                    {
  450|       |                        /* 8 pel substitution (other than TL) */
  451|   699k|                        pu2_ref_u = pu2_dst[(2 * nbr_id_from_bl) - 2];
  452|   699k|                        pu2_ref_v = pu2_dst[(2 * nbr_id_from_bl) - 1];
  453|  3.49M|                        for(i = 0; i < 8 * sub_sample; i += 2)
  ------------------
  |  Branch (453:36): [True: 2.79M, False: 699k]
  ------------------
  454|  2.79M|                        {
  455|  2.79M|                            pu2_dst[(2 * nbr_id_from_bl) + i] = pu2_ref_u;
  456|  2.79M|                            pu2_dst[(2 * nbr_id_from_bl) + 1 + i] = pu2_ref_v;
  457|  2.79M|                        }
  458|   699k|                    }
  459|  3.57M|                }
  460|  4.04M|                nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   81|  4.04M|#define T8C_4NT 32
  ------------------
  |  Branch (460:35): [True: 477k, False: 3.57M]
  ------------------
  461|  4.04M|            }
  462|   550k|        }
  463|   641k|        else if(nt == 16 || (nt == 32 && chroma_format_idc == CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (463:17): [True: 641k, False: 0]
  |  Branch (463:30): [True: 0, False: 0]
  |  Branch (463:42): [True: 0, False: 0]
  ------------------
  464|   650k|        {
  465|   650k|            WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1;
  ------------------
  |  Branch (465:33): [True: 0, False: 650k]
  ------------------
  466|       |            /* compute trailing ones based on mbr_flag for substitution process of below left see section . */
  467|       |            /* as each bit in nbr flags corresponds to 4 pels for bot_left, left, top and topright but 1 pel for topleft */
  468|   650k|            {
  469|   650k|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4 * sub_sample; /* for bottom left and left */
  ------------------
  |  |   43|   650k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 42.5k, False: 607k]
  |  |  ------------------
  ------------------
  470|       |
  471|   650k|                if(nbr_id_from_bl == 32 * sub_sample)
  ------------------
  |  Branch (471:20): [True: 42.5k, False: 607k]
  ------------------
  472|  42.5k|                {
  473|       |                    /* for top left : 1 pel per nbr bit */
  474|  42.5k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (474:24): [True: 42.5k, False: 10]
  ------------------
  475|  42.5k|                    {
  476|       |                        /* top left not available */
  477|  42.5k|                        nbr_id_from_bl++;
  478|       |                        /* top and top right;  4 pels per nbr bit */
  479|  42.5k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4 * sub_sample;
  ------------------
  |  |   43|  42.5k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 42.5k]
  |  |  ------------------
  ------------------
  480|  42.5k|                    }
  481|  42.5k|                }
  482|       |                /* Reverse Substitution Process */
  483|   650k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (483:20): [True: 281k, False: 368k]
  ------------------
  484|   281k|                {
  485|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  486|   281k|                    pu2_ref_u = pu2_dst[2 * nbr_id_from_bl];
  487|   281k|                    pu2_ref_v = pu2_dst[2 * nbr_id_from_bl + 1];
  488|  5.51M|                    for(i = (2 * (nbr_id_from_bl - 1)); i >= 0; i-=2)
  ------------------
  |  Branch (488:57): [True: 5.23M, False: 281k]
  ------------------
  489|  5.23M|                    {
  490|  5.23M|                        pu2_dst[i] = pu2_ref_u;
  491|  5.23M|                        pu2_dst[i + 1] = pu2_ref_v;
  492|  5.23M|                    }
  493|   281k|                }
  494|   650k|            }
  495|       |
  496|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  497|  10.3M|            while(nbr_id_from_bl < ((T16C_4NT * sub_sample) + 1))
  ------------------
  |  |   80|  10.3M|#define T16C_4NT 64
  ------------------
  |  Branch (497:19): [True: 9.69M, False: 650k]
  ------------------
  498|  9.69M|            {
  499|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  500|       |                /* Divide by 4 to obtain the original index */
  501|  9.69M|                frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2));
  ------------------
  |  Branch (501:53): [True: 0, False: 9.69M]
  ------------------
  502|       |
  503|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  504|  9.69M|                if(nbr_id_from_bl == (T16C_4NT * sub_sample / 2))
  ------------------
  |  |   80|  9.69M|#define T16C_4NT 64
  ------------------
  |  Branch (504:20): [True: 608k, False: 9.08M]
  ------------------
  505|   608k|                {
  506|   608k|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|   608k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  507|       |                    /* only pel substitution for TL */
  508|   608k|                    if(!get_bits)
  ------------------
  |  Branch (508:24): [True: 95.7k, False: 512k]
  ------------------
  509|  95.7k|                    {
  510|  95.7k|                        pu2_dst[2 * nbr_id_from_bl] = pu2_dst[(2 * nbr_id_from_bl) - 2];
  511|  95.7k|                        pu2_dst[(2 * nbr_id_from_bl) + 1] = pu2_dst[(2 * nbr_id_from_bl) - 1];
  512|  95.7k|                    }
  513|   608k|                }
  514|  9.08M|                else
  515|  9.08M|                {
  516|  9.08M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  9.08M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  517|  9.08M|                    if(!get_bits)
  ------------------
  |  Branch (517:24): [True: 2.38M, False: 6.70M]
  ------------------
  518|  2.38M|                    {
  519|       |                        /* 4 pel substitution (other than TL) */
  520|  2.38M|                        pu2_ref_u = pu2_dst[(2 * nbr_id_from_bl) - 2];
  521|  2.38M|                        pu2_ref_v = pu2_dst[(2 * nbr_id_from_bl) - 1];
  522|  11.9M|                        for(i = 0; i < 4 * sub_sample; i++)
  ------------------
  |  Branch (522:36): [True: 9.52M, False: 2.38M]
  ------------------
  523|  9.52M|                        {
  524|  9.52M|                            pu2_dst[(2 * nbr_id_from_bl) + 2 * i] = pu2_ref_u;
  525|  9.52M|                            pu2_dst[(2 * nbr_id_from_bl) + 1 + 2 * i] = pu2_ref_v;
  526|  9.52M|                        }
  527|  2.38M|                    }
  528|  9.08M|                }
  529|  9.69M|                nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample;
  ------------------
  |  |   80|  9.69M|#define T16C_4NT 64
  ------------------
  |  Branch (529:35): [True: 608k, False: 9.08M]
  ------------------
  530|  9.69M|            }
  531|   650k|        }
  532|  2.44M|    }
  533|  2.47M|}
ihevc_hbd_intra_pred_chroma_planar:
  580|   862k|{
  581|   862k|    WORD32 row, col;
  582|   862k|    WORD32 log2nt = 5;
  583|   862k|    WORD32 two_nt, three_nt;
  584|       |
  585|   862k|    switch(nt)
  586|   862k|    {
  587|   286k|        case 16:
  ------------------
  |  Branch (587:9): [True: 286k, False: 575k]
  ------------------
  588|   286k|            log2nt = 4;
  589|   286k|            break;
  590|   200k|        case 8:
  ------------------
  |  Branch (590:9): [True: 200k, False: 662k]
  ------------------
  591|   200k|            log2nt = 3;
  592|   200k|            break;
  593|   375k|        case 4:
  ------------------
  |  Branch (593:9): [True: 375k, False: 486k]
  ------------------
  594|   375k|            log2nt = 2;
  595|   375k|            break;
  596|      0|        default:
  ------------------
  |  Branch (596:9): [True: 0, False: 862k]
  ------------------
  597|      0|            break;
  598|   862k|    }
  599|   862k|    two_nt = 2 * nt;
  600|   862k|    three_nt = 3 * nt;
  601|       |    /* Planar filtering */
  602|  8.41M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (602:18): [True: 7.55M, False: 862k]
  ------------------
  603|  7.55M|    {
  604|  97.1M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (604:22): [True: 89.6M, False: 7.55M]
  ------------------
  605|  89.6M|        {
  606|  89.6M|            pu2_dst[row * dst_strd + col] = ((nt - 1 - col / 2)
  607|  89.6M|                            * pu2_ref[2 * (two_nt - 1 - row)]
  608|  89.6M|                            + (col / 2 + 1) * pu2_ref[2 * (three_nt + 1)]
  609|  89.6M|                            + (nt - 1 - row) * pu2_ref[2 * (two_nt + 1) + col]
  610|  89.6M|                            + (row + 1) * pu2_ref[2 * (nt - 1)] + nt) >> (log2nt + 1);
  611|       |
  612|  89.6M|            pu2_dst[row * dst_strd + col + 1] = ((nt - 1 - col / 2)
  613|  89.6M|                            * pu2_ref[2 * (two_nt - 1 - row) + 1]
  614|  89.6M|                            + (col / 2 + 1) * pu2_ref[2 * (three_nt + 1) + 1]
  615|  89.6M|                            + (nt - 1 - row) * pu2_ref[2 * (two_nt + 1) + col + 1]
  616|  89.6M|                            + (row + 1) * pu2_ref[2 * (nt - 1) + 1] + nt) >> (log2nt + 1);
  617|  89.6M|        }
  618|  7.55M|    }
  619|   862k|}
ihevc_hbd_intra_pred_chroma_dc:
  666|   471k|{
  667|   471k|    WORD32 acc_dc_u, acc_dc_v;
  668|   471k|    WORD32 dc_val_u , dc_val_v;
  669|   471k|    WORD32 i;
  670|   471k|    WORD32 row, col;
  671|   471k|    WORD32 log2nt = 5;
  672|       |
  673|   471k|    switch(nt)
  674|   471k|    {
  675|      0|        case 32:
  ------------------
  |  Branch (675:9): [True: 0, False: 471k]
  ------------------
  676|      0|            log2nt = 5;
  677|      0|            break;
  678|   106k|        case 16:
  ------------------
  |  Branch (678:9): [True: 106k, False: 364k]
  ------------------
  679|   106k|            log2nt = 4;
  680|   106k|            break;
  681|   131k|        case 8:
  ------------------
  |  Branch (681:9): [True: 131k, False: 340k]
  ------------------
  682|   131k|            log2nt = 3;
  683|   131k|            break;
  684|   233k|        case 4:
  ------------------
  |  Branch (684:9): [True: 233k, False: 237k]
  ------------------
  685|   233k|            log2nt = 2;
  686|   233k|            break;
  687|      0|        default:
  ------------------
  |  Branch (687:9): [True: 0, False: 471k]
  ------------------
  688|      0|            break;
  689|   471k|    }
  690|       |
  691|   471k|    acc_dc_u = 0;
  692|   471k|    acc_dc_v = 0;
  693|       |    /* Calculate DC value for the transform block */
  694|  4.16M|    for(i = (2 * nt); i < (4 * nt); i+=2)
  ------------------
  |  Branch (694:23): [True: 3.69M, False: 471k]
  ------------------
  695|  3.69M|    {
  696|  3.69M|        acc_dc_u += pu2_ref[i];
  697|  3.69M|        acc_dc_v += pu2_ref[i+1];
  698|  3.69M|    }
  699|  4.16M|    for(i = ((4 * nt) + 2); i < ((6 * nt) + 2); i+=2)
  ------------------
  |  Branch (699:29): [True: 3.69M, False: 471k]
  ------------------
  700|  3.69M|    {
  701|  3.69M|        acc_dc_u += pu2_ref[i];
  702|  3.69M|        acc_dc_v += pu2_ref[i+1];
  703|  3.69M|    }
  704|       |
  705|   471k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  706|   471k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  707|       |
  708|       |    /* Fill the remaining rows with DC value */
  709|  4.15M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (709:18): [True: 3.68M, False: 471k]
  ------------------
  710|  3.68M|    {
  711|  43.0M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (711:22): [True: 39.3M, False: 3.68M]
  ------------------
  712|  39.3M|        {
  713|  39.3M|            pu2_dst[(row * dst_strd) + col] = dc_val_u;
  714|  39.3M|            pu2_dst[(row * dst_strd) + col + 1] = dc_val_v;
  715|  39.3M|        }
  716|  3.68M|    }
  717|   471k|}
ihevc_hbd_intra_pred_chroma_horz:
  764|  56.6k|{
  765|  56.6k|    WORD32 row, col;
  766|       |
  767|       |    /* Replication to next rows */
  768|   530k|    for(row = 0; row < nt ; row++)
  ------------------
  |  Branch (768:18): [True: 473k, False: 56.6k]
  ------------------
  769|   473k|    {
  770|  6.00M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (770:22): [True: 5.53M, False: 473k]
  ------------------
  771|  5.53M|        {
  772|  5.53M|            pu2_dst[(row * dst_strd) + col] = pu2_ref[(4 * nt) - 2 - 2 * row];
  773|  5.53M|            pu2_dst[(row * dst_strd) + col+1] = pu2_ref[(4 * nt) - 1 - 2 * row];
  774|  5.53M|        }
  775|   473k|    }
  776|  56.6k|}
ihevc_hbd_intra_pred_chroma_ver:
  824|   368k|{
  825|   368k|    WORD32 row, col;
  826|       |
  827|       |    /* Replication to next columns */
  828|  3.62M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (828:18): [True: 3.26M, False: 368k]
  ------------------
  829|  3.26M|    {
  830|  42.0M|        for(col =0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (830:21): [True: 38.8M, False: 3.26M]
  ------------------
  831|  38.8M|        {
  832|  38.8M|            pu2_dst[(row * dst_strd) + col] = pu2_ref[(4 * nt) + 2 + col];
  833|  38.8M|            pu2_dst[(row * dst_strd) + col+1] = pu2_ref[(4 * nt) + 3 + col];
  834|  38.8M|        }
  835|  3.26M|    }
  836|   368k|}
ihevc_hbd_intra_pred_chroma_mode2:
  883|   218k|{
  884|   218k|    WORD32 row, col;
  885|       |
  886|   218k|    WORD32 intra_pred_ang = 32;
  887|   218k|    WORD32 idx_u, idx_v;
  888|       |
  889|       |    /* For the angle 45, replication is done from the corresponding angle */
  890|       |    /* intra_pred_ang = tan(angle) in q5 format */
  891|  1.53M|    for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (891:18): [True: 1.31M, False: 218k]
  ------------------
  892|  1.31M|    {
  893|  1.31M|        idx_u = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  894|  1.31M|        idx_v = (((col + 1) + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  895|  12.9M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (895:22): [True: 11.6M, False: 1.31M]
  ------------------
  896|  11.6M|        {
  897|  11.6M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[(4 * nt) - 2 * row - idx_u - 3];
  898|  11.6M|            pu2_dst[(col + 1) + (row * dst_strd)] = pu2_ref[(4 * nt) - 2 * row - idx_v - 1];
  899|  11.6M|        }
  900|  1.31M|    }
  901|   218k|}
ihevc_hbd_intra_pred_chroma_mode_18_34:
  948|  19.4k|{
  949|  19.4k|    WORD32 row, col;
  950|  19.4k|    WORD32 intra_pred_ang;
  951|  19.4k|    WORD32 idx = 0;
  952|       |
  953|  19.4k|    intra_pred_ang = 32; /* Default value */
  954|       |    /* For mode 18, angle is -45degree */
  955|  19.4k|    if(mode == 18)
  ------------------
  |  Branch (955:8): [True: 15.7k, False: 3.63k]
  ------------------
  956|  15.7k|    {
  957|  15.7k|        intra_pred_ang = -32;
  958|  15.7k|    }
  959|       |    /* For mode 34, angle is 45degree */
  960|  3.63k|    else if(mode == 34)
  ------------------
  |  Branch (960:13): [True: 3.63k, False: 0]
  ------------------
  961|  3.63k|    {
  962|  3.63k|        intra_pred_ang = 32;
  963|  3.63k|    }
  964|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
  965|       |    /* No interpolation is done for 45 degree */
  966|   176k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (966:18): [True: 156k, False: 19.4k]
  ------------------
  967|   156k|    {
  968|   156k|        idx = ((row + 1) * intra_pred_ang) >> 5;
  969|       |
  970|  1.94M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (970:22): [True: 1.78M, False: 156k]
  ------------------
  971|  1.78M|        {
  972|  1.78M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[(4 * nt) + col + 2 * idx + 2];
  973|  1.78M|            pu2_dst[(col + 1) + (row * dst_strd)] = pu2_ref[(4 * nt) + (col + 1) + 2 * idx + 2];
  974|  1.78M|        }
  975|   156k|    }
  976|  19.4k|}
ihevc_hbd_intra_pred_chroma_mode_3_to_9:
 1023|  70.1k|{
 1024|  70.1k|    WORD32 row, col;
 1025|  70.1k|    WORD32 intra_pred_ang;
 1026|  70.1k|    WORD32 idx_u, ref_main_idx_u;
 1027|  70.1k|    WORD32 idx_v, ref_main_idx_v;
 1028|  70.1k|    WORD32 pos_u, fract_u;
 1029|  70.1k|    WORD32 pos_v, fract_v;
 1030|       |
 1031|       |    /* Intra Pred Angle according to the mode */
 1032|  70.1k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1033|       |
 1034|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1035|       |    /* samples dependent on distance to obtain destination sample */
 1036|       |
 1037|   580k|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1037:18): [True: 510k, False: 70.1k]
  ------------------
 1038|   510k|    {
 1039|   510k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1040|   510k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1041|       |
 1042|   510k|        idx_u = pos_u >> 5;
 1043|   510k|        fract_u = pos_u & (31);
 1044|       |
 1045|   510k|        idx_v = pos_v >> 5;
 1046|   510k|        fract_v = pos_v & (31);
 1047|       |        // Do linear filtering
 1048|  5.78M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1048:22): [True: 5.27M, False: 510k]
  ------------------
 1049|  5.27M|        {
 1050|  5.27M|            ref_main_idx_u = (4 * nt) - 2 * row - 2 * idx_u - 2;
 1051|  5.27M|            ref_main_idx_v = (4 * nt) - 2 * row - 2 * idx_v - 1;
 1052|       |
 1053|  5.27M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract_u)
 1054|  5.27M|                            * pu2_ref[ref_main_idx_u]
 1055|  5.27M|                            + fract_u * pu2_ref[ref_main_idx_u - 2] + 16) >> 5 );
 1056|       |
 1057|  5.27M|            pu2_dst[(col + 1) + (row * dst_strd)] = (((32 - fract_v)
 1058|  5.27M|                            * pu2_ref[ref_main_idx_v]
 1059|  5.27M|                            + fract_v * pu2_ref[ref_main_idx_v - 2] + 16) >> 5 );
 1060|  5.27M|        }
 1061|   510k|    }
 1062|  70.1k|}
ihevc_hbd_intra_pred_chroma_mode_11_to_17:
 1109|  76.4k|{
 1110|       |    /* This function and ihevc_intra_pred_CHROMA_mode_19_to_25 are same except */
 1111|       |    /* for ref main & side samples assignment,can be combined for */
 1112|       |    /* optimzation */
 1113|       |
 1114|  76.4k|    WORD32 row, col, k;
 1115|  76.4k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1116|  76.4k|    WORD32 idx_u, idx_v, ref_main_idx_u, ref_main_idx_v, ref_idx;
 1117|  76.4k|    WORD32 pos_u, pos_v, fract_u, fract_v;
 1118|       |
 1119|  76.4k|    UWORD16 ref_temp[2 * MAX_CU_SIZE + 2];
 1120|  76.4k|    UWORD16 *ref_main;
 1121|  76.4k|    inv_ang_sum = 128;
 1122|       |
 1123|  76.4k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1124|       |
 1125|  76.4k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1126|       |    /* Intermediate reference samples for negative angle modes */
 1127|       |    /* This have to be removed during optimization */
 1128|       |
 1129|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1130|       |
 1131|  76.4k|    ref_main = ref_temp + 2*nt;
 1132|   709k|    for(k = 0; k < (2 * (nt + 1)); k+=2)
  ------------------
  |  Branch (1132:16): [True: 632k, False: 76.4k]
  ------------------
 1133|   632k|    {
 1134|   632k|        ref_temp[k + (2* (nt - 1))] = pu2_ref[(4 * nt) - k];
 1135|   632k|        ref_temp[k + 1+ (2* (nt - 1))] = pu2_ref[(4 * nt) - k + 1];
 1136|   632k|    }
 1137|       |
 1138|  76.4k|    ref_main = ref_temp + (2 * (nt - 1));
 1139|  76.4k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1140|       |
 1141|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1142|       |    /* For negative angled derive the main reference samples from side */
 1143|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1144|   282k|    for(k = -2; k > (2 * ref_idx); k-=2)
  ------------------
  |  Branch (1144:17): [True: 205k, False: 76.4k]
  ------------------
 1145|   205k|    {
 1146|   205k|        inv_ang_sum += inv_ang;
 1147|   205k|        ref_main[k] = pu2_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1148|   205k|        ref_main[k + 1] = pu2_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1149|   205k|    }
 1150|       |
 1151|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1152|       |    /* samples dependent on distance to obtain destination sample */
 1153|   632k|    for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (1153:18): [True: 555k, False: 76.4k]
  ------------------
 1154|   555k|    {
 1155|   555k|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1156|   555k|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1157|   555k|        idx_u = pos_u >> 5;
 1158|   555k|        idx_v = pos_v >> 5;
 1159|   555k|        fract_u = pos_u & (31);
 1160|   555k|        fract_v = pos_v & (31);
 1161|       |
 1162|       |        // Do linear filtering
 1163|  6.08M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1163:22): [True: 5.52M, False: 555k]
  ------------------
 1164|  5.52M|        {
 1165|  5.52M|            ref_main_idx_u = 2 * (row + idx_u + 1);
 1166|  5.52M|            ref_main_idx_v = 2 * (row + idx_v + 1) + 1;
 1167|       |
 1168|  5.52M|            pu2_dst[col + (dst_strd * row)] = (UWORD16)(((32 - fract_u)
 1169|  5.52M|                            * ref_main[ref_main_idx_u]
 1170|  5.52M|                            + fract_u * ref_main[ref_main_idx_u + 2] + 16) >> 5 );
 1171|  5.52M|            pu2_dst[(col + 1) + (dst_strd * row)] = (UWORD16)(((32 - fract_v)
 1172|  5.52M|                                        * ref_main[ref_main_idx_v]
 1173|  5.52M|                                        + fract_v * ref_main[ref_main_idx_v + 2] + 16) >> 5 );
 1174|  5.52M|        }
 1175|   555k|    }
 1176|  76.4k|}
ihevc_hbd_intra_pred_chroma_mode_19_to_25:
 1224|   174k|{
 1225|   174k|    WORD32 row, col, k;
 1226|   174k|    WORD32 intra_pred_ang, idx;
 1227|   174k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1228|   174k|    WORD32 ref_main_idx_u, ref_main_idx_v, ref_idx;
 1229|   174k|    UWORD16 ref_temp[(2 * MAX_CU_SIZE) + 2];
 1230|   174k|    UWORD16 *ref_main;
 1231|       |
 1232|   174k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1233|   174k|    inv_ang = gai4_ihevc_inv_ang_table_chroma[mode - 12];
 1234|       |
 1235|       |    /* Intermediate reference samples for negative angle modes */
 1236|       |    /* This have to be removed during optimization */
 1237|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1238|   174k|    ref_main = ref_temp + 2*nt;
 1239|  1.56M|    for(k = 0; k < (2 * (nt + 1)); k+=2)
  ------------------
  |  Branch (1239:16): [True: 1.39M, False: 174k]
  ------------------
 1240|  1.39M|    {
 1241|  1.39M|        ref_temp[k + (2* (nt - 1))] = pu2_ref[(4 * nt) + k];
 1242|  1.39M|        ref_temp[k + 1 + (2* (nt - 1))] = pu2_ref[(4 * nt) + k + 1];
 1243|  1.39M|    }
 1244|       |
 1245|   174k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1246|   174k|    inv_ang_sum = 128;
 1247|   174k|    ref_main = ref_temp + (2 *( nt - 1));
 1248|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1249|       |    /* For negative angled derive the main reference samples from side */
 1250|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1251|   496k|    for(k = -2; k > (2 * ref_idx) ; k-=2)
  ------------------
  |  Branch (1251:17): [True: 321k, False: 174k]
  ------------------
 1252|   321k|    {
 1253|   321k|        inv_ang_sum += inv_ang;
 1254|   321k|        ref_main[k] = pu2_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 1255|   321k|        ref_main[k + 1] = pu2_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 1256|   321k|    }
 1257|       |
 1258|  1.39M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1258:18): [True: 1.21M, False: 174k]
  ------------------
 1259|  1.21M|    {
 1260|  1.21M|        pos = ((row + 1) * intra_pred_ang);
 1261|  1.21M|        idx = pos >> 5;
 1262|  1.21M|        fract = pos & (31);
 1263|       |
 1264|       |        // Do linear filtering
 1265|  13.2M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (1265:22): [True: 12.0M, False: 1.21M]
  ------------------
 1266|  12.0M|        {
 1267|  12.0M|            ref_main_idx_u = col + 2 * idx + 2;
 1268|  12.0M|            ref_main_idx_v = (col + 1) + 2 * idx + 2;
 1269|  12.0M|            pu2_dst[(row * dst_strd) + col] = (UWORD16)(((32 - fract)
 1270|  12.0M|                            * ref_main[ref_main_idx_u]
 1271|  12.0M|                            + fract * ref_main[ref_main_idx_u + 2] + 16) >> 5 );
 1272|  12.0M|            pu2_dst[(row * dst_strd) + (col + 1)] = (UWORD16)(((32 - fract)
 1273|  12.0M|                                        * ref_main[ref_main_idx_v]
 1274|  12.0M|                                        + fract * ref_main[ref_main_idx_v + 2] + 16) >> 5 );
 1275|  12.0M|        }
 1276|  1.21M|    }
 1277|   174k|}
ihevc_hbd_intra_pred_chroma_mode_27_to_33:
 1322|   166k|{
 1323|   166k|    WORD32 row, col ;
 1324|   166k|    WORD32 pos, fract;
 1325|   166k|    WORD32 intra_pred_ang;
 1326|   166k|    WORD32 idx, ref_main_idx_u, ref_main_idx_v;
 1327|       |
 1328|   166k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1329|       |
 1330|  1.40M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1330:18): [True: 1.24M, False: 166k]
  ------------------
 1331|  1.24M|    {
 1332|  1.24M|        pos = ((row + 1) * intra_pred_ang);
 1333|  1.24M|        idx = pos >> 5;
 1334|  1.24M|        fract = pos & (31);
 1335|       |
 1336|       |        // Do linear filtering
 1337|  14.4M|        for(col = 0; col < (2 * nt); col+=2)
  ------------------
  |  Branch (1337:22): [True: 13.1M, False: 1.24M]
  ------------------
 1338|  13.1M|        {
 1339|  13.1M|            ref_main_idx_u = (4 * nt) + col + 2 * idx + 2;
 1340|  13.1M|            ref_main_idx_v = (4 * nt) + (col + 1) + 2 * idx + 2;
 1341|  13.1M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract)
 1342|  13.1M|                            * pu2_ref[ref_main_idx_u]
 1343|  13.1M|                            + fract * pu2_ref[ref_main_idx_u + 2] + 16) >> 5 );
 1344|  13.1M|            pu2_dst[(col+1) + (row * dst_strd)] = (((32 - fract)
 1345|  13.1M|                                        * pu2_ref[ref_main_idx_v]
 1346|  13.1M|                                        + fract * pu2_ref[ref_main_idx_v + 2] + 16) >> 5 );
 1347|  13.1M|        }
 1348|  1.24M|    }
 1349|   166k|}

ihevc_hbd_chroma_itrans_recon_4x4:
  117|   128k|{
  118|   128k|    WORD32 j;
  119|   128k|    WORD32 e[2], o[2];
  120|   128k|    WORD32 add;
  121|   128k|    WORD32 shift;
  122|   128k|    WORD16 *pi2_tmp_orig;
  123|   128k|    WORD32 trans_size;
  124|   128k|    WORD16 clip_limit;
  125|       |
  126|   128k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   128k|#define TRANS_SIZE_4   4
  ------------------
  127|       |
  128|   128k|    pi2_tmp_orig = pi2_tmp;
  129|       |
  130|       |    /* Inverse Transform 1st stage */
  131|   128k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   128k|#define IT_SHIFT_STAGE_1 7
  ------------------
  132|   128k|    add = 1 << (shift - 1);
  133|       |
  134|   641k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (134:16): [True: 513k, False: 128k]
  ------------------
  135|   513k|    {
  136|       |        /* Checking for Zero Cols */
  137|   513k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (137:12): [True: 292k, False: 220k]
  ------------------
  138|   292k|        {
  139|   292k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  140|   292k|        }
  141|   220k|        else
  142|   220k|        {
  143|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  144|   220k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  145|   220k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  146|   220k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  147|   220k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  148|   220k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  149|   220k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  150|   220k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  151|   220k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  152|       |
  153|   220k|            pi2_tmp[0] =
  154|   220k|                            CLIP_S16( ((e[0] + o[0] + add)>>shift) );
  ------------------
  |  |   53|   220k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   220k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 358, False: 220k]
  |  |  |  |  |  Branch (40:53): [True: 401, False: 219k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|   220k|            pi2_tmp[1] =
  156|   220k|                            CLIP_S16( ((e[1] + o[1] + add)>>shift) );
  ------------------
  |  |   53|   220k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   220k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 114, False: 220k]
  |  |  |  |  |  Branch (40:53): [True: 253, False: 220k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   220k|            pi2_tmp[2] =
  158|   220k|                            CLIP_S16( ((e[1] - o[1] + add)>>shift) );
  ------------------
  |  |   53|   220k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   220k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 74, False: 220k]
  |  |  |  |  |  Branch (40:53): [True: 240, False: 220k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|   220k|            pi2_tmp[3] =
  160|   220k|                            CLIP_S16( ((e[0] - o[0] + add)>>shift) );
  ------------------
  |  |   53|   220k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   220k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 226, False: 220k]
  |  |  |  |  |  Branch (40:53): [True: 288, False: 220k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|   220k|        }
  162|   513k|        pi2_src++;
  163|   513k|        pi2_tmp += trans_size;
  164|   513k|        zero_cols = zero_cols >> 1;
  165|   513k|    }
  166|       |
  167|   128k|    pi2_tmp = pi2_tmp_orig;
  168|       |
  169|       |    /* Inverse Transform 2nd stage */
  170|   128k|    shift = 20 - u1_bit_depth;
  171|   128k|    add = 1 << (shift - 1);
  172|   128k|    clip_limit = (1 << u1_bit_depth) - 1;
  173|       |
  174|   641k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (174:16): [True: 512k, False: 128k]
  ------------------
  175|   512k|    {
  176|   512k|        WORD32 itrans_out;
  177|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  178|   512k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  179|   512k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  180|   512k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  181|   512k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  182|   512k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  183|   512k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  184|   512k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  185|   512k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  186|       |
  187|   512k|        itrans_out =
  188|   512k|                        CLIP_S16( ((e[0] + o[0] + add)>>shift ) );
  ------------------
  |  |   53|   512k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 512k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 512k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|   512k|        pu2_dst[0 * 2] = CLIP3( (itrans_out + pu2_pred[0 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 39.9k, False: 472k]
  |  |  |  Branch (40:53): [True: 31.9k, False: 441k]
  |  |  ------------------
  ------------------
  190|   512k|        itrans_out =
  191|   512k|                        CLIP_S16( ((e[1] + o[1] + add)>>shift ) );
  ------------------
  |  |   53|   512k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 512k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 512k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|   512k|        pu2_dst[1 * 2] = CLIP3( (itrans_out + pu2_pred[1 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 31.9k, False: 480k]
  |  |  |  Branch (40:53): [True: 27.2k, False: 453k]
  |  |  ------------------
  ------------------
  193|   512k|        itrans_out =
  194|   512k|                        CLIP_S16( ((e[1] - o[1] + add)>>shift ) );
  ------------------
  |  |   53|   512k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 512k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 512k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|   512k|        pu2_dst[2 * 2] = CLIP3( (itrans_out + pu2_pred[2 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 31.7k, False: 481k]
  |  |  |  Branch (40:53): [True: 34.1k, False: 446k]
  |  |  ------------------
  ------------------
  196|   512k|        itrans_out =
  197|   512k|                        CLIP_S16( ((e[0] - o[0] + add)>>shift ));
  ------------------
  |  |   53|   512k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 512k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 512k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|   512k|        pu2_dst[3 * 2] = CLIP3( (itrans_out + pu2_pred[3 * 2] ), 0, clip_limit);
  ------------------
  |  |   40|   512k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 35.0k, False: 477k]
  |  |  |  Branch (40:53): [True: 41.5k, False: 436k]
  |  |  ------------------
  ------------------
  199|       |
  200|   512k|        pi2_tmp++;
  201|   512k|        pu2_pred += pred_strd;
  202|   512k|        pu2_dst += dst_strd;
  203|   512k|    }
  204|   128k|}

ihevc_hbd_chroma_itrans_recon_16x16:
  115|  58.1k|{
  116|  58.1k|    WORD32 j, k;
  117|  58.1k|    WORD32 e[8], o[8];
  118|  58.1k|    WORD32 ee[4], eo[4];
  119|  58.1k|    WORD32 eee[2], eeo[2];
  120|  58.1k|    WORD32 add;
  121|  58.1k|    WORD32 shift;
  122|  58.1k|    WORD16 *pi2_tmp_orig;
  123|  58.1k|    WORD32 trans_size;
  124|  58.1k|    WORD16 clip_limit;
  125|  58.1k|    WORD32 row_limit_2nd_stage, zero_rows_2nd_stage = zero_cols;
  126|       |
  127|  58.1k|    clip_limit = (1 << u1_bit_depth) - 1;
  128|  58.1k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  58.1k|#define TRANS_SIZE_16 16
  ------------------
  129|  58.1k|    pi2_tmp_orig = pi2_tmp;
  130|       |
  131|  58.1k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (131:8): [True: 30.5k, False: 27.6k]
  ------------------
  132|  30.5k|        row_limit_2nd_stage = 4;
  133|  27.6k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (133:13): [True: 19.0k, False: 8.53k]
  ------------------
  134|  19.0k|        row_limit_2nd_stage = 8;
  135|  8.53k|    else
  136|  8.53k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  8.53k|#define TRANS_SIZE_16 16
  ------------------
  137|       |
  138|  58.1k|    if((zero_rows & 0xFFF0) == 0xFFF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (138:8): [True: 22.3k, False: 35.8k]
  ------------------
  139|  22.3k|    {
  140|       |        /************************************************************************************************/
  141|       |        /**********************************START - IT_RECON_16x16****************************************/
  142|       |        /************************************************************************************************/
  143|       |
  144|       |        /* Inverse Transform 1st stage */
  145|  22.3k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  22.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
  146|  22.3k|        add = 1 << (shift - 1);
  147|       |
  148|   151k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (148:20): [True: 129k, False: 22.3k]
  ------------------
  149|   129k|        {
  150|       |            /* Checking for Zero Cols */
  151|   129k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (151:16): [True: 78.4k, False: 51.2k]
  ------------------
  152|  78.4k|            {
  153|  78.4k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  154|  78.4k|            }
  155|  51.2k|            else
  156|  51.2k|            {
  157|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  158|   461k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (158:28): [True: 409k, False: 51.2k]
  ------------------
  159|   409k|                {
  160|   409k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  161|   409k|                                    + g_ai2_ihevc_trans_16[3][k]
  162|   409k|                                                    * pi2_src[3 * src_strd];
  163|   409k|                }
  164|   256k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (164:28): [True: 205k, False: 51.2k]
  ------------------
  165|   205k|                {
  166|   205k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  167|   205k|                }
  168|  51.2k|                eeo[0] = 0;
  169|  51.2k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  170|  51.2k|                eeo[1] = 0;
  171|  51.2k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  172|       |
  173|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  174|   153k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (174:28): [True: 102k, False: 51.2k]
  ------------------
  175|   102k|                {
  176|   102k|                    ee[k] = eee[k] + eeo[k];
  177|   102k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  178|   102k|                }
  179|   256k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (179:28): [True: 205k, False: 51.2k]
  ------------------
  180|   205k|                {
  181|   205k|                    e[k] = ee[k] + eo[k];
  182|   205k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  183|   205k|                }
  184|   461k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (184:28): [True: 410k, False: 51.2k]
  ------------------
  185|   410k|                {
  186|   410k|                    pi2_tmp[k] =
  187|   410k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   410k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   410k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 86, False: 409k]
  |  |  |  |  |  Branch (40:53): [True: 239, False: 409k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|   410k|                    pi2_tmp[k + 8] =
  189|   410k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|   410k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   410k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 93, False: 409k]
  |  |  |  |  |  Branch (40:53): [True: 114, False: 409k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|   410k|                }
  191|  51.2k|            }
  192|   129k|            pi2_src++;
  193|   129k|            pi2_tmp += trans_size;
  194|   129k|            zero_cols = zero_cols >> 1;
  195|   129k|        }
  196|       |
  197|  22.3k|        pi2_tmp = pi2_tmp_orig;
  198|       |
  199|       |        /* Inverse Transform 2nd stage */
  200|  22.3k|        shift = 20 - u1_bit_depth;
  201|  22.3k|        add = 1 << (shift - 1);
  202|  22.3k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (202:12): [True: 15.3k, False: 6.95k]
  ------------------
  203|  15.3k|        {
  204|   260k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (204:24): [True: 245k, False: 15.3k]
  ------------------
  205|   245k|            {
  206|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  207|  2.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (207:28): [True: 1.96M, False: 245k]
  ------------------
  208|  1.96M|                {
  209|  1.96M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  210|  1.96M|                                    + g_ai2_ihevc_trans_16[3][k]
  211|  1.96M|                                                    * pi2_tmp[3 * trans_size];
  212|  1.96M|                }
  213|  1.22M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (213:28): [True: 981k, False: 245k]
  ------------------
  214|   981k|                {
  215|   981k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  216|   981k|                }
  217|   245k|                eeo[0] = 0;
  218|   245k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  219|   245k|                eeo[1] = 0;
  220|   245k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  221|       |
  222|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  223|   736k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (223:28): [True: 490k, False: 245k]
  ------------------
  224|   490k|                {
  225|   490k|                    ee[k] = eee[k] + eeo[k];
  226|   490k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  227|   490k|                }
  228|  1.22M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (228:28): [True: 981k, False: 245k]
  ------------------
  229|   981k|                {
  230|   981k|                    e[k] = ee[k] + eo[k];
  231|   981k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  232|   981k|                }
  233|  2.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (233:28): [True: 1.96M, False: 245k]
  ------------------
  234|  1.96M|                {
  235|  1.96M|                    WORD32 itrans_out;
  236|  1.96M|                    itrans_out =
  237|  1.96M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.96M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.96M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  1.96M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 50.8k, False: 1.91M]
  |  |  |  Branch (40:53): [True: 28.0k, False: 1.88M]
  |  |  ------------------
  ------------------
  239|  1.96M|                    itrans_out =
  240|  1.96M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.96M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.96M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  1.96M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 33.2k, False: 1.93M]
  |  |  |  Branch (40:53): [True: 27.5k, False: 1.90M]
  |  |  ------------------
  ------------------
  242|  1.96M|                }
  243|   245k|                pi2_tmp++;
  244|   245k|                pu2_pred += pred_strd;
  245|   245k|                pu2_dst += dst_strd;
  246|   245k|            }
  247|  15.3k|        }
  248|  6.95k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (248:17): [True: 5.37k, False: 1.58k]
  ------------------
  249|  5.37k|        {
  250|  90.1k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (250:24): [True: 84.8k, False: 5.37k]
  ------------------
  251|  84.8k|            {
  252|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  253|   763k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (253:28): [True: 678k, False: 84.8k]
  ------------------
  254|   678k|                {
  255|   678k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  256|   678k|                                    + g_ai2_ihevc_trans_16[3][k]
  257|   678k|                                                    * pi2_tmp[3 * trans_size]
  258|   678k|                                    + g_ai2_ihevc_trans_16[5][k]
  259|   678k|                                                    * pi2_tmp[5 * trans_size]
  260|   678k|                                    + g_ai2_ihevc_trans_16[7][k]
  261|   678k|                                                    * pi2_tmp[7 * trans_size];
  262|   678k|                }
  263|   424k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (263:28): [True: 339k, False: 84.8k]
  ------------------
  264|   339k|                {
  265|   339k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  266|   339k|                                    + g_ai2_ihevc_trans_16[6][k]
  267|   339k|                                                    * pi2_tmp[6 * trans_size];
  268|   339k|                }
  269|  84.8k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  270|  84.8k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  271|  84.8k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  272|  84.8k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  273|       |
  274|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  275|   254k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (275:28): [True: 169k, False: 84.8k]
  ------------------
  276|   169k|                {
  277|   169k|                    ee[k] = eee[k] + eeo[k];
  278|   169k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  279|   169k|                }
  280|   426k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (280:28): [True: 341k, False: 84.8k]
  ------------------
  281|   341k|                {
  282|   341k|                    e[k] = ee[k] + eo[k];
  283|   341k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  284|   341k|                }
  285|   763k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (285:28): [True: 678k, False: 84.8k]
  ------------------
  286|   678k|                {
  287|   678k|                    WORD32 itrans_out;
  288|   678k|                    itrans_out =
  289|   678k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   678k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   678k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 678k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 678k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|   678k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   678k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 20.3k, False: 658k]
  |  |  |  Branch (40:53): [True: 10.8k, False: 647k]
  |  |  ------------------
  ------------------
  291|   678k|                    itrans_out =
  292|   678k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   678k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   678k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 678k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 678k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|   678k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   678k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 22.7k, False: 655k]
  |  |  |  Branch (40:53): [True: 10.1k, False: 645k]
  |  |  ------------------
  ------------------
  294|   678k|                }
  295|  84.8k|                pi2_tmp++;
  296|  84.8k|                pu2_pred += pred_strd;
  297|  84.8k|                pu2_dst += dst_strd;
  298|  84.8k|            }
  299|  5.37k|        }
  300|  1.58k|        else /* All rows of output of 1st stage are non-zero */
  301|  1.58k|        {
  302|  27.0k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (302:24): [True: 25.4k, False: 1.58k]
  ------------------
  303|  25.4k|            {
  304|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  305|   228k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (305:28): [True: 203k, False: 25.4k]
  ------------------
  306|   203k|                {
  307|   203k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  308|   203k|                                    + g_ai2_ihevc_trans_16[3][k]
  309|   203k|                                                    * pi2_tmp[3 * trans_size]
  310|   203k|                                    + g_ai2_ihevc_trans_16[5][k]
  311|   203k|                                                    * pi2_tmp[5 * trans_size]
  312|   203k|                                    + g_ai2_ihevc_trans_16[7][k]
  313|   203k|                                                    * pi2_tmp[7 * trans_size]
  314|   203k|                                    + g_ai2_ihevc_trans_16[9][k]
  315|   203k|                                                    * pi2_tmp[9 * trans_size]
  316|   203k|                                    + g_ai2_ihevc_trans_16[11][k]
  317|   203k|                                                    * pi2_tmp[11 * trans_size]
  318|   203k|                                    + g_ai2_ihevc_trans_16[13][k]
  319|   203k|                                                    * pi2_tmp[13 * trans_size]
  320|   203k|                                    + g_ai2_ihevc_trans_16[15][k]
  321|   203k|                                                    * pi2_tmp[15 * trans_size];
  322|   203k|                }
  323|   127k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (323:28): [True: 101k, False: 25.4k]
  ------------------
  324|   101k|                {
  325|   101k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  326|   101k|                                    + g_ai2_ihevc_trans_16[6][k]
  327|   101k|                                                    * pi2_tmp[6 * trans_size]
  328|   101k|                                    + g_ai2_ihevc_trans_16[10][k]
  329|   101k|                                                    * pi2_tmp[10 * trans_size]
  330|   101k|                                    + g_ai2_ihevc_trans_16[14][k]
  331|   101k|                                                    * pi2_tmp[14 * trans_size];
  332|   101k|                }
  333|  25.4k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  334|  25.4k|                                    + g_ai2_ihevc_trans_16[12][0]
  335|  25.4k|                                                    * pi2_tmp[12 * trans_size];
  336|  25.4k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  337|  25.4k|                                    + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  338|  25.4k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  339|  25.4k|                                    + g_ai2_ihevc_trans_16[12][1]
  340|  25.4k|                                                    * pi2_tmp[12 * trans_size];
  341|  25.4k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  342|  25.4k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  343|       |
  344|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  345|  76.3k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (345:28): [True: 50.8k, False: 25.4k]
  ------------------
  346|  50.8k|                {
  347|  50.8k|                    ee[k] = eee[k] + eeo[k];
  348|  50.8k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  349|  50.8k|                }
  350|   127k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (350:28): [True: 101k, False: 25.4k]
  ------------------
  351|   101k|                {
  352|   101k|                    e[k] = ee[k] + eo[k];
  353|   101k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  354|   101k|                }
  355|   228k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (355:28): [True: 203k, False: 25.4k]
  ------------------
  356|   203k|                {
  357|   203k|                    WORD32 itrans_out;
  358|   203k|                    itrans_out =
  359|   203k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   203k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   203k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 203k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 203k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|   203k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   203k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.30k, False: 198k]
  |  |  |  Branch (40:53): [True: 6.01k, False: 191k]
  |  |  ------------------
  ------------------
  361|   203k|                    itrans_out =
  362|   203k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   203k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   203k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 203k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 203k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|   203k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   203k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.87k, False: 198k]
  |  |  |  Branch (40:53): [True: 6.26k, False: 192k]
  |  |  ------------------
  ------------------
  364|   203k|                }
  365|  25.4k|                pi2_tmp++;
  366|  25.4k|                pu2_pred += pred_strd;
  367|  25.4k|                pu2_dst += dst_strd;
  368|  25.4k|            }
  369|  1.58k|        }
  370|       |        /************************************************************************************************/
  371|       |        /************************************END - IT_RECON_16x16****************************************/
  372|       |        /************************************************************************************************/
  373|  22.3k|    }
  374|  35.8k|    else if((zero_rows & 0xFF00) == 0xFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (374:13): [True: 24.3k, False: 11.5k]
  ------------------
  375|  24.3k|    {
  376|       |        /************************************************************************************************/
  377|       |        /**********************************START - IT_RECON_16x16****************************************/
  378|       |        /************************************************************************************************/
  379|       |
  380|       |        /* Inverse Transform 1st stage */
  381|  24.3k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  24.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
  382|  24.3k|        add = 1 << (shift - 1);
  383|       |
  384|   172k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (384:20): [True: 148k, False: 24.3k]
  ------------------
  385|   148k|        {
  386|       |            /* Checking for Zero Cols */
  387|   148k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (387:16): [True: 97.3k, False: 51.3k]
  ------------------
  388|  97.3k|            {
  389|  97.3k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  390|  97.3k|            }
  391|  51.3k|            else
  392|  51.3k|            {
  393|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  394|   467k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (394:28): [True: 416k, False: 51.3k]
  ------------------
  395|   416k|                {
  396|   416k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  397|   416k|                                    + g_ai2_ihevc_trans_16[3][k]
  398|   416k|                                                    * pi2_src[3 * src_strd]
  399|   416k|                                    + g_ai2_ihevc_trans_16[5][k]
  400|   416k|                                                    * pi2_src[5 * src_strd]
  401|   416k|                                    + g_ai2_ihevc_trans_16[7][k]
  402|   416k|                                                    * pi2_src[7 * src_strd];
  403|   416k|                }
  404|   259k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (404:28): [True: 208k, False: 51.3k]
  ------------------
  405|   208k|                {
  406|   208k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  407|   208k|                                    + g_ai2_ihevc_trans_16[6][k]
  408|   208k|                                                    * pi2_src[6 * src_strd];
  409|   208k|                }
  410|  51.3k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  411|  51.3k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  412|  51.3k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  413|  51.3k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  414|       |
  415|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  416|   155k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (416:28): [True: 104k, False: 51.3k]
  ------------------
  417|   104k|                {
  418|   104k|                    ee[k] = eee[k] + eeo[k];
  419|   104k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  420|   104k|                }
  421|   259k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (421:28): [True: 208k, False: 51.3k]
  ------------------
  422|   208k|                {
  423|   208k|                    e[k] = ee[k] + eo[k];
  424|   208k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  425|   208k|                }
  426|   468k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (426:28): [True: 416k, False: 51.3k]
  ------------------
  427|   416k|                {
  428|   416k|                    pi2_tmp[k] =
  429|   416k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   416k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   416k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 148, False: 416k]
  |  |  |  |  |  Branch (40:53): [True: 207, False: 416k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|   416k|                    pi2_tmp[k + 8] =
  431|   416k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|   416k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   416k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 260, False: 416k]
  |  |  |  |  |  Branch (40:53): [True: 213, False: 416k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|   416k|                }
  433|  51.3k|            }
  434|   148k|            pi2_src++;
  435|   148k|            pi2_tmp += trans_size;
  436|   148k|            zero_cols = zero_cols >> 1;
  437|   148k|        }
  438|       |
  439|  24.3k|        pi2_tmp = pi2_tmp_orig;
  440|       |
  441|       |        /* Inverse Transform 2nd stage */
  442|  24.3k|        shift = 20 - u1_bit_depth;
  443|  24.3k|        add = 1 << (shift - 1);
  444|  24.3k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (444:12): [True: 12.9k, False: 11.3k]
  ------------------
  445|  12.9k|        {
  446|   212k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (446:24): [True: 199k, False: 12.9k]
  ------------------
  447|   199k|            {
  448|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  449|  1.79M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (449:28): [True: 1.59M, False: 199k]
  ------------------
  450|  1.59M|                {
  451|  1.59M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  452|  1.59M|                                    + g_ai2_ihevc_trans_16[3][k]
  453|  1.59M|                                                    * pi2_tmp[3 * trans_size];
  454|  1.59M|                }
  455|   998k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (455:28): [True: 798k, False: 199k]
  ------------------
  456|   798k|                {
  457|   798k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  458|   798k|                }
  459|   199k|                eeo[0] = 0;
  460|   199k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  461|   199k|                eeo[1] = 0;
  462|   199k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  463|       |
  464|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  465|   597k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (465:28): [True: 398k, False: 199k]
  ------------------
  466|   398k|                {
  467|   398k|                    ee[k] = eee[k] + eeo[k];
  468|   398k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  469|   398k|                }
  470|   992k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (470:28): [True: 793k, False: 199k]
  ------------------
  471|   793k|                {
  472|   793k|                    e[k] = ee[k] + eo[k];
  473|   793k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  474|   793k|                }
  475|  1.78M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (475:28): [True: 1.58M, False: 199k]
  ------------------
  476|  1.58M|                {
  477|  1.58M|                    WORD32 itrans_out;
  478|  1.58M|                    itrans_out =
  479|  1.58M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.58M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.58M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.58M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  1.58M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.58M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 8.07k, False: 1.57M]
  |  |  |  Branch (40:53): [True: 3.70k, False: 1.57M]
  |  |  ------------------
  ------------------
  481|  1.58M|                    itrans_out =
  482|  1.58M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.58M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.58M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.58M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  1.58M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.58M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 7.95k, False: 1.57M]
  |  |  |  Branch (40:53): [True: 4.15k, False: 1.57M]
  |  |  ------------------
  ------------------
  484|  1.58M|                }
  485|   199k|                pi2_tmp++;
  486|   199k|                pu2_pred += pred_strd;
  487|   199k|                pu2_dst += dst_strd;
  488|   199k|            }
  489|  12.9k|        }
  490|  11.3k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (490:17): [True: 10.6k, False: 680]
  ------------------
  491|  10.6k|        {
  492|   176k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (492:24): [True: 166k, False: 10.6k]
  ------------------
  493|   166k|            {
  494|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  495|  1.49M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (495:28): [True: 1.32M, False: 166k]
  ------------------
  496|  1.32M|                {
  497|  1.32M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  498|  1.32M|                                    + g_ai2_ihevc_trans_16[3][k]
  499|  1.32M|                                                    * pi2_tmp[3 * trans_size]
  500|  1.32M|                                    + g_ai2_ihevc_trans_16[5][k]
  501|  1.32M|                                                    * pi2_tmp[5 * trans_size]
  502|  1.32M|                                    + g_ai2_ihevc_trans_16[7][k]
  503|  1.32M|                                                    * pi2_tmp[7 * trans_size];
  504|  1.32M|                }
  505|   832k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (505:28): [True: 666k, False: 166k]
  ------------------
  506|   666k|                {
  507|   666k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  508|   666k|                                    + g_ai2_ihevc_trans_16[6][k]
  509|   666k|                                                    * pi2_tmp[6 * trans_size];
  510|   666k|                }
  511|   166k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  512|   166k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  513|   166k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  514|   166k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  515|       |
  516|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  517|   499k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (517:28): [True: 333k, False: 166k]
  ------------------
  518|   333k|                {
  519|   333k|                    ee[k] = eee[k] + eeo[k];
  520|   333k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  521|   333k|                }
  522|   831k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (522:28): [True: 665k, False: 166k]
  ------------------
  523|   665k|                {
  524|   665k|                    e[k] = ee[k] + eo[k];
  525|   665k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  526|   665k|                }
  527|  1.48M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (527:28): [True: 1.32M, False: 166k]
  ------------------
  528|  1.32M|                {
  529|  1.32M|                    WORD32 itrans_out;
  530|  1.32M|                    itrans_out =
  531|  1.32M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.32M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  532|  1.32M|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 24.1k, False: 1.29M]
  |  |  |  Branch (40:53): [True: 2.07k, False: 1.29M]
  |  |  ------------------
  ------------------
  533|  1.32M|                    itrans_out =
  534|  1.32M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.32M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|  1.32M|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 25.1k, False: 1.29M]
  |  |  |  Branch (40:53): [True: 2.13k, False: 1.29M]
  |  |  ------------------
  ------------------
  536|  1.32M|                }
  537|   166k|                pi2_tmp++;
  538|   166k|                pu2_pred += pred_strd;
  539|   166k|                pu2_dst += dst_strd;
  540|   166k|            }
  541|  10.6k|        }
  542|    680|        else /* All rows of output of 1st stage are non-zero */
  543|    680|        {
  544|  13.1k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (544:24): [True: 12.4k, False: 680]
  ------------------
  545|  12.4k|            {
  546|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  547|   112k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (547:28): [True: 99.8k, False: 12.4k]
  ------------------
  548|  99.8k|                {
  549|  99.8k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  550|  99.8k|                                    + g_ai2_ihevc_trans_16[3][k]
  551|  99.8k|                                                    * pi2_tmp[3 * trans_size]
  552|  99.8k|                                    + g_ai2_ihevc_trans_16[5][k]
  553|  99.8k|                                                    * pi2_tmp[5 * trans_size]
  554|  99.8k|                                    + g_ai2_ihevc_trans_16[7][k]
  555|  99.8k|                                                    * pi2_tmp[7 * trans_size]
  556|  99.8k|                                    + g_ai2_ihevc_trans_16[9][k]
  557|  99.8k|                                                    * pi2_tmp[9 * trans_size]
  558|  99.8k|                                    + g_ai2_ihevc_trans_16[11][k]
  559|  99.8k|                                                    * pi2_tmp[11 * trans_size]
  560|  99.8k|                                    + g_ai2_ihevc_trans_16[13][k]
  561|  99.8k|                                                    * pi2_tmp[13 * trans_size]
  562|  99.8k|                                    + g_ai2_ihevc_trans_16[15][k]
  563|  99.8k|                                                    * pi2_tmp[15 * trans_size];
  564|  99.8k|                }
  565|  62.3k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (565:28): [True: 49.9k, False: 12.4k]
  ------------------
  566|  49.9k|                {
  567|  49.9k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  568|  49.9k|                                    + g_ai2_ihevc_trans_16[6][k]
  569|  49.9k|                                                    * pi2_tmp[6 * trans_size]
  570|  49.9k|                                    + g_ai2_ihevc_trans_16[10][k]
  571|  49.9k|                                                    * pi2_tmp[10 * trans_size]
  572|  49.9k|                                    + g_ai2_ihevc_trans_16[14][k]
  573|  49.9k|                                                    * pi2_tmp[14 * trans_size];
  574|  49.9k|                }
  575|  12.4k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  576|  12.4k|                                    + g_ai2_ihevc_trans_16[12][0]
  577|  12.4k|                                                    * pi2_tmp[12 * trans_size];
  578|  12.4k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  579|  12.4k|                                    + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  580|  12.4k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  581|  12.4k|                                    + g_ai2_ihevc_trans_16[12][1]
  582|  12.4k|                                                    * pi2_tmp[12 * trans_size];
  583|  12.4k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  584|  12.4k|                                    + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  585|       |
  586|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  587|  37.4k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (587:28): [True: 24.9k, False: 12.4k]
  ------------------
  588|  24.9k|                {
  589|  24.9k|                    ee[k] = eee[k] + eeo[k];
  590|  24.9k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  591|  24.9k|                }
  592|  62.3k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (592:28): [True: 49.9k, False: 12.4k]
  ------------------
  593|  49.9k|                {
  594|  49.9k|                    e[k] = ee[k] + eo[k];
  595|  49.9k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  596|  49.9k|                }
  597|   112k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (597:28): [True: 99.8k, False: 12.4k]
  ------------------
  598|  99.8k|                {
  599|  99.8k|                    WORD32 itrans_out;
  600|  99.8k|                    itrans_out =
  601|  99.8k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  99.8k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  99.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 99.8k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 99.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|  99.8k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  99.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.3k, False: 87.4k]
  |  |  |  Branch (40:53): [True: 9.48k, False: 77.9k]
  |  |  ------------------
  ------------------
  603|  99.8k|                    itrans_out =
  604|  99.8k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  99.8k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  99.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 99.8k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 99.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  99.8k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|  99.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 10.7k, False: 89.0k]
  |  |  |  Branch (40:53): [True: 10.6k, False: 78.4k]
  |  |  ------------------
  ------------------
  606|  99.8k|                }
  607|  12.4k|                pi2_tmp++;
  608|  12.4k|                pu2_pred += pred_strd;
  609|  12.4k|                pu2_dst += dst_strd;
  610|  12.4k|            }
  611|    680|        }
  612|       |        /************************************************************************************************/
  613|       |        /************************************END - IT_RECON_16x16****************************************/
  614|       |        /************************************************************************************************/
  615|  24.3k|    }
  616|  11.5k|    else /* All rows of input are non-zero */
  617|  11.5k|    {
  618|       |        /************************************************************************************************/
  619|       |        /**********************************START - IT_RECON_16x16****************************************/
  620|       |        /************************************************************************************************/
  621|       |
  622|       |        /* Inverse Transform 1st stage */
  623|  11.5k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  11.5k|#define IT_SHIFT_STAGE_1 7
  ------------------
  624|  11.5k|        add = 1 << (shift - 1);
  625|       |
  626|   144k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (626:20): [True: 132k, False: 11.5k]
  ------------------
  627|   132k|        {
  628|       |            /* Checking for Zero Cols */
  629|   132k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (629:16): [True: 32.6k, False: 99.9k]
  ------------------
  630|  32.6k|            {
  631|  32.6k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  632|  32.6k|            }
  633|  99.9k|            else
  634|  99.9k|            {
  635|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  636|   899k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (636:28): [True: 799k, False: 99.9k]
  ------------------
  637|   799k|                {
  638|   799k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  639|   799k|                                    + g_ai2_ihevc_trans_16[3][k]
  640|   799k|                                                    * pi2_src[3 * src_strd]
  641|   799k|                                    + g_ai2_ihevc_trans_16[5][k]
  642|   799k|                                                    * pi2_src[5 * src_strd]
  643|   799k|                                    + g_ai2_ihevc_trans_16[7][k]
  644|   799k|                                                    * pi2_src[7 * src_strd]
  645|   799k|                                    + g_ai2_ihevc_trans_16[9][k]
  646|   799k|                                                    * pi2_src[9 * src_strd]
  647|   799k|                                    + g_ai2_ihevc_trans_16[11][k]
  648|   799k|                                                    * pi2_src[11 * src_strd]
  649|   799k|                                    + g_ai2_ihevc_trans_16[13][k]
  650|   799k|                                                    * pi2_src[13 * src_strd]
  651|   799k|                                    + g_ai2_ihevc_trans_16[15][k]
  652|   799k|                                                    * pi2_src[15 * src_strd];
  653|   799k|                }
  654|   499k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (654:28): [True: 400k, False: 99.9k]
  ------------------
  655|   400k|                {
  656|   400k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  657|   400k|                                    + g_ai2_ihevc_trans_16[6][k]
  658|   400k|                                                    * pi2_src[6 * src_strd]
  659|   400k|                                    + g_ai2_ihevc_trans_16[10][k]
  660|   400k|                                                    * pi2_src[10 * src_strd]
  661|   400k|                                    + g_ai2_ihevc_trans_16[14][k]
  662|   400k|                                                    * pi2_src[14 * src_strd];
  663|   400k|                }
  664|  99.9k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  665|  99.9k|                                    + g_ai2_ihevc_trans_16[12][0]
  666|  99.9k|                                                    * pi2_src[12 * src_strd];
  667|  99.9k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  668|  99.9k|                                    + g_ai2_ihevc_trans_16[8][0]
  669|  99.9k|                                                    * pi2_src[8 * src_strd];
  670|  99.9k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  671|  99.9k|                                    + g_ai2_ihevc_trans_16[12][1]
  672|  99.9k|                                                    * pi2_src[12 * src_strd];
  673|  99.9k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  674|  99.9k|                                    + g_ai2_ihevc_trans_16[8][1]
  675|  99.9k|                                                    * pi2_src[8 * src_strd];
  676|       |
  677|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  678|   299k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (678:28): [True: 199k, False: 99.9k]
  ------------------
  679|   199k|                {
  680|   199k|                    ee[k] = eee[k] + eeo[k];
  681|   199k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  682|   199k|                }
  683|   499k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (683:28): [True: 399k, False: 99.9k]
  ------------------
  684|   399k|                {
  685|   399k|                    e[k] = ee[k] + eo[k];
  686|   399k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  687|   399k|                }
  688|   899k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (688:28): [True: 799k, False: 99.9k]
  ------------------
  689|   799k|                {
  690|   799k|                    pi2_tmp[k] =
  691|   799k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   799k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   799k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 635, False: 799k]
  |  |  |  |  |  Branch (40:53): [True: 599, False: 798k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|   799k|                    pi2_tmp[k + 8] =
  693|   799k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|   799k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   799k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 503, False: 799k]
  |  |  |  |  |  Branch (40:53): [True: 596, False: 798k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  694|   799k|                }
  695|  99.9k|            }
  696|   132k|            pi2_src++;
  697|   132k|            pi2_tmp += trans_size;
  698|   132k|            zero_cols = zero_cols >> 1;
  699|   132k|        }
  700|       |
  701|  11.5k|        pi2_tmp = pi2_tmp_orig;
  702|       |
  703|       |        /* Inverse Transform 2nd stage */
  704|  11.5k|        shift = 20 - u1_bit_depth;
  705|  11.5k|        add = 1 << (shift - 1);
  706|  11.5k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (706:12): [True: 2.31k, False: 9.22k]
  ------------------
  707|  2.31k|        {
  708|  38.9k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (708:24): [True: 36.6k, False: 2.31k]
  ------------------
  709|  36.6k|            {
  710|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  711|   329k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (711:28): [True: 293k, False: 36.6k]
  ------------------
  712|   293k|                {
  713|   293k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  714|   293k|                                    + g_ai2_ihevc_trans_16[3][k]
  715|   293k|                                                    * pi2_tmp[3 * trans_size];
  716|   293k|                }
  717|   183k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (717:28): [True: 146k, False: 36.6k]
  ------------------
  718|   146k|                {
  719|   146k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  720|   146k|                }
  721|  36.6k|                eeo[0] = 0;
  722|  36.6k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  723|  36.6k|                eeo[1] = 0;
  724|  36.6k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  725|       |
  726|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  727|   109k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (727:28): [True: 73.3k, False: 36.6k]
  ------------------
  728|  73.3k|                {
  729|  73.3k|                    ee[k] = eee[k] + eeo[k];
  730|  73.3k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  731|  73.3k|                }
  732|   183k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (732:28): [True: 147k, False: 36.6k]
  ------------------
  733|   147k|                {
  734|   147k|                    e[k] = ee[k] + eo[k];
  735|   147k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  736|   147k|                }
  737|   329k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (737:28): [True: 293k, False: 36.6k]
  ------------------
  738|   293k|                {
  739|   293k|                    WORD32 itrans_out;
  740|   293k|                    itrans_out =
  741|   293k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   293k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   293k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 293k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 293k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  742|   293k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   293k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 11.5k, False: 281k]
  |  |  |  Branch (40:53): [True: 9.99k, False: 271k]
  |  |  ------------------
  ------------------
  743|   293k|                    itrans_out =
  744|   293k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   293k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   293k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 293k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 293k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|   293k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   293k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 11.4k, False: 281k]
  |  |  |  Branch (40:53): [True: 10.9k, False: 270k]
  |  |  ------------------
  ------------------
  746|   293k|                }
  747|  36.6k|                pi2_tmp++;
  748|  36.6k|                pu2_pred += pred_strd;
  749|  36.6k|                pu2_dst += dst_strd;
  750|  36.6k|            }
  751|  2.31k|        }
  752|  9.22k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (752:17): [True: 3.07k, False: 6.15k]
  ------------------
  753|  3.07k|        {
  754|  51.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (754:24): [True: 48.7k, False: 3.07k]
  ------------------
  755|  48.7k|            {
  756|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  757|   434k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (757:28): [True: 386k, False: 48.7k]
  ------------------
  758|   386k|                {
  759|   386k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  760|   386k|                                    + g_ai2_ihevc_trans_16[3][k]
  761|   386k|                                                    * pi2_tmp[3 * trans_size]
  762|   386k|                                    + g_ai2_ihevc_trans_16[5][k]
  763|   386k|                                                    * pi2_tmp[5 * trans_size]
  764|   386k|                                    + g_ai2_ihevc_trans_16[7][k]
  765|   386k|                                                    * pi2_tmp[7 * trans_size];
  766|   386k|                }
  767|   243k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (767:28): [True: 194k, False: 48.7k]
  ------------------
  768|   194k|                {
  769|   194k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  770|   194k|                                    + g_ai2_ihevc_trans_16[6][k]
  771|   194k|                                                    * pi2_tmp[6 * trans_size];
  772|   194k|                }
  773|  48.7k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  774|  48.7k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  775|  48.7k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  776|  48.7k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  777|       |
  778|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  779|   146k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (779:28): [True: 97.2k, False: 48.7k]
  ------------------
  780|  97.2k|                {
  781|  97.2k|                    ee[k] = eee[k] + eeo[k];
  782|  97.2k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  783|  97.2k|                }
  784|   242k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (784:28): [True: 193k, False: 48.7k]
  ------------------
  785|   193k|                {
  786|   193k|                    e[k] = ee[k] + eo[k];
  787|   193k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  788|   193k|                }
  789|   432k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (789:28): [True: 383k, False: 48.7k]
  ------------------
  790|   383k|                {
  791|   383k|                    WORD32 itrans_out;
  792|   383k|                    itrans_out =
  793|   383k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   383k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   383k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 383k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 383k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  794|   383k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   383k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.77k, False: 379k]
  |  |  |  Branch (40:53): [True: 2.96k, False: 376k]
  |  |  ------------------
  ------------------
  795|   383k|                    itrans_out =
  796|   383k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   383k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   383k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 383k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 383k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  797|   383k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   383k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.40k, False: 379k]
  |  |  |  Branch (40:53): [True: 2.51k, False: 377k]
  |  |  ------------------
  ------------------
  798|   383k|                }
  799|  48.7k|                pi2_tmp++;
  800|  48.7k|                pu2_pred += pred_strd;
  801|  48.7k|                pu2_dst += dst_strd;
  802|  48.7k|            }
  803|  3.07k|        }
  804|  6.15k|        else /* All rows of output of 1st stage are non-zero */
  805|  6.15k|        {
  806|   104k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (806:24): [True: 98.8k, False: 6.15k]
  ------------------
  807|  98.8k|            {
  808|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  809|   889k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (809:28): [True: 790k, False: 98.8k]
  ------------------
  810|   790k|                {
  811|   790k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  812|   790k|                                    + g_ai2_ihevc_trans_16[3][k]
  813|   790k|                                                    * pi2_tmp[3 * trans_size]
  814|   790k|                                    + g_ai2_ihevc_trans_16[5][k]
  815|   790k|                                                    * pi2_tmp[5 * trans_size]
  816|   790k|                                    + g_ai2_ihevc_trans_16[7][k]
  817|   790k|                                                    * pi2_tmp[7 * trans_size]
  818|   790k|                                    + g_ai2_ihevc_trans_16[9][k]
  819|   790k|                                                    * pi2_tmp[9 * trans_size]
  820|   790k|                                    + g_ai2_ihevc_trans_16[11][k]
  821|   790k|                                                    * pi2_tmp[11 * trans_size]
  822|   790k|                                    + g_ai2_ihevc_trans_16[13][k]
  823|   790k|                                                    * pi2_tmp[13 * trans_size]
  824|   790k|                                    + g_ai2_ihevc_trans_16[15][k]
  825|   790k|                                                    * pi2_tmp[15 * trans_size];
  826|   790k|                }
  827|   494k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (827:28): [True: 395k, False: 98.8k]
  ------------------
  828|   395k|                {
  829|   395k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  830|   395k|                                    + g_ai2_ihevc_trans_16[6][k]
  831|   395k|                                                    * pi2_tmp[6 * trans_size]
  832|   395k|                                    + g_ai2_ihevc_trans_16[10][k]
  833|   395k|                                                    * pi2_tmp[10 * trans_size]
  834|   395k|                                    + g_ai2_ihevc_trans_16[14][k]
  835|   395k|                                                    * pi2_tmp[14 * trans_size];
  836|   395k|                }
  837|  98.8k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  838|  98.8k|                                    + g_ai2_ihevc_trans_16[12][0]
  839|  98.8k|                                                    * pi2_tmp[12 * trans_size];
  840|  98.8k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  841|  98.8k|                                    + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  842|  98.8k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  843|  98.8k|                                    + g_ai2_ihevc_trans_16[12][1]
  844|  98.8k|                                                    * pi2_tmp[12 * trans_size];
  845|  98.8k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  846|  98.8k|                                    + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  847|       |
  848|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  849|   296k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (849:28): [True: 197k, False: 98.8k]
  ------------------
  850|   197k|                {
  851|   197k|                    ee[k] = eee[k] + eeo[k];
  852|   197k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  853|   197k|                }
  854|   494k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (854:28): [True: 395k, False: 98.8k]
  ------------------
  855|   395k|                {
  856|   395k|                    e[k] = ee[k] + eo[k];
  857|   395k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  858|   395k|                }
  859|   889k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (859:28): [True: 790k, False: 98.8k]
  ------------------
  860|   790k|                {
  861|   790k|                    WORD32 itrans_out;
  862|   790k|                    itrans_out =
  863|   790k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   790k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   790k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 790k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 790k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  864|   790k|                    pu2_dst[k * 2] = CLIP3((itrans_out+ pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|   790k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 366k, False: 424k]
  |  |  |  Branch (40:53): [True: 75.6k, False: 348k]
  |  |  ------------------
  ------------------
  865|   790k|                    itrans_out =
  866|   790k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   790k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   790k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 790k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 790k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  867|   790k|                    pu2_dst[(k + 8) * 2] = CLIP3((itrans_out + pu2_pred[(k + 8) * 2]), 0, clip_limit);
  ------------------
  |  |   40|   790k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 348k, False: 441k]
  |  |  |  Branch (40:53): [True: 63.5k, False: 378k]
  |  |  ------------------
  ------------------
  868|   790k|                }
  869|  98.8k|                pi2_tmp++;
  870|  98.8k|                pu2_pred += pred_strd;
  871|  98.8k|                pu2_dst += dst_strd;
  872|  98.8k|            }
  873|  6.15k|        }
  874|       |        /************************************************************************************************/
  875|       |        /************************************END - IT_RECON_16x16****************************************/
  876|       |        /************************************************************************************************/
  877|  11.5k|    }
  878|  58.1k|}

ihevc_hbd_chroma_itrans_recon_8x8:
  114|  56.6k|{
  115|  56.6k|    WORD32 j, k;
  116|  56.6k|    WORD32 e[4], o[4];
  117|  56.6k|    WORD32 ee[2], eo[2];
  118|  56.6k|    WORD32 add;
  119|  56.6k|    WORD32 shift;
  120|  56.6k|    WORD16 *pi2_tmp_orig;
  121|  56.6k|    WORD32 trans_size;
  122|  56.6k|    WORD32 zero_rows_2nd_stage = zero_cols;
  123|  56.6k|    WORD32 row_limit_2nd_stage;
  124|  56.6k|    WORD16 clip_limit;
  125|       |
  126|  56.6k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  56.6k|#define TRANS_SIZE_8   8
  ------------------
  127|       |
  128|  56.6k|    clip_limit = (1 << u1_bit_depth) - 1;
  129|  56.6k|    pi2_tmp_orig = pi2_tmp;
  130|       |
  131|  56.6k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (131:8): [True: 53.8k, False: 2.85k]
  ------------------
  132|  53.8k|        row_limit_2nd_stage = 4;
  133|  2.85k|    else
  134|  2.85k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  2.85k|#define TRANS_SIZE_8   8
  ------------------
  135|       |
  136|       |    /* Inverse Transform 1st stage */
  137|  56.6k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  56.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  138|  56.6k|    add = 1 << (shift - 1);
  139|  56.6k|    {
  140|       |        /************************************************************************************************/
  141|       |        /**********************************START - IT_RECON_8x8******************************************/
  142|       |        /************************************************************************************************/
  143|       |
  144|   294k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (144:20): [True: 237k, False: 56.6k]
  ------------------
  145|   237k|        {
  146|       |            /* Checking for Zero Cols */
  147|   237k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (147:16): [True: 130k, False: 107k]
  ------------------
  148|   130k|            {
  149|   130k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  150|   130k|            }
  151|   107k|            else
  152|   107k|            {
  153|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  154|   537k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (154:28): [True: 430k, False: 107k]
  ------------------
  155|   430k|                {
  156|   430k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  157|   430k|                                    + g_ai2_ihevc_trans_8[3][k]
  158|   430k|                                                    * pi2_src[3 * src_strd]
  159|   430k|                                    + g_ai2_ihevc_trans_8[5][k]
  160|   430k|                                                    * pi2_src[5 * src_strd]
  161|   430k|                                    + g_ai2_ihevc_trans_8[7][k]
  162|   430k|                                                    * pi2_src[7 * src_strd];
  163|   430k|                }
  164|       |
  165|   107k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  166|   107k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  167|   107k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  168|   107k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  169|   107k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  170|   107k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  171|   107k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  172|   107k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd];
  173|       |
  174|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  175|   107k|                e[0] = ee[0] + eo[0];
  176|   107k|                e[3] = ee[0] - eo[0];
  177|   107k|                e[1] = ee[1] + eo[1];
  178|   107k|                e[2] = ee[1] - eo[1];
  179|   537k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (179:28): [True: 430k, False: 107k]
  ------------------
  180|   430k|                {
  181|   430k|                    pi2_tmp[k] =
  182|   430k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   430k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   430k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.13k, False: 429k]
  |  |  |  |  |  Branch (40:53): [True: 1.07k, False: 428k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|   430k|                    pi2_tmp[k + 4] =
  184|   430k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift) );
  ------------------
  |  |   53|   430k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   430k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 153, False: 430k]
  |  |  |  |  |  Branch (40:53): [True: 263, False: 429k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|   430k|                }
  186|   107k|            }
  187|   237k|            pi2_src++;
  188|   237k|            pi2_tmp += trans_size;
  189|   237k|            zero_cols = zero_cols >> 1;
  190|   237k|        }
  191|       |
  192|  56.6k|        pi2_tmp = pi2_tmp_orig;
  193|       |
  194|       |        /* Inverse Transform 2nd stage */
  195|  56.6k|        shift = 20 - u1_bit_depth;
  196|  56.6k|        add = 1 << (shift - 1);
  197|       |
  198|  56.6k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (198:12): [True: 53.8k, False: 2.82k]
  ------------------
  199|  53.8k|        {
  200|   483k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (200:24): [True: 429k, False: 53.8k]
  ------------------
  201|   429k|            {
  202|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  203|  2.14M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 1.71M, False: 429k]
  ------------------
  204|  1.71M|                {
  205|  1.71M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  206|  1.71M|                                    + g_ai2_ihevc_trans_8[3][k]
  207|  1.71M|                                                    * pi2_tmp[3 * trans_size];
  208|  1.71M|                }
  209|   429k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  210|   429k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  211|   429k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  212|   429k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  213|       |
  214|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  215|   429k|                e[0] = ee[0] + eo[0];
  216|   429k|                e[3] = ee[0] - eo[0];
  217|   429k|                e[1] = ee[1] + eo[1];
  218|   429k|                e[2] = ee[1] - eo[1];
  219|  2.14M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (219:28): [True: 1.71M, False: 429k]
  ------------------
  220|  1.71M|                {
  221|  1.71M|                    WORD32 itrans_out;
  222|  1.71M|                    itrans_out =
  223|  1.71M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.71M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.71M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  1.71M|                    pu2_dst[k * 2] = CLIP3((itrans_out + pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  1.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 83.1k, False: 1.63M]
  |  |  |  Branch (40:53): [True: 20.1k, False: 1.61M]
  |  |  ------------------
  ------------------
  225|  1.71M|                    itrans_out =
  226|  1.71M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.71M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.71M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  1.71M|                    pu2_dst[(k + 4) * 2] =
  228|  1.71M|                                    CLIP3((itrans_out + pu2_pred[(k + 4) * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  1.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 69.8k, False: 1.64M]
  |  |  |  Branch (40:53): [True: 19.8k, False: 1.62M]
  |  |  ------------------
  ------------------
  229|  1.71M|                }
  230|   429k|                pi2_tmp++;
  231|   429k|                pu2_pred += pred_strd;
  232|   429k|                pu2_dst += dst_strd;
  233|   429k|            }
  234|  53.8k|        }
  235|  2.82k|        else /* All rows of output of 1st stage are non-zero */
  236|  2.82k|        {
  237|  25.6k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (237:24): [True: 22.8k, False: 2.82k]
  ------------------
  238|  22.8k|            {
  239|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  240|   114k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (240:28): [True: 91.4k, False: 22.8k]
  ------------------
  241|  91.4k|                {
  242|  91.4k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  243|  91.4k|                                    + g_ai2_ihevc_trans_8[3][k]
  244|  91.4k|                                                    * pi2_tmp[3 * trans_size]
  245|  91.4k|                                    + g_ai2_ihevc_trans_8[5][k]
  246|  91.4k|                                                    * pi2_tmp[5 * trans_size]
  247|  91.4k|                                    + g_ai2_ihevc_trans_8[7][k]
  248|  91.4k|                                                    * pi2_tmp[7 * trans_size];
  249|  91.4k|                }
  250|       |
  251|  22.8k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  252|  22.8k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  253|  22.8k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  254|  22.8k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  255|  22.8k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  256|  22.8k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  257|  22.8k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  258|  22.8k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  259|       |
  260|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  261|  22.8k|                e[0] = ee[0] + eo[0];
  262|  22.8k|                e[3] = ee[0] - eo[0];
  263|  22.8k|                e[1] = ee[1] + eo[1];
  264|  22.8k|                e[2] = ee[1] - eo[1];
  265|   114k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (265:28): [True: 91.4k, False: 22.8k]
  ------------------
  266|  91.4k|                {
  267|  91.4k|                    WORD32 itrans_out;
  268|  91.4k|                    itrans_out =
  269|  91.4k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  91.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  91.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 91.4k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 91.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|  91.4k|                    pu2_dst[k * 2] = CLIP3((itrans_out + pu2_pred[k * 2]), 0, clip_limit);
  ------------------
  |  |   40|  91.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 11.1k, False: 80.2k]
  |  |  |  Branch (40:53): [True: 10.6k, False: 69.6k]
  |  |  ------------------
  ------------------
  271|  91.4k|                    itrans_out =
  272|  91.4k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|  91.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  91.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 91.4k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 91.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  91.4k|                    pu2_dst[(k + 4) * 2] =
  274|  91.4k|                                    CLIP3((itrans_out + pu2_pred[(k + 4) * 2] ), 0, clip_limit);
  ------------------
  |  |   40|  91.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 10.2k, False: 81.1k]
  |  |  |  Branch (40:53): [True: 11.2k, False: 69.9k]
  |  |  ------------------
  ------------------
  275|  91.4k|                }
  276|  22.8k|                pi2_tmp++;
  277|  22.8k|                pu2_pred += pred_strd;
  278|  22.8k|                pu2_dst += dst_strd;
  279|  22.8k|            }
  280|  2.82k|        }
  281|       |        /************************************************************************************************/
  282|       |        /************************************END - IT_RECON_8x8******************************************/
  283|       |        /************************************************************************************************/
  284|  56.6k|    }
  285|  56.6k|}

ihevc_hbd_chroma_recon_4x4:
  109|   357k|{
  110|   357k|    WORD32 i, j;
  111|   357k|    WORD32 trans_size;
  112|   357k|    WORD16 clip_limit;
  113|       |
  114|   357k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   357k|#define TRANS_SIZE_4   4
  ------------------
  115|   357k|    clip_limit = (1 << u1_bit_depth) - 1;
  116|       |    /* Reconstruction */
  117|       |
  118|  1.78M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (118:16): [True: 1.42M, False: 357k]
  ------------------
  119|  1.42M|    {
  120|       |        /* Checking for Zero Cols */
  121|  1.42M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (121:12): [True: 954k, False: 474k]
  ------------------
  122|   954k|        {
  123|  4.77M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (123:24): [True: 3.81M, False: 954k]
  ------------------
  124|  3.81M|            {
  125|  3.81M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  126|  3.81M|            }
  127|   954k|        }
  128|   474k|        else
  129|   474k|        {
  130|  2.37M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (130:24): [True: 1.89M, False: 474k]
  ------------------
  131|  1.89M|            {
  132|  1.89M|                pu2_dst[j * dst_strd] =
  133|  1.89M|                    CLIP3((pi2_src[j * src_strd] + pu2_pred[j * pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  1.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 86.2k, False: 1.81M]
  |  |  |  Branch (40:53): [True: 13.3k, False: 1.79M]
  |  |  ------------------
  ------------------
  134|  1.89M|            }
  135|   474k|        }
  136|  1.42M|        pi2_src++;
  137|  1.42M|        pu2_dst += 2;
  138|  1.42M|        pu2_pred += 2;
  139|  1.42M|        zero_cols = zero_cols >> 1;
  140|  1.42M|    }
  141|   357k|}
ihevc_hbd_chroma_recon_8x8:
  192|  14.7k|{
  193|  14.7k|    WORD32 i, j;
  194|  14.7k|    WORD32 trans_size;
  195|  14.7k|    WORD16 clip_limit;
  196|       |
  197|  14.7k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  14.7k|#define TRANS_SIZE_8   8
  ------------------
  198|  14.7k|    clip_limit = (1 << u1_bit_depth) - 1;
  199|       |    /* Reconstruction */
  200|       |
  201|   132k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (201:16): [True: 118k, False: 14.7k]
  ------------------
  202|   118k|    {
  203|       |        /* Checking for Zero Cols */
  204|   118k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (204:12): [True: 96.6k, False: 21.5k]
  ------------------
  205|  96.6k|        {
  206|   869k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (206:24): [True: 773k, False: 96.6k]
  ------------------
  207|   773k|            {
  208|   773k|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  209|   773k|            }
  210|  96.6k|        }
  211|  21.5k|        else
  212|  21.5k|        {
  213|   194k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (213:24): [True: 172k, False: 21.5k]
  ------------------
  214|   172k|            {
  215|   172k|                pu2_dst[j * dst_strd] =
  216|   172k|                    CLIP3((pi2_src[j * src_strd] + pu2_pred[j * pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|   172k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.45k, False: 169k]
  |  |  |  Branch (40:53): [True: 317, False: 168k]
  |  |  ------------------
  ------------------
  217|   172k|            }
  218|  21.5k|        }
  219|   118k|        pi2_src++;
  220|   118k|        pu2_dst += 2;
  221|   118k|        pu2_pred += 2;
  222|   118k|        zero_cols = zero_cols >> 1;
  223|   118k|    }
  224|  14.7k|}
ihevc_hbd_chroma_recon_16x16:
  275|  15.1k|{
  276|  15.1k|    WORD32 i, j;
  277|  15.1k|    WORD32 trans_size;
  278|  15.1k|    WORD16 clip_limit;
  279|       |
  280|  15.1k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  15.1k|#define TRANS_SIZE_16 16
  ------------------
  281|  15.1k|    clip_limit = (1 << u1_bit_depth) - 1;
  282|       |    /* Reconstruction */
  283|       |
  284|   257k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (284:16): [True: 242k, False: 15.1k]
  ------------------
  285|   242k|    {
  286|       |        /* Checking for Zero Cols */
  287|   242k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (287:12): [True: 221k, False: 20.5k]
  ------------------
  288|   221k|        {
  289|  3.77M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (289:24): [True: 3.54M, False: 221k]
  ------------------
  290|  3.54M|            {
  291|  3.54M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  292|  3.54M|            }
  293|   221k|        }
  294|  20.5k|        else
  295|  20.5k|        {
  296|   349k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (296:24): [True: 329k, False: 20.5k]
  ------------------
  297|   329k|            {
  298|   329k|                pu2_dst[j * dst_strd] =
  299|   329k|                    CLIP3((pi2_src[j * src_strd] + pu2_pred[j * pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|   329k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.41k, False: 326k]
  |  |  |  Branch (40:53): [True: 675, False: 326k]
  |  |  ------------------
  ------------------
  300|   329k|            }
  301|  20.5k|        }
  302|   242k|        pi2_src++;
  303|   242k|        pu2_dst += 2;
  304|   242k|        pu2_pred += 2;
  305|   242k|        zero_cols = zero_cols >> 1;
  306|   242k|    }
  307|  15.1k|}
ihevc_hbd_chroma_recon_nxn_ccp:
  452|  27.3k|{
  453|  27.3k|    WORD32 i, j;
  454|  27.3k|    WORD32 clip_limit = (1 << bit_depth) - 1;
  455|       |
  456|   183k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (456:16): [True: 156k, False: 27.3k]
  ------------------
  457|   156k|    {
  458|  1.42M|        for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (458:20): [True: 1.26M, False: 156k]
  ------------------
  459|  1.26M|        {
  460|  1.26M|            WORD32 res = (alpha * pi2_luma_res[j]) >> 3;
  461|  1.26M|            pu2_dst[j * 2] = CLIP3((pu2_pred[j * 2] + pi2_chroma_res[j] + res), 0, clip_limit);
  ------------------
  |  |   40|  1.26M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.8k, False: 1.24M]
  |  |  |  Branch (40:53): [True: 16.5k, False: 1.23M]
  |  |  ------------------
  ------------------
  462|  1.26M|        }
  463|   156k|        pi2_luma_res += luma_res_strd;
  464|   156k|        pi2_chroma_res += chroma_res_strd;
  465|   156k|        pu2_dst += dst_strd;
  466|   156k|        pu2_pred += pred_strd;
  467|   156k|    }
  468|  27.3k|}

ihevc_hbd_deblk_luma_vert:
  114|  28.0M|{
  115|  28.0M|    WORD32 qp_luma, beta_indx, tc_indx;
  116|  28.0M|    WORD32 beta, tc;
  117|  28.0M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  118|  28.0M|    WORD32 d_sam0, d_sam3;
  119|  28.0M|    WORD32 de, dep, deq;
  120|  28.0M|    WORD32 row;
  121|  28.0M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  122|  28.0M|    WORD32 delta, delta_p, delta_q;
  123|       |
  124|  28.0M|    ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  28.0M|#define ASSERT(x) {}
  ------------------
  125|  28.0M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  28.0M|#define ASSERT(x) {}
  ------------------
  126|       |
  127|  28.0M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  128|  28.0M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  28.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 7.60k, False: 28.0M]
  |  |  |  Branch (40:53): [True: 74.7k, False: 27.9M]
  |  |  ------------------
  ------------------
  129|       |
  130|       |    /* BS based on implementation can take value 3 if it is intra/inter egde          */
  131|       |    /* based on BS, tc index is calcuated by adding 2 * ( bs - 1) to QP and tc_offset */
  132|       |    /* for BS = 1 adding factor is (0*2), BS = 2 or 3 adding factor is (1*2)          */
  133|       |    /* the above desired functionallity is achieved by doing (2*(bs>>1))              */
  134|       |
  135|  28.0M|    tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  28.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.63k, False: 28.0M]
  |  |  |  Branch (40:53): [True: 70.3k, False: 27.9M]
  |  |  ------------------
  ------------------
  136|       |
  137|  28.0M|    beta = gai4_ihevc_beta_table[beta_indx] * (1 << (bit_depth - 8));
  138|  28.0M|    tc = gai4_ihevc_tc_table[tc_indx] * (1 << (bit_depth - 8));
  139|  28.0M|    if(0 == tc)
  ------------------
  |  Branch (139:8): [True: 252k, False: 27.7M]
  ------------------
  140|   252k|    {
  141|   252k|        return;
  142|   252k|    }
  143|       |
  144|  27.7M|    dq0 = ABS(pu2_src[2] - 2 * pu2_src[1] + pu2_src[0]);
  ------------------
  |  |   45|  27.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.31M, False: 23.4M]
  |  |  ------------------
  ------------------
  145|  27.7M|    dq3 = ABS(pu2_src[3 * src_strd + 2] - 2 * pu2_src[3 * src_strd + 1]
  ------------------
  |  |   45|  27.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.19M, False: 23.5M]
  |  |  ------------------
  ------------------
  146|  27.7M|                    + pu2_src[3 * src_strd + 0]);
  147|  27.7M|    dp0 = ABS(pu2_src[-3] - 2 * pu2_src[-2] + pu2_src[-1]);
  ------------------
  |  |   45|  27.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.24M, False: 23.5M]
  |  |  ------------------
  ------------------
  148|  27.7M|    dp3 = ABS(pu2_src[3 * src_strd - 3] - 2 * pu2_src[3 * src_strd - 2]
  ------------------
  |  |   45|  27.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.13M, False: 23.6M]
  |  |  ------------------
  ------------------
  149|  27.7M|                    + pu2_src[3 * src_strd - 1]);
  150|       |
  151|  27.7M|    d0 = dp0 + dq0;
  152|  27.7M|    d3 = dp3 + dq3;
  153|       |
  154|  27.7M|    dp = dp0 + dp3;
  155|  27.7M|    dq = dq0 + dq3;
  156|       |
  157|  27.7M|    d = d0 + d3;
  158|       |
  159|  27.7M|    de = 0;
  160|  27.7M|    dep = 0;
  161|  27.7M|    deq = 0;
  162|       |
  163|  27.7M|    if(d < beta)
  ------------------
  |  Branch (163:8): [True: 26.8M, False: 887k]
  ------------------
  164|  26.8M|    {
  165|  26.8M|        d_sam0 = 0;
  166|  26.8M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (166:12): [True: 26.2M, False: 630k]
  ------------------
  167|  26.2M|                        && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  26.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.58M, False: 21.6M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  26.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.77M, False: 21.4M]
  |  |  ------------------
  ------------------
  |  Branch (167:28): [True: 23.3M, False: 2.92M]
  ------------------
  168|  26.2M|                                        < (beta >> 3))
  169|  23.2M|                        && ABS(pu2_src[0] - pu2_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  23.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.67M, False: 20.6M]
  |  |  ------------------
  ------------------
  |  Branch (169:28): [True: 23.2M, False: 84.3k]
  ------------------
  170|  23.2M|        {
  171|  23.2M|            d_sam0 = 1;
  172|  23.2M|        }
  173|       |
  174|  26.8M|        pu2_src += 3 * src_strd;
  175|  26.8M|        d_sam3 = 0;
  176|  26.8M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (176:12): [True: 26.1M, False: 793k]
  ------------------
  177|  26.1M|                        && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  26.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.54M, False: 21.5M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu2_src[3] - pu2_src[0]) + ABS(pu2_src[-1] - pu2_src[-4])
  ------------------
  |  |   45|  26.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.68M, False: 21.4M]
  |  |  ------------------
  ------------------
  |  Branch (177:28): [True: 23.3M, False: 2.79M]
  ------------------
  178|  26.1M|                                        < (beta >> 3))
  179|  23.2M|                        && ABS(pu2_src[0] - pu2_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  23.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.62M, False: 20.6M]
  |  |  ------------------
  ------------------
  |  Branch (179:28): [True: 23.2M, False: 356]
  ------------------
  180|  23.5M|        {
  181|  23.5M|            d_sam3 = 1;
  182|  23.5M|        }
  183|  26.8M|        pu2_src -= 3 * src_strd;
  184|       |
  185|  26.8M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (185:15): [True: 23.4M, False: 3.47M]
  |  Branch (185:30): [True: 22.9M, False: 432k]
  ------------------
  186|  26.8M|        dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (186:15): [True: 26.7M, False: 150k]
  ------------------
  187|  26.8M|        deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (187:15): [True: 26.2M, False: 653k]
  ------------------
  188|  26.8M|        if(tc <= 1)
  ------------------
  |  Branch (188:12): [True: 0, False: 26.8M]
  ------------------
  189|      0|        {
  190|      0|            dep = 0;
  191|      0|            deq = 0;
  192|      0|        }
  193|  26.8M|    }
  194|       |
  195|  27.7M|    if(de != 0)
  ------------------
  |  Branch (195:8): [True: 27.0M, False: 744k]
  ------------------
  196|  27.0M|    {
  197|   128M|        for(row = 0; row < 4; row++)
  ------------------
  |  Branch (197:22): [True: 101M, False: 27.0M]
  ------------------
  198|   101M|        {
  199|   101M|            tmp_p0 = pu2_src[-1];
  200|   101M|            tmp_p1 = pu2_src[-2];
  201|   101M|            tmp_p2 = pu2_src[-3];
  202|       |
  203|   101M|            tmp_q0 = pu2_src[0];
  204|   101M|            tmp_q1 = pu2_src[1];
  205|   101M|            tmp_q2 = pu2_src[2];
  206|       |
  207|   101M|            if(de == 2)
  ------------------
  |  Branch (207:16): [True: 86.0M, False: 15.3M]
  ------------------
  208|  86.0M|            {
  209|  86.0M|                tmp_q0 = CLIP3((pu2_src[2] + 2 * pu2_src[1] +
  ------------------
  |  |   40|  86.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 675, False: 86.0M]
  |  |  |  Branch (40:53): [True: 2.12k, False: 86.0M]
  |  |  ------------------
  ------------------
  210|  86.0M|                                2 * pu2_src[0] + 2 * pu2_src[-1] +
  211|  86.0M|                                pu2_src[-2] + 4) >> 3,
  212|  86.0M|                                pu2_src[0] - 2 * tc,
  213|  86.0M|                                pu2_src[0] + 2 * tc);
  214|       |
  215|  86.0M|                tmp_q1 = CLIP3((pu2_src[2] + pu2_src[1] + pu2_src[0] +
  ------------------
  |  |   40|  86.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.82k, False: 86.0M]
  |  |  |  Branch (40:53): [True: 811, False: 86.0M]
  |  |  ------------------
  ------------------
  216|  86.0M|                                pu2_src[-1] + 2) >> 2,
  217|  86.0M|                                pu2_src[1] - 2 * tc,
  218|  86.0M|                                pu2_src[1] + 2 * tc);
  219|       |
  220|  86.0M|                tmp_q2 = CLIP3((2 * pu2_src[3] + 3 * pu2_src[2] +
  ------------------
  |  |   40|  86.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 898, False: 86.0M]
  |  |  |  Branch (40:53): [True: 1.05k, False: 86.0M]
  |  |  ------------------
  ------------------
  221|  86.0M|                                pu2_src[1] + pu2_src[0] +
  222|  86.0M|                                pu2_src[-1] + 4) >> 3,
  223|  86.0M|                                pu2_src[2] - 2 * tc,
  224|  86.0M|                                pu2_src[2] + 2 * tc);
  225|       |
  226|  86.0M|                tmp_p0 = CLIP3((pu2_src[1] + 2 * pu2_src[0] +
  ------------------
  |  |   40|  86.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.09k, False: 86.0M]
  |  |  |  Branch (40:53): [True: 1.31k, False: 86.0M]
  |  |  ------------------
  ------------------
  227|  86.0M|                                2 * pu2_src[-1] + 2 * pu2_src[-2] +
  228|  86.0M|                                pu2_src[-3] + 4) >> 3,
  229|  86.0M|                                pu2_src[-1] - 2 * tc,
  230|  86.0M|                                pu2_src[-1] + 2 * tc);
  231|       |
  232|  86.0M|                tmp_p1 = CLIP3((pu2_src[0] + pu2_src[-1] +
  ------------------
  |  |   40|  86.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.08k, False: 86.0M]
  |  |  |  Branch (40:53): [True: 1.43k, False: 86.0M]
  |  |  ------------------
  ------------------
  233|  86.0M|                                pu2_src[-2] + pu2_src[-3] + 2) >> 2,
  234|  86.0M|                                pu2_src[-2] - 2 * tc,
  235|  86.0M|                                pu2_src[-2] + 2 * tc);
  236|       |
  237|  86.0M|                tmp_p2 = CLIP3((pu2_src[0] + pu2_src[-1] +
  ------------------
  |  |   40|  86.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.79k, False: 86.0M]
  |  |  |  Branch (40:53): [True: 732, False: 86.0M]
  |  |  ------------------
  ------------------
  238|  86.0M|                                pu2_src[-2] + 3 * pu2_src[-3] +
  239|  86.0M|                                2 * pu2_src[-4] + 4) >> 3,
  240|  86.0M|                                pu2_src[-3] - 2 * tc,
  241|  86.0M|                                pu2_src[-3] + 2 * tc);
  242|  86.0M|            }
  243|  15.3M|            else
  244|  15.3M|            {
  245|  15.3M|                delta = (9 * (pu2_src[0] - pu2_src[-1]) -
  246|  15.3M|                                3 * (pu2_src[1] - pu2_src[-2]) + 8) >> 4;
  247|  15.3M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  15.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 5.42M, False: 9.96M]
  |  |  ------------------
  ------------------
  |  Branch (247:20): [True: 22.6M, False: 18.4E]
  ------------------
  248|  22.6M|                {
  249|  22.6M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  22.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 663k, False: 21.9M]
  |  |  |  Branch (40:53): [True: 555k, False: 21.3M]
  |  |  ------------------
  ------------------
  250|       |
  251|  22.6M|                    tmp_p0 = CLIP3(pu2_src[-1] + delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  22.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 89.2k, False: 22.5M]
  |  |  |  Branch (40:53): [True: 8.88k, False: 22.5M]
  |  |  ------------------
  ------------------
  252|  22.6M|                    tmp_q0 = CLIP3(pu2_src[0] - delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  22.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 108k, False: 22.4M]
  |  |  |  Branch (40:53): [True: 9.03k, False: 22.4M]
  |  |  ------------------
  ------------------
  253|  22.6M|                    if(dep == 1)
  ------------------
  |  Branch (253:24): [True: 20.7M, False: 1.81M]
  ------------------
  254|  20.7M|                    {
  255|  20.7M|                        delta_p = CLIP3((((pu2_src[-3] + pu2_src[-1] + 1) >> 1)
  ------------------
  |  |   40|  20.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 97.7k, False: 20.6M]
  |  |  |  Branch (40:53): [True: 103k, False: 20.5M]
  |  |  ------------------
  ------------------
  256|  20.7M|                                        - pu2_src[-2] + delta) >> 1,
  257|  20.7M|                                        -(tc >> 1),
  258|  20.7M|                                        (tc >> 1));
  259|  20.7M|                        tmp_p1 = CLIP3(pu2_src[-2] + delta_p, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  20.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 35.3k, False: 20.7M]
  |  |  |  Branch (40:53): [True: 6.70k, False: 20.7M]
  |  |  ------------------
  ------------------
  260|  20.7M|                    }
  261|       |
  262|  22.6M|                    if(deq == 1)
  ------------------
  |  Branch (262:24): [True: 19.6M, False: 2.98M]
  ------------------
  263|  19.6M|                    {
  264|  19.6M|                        delta_q = CLIP3((((pu2_src[2] + pu2_src[0] + 1) >> 1)
  ------------------
  |  |   40|  19.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 114k, False: 19.5M]
  |  |  |  Branch (40:53): [True: 151k, False: 19.3M]
  |  |  ------------------
  ------------------
  265|  19.6M|                                        - pu2_src[1] - delta) >> 1,
  266|  19.6M|                                        -(tc >> 1),
  267|  19.6M|                                        (tc >> 1));
  268|  19.6M|                        tmp_q1 = CLIP3(pu2_src[1] + delta_q, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  19.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 41.1k, False: 19.5M]
  |  |  |  Branch (40:53): [True: 5.70k, False: 19.5M]
  |  |  ------------------
  ------------------
  269|  19.6M|                    }
  270|  22.6M|                }
  271|  15.3M|            }
  272|       |
  273|   101M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (273:16): [True: 100M, False: 674k]
  ------------------
  274|   100M|            {
  275|   100M|                pu2_src[-3] = tmp_p2;
  276|   100M|                pu2_src[-2] = tmp_p1;
  277|   100M|                pu2_src[-1] = tmp_p0;
  278|   100M|            }
  279|       |
  280|   101M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (280:16): [True: 100M, False: 636k]
  ------------------
  281|   100M|            {
  282|   100M|                pu2_src[0] = tmp_q0;
  283|   100M|                pu2_src[1] = tmp_q1;
  284|   100M|                pu2_src[2] = tmp_q2;
  285|   100M|            }
  286|       |
  287|   101M|            pu2_src += src_strd;
  288|   101M|        }
  289|  27.0M|    }
  290|  27.7M|}
ihevc_hbd_deblk_luma_horz:
  349|  28.0M|{
  350|  28.0M|    WORD32 qp_luma, beta_indx, tc_indx;
  351|  28.0M|    WORD32 beta, tc;
  352|  28.0M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  353|  28.0M|    WORD32 d_sam0, d_sam3;
  354|  28.0M|    WORD32 de, dep, deq;
  355|  28.0M|    WORD32 col;
  356|  28.0M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  357|  28.0M|    WORD32 delta, delta_p, delta_q;
  358|       |
  359|  28.0M|    ASSERT((bs > 0));
  ------------------
  |  |   55|  28.0M|#define ASSERT(x) {}
  ------------------
  360|  28.0M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  28.0M|#define ASSERT(x) {}
  ------------------
  361|       |
  362|  28.0M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  363|  28.0M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  28.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 8.02k, False: 28.0M]
  |  |  |  Branch (40:53): [True: 82.4k, False: 27.9M]
  |  |  ------------------
  ------------------
  364|       |
  365|       |    /* BS based on implementation can take value 3 if it is intra/inter egde          */
  366|       |    /* based on BS, tc index is calcuated by adding 2 * ( bs - 1) to QP and tc_offset */
  367|       |    /* for BS = 1 adding factor is (0*2), BS = 2 or 3 adding factor is (1*2)          */
  368|       |    /* the above desired functionallity is achieved by doing (2*(bs>>1))              */
  369|       |
  370|  28.0M|    tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  28.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.87k, False: 28.0M]
  |  |  |  Branch (40:53): [True: 78.9k, False: 27.9M]
  |  |  ------------------
  ------------------
  371|       |
  372|  28.0M|    beta = gai4_ihevc_beta_table[beta_indx] * (1 << (bit_depth - 8));
  373|  28.0M|    tc = gai4_ihevc_tc_table[tc_indx] * (1 << (bit_depth - 8));
  374|  28.0M|    if(0 == tc)
  ------------------
  |  Branch (374:8): [True: 594k, False: 27.4M]
  ------------------
  375|   594k|    {
  376|   594k|        return;
  377|   594k|    }
  378|       |
  379|  27.4M|    dq0 = ABS(pu2_src[2 * src_strd] - 2 * pu2_src[1 * src_strd] +
  ------------------
  |  |   45|  27.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.24M, False: 23.2M]
  |  |  ------------------
  ------------------
  380|  27.4M|                    pu2_src[0 * src_strd]);
  381|       |
  382|  27.4M|    dq3 = ABS(pu2_src[3 + 2 * src_strd] - 2 * pu2_src[3 + 1 * src_strd] +
  ------------------
  |  |   45|  27.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.23M, False: 23.2M]
  |  |  ------------------
  ------------------
  383|  27.4M|                    pu2_src[3 + 0 * src_strd]);
  384|       |
  385|  27.4M|    dp0 = ABS(pu2_src[-3 * src_strd] - 2 * pu2_src[-2 * src_strd] +
  ------------------
  |  |   45|  27.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.59M, False: 22.8M]
  |  |  ------------------
  ------------------
  386|  27.4M|                    pu2_src[-1 * src_strd]);
  387|       |
  388|  27.4M|    dp3 = ABS(pu2_src[3 - 3 * src_strd] - 2 * pu2_src[3 - 2 * src_strd] +
  ------------------
  |  |   45|  27.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.61M, False: 22.8M]
  |  |  ------------------
  ------------------
  389|  27.4M|                    pu2_src[3 - 1 * src_strd]);
  390|       |
  391|  27.4M|    d0 = dp0 + dq0;
  392|  27.4M|    d3 = dp3 + dq3;
  393|       |
  394|  27.4M|    dp = dp0 + dp3;
  395|  27.4M|    dq = dq0 + dq3;
  396|       |
  397|  27.4M|    d = d0 + d3;
  398|       |
  399|  27.4M|    de = 0;
  400|  27.4M|    dep = 0;
  401|  27.4M|    deq = 0;
  402|       |
  403|  27.4M|    if(d < beta)
  ------------------
  |  Branch (403:8): [True: 26.2M, False: 1.16M]
  ------------------
  404|  26.2M|    {
  405|  26.2M|        d_sam0 = 0;
  406|  26.2M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (406:12): [True: 25.2M, False: 996k]
  ------------------
  407|  25.2M|                        && (ABS(pu2_src[3 * src_strd] - pu2_src[0 * src_strd]) +
  ------------------
  |  |   45|  25.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.60M, False: 21.6M]
  |  |  ------------------
  ------------------
  |  Branch (407:28): [True: 22.1M, False: 3.09M]
  ------------------
  408|  25.2M|                                        ABS(pu2_src[-1 * src_strd] - pu2_src[-4 * src_strd])
  ------------------
  |  |   45|  25.2M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.18M, False: 21.0M]
  |  |  ------------------
  ------------------
  409|  25.2M|                                        < (beta >> 3))
  410|  22.3M|                        && ABS(pu2_src[0 * src_strd] - pu2_src[-1 * src_strd])
  ------------------
  |  |   45|  22.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.07M, False: 20.2M]
  |  |  ------------------
  ------------------
  |  Branch (410:28): [True: 22.2M, False: 76.8k]
  ------------------
  411|  22.3M|                        < ((5 * tc + 1) >> 1))
  412|  22.2M|        {
  413|  22.2M|            d_sam0 = 1;
  414|  22.2M|        }
  415|       |
  416|  26.2M|        pu2_src += 3;
  417|  26.2M|        d_sam3 = 0;
  418|  26.2M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (418:12): [True: 25.5M, False: 720k]
  ------------------
  419|  25.5M|                        && (ABS(pu2_src[3 * src_strd] - pu2_src[0 * src_strd]) +
  ------------------
  |  |   45|  25.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.63M, False: 21.9M]
  |  |  ------------------
  ------------------
  |  Branch (419:28): [True: 22.4M, False: 3.11M]
  ------------------
  420|  25.5M|                                        ABS(pu2_src[-1 * src_strd] - pu2_src[-4 * src_strd])
  ------------------
  |  |   45|  25.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.21M, False: 21.3M]
  |  |  ------------------
  ------------------
  421|  25.5M|                                        < (beta >> 3))
  422|  22.4M|                        && ABS(pu2_src[0 * src_strd] - pu2_src[-1 * src_strd])
  ------------------
  |  |   45|  22.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.07M, False: 20.4M]
  |  |  ------------------
  ------------------
  |  Branch (422:28): [True: 22.3M, False: 111k]
  ------------------
  423|  22.4M|                        < ((5 * tc + 1) >> 1))
  424|  22.3M|        {
  425|  22.3M|            d_sam3 = 1;
  426|  22.3M|        }
  427|  26.2M|        pu2_src -= 3;
  428|       |
  429|  26.2M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (429:15): [True: 22.3M, False: 3.93M]
  |  Branch (429:30): [True: 22.0M, False: 325k]
  ------------------
  430|  18.4E|        dep = (dp < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (430:15): [True: 26.6M, False: 18.4E]
  ------------------
  431|  18.4E|        deq = (dq < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (431:15): [True: 26.6M, False: 18.4E]
  ------------------
  432|  26.2M|        if(tc <= 1)
  ------------------
  |  Branch (432:12): [True: 0, False: 26.2M]
  ------------------
  433|      0|        {
  434|      0|            dep = 0;
  435|      0|            deq = 0;
  436|      0|        }
  437|  26.2M|    }
  438|       |
  439|  27.4M|    if(de != 0)
  ------------------
  |  Branch (439:8): [True: 27.9M, False: 18.4E]
  ------------------
  440|  27.9M|    {
  441|   131M|        for(col = 0; col < 4; col++)
  ------------------
  |  Branch (441:22): [True: 103M, False: 27.9M]
  ------------------
  442|   103M|        {
  443|   103M|            tmp_p0 = pu2_src[-1 * src_strd];
  444|   103M|            tmp_p1 = pu2_src[-2 * src_strd];
  445|   103M|            tmp_p2 = pu2_src[-3 * src_strd];
  446|       |
  447|   103M|            tmp_q0 = pu2_src[0 * src_strd];
  448|   103M|            tmp_q1 = pu2_src[1 * src_strd];
  449|   103M|            tmp_q2 = pu2_src[2 * src_strd];
  450|   103M|            if(de == 2)
  ------------------
  |  Branch (450:16): [True: 85.8M, False: 17.1M]
  ------------------
  451|  85.8M|            {
  452|  85.8M|                tmp_q0 = CLIP3((pu2_src[2 * src_strd] +
  ------------------
  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.31k, False: 85.8M]
  |  |  |  Branch (40:53): [True: 1.26k, False: 85.8M]
  |  |  ------------------
  ------------------
  453|  85.8M|                                2 * pu2_src[1 * src_strd] +
  454|  85.8M|                                2 * pu2_src[0 * src_strd] +
  455|  85.8M|                                2 * pu2_src[-1 * src_strd] +
  456|  85.8M|                                pu2_src[-2 * src_strd] + 4) >> 3,
  457|  85.8M|                                pu2_src[0 * src_strd] - 2 * tc,
  458|  85.8M|                                pu2_src[0 * src_strd] + 2 * tc);
  459|       |
  460|  85.8M|                tmp_q1 = CLIP3((pu2_src[2 * src_strd] +
  ------------------
  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 490, False: 85.8M]
  |  |  |  Branch (40:53): [True: 1.47k, False: 85.8M]
  |  |  ------------------
  ------------------
  461|  85.8M|                                pu2_src[1 * src_strd] +
  462|  85.8M|                                pu2_src[0 * src_strd] +
  463|  85.8M|                                pu2_src[-1 * src_strd] + 2) >> 2,
  464|  85.8M|                                pu2_src[1 * src_strd] - 2 * tc,
  465|  85.8M|                                pu2_src[1 * src_strd] + 2 * tc);
  466|       |
  467|  85.8M|                tmp_q2 = CLIP3((2 * pu2_src[3 * src_strd] +
  ------------------
  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.13k, False: 85.8M]
  |  |  |  Branch (40:53): [True: 816, False: 85.8M]
  |  |  ------------------
  ------------------
  468|  85.8M|                                3 * pu2_src[2 * src_strd] +
  469|  85.8M|                                pu2_src[1 * src_strd] +
  470|  85.8M|                                pu2_src[0 * src_strd] +
  471|  85.8M|                                pu2_src[-1 * src_strd] + 4) >> 3,
  472|  85.8M|                                pu2_src[2 * src_strd] - 2 * tc,
  473|  85.8M|                                pu2_src[2 * src_strd] + 2 * tc);
  474|       |
  475|  85.8M|                tmp_p0 = CLIP3((pu2_src[1 * src_strd] +
  ------------------
  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.04k, False: 85.8M]
  |  |  |  Branch (40:53): [True: 1.14k, False: 85.8M]
  |  |  ------------------
  ------------------
  476|  85.8M|                                2 * pu2_src[0 * src_strd] +
  477|  85.8M|                                2 * pu2_src[-1 * src_strd] +
  478|  85.8M|                                2 * pu2_src[-2 * src_strd] +
  479|  85.8M|                                pu2_src[-3 * src_strd] + 4) >> 3,
  480|  85.8M|                                pu2_src[-1 * src_strd] - 2 * tc,
  481|  85.8M|                                pu2_src[-1 * src_strd] + 2 * tc);
  482|       |
  483|  85.8M|                tmp_p1 = CLIP3((pu2_src[0 * src_strd] +
  ------------------
  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.70k, False: 85.8M]
  |  |  |  Branch (40:53): [True: 730, False: 85.8M]
  |  |  ------------------
  ------------------
  484|  85.8M|                                pu2_src[-1 * src_strd] +
  485|  85.8M|                                pu2_src[-2 * src_strd] +
  486|  85.8M|                                pu2_src[-3 * src_strd] + 2) >> 2,
  487|  85.8M|                                pu2_src[-2 * src_strd] - 2 * tc,
  488|  85.8M|                                pu2_src[-2 * src_strd] + 2 * tc);
  489|       |
  490|  85.8M|                tmp_p2 = CLIP3((pu2_src[0 * src_strd] +
  ------------------
  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 622, False: 85.8M]
  |  |  |  Branch (40:53): [True: 1.29k, False: 85.8M]
  |  |  ------------------
  ------------------
  491|  85.8M|                                pu2_src[-1 * src_strd] +
  492|  85.8M|                                pu2_src[-2 * src_strd] +
  493|  85.8M|                                3 * pu2_src[-3 * src_strd] +
  494|  85.8M|                                2 * pu2_src[-4 * src_strd] + 4) >> 3,
  495|  85.8M|                                pu2_src[-3 * src_strd] - 2 * tc,
  496|  85.8M|                                pu2_src[-3 * src_strd] + 2 * tc);
  497|  85.8M|            }
  498|  17.1M|            else
  499|  17.1M|            {
  500|  17.1M|                delta = (9 * (pu2_src[0 * src_strd] - pu2_src[-1 * src_strd]) -
  501|  17.1M|                                3 * (pu2_src[1 * src_strd] - pu2_src[-2 * src_strd]) +
  502|  17.1M|                                8) >> 4;
  503|  17.1M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|  17.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 7.14M, False: 10.0M]
  |  |  ------------------
  ------------------
  |  Branch (503:20): [True: 25.0M, False: 18.4E]
  ------------------
  504|  25.0M|                {
  505|  25.0M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|  25.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.20M, False: 23.8M]
  |  |  |  Branch (40:53): [True: 1.30M, False: 22.5M]
  |  |  ------------------
  ------------------
  506|  25.0M|                    tmp_p0 = CLIP3(pu2_src[-1 * src_strd] + delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  25.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 118k, False: 24.9M]
  |  |  |  Branch (40:53): [True: 8.05k, False: 24.9M]
  |  |  ------------------
  ------------------
  507|  25.0M|                    tmp_q0 = CLIP3(pu2_src[0 * src_strd] - delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  25.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 151k, False: 24.8M]
  |  |  |  Branch (40:53): [True: 10.0k, False: 24.8M]
  |  |  ------------------
  ------------------
  508|  25.0M|                    if(dep == 1)
  ------------------
  |  Branch (508:24): [True: 22.3M, False: 2.69M]
  ------------------
  509|  22.3M|                    {
  510|  22.3M|                        delta_p = CLIP3((((pu2_src[-3 * src_strd] +
  ------------------
  |  |   40|  22.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 138k, False: 22.1M]
  |  |  |  Branch (40:53): [True: 320k, False: 21.8M]
  |  |  ------------------
  ------------------
  511|  22.3M|                                        pu2_src[-1 * src_strd] + 1) >> 1) -
  512|  22.3M|                                        pu2_src[-2 * src_strd] + delta) >> 1,
  513|  22.3M|                                        -(tc >> 1),
  514|  22.3M|                                        (tc >> 1));
  515|  22.3M|                        tmp_p1 = CLIP3(pu2_src[-2 * src_strd] + delta_p, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  22.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 52.2k, False: 22.2M]
  |  |  |  Branch (40:53): [True: 6.03k, False: 22.2M]
  |  |  ------------------
  ------------------
  516|  22.3M|                    }
  517|       |
  518|  25.0M|                    if(deq == 1)
  ------------------
  |  Branch (518:24): [True: 20.8M, False: 4.13M]
  ------------------
  519|  20.8M|                    {
  520|  20.8M|                        delta_q = CLIP3((((pu2_src[2 * src_strd] +
  ------------------
  |  |   40|  20.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 129k, False: 20.7M]
  |  |  |  Branch (40:53): [True: 180k, False: 20.5M]
  |  |  ------------------
  ------------------
  521|  20.8M|                                        pu2_src[0 * src_strd] + 1) >> 1) -
  522|  20.8M|                                        pu2_src[1 * src_strd] - delta) >> 1,
  523|  20.8M|                                        -(tc >> 1),
  524|  20.8M|                                        (tc >> 1));
  525|  20.8M|                        tmp_q1 = CLIP3(pu2_src[1 * src_strd] + delta_q, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  20.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 56.1k, False: 20.8M]
  |  |  |  Branch (40:53): [True: 7.64k, False: 20.8M]
  |  |  ------------------
  ------------------
  526|  20.8M|                    }
  527|  25.0M|                }
  528|  17.1M|            }
  529|       |
  530|   103M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (530:16): [True: 102M, False: 694k]
  ------------------
  531|   102M|            {
  532|   102M|                pu2_src[-3 * src_strd] = tmp_p2;
  533|   102M|                pu2_src[-2 * src_strd] = tmp_p1;
  534|   102M|                pu2_src[-1 * src_strd] = tmp_p0;
  535|   102M|            }
  536|       |
  537|   103M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (537:16): [True: 102M, False: 230k]
  ------------------
  538|   102M|            {
  539|   102M|                pu2_src[0 * src_strd] = tmp_q0;
  540|   102M|                pu2_src[1 * src_strd] = tmp_q1;
  541|   102M|                pu2_src[2 * src_strd] = tmp_q2;
  542|   102M|            }
  543|       |
  544|   103M|            pu2_src += 1;
  545|   103M|        }
  546|  27.9M|    }
  547|  27.4M|}
ihevc_hbd_deblk_chroma_vert:
  606|  18.0M|{
  607|  18.0M|    WORD32 qp_indx_u, qp_chroma_u;
  608|  18.0M|    WORD32 qp_indx_v, qp_chroma_v;
  609|  18.0M|    WORD32 tc_indx_u, tc_u;
  610|  18.0M|    WORD32 tc_indx_v, tc_v;
  611|  18.0M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  612|  18.0M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  613|  18.0M|    WORD32 row;
  614|       |
  615|  18.0M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  18.0M|#define ASSERT(x) {}
  ------------------
  616|       |
  617|       |    /* chroma processing is done only if BS is 2             */
  618|       |    /* this function is assumed to be called only if BS is 2 */
  619|  18.0M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  620|  18.0M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  621|       |
  622|       |    /* 8.7.2.5.5 Filtering process for chroma block edges */
  623|  18.0M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (623:8): [True: 18.4E, False: 18.0M]
  |  Branch (623:51): [True: 17.1M, False: 865k]
  ------------------
  624|  17.1M|    {
  625|  17.1M|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  17.1M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 7.73M, False: 9.44M]
  |  |  ------------------
  ------------------
  626|  17.1M|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  17.1M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 11.4M, False: 5.72M]
  |  |  ------------------
  ------------------
  627|  17.1M|    }
  628|   862k|    else
  629|   862k|    {
  630|   862k|        qp_chroma_u = qp_indx_u < 0 ? qp_indx_u : (qp_indx_u > 57 ? qp_indx_u - 6 : gai4_ihevc_qp_table[qp_indx_u]);
  ------------------
  |  Branch (630:23): [True: 10.8k, False: 851k]
  |  Branch (630:52): [True: 3.06k, False: 848k]
  ------------------
  631|   862k|        qp_chroma_v = qp_indx_v < 0 ? qp_indx_v : (qp_indx_v > 57 ? qp_indx_v - 6 : gai4_ihevc_qp_table[qp_indx_v]);
  ------------------
  |  Branch (631:23): [True: 7.00k, False: 855k]
  |  Branch (631:52): [True: 5.13k, False: 850k]
  ------------------
  632|   862k|    }
  633|       |
  634|  18.0M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  18.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.07k, False: 18.0M]
  |  |  |  Branch (40:53): [True: 13.9k, False: 18.0M]
  |  |  ------------------
  ------------------
  635|  18.0M|    tc_u = gai4_ihevc_tc_table[tc_indx_u] * (1 << (bit_depth - 8));
  636|       |
  637|  18.0M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  18.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.13k, False: 18.0M]
  |  |  |  Branch (40:53): [True: 15.0k, False: 18.0M]
  |  |  ------------------
  ------------------
  638|  18.0M|    tc_v = gai4_ihevc_tc_table[tc_indx_v] * (1 << (bit_depth - 8));
  639|       |
  640|  18.0M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (640:8): [True: 124k, False: 17.9M]
  |  Branch (640:21): [True: 123k, False: 1.03k]
  ------------------
  641|   123k|    {
  642|   123k|        return;
  643|   123k|    }
  644|       |
  645|  89.5M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (645:18): [True: 71.5M, False: 17.9M]
  ------------------
  646|  71.5M|    {
  647|  71.5M|        delta_u = CLIP3((((pu2_src[0] - pu2_src[-2]) << 2) +
  ------------------
  |  |   40|  71.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 436k, False: 71.1M]
  |  |  |  Branch (40:53): [True: 325k, False: 70.8M]
  |  |  ------------------
  ------------------
  648|  71.5M|                        pu2_src[-4] - pu2_src[2] + 4) >> 3,
  649|  71.5M|                        -tc_u, tc_u);
  650|  71.5M|        tmp_p0_u = CLIP3(pu2_src[-2] + delta_u, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  71.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 135k, False: 71.4M]
  |  |  |  Branch (40:53): [True: 4.91k, False: 71.4M]
  |  |  ------------------
  ------------------
  651|  71.5M|        tmp_q0_u = CLIP3(pu2_src[0] - delta_u, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  71.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 148k, False: 71.4M]
  |  |  |  Branch (40:53): [True: 12.4k, False: 71.4M]
  |  |  ------------------
  ------------------
  652|       |
  653|  71.5M|        delta_v = CLIP3((((pu2_src[1] - pu2_src[-1]) << 2) +
  ------------------
  |  |   40|  71.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 976k, False: 70.6M]
  |  |  |  Branch (40:53): [True: 623k, False: 69.9M]
  |  |  ------------------
  ------------------
  654|  71.5M|                        pu2_src[-3] - pu2_src[3] + 4) >> 3,
  655|  71.5M|                        -tc_v, tc_v);
  656|  71.5M|        tmp_p0_v = CLIP3(pu2_src[-1] + delta_v, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  71.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 776k, False: 70.8M]
  |  |  |  Branch (40:53): [True: 17.3k, False: 70.7M]
  |  |  ------------------
  ------------------
  657|  71.5M|        tmp_q0_v = CLIP3(pu2_src[1] - delta_v, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|  71.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 919k, False: 70.6M]
  |  |  |  Branch (40:53): [True: 15.0k, False: 70.6M]
  |  |  ------------------
  ------------------
  658|  71.5M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (658:12): [True: 71.0M, False: 579k]
  ------------------
  659|  71.0M|        {
  660|  71.0M|            pu2_src[-2] = tmp_p0_u;
  661|  71.0M|            pu2_src[-1] = tmp_p0_v;
  662|  71.0M|        }
  663|       |
  664|  71.5M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (664:12): [True: 70.9M, False: 606k]
  ------------------
  665|  70.9M|        {
  666|  70.9M|            pu2_src[0] = tmp_q0_u;
  667|  70.9M|            pu2_src[1] = tmp_q0_v;
  668|  70.9M|        }
  669|       |
  670|  71.5M|        pu2_src += src_strd;
  671|  71.5M|    }
  672|  17.9M|}
ihevc_deblk_422chroma_vert:
  730|  1.23M|{
  731|  1.23M|    WORD32 qp_indx_u, qp_chroma_u;
  732|  1.23M|    WORD32 qp_indx_v, qp_chroma_v;
  733|  1.23M|    WORD32 tc_indx_u, tc_u;
  734|  1.23M|    WORD32 tc_indx_v, tc_v;
  735|  1.23M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  736|  1.23M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  737|  1.23M|    WORD32 row;
  738|       |
  739|  1.23M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  1.23M|#define ASSERT(x) {}
  ------------------
  740|       |
  741|       |    /* chroma processing is done only if BS is 2             */
  742|       |    /* this function is assumed to be called only if BS is 2 */
  743|  1.23M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  744|  1.23M|    qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  1.23M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.16M, False: 67.4k]
  |  |  ------------------
  ------------------
  745|       |
  746|  1.23M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  747|  1.23M|    qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  1.23M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.22M, False: 11.0k]
  |  |  ------------------
  ------------------
  748|       |
  749|  1.23M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.15k, False: 1.23M]
  |  |  |  Branch (40:53): [True: 926, False: 1.23M]
  |  |  ------------------
  ------------------
  750|  1.23M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  751|       |
  752|  1.23M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.23M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.15k, False: 1.23M]
  |  |  |  Branch (40:53): [True: 1.35k, False: 1.23M]
  |  |  ------------------
  ------------------
  753|  1.23M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  754|       |
  755|  1.23M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (755:8): [True: 56.8k, False: 1.17M]
  |  Branch (755:21): [True: 55.8k, False: 1.00k]
  ------------------
  756|  55.8k|    {
  757|  55.8k|        return;
  758|  55.8k|    }
  759|       |
  760|  5.89M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (760:18): [True: 4.71M, False: 1.18M]
  ------------------
  761|  4.71M|    {
  762|  4.71M|        delta_u = CLIP3((((pu1_src[0] - pu1_src[-2]) << 2) +
  ------------------
  |  |   40|  4.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 61.7k, False: 4.65M]
  |  |  |  Branch (40:53): [True: 46.1k, False: 4.60M]
  |  |  ------------------
  ------------------
  763|  4.71M|                        pu1_src[-4] - pu1_src[2] + 4) >> 3,
  764|  4.71M|                        -tc_u, tc_u);
  765|       |
  766|  4.71M|        tmp_p0_u = CLIP_U8(pu1_src[-2] + delta_u);
  ------------------
  |  |   40|  4.71M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.00k, False: 4.71M]
  |  |  |  |  |  Branch (40:53): [True: 481, False: 4.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|  4.71M|        tmp_q0_u = CLIP_U8(pu1_src[0] - delta_u);
  ------------------
  |  |   40|  4.71M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 842, False: 4.71M]
  |  |  |  |  |  Branch (40:53): [True: 1.25k, False: 4.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  768|       |
  769|  4.71M|        delta_v = CLIP3((((pu1_src[1] - pu1_src[-1]) << 2) +
  ------------------
  |  |   40|  4.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 50.8k, False: 4.66M]
  |  |  |  Branch (40:53): [True: 48.9k, False: 4.61M]
  |  |  ------------------
  ------------------
  770|  4.71M|                        pu1_src[-3] - pu1_src[3] + 4) >> 3,
  771|  4.71M|                        -tc_v, tc_v);
  772|       |
  773|  4.71M|        tmp_p0_v = CLIP_U8(pu1_src[-1] + delta_v);
  ------------------
  |  |   40|  4.71M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 363, False: 4.71M]
  |  |  |  |  |  Branch (40:53): [True: 724, False: 4.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|  4.71M|        tmp_q0_v = CLIP_U8(pu1_src[1] - delta_v);
  ------------------
  |  |   40|  4.71M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 951, False: 4.71M]
  |  |  |  |  |  Branch (40:53): [True: 1.07k, False: 4.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  775|       |
  776|  4.71M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (776:12): [True: 4.70M, False: 5.40k]
  ------------------
  777|  4.70M|        {
  778|  4.70M|            pu1_src[-2] = tmp_p0_u;
  779|  4.70M|            pu1_src[-1] = tmp_p0_v;
  780|  4.70M|        }
  781|       |
  782|  4.71M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (782:12): [True: 4.70M, False: 7.36k]
  ------------------
  783|  4.70M|        {
  784|  4.70M|            pu1_src[0] = tmp_q0_u;
  785|  4.70M|            pu1_src[1] = tmp_q0_v;
  786|  4.70M|        }
  787|       |
  788|  4.71M|        pu1_src += src_strd;
  789|  4.71M|    }
  790|  1.18M|}
ihevc_deblk_422chroma_horz:
  968|  1.12M|{
  969|  1.12M|    WORD32 qp_indx_u, qp_chroma_u;
  970|  1.12M|    WORD32 qp_indx_v, qp_chroma_v;
  971|  1.12M|    WORD32 tc_indx_u, tc_u;
  972|  1.12M|    WORD32 tc_indx_v, tc_v;
  973|  1.12M|    WORD32 tc;
  974|       |
  975|  1.12M|    WORD32 delta, tmp_p0, tmp_q0;
  976|  1.12M|    WORD32 col;
  977|       |
  978|  1.12M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  1.12M|#define ASSERT(x) {}
  ------------------
  979|       |
  980|       |    /* chroma processing is done only if BS is 2             */
  981|       |    /* this function is assumed to be called only if BS is 2 */
  982|  1.12M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  983|  1.12M|    qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  1.12M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.07M, False: 52.1k]
  |  |  ------------------
  ------------------
  984|       |
  985|  1.12M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  986|  1.12M|    qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  1.12M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.11M, False: 6.52k]
  |  |  ------------------
  ------------------
  987|       |
  988|  1.12M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.12M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.35k, False: 1.12M]
  |  |  |  Branch (40:53): [True: 853, False: 1.12M]
  |  |  ------------------
  ------------------
  989|  1.12M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  990|       |
  991|  1.12M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  1.12M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.33k, False: 1.12M]
  |  |  |  Branch (40:53): [True: 1.24k, False: 1.12M]
  |  |  ------------------
  ------------------
  992|  1.12M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  993|       |
  994|  1.12M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (994:8): [True: 41.9k, False: 1.08M]
  |  Branch (994:21): [True: 40.9k, False: 1.06k]
  ------------------
  995|  40.9k|    {
  996|  40.9k|        return;
  997|  40.9k|    }
  998|       |
  999|  9.67M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (999:18): [True: 8.59M, False: 1.08M]
  ------------------
 1000|  8.59M|    {
 1001|  8.59M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (1001:14): [True: 4.29M, False: 4.29M]
  ------------------
 1002|  8.59M|        delta = CLIP3((((pu1_src[0 * src_strd] -
  ------------------
  |  |   40|  8.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 94.3k, False: 8.49M]
  |  |  |  Branch (40:53): [True: 82.1k, False: 8.41M]
  |  |  ------------------
  ------------------
 1003|  8.59M|                      pu1_src[-1 * src_strd]) << 2) +
 1004|  8.59M|                      pu1_src[-2 * src_strd] -
 1005|  8.59M|                      pu1_src[1 * src_strd] + 4) >> 3,
 1006|  8.59M|                      -tc, tc);
 1007|       |
 1008|  8.59M|        tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|  8.59M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.68k, False: 8.59M]
  |  |  |  |  |  Branch (40:53): [True: 553, False: 8.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1009|  8.59M|        tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|  8.59M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 728, False: 8.59M]
  |  |  |  |  |  Branch (40:53): [True: 3.80k, False: 8.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1010|       |
 1011|  8.59M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (1011:12): [True: 8.57M, False: 13.3k]
  ------------------
 1012|  8.57M|        {
 1013|  8.57M|            pu1_src[-1 * src_strd] = tmp_p0;
 1014|  8.57M|        }
 1015|       |
 1016|  8.59M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (1016:12): [True: 8.58M, False: 6.33k]
  ------------------
 1017|  8.58M|        {
 1018|  8.58M|            pu1_src[0 * src_strd] = tmp_q0;
 1019|  8.58M|        }
 1020|       |
 1021|  8.59M|        pu1_src += 1;
 1022|  8.59M|    }
 1023|  1.08M|}
ihevc_hbd_deblk_chroma_horz:
 1083|  15.9M|{
 1084|  15.9M|    WORD32 qp_indx_u, qp_chroma_u;
 1085|  15.9M|    WORD32 qp_indx_v, qp_chroma_v;
 1086|  15.9M|    WORD32 tc_indx_u, tc_u;
 1087|  15.9M|    WORD32 tc_indx_v, tc_v;
 1088|  15.9M|    WORD32 tc;
 1089|       |
 1090|  15.9M|    WORD32 delta, tmp_p0, tmp_q0;
 1091|  15.9M|    WORD32 col;
 1092|       |
 1093|  15.9M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  15.9M|#define ASSERT(x) {}
  ------------------
 1094|       |
 1095|       |    /* chroma processing is done only if BS is 2             */
 1096|       |    /* this function is assumed to be called only if BS is 2 */
 1097|  15.9M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
 1098|  15.9M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
 1099|       |
 1100|       |    /* 8.7.2.5.5 Filtering process for chroma block edges */
 1101|  15.9M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1101:8): [True: 18.4E, False: 15.9M]
  |  Branch (1101:51): [True: 14.9M, False: 1.00M]
  ------------------
 1102|  14.9M|    {
 1103|  14.9M|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|  14.9M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 7.13M, False: 7.85M]
  |  |  ------------------
  ------------------
 1104|  14.9M|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|  14.9M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 10.4M, False: 4.50M]
  |  |  ------------------
  ------------------
 1105|  14.9M|    }
 1106|   980k|    else
 1107|   980k|    {
 1108|   980k|        qp_chroma_u = qp_indx_u < 0 ? qp_indx_u : (qp_indx_u > 57 ? qp_indx_u - 6 : gai4_ihevc_qp_table[qp_indx_u]);
  ------------------
  |  Branch (1108:23): [True: 14.3k, False: 966k]
  |  Branch (1108:52): [True: 4.07k, False: 962k]
  ------------------
 1109|   980k|        qp_chroma_v = qp_indx_v < 0 ? qp_indx_v : (qp_indx_v > 57 ? qp_indx_v - 6 : gai4_ihevc_qp_table[qp_indx_v]);
  ------------------
  |  Branch (1109:23): [True: 9.15k, False: 971k]
  |  Branch (1109:52): [True: 5.51k, False: 965k]
  ------------------
 1110|   980k|    }
 1111|       |
 1112|  15.9M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  15.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.07k, False: 15.9M]
  |  |  |  Branch (40:53): [True: 15.8k, False: 15.9M]
  |  |  ------------------
  ------------------
 1113|  15.9M|    tc_u = gai4_ihevc_tc_table[tc_indx_u] * (1 << (bit_depth - 8));
 1114|       |
 1115|  15.9M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  15.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.52k, False: 15.9M]
  |  |  |  Branch (40:53): [True: 13.5k, False: 15.9M]
  |  |  ------------------
  ------------------
 1116|  15.9M|    tc_v = gai4_ihevc_tc_table[tc_indx_v] * (1 << (bit_depth - 8));
 1117|       |
 1118|  15.9M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (1118:8): [True: 265k, False: 15.7M]
  |  Branch (1118:21): [True: 263k, False: 1.94k]
  ------------------
 1119|   263k|    {
 1120|   263k|        return;
 1121|   263k|    }
 1122|       |
 1123|   139M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (1123:18): [True: 124M, False: 15.7M]
  ------------------
 1124|   124M|    {
 1125|   124M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (1125:14): [True: 62.0M, False: 61.9M]
  ------------------
 1126|   124M|        delta = CLIP3((((pu2_src[0 * src_strd] -
  ------------------
  |  |   40|   124M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.41M, False: 122M]
  |  |  |  Branch (40:53): [True: 1.11M, False: 121M]
  |  |  ------------------
  ------------------
 1127|   124M|                      pu2_src[-1 * src_strd]) << 2) +
 1128|   124M|                      pu2_src[-2 * src_strd] -
 1129|   124M|                      pu2_src[1 * src_strd] + 4) >> 3,
 1130|   124M|                      -tc, tc);
 1131|   124M|        tmp_p0 = CLIP3(pu2_src[-1 * src_strd] + delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   124M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 900k, False: 123M]
  |  |  |  Branch (40:53): [True: 5.59k, False: 123M]
  |  |  ------------------
  ------------------
 1132|   124M|        tmp_q0 = CLIP3(pu2_src[0 * src_strd] - delta, 0, ((1 << bit_depth) - 1));
  ------------------
  |  |   40|   124M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 943k, False: 123M]
  |  |  |  Branch (40:53): [True: 23.1k, False: 123M]
  |  |  ------------------
  ------------------
 1133|       |
 1134|   124M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (1134:12): [True: 123M, False: 880k]
  ------------------
 1135|   123M|        {
 1136|   123M|            pu2_src[-1 * src_strd] = tmp_p0;
 1137|   123M|        }
 1138|       |
 1139|   124M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (1139:12): [True: 123M, False: 418k]
  ------------------
 1140|   123M|        {
 1141|   123M|            pu2_src[0 * src_strd] = tmp_q0;
 1142|   123M|        }
 1143|       |
 1144|   124M|        pu2_src += 1;
 1145|   124M|    }
 1146|  15.7M|}

ihevc_hbd_inter_pred_luma_copy:
  115|  70.7k|{
  116|  70.7k|    WORD32 row, col;
  117|       |
  118|   605k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (118:18): [True: 534k, False: 70.7k]
  ------------------
  119|   534k|    {
  120|  5.03M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (120:22): [True: 4.49M, False: 534k]
  ------------------
  121|  4.49M|        {
  122|  4.49M|            pu2_dst[col] = pu2_src[col];
  123|  4.49M|        }
  124|       |
  125|   534k|        pu2_src += src_strd;
  126|   534k|        pu2_dst += dst_strd;
  127|   534k|    }
  128|  70.7k|}
ihevc_hbd_inter_pred_luma_horz:
  178|  13.5k|{
  179|  13.5k|    WORD32 row, col, i;
  180|  13.5k|    WORD32 tmp;
  181|       |
  182|   125k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (182:18): [True: 111k, False: 13.5k]
  ------------------
  183|   111k|    {
  184|  1.15M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (184:22): [True: 1.04M, False: 111k]
  ------------------
  185|  1.04M|        {
  186|  1.04M|            tmp = 0;
  187|  9.31M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  9.31M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (187:24): [True: 8.27M, False: 1.04M]
  ------------------
  188|  8.27M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3)];
  189|       |
  190|  1.04M|            tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.04M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.04M|#define FILTER_PREC 6
  ------------------
  191|  1.04M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.9k, False: 1.02M]
  |  |  |  Branch (40:53): [True: 19.4k, False: 1.00M]
  |  |  ------------------
  ------------------
  192|  1.04M|            pu2_dst[col] = (UWORD16)tmp;
  193|  1.04M|        }
  194|       |
  195|   111k|        pu2_src += src_strd;
  196|   111k|        pu2_dst += dst_strd;
  197|   111k|    }
  198|  13.5k|}
ihevc_hbd_inter_pred_luma_vert:
  250|  23.4k|{
  251|  23.4k|    WORD32 row, col, i;
  252|  23.4k|    WORD32 tmp;
  253|       |
  254|   212k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (254:18): [True: 189k, False: 23.4k]
  ------------------
  255|   189k|    {
  256|  1.80M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (256:22): [True: 1.61M, False: 189k]
  ------------------
  257|  1.61M|        {
  258|  1.61M|            tmp = 0;
  259|  14.4M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  14.4M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (259:24): [True: 12.8M, False: 1.61M]
  ------------------
  260|  12.8M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3) * src_strd];
  261|       |
  262|  1.61M|            tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.61M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.61M|#define FILTER_PREC 6
  ------------------
  263|  1.61M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.61M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 39.7k, False: 1.57M]
  |  |  |  Branch (40:53): [True: 335k, False: 1.24M]
  |  |  ------------------
  ------------------
  264|  1.61M|            pu2_dst[col] = (UWORD16)tmp;
  265|  1.61M|        }
  266|       |
  267|   189k|        pu2_src += src_strd;
  268|   189k|        pu2_dst += dst_strd;
  269|   189k|    }
  270|  23.4k|}
ihevc_hbd_inter_pred_luma_copy_w16out:
  322|   458k|{
  323|   458k|    WORD32 row, col;
  324|       |
  325|  4.10M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (325:18): [True: 3.65M, False: 458k]
  ------------------
  326|  3.65M|    {
  327|  38.8M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (327:22): [True: 35.2M, False: 3.65M]
  ------------------
  328|  35.2M|        {
  329|  35.2M|            pi2_dst[col] = (pu2_src[col] << (14-bit_depth));
  330|  35.2M|        }
  331|       |
  332|  3.65M|        pu2_src += src_strd;
  333|  3.65M|        pi2_dst += dst_strd;
  334|  3.65M|    }
  335|   458k|}
ihevc_hbd_inter_pred_luma_horz_w16out:
  388|   104k|{
  389|   104k|    WORD32 row, col, i;
  390|   104k|    WORD32 tmp;
  391|       |
  392|  1.50M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (392:18): [True: 1.40M, False: 104k]
  ------------------
  393|  1.40M|    {
  394|  15.1M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (394:22): [True: 13.7M, False: 1.40M]
  ------------------
  395|  13.7M|        {
  396|  13.7M|            tmp = 0;
  397|   123M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   123M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (397:24): [True: 109M, False: 13.7M]
  ------------------
  398|   109M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3)];
  399|  13.7M|            pi2_dst[col] = tmp >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  13.7M|#define FILTER_PREC 6
  ------------------
  400|  13.7M|        }
  401|       |
  402|  1.40M|        pu2_src += src_strd;
  403|  1.40M|        pi2_dst += dst_strd;
  404|  1.40M|    }
  405|   104k|}
ihevc_hbd_inter_pred_luma_vert_w16out:
  458|  28.2k|{
  459|  28.2k|    WORD32 row, col, i;
  460|  28.2k|    WORD32 tmp;
  461|       |
  462|   267k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (462:18): [True: 239k, False: 28.2k]
  ------------------
  463|   239k|    {
  464|  3.22M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (464:22): [True: 2.98M, False: 239k]
  ------------------
  465|  2.98M|        {
  466|  2.98M|            tmp = 0;
  467|  26.7M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  26.7M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (467:24): [True: 23.7M, False: 2.98M]
  ------------------
  468|  23.7M|                tmp += pi1_coeff[i] * pu2_src[col + (i - 3) * src_strd];
  469|       |
  470|  2.98M|            pi2_dst[col] = tmp >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  2.98M|#define FILTER_PREC 6
  ------------------
  471|  2.98M|        }
  472|       |
  473|   239k|        pu2_src += src_strd;
  474|   239k|        pi2_dst += dst_strd;
  475|   239k|    }
  476|  28.2k|}
ihevc_hbd_inter_pred_luma_vert_w16inp:
  528|  27.7k|{
  529|  27.7k|    WORD32 row, col, i;
  530|  27.7k|    WORD32 tmp;
  531|   254k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (531:18): [True: 227k, False: 27.7k]
  ------------------
  532|   227k|    {
  533|  2.25M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (533:22): [True: 2.02M, False: 227k]
  ------------------
  534|  2.02M|        {
  535|  2.02M|            tmp = 0;
  536|  18.2M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  18.2M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (536:24): [True: 16.1M, False: 2.02M]
  ------------------
  537|  16.1M|                tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  538|       |
  539|  2.02M|            tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  2.02M|#define FILTER_PREC 6
  ------------------
                          tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  2.02M|#define FILTER_PREC 6
  ------------------
  540|       |
  541|  2.02M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  2.02M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.38k, False: 2.02M]
  |  |  |  Branch (40:53): [True: 46.4k, False: 1.97M]
  |  |  ------------------
  ------------------
  542|  2.02M|            pu2_dst[col] = tmp;
  543|  2.02M|        }
  544|       |
  545|   227k|        pi2_src += src_strd;
  546|   227k|        pu2_dst += dst_strd;
  547|   227k|    }
  548|  27.7k|}
ihevc_hbd_inter_pred_luma_vert_w16inp_w16out:
  602|  50.0k|{
  603|  50.0k|    WORD32 row, col, i;
  604|  50.0k|    WORD32 tmp;
  605|       |
  606|   490k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (606:18): [True: 440k, False: 50.0k]
  ------------------
  607|   440k|    {
  608|  5.59M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (608:22): [True: 5.15M, False: 440k]
  ------------------
  609|  5.15M|        {
  610|  5.15M|            tmp = 0;
  611|  46.2M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  46.2M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (611:24): [True: 41.1M, False: 5.15M]
  ------------------
  612|  41.1M|                tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  613|  5.15M|            tmp = (tmp >> FILTER_PREC) - OFFSET14;
  ------------------
  |  |   44|  5.15M|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp >> FILTER_PREC) - OFFSET14;
  ------------------
  |  |   43|  5.15M|#define OFFSET14 (1 << (14 - 1))
  ------------------
  614|       |
  615|  5.15M|            pi2_dst[col] = tmp;
  616|  5.15M|        }
  617|       |
  618|   440k|        pi2_src += src_strd;
  619|   440k|        pi2_dst += dst_strd;
  620|   440k|    }
  621|  50.0k|}
ihevc_hbd_inter_pred_chroma_copy:
  673|  68.0k|{
  674|  68.0k|    WORD32 row, col;
  675|       |
  676|   371k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (676:18): [True: 303k, False: 68.0k]
  ------------------
  677|   303k|    {
  678|  2.86M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (678:22): [True: 2.56M, False: 303k]
  ------------------
  679|  2.56M|        {
  680|  2.56M|            pu2_dst[col] = pu2_src[col];
  681|  2.56M|        }
  682|       |
  683|   303k|        pu2_src += src_strd;
  684|   303k|        pu2_dst += dst_strd;
  685|   303k|    }
  686|  68.0k|}
ihevc_hbd_inter_pred_chroma_horz:
  739|  13.3k|{
  740|  13.3k|    WORD32 row, col, i;
  741|  13.3k|    WORD32 tmp_u, tmp_v;
  742|       |
  743|  75.2k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (743:18): [True: 61.8k, False: 13.3k]
  ------------------
  744|  61.8k|    {
  745|   353k|        for(col = 0; col < 2*wd; col+=2)
  ------------------
  |  Branch (745:22): [True: 291k, False: 61.8k]
  ------------------
  746|   291k|        {
  747|   291k|            tmp_u = 0;
  748|   291k|            tmp_v = 0;
  749|  1.45M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  1.45M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (749:24): [True: 1.16M, False: 291k]
  ------------------
  750|  1.16M|            {
  751|  1.16M|                tmp_u += pi1_coeff[i] * pu2_src[col + (i-1)*2];
  752|  1.16M|                tmp_v += pi1_coeff[i] * pu2_src[col + 1 + (i-1)*2];
  753|  1.16M|            }
  754|       |
  755|   291k|            tmp_u = (tmp_u + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   291k|#define FILTER_PREC 6
  ------------------
                          tmp_u = (tmp_u + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   291k|#define FILTER_PREC 6
  ------------------
  756|   291k|            tmp_v = (tmp_v + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   291k|#define FILTER_PREC 6
  ------------------
                          tmp_v = (tmp_v + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   291k|#define FILTER_PREC 6
  ------------------
  757|       |
  758|   291k|            tmp_u = CLIP3(tmp_u,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   291k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.00k, False: 288k]
  |  |  |  Branch (40:53): [True: 4.58k, False: 283k]
  |  |  ------------------
  ------------------
  759|   291k|            tmp_v = CLIP3(tmp_v,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   291k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.27k, False: 287k]
  |  |  |  Branch (40:53): [True: 4.69k, False: 283k]
  |  |  ------------------
  ------------------
  760|       |
  761|   291k|            pu2_dst[col] = (UWORD16)tmp_u;
  762|   291k|            pu2_dst[col + 1] = (UWORD16)tmp_v;
  763|   291k|        }
  764|       |
  765|  61.8k|        pu2_src += src_strd;
  766|  61.8k|        pu2_dst += dst_strd;
  767|  61.8k|    }
  768|  13.3k|}
ihevc_hbd_inter_pred_chroma_vert:
  822|  22.0k|{
  823|  22.0k|    WORD32 row, col, i;
  824|  22.0k|    WORD32 tmp;
  825|       |
  826|   117k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (826:18): [True: 95.8k, False: 22.0k]
  ------------------
  827|  95.8k|    {
  828|   944k|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (828:22): [True: 848k, False: 95.8k]
  ------------------
  829|   848k|        {
  830|   848k|            tmp = 0;
  831|  4.23M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  4.23M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (831:24): [True: 3.38M, False: 848k]
  ------------------
  832|  3.38M|            {
  833|  3.38M|                tmp += pi1_coeff[i] * pu2_src[col + (i-1) * src_strd];
  834|  3.38M|            }
  835|       |
  836|   848k|            tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   848k|#define FILTER_PREC 6
  ------------------
                          tmp = (tmp + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|   848k|#define FILTER_PREC 6
  ------------------
  837|       |
  838|   848k|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   848k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.16k, False: 846k]
  |  |  |  Branch (40:53): [True: 4.71k, False: 841k]
  |  |  ------------------
  ------------------
  839|   848k|            pu2_dst[col] = (UWORD16)tmp;
  840|   848k|        }
  841|       |
  842|  95.8k|        pu2_src += src_strd;
  843|  95.8k|        pu2_dst += dst_strd;
  844|  95.8k|    }
  845|  22.0k|}
ihevc_hbd_inter_pred_chroma_copy_w16out:
  898|   444k|{
  899|   444k|    WORD32 row, col;
  900|       |
  901|  3.01M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (901:18): [True: 2.56M, False: 444k]
  ------------------
  902|  2.56M|    {
  903|  27.5M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (903:22): [True: 25.0M, False: 2.56M]
  ------------------
  904|  25.0M|        {
  905|  25.0M|            pi2_dst[col] = (pu2_src[col] << (14 - bit_depth));
  906|  25.0M|        }
  907|       |
  908|  2.56M|        pu2_src += src_strd;
  909|  2.56M|        pi2_dst += dst_strd;
  910|  2.56M|    }
  911|   444k|}
ihevc_hbd_inter_pred_chroma_horz_w16out:
  965|   113k|{
  966|   113k|    WORD32 row, col, i;
  967|   113k|    WORD32 tmp_u, tmp_v;
  968|       |
  969|  1.01M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (969:18): [True: 900k, False: 113k]
  ------------------
  970|   900k|    {
  971|  5.74M|        for(col = 0; col < 2*wd; col+=2)
  ------------------
  |  Branch (971:22): [True: 4.84M, False: 900k]
  ------------------
  972|  4.84M|        {
  973|  4.84M|            tmp_u = 0;
  974|  4.84M|            tmp_v = 0;
  975|  24.2M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  24.2M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (975:24): [True: 19.3M, False: 4.84M]
  ------------------
  976|  19.3M|            {
  977|  19.3M|                tmp_u += pi1_coeff[i] * pu2_src[col + (i-1)*2];
  978|  19.3M|                tmp_v += pi1_coeff[i] * pu2_src[col + 1 + (i-1)*2];
  979|  19.3M|            }
  980|       |
  981|  4.84M|            pi2_dst[col] = tmp_u >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  4.84M|#define FILTER_PREC 6
  ------------------
  982|  4.84M|            pi2_dst[col + 1] = tmp_v >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  4.84M|#define FILTER_PREC 6
  ------------------
  983|  4.84M|        }
  984|       |
  985|   900k|        pu2_src += src_strd;
  986|   900k|        pi2_dst += dst_strd;
  987|   900k|    }
  988|   113k|}
ihevc_hbd_inter_pred_chroma_vert_w16out:
 1042|  23.4k|{
 1043|  23.4k|    WORD32 row, col, i;
 1044|  23.4k|    WORD32 tmp;
 1045|       |
 1046|   176k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1046:18): [True: 153k, False: 23.4k]
  ------------------
 1047|   153k|    {
 1048|  2.33M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1048:22): [True: 2.18M, False: 153k]
  ------------------
 1049|  2.18M|        {
 1050|  2.18M|            tmp = 0;
 1051|  10.9M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  10.9M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1051:24): [True: 8.72M, False: 2.18M]
  ------------------
 1052|  8.72M|            {
 1053|  8.72M|                tmp += pi1_coeff[i] * pu2_src[col + (i-1) * src_strd];
 1054|  8.72M|            }
 1055|       |
 1056|  2.18M|            pi2_dst[col] = tmp >> (FILTER_PREC - (14-bit_depth));
  ------------------
  |  |   44|  2.18M|#define FILTER_PREC 6
  ------------------
 1057|  2.18M|        }
 1058|       |
 1059|   153k|        pu2_src += src_strd;
 1060|   153k|        pi2_dst += dst_strd;
 1061|   153k|    }
 1062|  23.4k|}
ihevc_hbd_inter_pred_chroma_vert_w16inp:
 1114|  31.4k|{
 1115|  31.4k|    WORD32 row, col, i;
 1116|  31.4k|    WORD32 tmp;
 1117|       |
 1118|   187k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1118:18): [True: 156k, False: 31.4k]
  ------------------
 1119|   156k|    {
 1120|  1.57M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1120:22): [True: 1.41M, False: 156k]
  ------------------
 1121|  1.41M|        {
 1122|  1.41M|            tmp = 0;
 1123|  7.09M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  7.09M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1123:24): [True: 5.67M, False: 1.41M]
  ------------------
 1124|  5.67M|            {
 1125|  5.67M|                tmp += pi1_coeff[i] * pi2_src[col + (i-1) * src_strd];
 1126|  5.67M|            }
 1127|       |
 1128|  1.41M|            tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.41M|#define FILTER_PREC 6
  ------------------
                          tmp = ((tmp >> (14-bit_depth)) + (1<<(FILTER_PREC-1))) >> FILTER_PREC;
  ------------------
  |  |   44|  1.41M|#define FILTER_PREC 6
  ------------------
 1129|       |
 1130|  1.41M|            tmp = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 993, False: 1.41M]
  |  |  |  Branch (40:53): [True: 17.4k, False: 1.40M]
  |  |  ------------------
  ------------------
 1131|  1.41M|            pu2_dst[col] = tmp;
 1132|  1.41M|        }
 1133|       |
 1134|   156k|        pi2_src += src_strd;
 1135|   156k|        pu2_dst += dst_strd;
 1136|   156k|    }
 1137|  31.4k|}
ihevc_hbd_inter_pred_chroma_vert_w16inp_w16out:
 1191|  58.2k|{
 1192|  58.2k|    WORD32 row, col, i;
 1193|  58.2k|    WORD32 tmp;
 1194|       |
 1195|   387k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1195:18): [True: 329k, False: 58.2k]
  ------------------
 1196|   329k|    {
 1197|  4.41M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1197:22): [True: 4.08M, False: 329k]
  ------------------
 1198|  4.08M|        {
 1199|  4.08M|            tmp = 0;
 1200|  20.3M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  20.3M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1200:24): [True: 16.3M, False: 4.08M]
  ------------------
 1201|  16.3M|            {
 1202|  16.3M|                tmp += pi1_coeff[i] * pi2_src[col + (i-1) * src_strd];
 1203|  16.3M|            }
 1204|       |
 1205|  4.08M|            tmp = (tmp >> FILTER_PREC);
  ------------------
  |  |   44|  4.08M|#define FILTER_PREC 6
  ------------------
 1206|       |
 1207|  4.08M|            pi2_dst[col] = tmp;
 1208|  4.08M|        }
 1209|       |
 1210|   329k|        pi2_src += src_strd;
 1211|   329k|        pi2_dst += dst_strd;
 1212|   329k|    }
 1213|  58.2k|}

ihevc_hbd_intra_pred_luma_ref_substitution:
  137|  2.26M|{
  138|  2.26M|    UWORD16 pu2_ref;
  139|  2.26M|    WORD32 dc_val, i;
  140|  2.26M|    WORD32 total_samples = (4 * nt) + 1;
  141|  2.26M|    WORD32 two_nt = 2 * nt;
  142|       |
  143|  2.26M|    WORD32 three_nt = 3 * nt;
  144|  2.26M|    WORD32 get_bits;
  145|  2.26M|    WORD32 next;
  146|  2.26M|    WORD32 bot_left, left, top, tp_right, tp_left;
  147|       |
  148|  2.26M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  149|       |
  150|  2.26M|    dc_val = 1 << (bit_depth - 1);
  151|       |
  152|       |    /* Neighbor Flag Structure */
  153|       |    /* MSB ---> LSB */
  154|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  155|       |              1         4         4     4         4
  156|       |     */
  157|       |    /* If no neighbor flags are present, fill the neighbor samples with DC value */
  158|  2.26M|    if(nbr_flags == 0)
  ------------------
  |  Branch (158:8): [True: 24.2k, False: 2.24M]
  ------------------
  159|  24.2k|    {
  160|  2.18M|        for(i = 0; i < total_samples; i++)
  ------------------
  |  Branch (160:20): [True: 2.15M, False: 24.2k]
  ------------------
  161|  2.15M|        {
  162|  2.15M|            pu2_dst[i] = dc_val;
  163|  2.15M|        }
  164|  24.2k|    }
  165|  2.24M|    else
  166|  2.24M|    {
  167|  2.24M|        if(nt <= 8)
  ------------------
  |  Branch (167:12): [True: 1.50M, False: 741k]
  ------------------
  168|  1.50M|        {
  169|       |            /* 1 bit extraction for all the neighboring blocks */
  170|  1.50M|            tp_left = (nbr_flags & 0x10000) >> 16;
  171|  1.50M|            bot_left = (nbr_flags & 0x8)>>3;
  172|  1.50M|            left = (nbr_flags & 0x80) >> 7;
  173|  1.50M|            top = (nbr_flags & 0x100) >> 8;
  174|  1.50M|            tp_right = (nbr_flags & 0x1000) >> 12;
  175|       |
  176|       |            /* Else fill the corresponding samples */
  177|  1.50M|            if(tp_left)
  ------------------
  |  Branch (177:16): [True: 1.36M, False: 143k]
  ------------------
  178|  1.36M|                pu2_dst[two_nt] = *pu2_top_left;
  179|   143k|            else
  180|   143k|                pu2_dst[two_nt] = 0;
  181|       |
  182|       |
  183|  1.50M|            if(left)
  ------------------
  |  Branch (183:16): [True: 1.42M, False: 73.7k]
  ------------------
  184|  1.42M|            {
  185|  8.82M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (185:28): [True: 7.39M, False: 1.42M]
  ------------------
  186|  7.39M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  187|  1.42M|            }
  188|  73.7k|            else
  189|  73.7k|            {
  190|   470k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (190:28): [True: 396k, False: 73.7k]
  ------------------
  191|   396k|                    pu2_dst[two_nt - 1 - i] = 0;
  192|  73.7k|            }
  193|       |
  194|  1.50M|            if(bot_left)
  ------------------
  |  Branch (194:16): [True: 442k, False: 1.06M]
  ------------------
  195|   442k|            {
  196|  2.75M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (196:29): [True: 2.30M, False: 442k]
  ------------------
  197|  2.30M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  198|   442k|            }
  199|  1.06M|            else
  200|  1.06M|            {
  201|  6.55M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (201:29): [True: 5.49M, False: 1.06M]
  ------------------
  202|  5.49M|                    pu2_dst[two_nt - 1 - i] = 0;
  203|  1.06M|            }
  204|       |
  205|  1.50M|            if(top)
  ------------------
  |  Branch (205:16): [True: 1.43M, False: 69.8k]
  ------------------
  206|  1.43M|            {
  207|  8.83M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (207:28): [True: 7.40M, False: 1.43M]
  ------------------
  208|  7.40M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  209|  1.43M|            }
  210|  69.8k|            else
  211|  69.8k|            {
  212|   453k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (212:28): [True: 383k, False: 69.8k]
  ------------------
  213|   383k|                    pu2_dst[two_nt + 1 + i] = 0;
  214|  69.8k|            }
  215|       |
  216|  1.50M|            if(tp_right)
  ------------------
  |  Branch (216:16): [True: 906k, False: 597k]
  ------------------
  217|   906k|            {
  218|  5.51M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (218:29): [True: 4.61M, False: 906k]
  ------------------
  219|  4.61M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  220|   906k|            }
  221|   597k|            else
  222|   597k|            {
  223|  3.78M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (223:29): [True: 3.19M, False: 597k]
  ------------------
  224|  3.19M|                    pu2_dst[two_nt + 1 + i] = 0;
  225|   597k|            }
  226|  1.50M|            next = 1;
  227|       |
  228|       |            /* If bottom -left is not available, reverse substitution process */
  229|  1.50M|            if(bot_left == 0)
  ------------------
  |  Branch (229:16): [True: 1.06M, False: 438k]
  ------------------
  230|  1.06M|            {
  231|  1.06M|                WORD32 a_nbr_flag[5] = { bot_left, left, tp_left, top, tp_right};
  232|       |
  233|       |                /* Check for the 1st available sample from bottom-left */
  234|  1.21M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (234:23): [True: 150k, False: 1.06M]
  ------------------
  235|   150k|                    next++;
  236|       |
  237|       |                /* If Left, top-left are available */
  238|  1.06M|                if(next <= 2)
  ------------------
  |  Branch (238:20): [True: 991k, False: 73.6k]
  ------------------
  239|   991k|                {
  240|   991k|                    idx = nt * next;
  241|   991k|                    pu2_ref = pu2_dst[idx];
  242|  6.09M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (242:32): [True: 5.10M, False: 991k]
  ------------------
  243|  5.10M|                        pu2_dst[i] = pu2_ref;
  244|   991k|                }
  245|  73.6k|                else /* If top, top-right are available */
  246|  73.6k|                {
  247|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available */
  248|  73.6k|                    idx = (nt * (next - 1)) + 1;
  249|  73.6k|                    pu2_ref = pu2_dst[idx];
  250|   941k|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (250:32): [True: 867k, False: 73.6k]
  ------------------
  251|   867k|                        pu2_dst[i] = pu2_ref;
  252|  73.6k|                }
  253|  1.06M|            }
  254|       |
  255|       |            /* Forward Substitution Process */
  256|       |            /* If left is Unavailable, copy the last bottom-left value */
  257|  1.50M|            if(left == 0)
  ------------------
  |  Branch (257:16): [True: 75.3k, False: 1.42M]
  ------------------
  258|  75.3k|            {
  259|   471k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (259:28): [True: 396k, False: 75.3k]
  ------------------
  260|   396k|                    pu2_dst[nt + i] = pu2_dst[nt - 1];
  261|  75.3k|            }
  262|       |            /* If top-left is Unavailable, copy the last left value */
  263|  1.50M|            if(tp_left == 0)
  ------------------
  |  Branch (263:16): [True: 144k, False: 1.35M]
  ------------------
  264|   144k|                pu2_dst[two_nt] = pu2_dst[two_nt - 1];
  265|       |            /* If top is Unavailable, copy the last top-left value */
  266|  1.50M|            if(top == 0)
  ------------------
  |  Branch (266:16): [True: 69.3k, False: 1.43M]
  ------------------
  267|  69.3k|            {
  268|   453k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (268:28): [True: 383k, False: 69.3k]
  ------------------
  269|   383k|                    pu2_dst[two_nt + 1 + i] = pu2_dst[two_nt];
  270|  69.3k|            }
  271|       |            /* If to right is Unavailable, copy the last top value */
  272|  1.50M|            if(tp_right == 0)
  ------------------
  |  Branch (272:16): [True: 601k, False: 902k]
  ------------------
  273|   601k|            {
  274|  3.79M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (274:28): [True: 3.19M, False: 601k]
  ------------------
  275|  3.19M|                    pu2_dst[three_nt + 1 + i] = pu2_dst[three_nt];
  276|   601k|            }
  277|  1.50M|        }
  278|       |
  279|  2.24M|        if(nt == 16)
  ------------------
  |  Branch (279:12): [True: 413k, False: 1.83M]
  ------------------
  280|   413k|        {
  281|   413k|            WORD32 nbr_flags_temp = 0;
  282|   413k|            nbr_flags_temp = ((nbr_flags & 0xC)>>2) + ((nbr_flags & 0xC0) >> 4)
  283|   413k|                            + ((nbr_flags & 0x300) >> 4)
  284|   413k|                            + ((nbr_flags & 0x3000) >> 6)
  285|   413k|                            + ((nbr_flags & 0x10000) >> 8);
  286|       |
  287|       |            /* Else fill the corresponding samples */
  288|   413k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (288:16): [True: 323k, False: 89.9k]
  ------------------
  289|   323k|                pu2_dst[two_nt] = *pu2_top_left;
  290|  89.9k|            else
  291|  89.9k|                pu2_dst[two_nt] = 0;
  292|       |
  293|   413k|            if(nbr_flags & 0xC0)
  ------------------
  |  Branch (293:16): [True: 360k, False: 52.4k]
  ------------------
  294|   360k|            {
  295|  6.13M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (295:28): [True: 5.77M, False: 360k]
  ------------------
  296|  5.77M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  297|   360k|            }
  298|  52.4k|            else
  299|  52.4k|            {
  300|   893k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (300:28): [True: 840k, False: 52.4k]
  ------------------
  301|   840k|                    pu2_dst[two_nt - 1 - i] = 0;
  302|  52.4k|            }
  303|       |
  304|   413k|            if(nbr_flags & 0xC)
  ------------------
  |  Branch (304:16): [True: 90.3k, False: 322k]
  ------------------
  305|  90.3k|            {
  306|  1.53M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (306:29): [True: 1.44M, False: 90.3k]
  ------------------
  307|  1.44M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  308|  90.3k|            }
  309|   322k|            else
  310|   322k|            {
  311|  5.49M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (311:29): [True: 5.16M, False: 322k]
  ------------------
  312|  5.16M|                    pu2_dst[two_nt - 1 - i] = 0;
  313|   322k|            }
  314|       |
  315|       |
  316|   413k|            if(nbr_flags & 0x300)
  ------------------
  |  Branch (316:16): [True: 375k, False: 37.6k]
  ------------------
  317|   375k|            {
  318|  6.38M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (318:28): [True: 6.00M, False: 375k]
  ------------------
  319|  6.00M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  320|   375k|            }
  321|  37.6k|            else
  322|  37.6k|            {
  323|   646k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (323:28): [True: 608k, False: 37.6k]
  ------------------
  324|   608k|                    pu2_dst[two_nt + 1 + i] = 0;
  325|  37.6k|            }
  326|       |
  327|   413k|            if(nbr_flags & 0x3000)
  ------------------
  |  Branch (327:16): [True: 239k, False: 173k]
  ------------------
  328|   239k|            {
  329|  4.06M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (329:29): [True: 3.82M, False: 239k]
  ------------------
  330|  3.82M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  331|   239k|            }
  332|   173k|            else
  333|   173k|            {
  334|  2.96M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (334:29): [True: 2.78M, False: 173k]
  ------------------
  335|  2.78M|                    pu2_dst[two_nt + 1 + i] = 0;
  336|   173k|            }
  337|       |            /* compute trailing zeors based on nbr_flag for substitution process of below left see section . */
  338|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  339|   413k|            {
  340|   413k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 8; /* for below left and left */
  ------------------
  |  |   43|   413k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 52.5k, False: 360k]
  |  |  ------------------
  ------------------
  341|       |
  342|   413k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (342:20): [True: 52.5k, False: 360k]
  ------------------
  343|  52.5k|                    nbr_id_from_bl = 32;
  344|       |
  345|   413k|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (345:20): [True: 52.5k, False: 360k]
  ------------------
  346|  52.5k|                {
  347|       |                    /* for top left : 1 pel per nbr bit */
  348|  52.5k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (348:24): [True: 52.3k, False: 212]
  ------------------
  349|  52.3k|                    {
  350|  52.3k|                        nbr_id_from_bl++;
  351|  52.3k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 8; /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  52.3k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 52.3k]
  |  |  ------------------
  ------------------
  352|  52.3k|                    }
  353|  52.5k|                }
  354|       |                /* Reverse Substitution Process */
  355|   413k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (355:20): [True: 325k, False: 87.4k]
  ------------------
  356|   325k|                {
  357|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  358|   325k|                    pu2_ref = pu2_dst[nbr_id_from_bl];
  359|  6.41M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (359:51): [True: 6.08M, False: 325k]
  ------------------
  360|  6.08M|                    {
  361|  6.08M|                        pu2_dst[i] = pu2_ref;
  362|  6.08M|                    }
  363|   325k|                }
  364|   413k|            }
  365|       |
  366|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  367|  3.32M|            while(nbr_id_from_bl < ((T16_4NT) + 1))
  ------------------
  |  |   66|  3.32M|#define T16_4NT 64
  ------------------
  |  Branch (367:19): [True: 2.91M, False: 413k]
  ------------------
  368|  2.91M|            {
  369|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  370|       |                /* Devide by 8 to obtain the original index */
  371|  2.91M|                frwd_nbr_flag = (nbr_id_from_bl >> 3);
  372|       |
  373|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  374|  2.91M|                if(nbr_id_from_bl == (T16_4NT / 2))
  ------------------
  |  |   66|  2.91M|#define T16_4NT 64
  ------------------
  |  Branch (374:20): [True: 361k, False: 2.55M]
  ------------------
  375|   361k|                {
  376|   361k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   361k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  377|       |
  378|       |                    /* only pel substitution for TL */
  379|   361k|                    if(!get_bits)
  ------------------
  |  Branch (379:24): [True: 37.7k, False: 323k]
  ------------------
  380|  37.7k|                        pu2_dst[nbr_id_from_bl] = pu2_dst[nbr_id_from_bl - 1];
  381|   361k|                }
  382|  2.55M|                else
  383|  2.55M|                {
  384|  2.55M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  2.55M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  385|  2.55M|                    if(!get_bits)
  ------------------
  |  Branch (385:24): [True: 425k, False: 2.12M]
  ------------------
  386|   425k|                    {
  387|       |                        /* 8 pel substitution (other than TL) */
  388|   425k|                        pu2_ref = pu2_dst[nbr_id_from_bl - 1];
  389|  3.82M|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (389:36): [True: 3.40M, False: 425k]
  ------------------
  390|  3.40M|                            pu2_dst[nbr_id_from_bl + i] = pu2_ref;
  391|   425k|                    }
  392|  2.55M|                }
  393|  2.91M|                nbr_id_from_bl += (nbr_id_from_bl == (T16_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   66|  2.91M|#define T16_4NT 64
  ------------------
  |  Branch (393:35): [True: 361k, False: 2.55M]
  ------------------
  394|  2.91M|            }
  395|   413k|        }
  396|       |
  397|  2.24M|        if(nt == 32)
  ------------------
  |  Branch (397:12): [True: 330k, False: 1.91M]
  ------------------
  398|   330k|        {
  399|       |            /* Else fill the corresponding samples */
  400|   330k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (400:16): [True: 215k, False: 115k]
  ------------------
  401|   215k|                pu2_dst[two_nt] = *pu2_top_left;
  402|   115k|            else
  403|   115k|                pu2_dst[two_nt] = 0;
  404|       |
  405|   330k|            if(nbr_flags & 0xF0)
  ------------------
  |  Branch (405:16): [True: 310k, False: 20.5k]
  ------------------
  406|   310k|            {
  407|  10.2M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (407:28): [True: 9.90M, False: 310k]
  ------------------
  408|  9.90M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  409|   310k|            }
  410|  20.5k|            else
  411|  20.5k|            {
  412|   679k|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (412:28): [True: 659k, False: 20.5k]
  ------------------
  413|   659k|                    pu2_dst[two_nt - 1 - i] = 0;
  414|  20.5k|            }
  415|       |
  416|   330k|            if(nbr_flags & 0xF)
  ------------------
  |  Branch (416:16): [True: 71.5k, False: 259k]
  ------------------
  417|  71.5k|            {
  418|  2.35M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (418:29): [True: 2.28M, False: 71.5k]
  ------------------
  419|  2.28M|                    pu2_dst[two_nt - 1 - i] = pu2_left[i * src_strd];
  420|  71.5k|            }
  421|   259k|            else
  422|   259k|            {
  423|  8.58M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (423:29): [True: 8.32M, False: 259k]
  ------------------
  424|  8.32M|                    pu2_dst[two_nt - 1 - i] = 0;
  425|   259k|            }
  426|       |
  427|   330k|            if(nbr_flags & 0xF00)
  ------------------
  |  Branch (427:16): [True: 236k, False: 94.7k]
  ------------------
  428|   236k|            {
  429|  7.78M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (429:28): [True: 7.54M, False: 236k]
  ------------------
  430|  7.54M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  431|   236k|            }
  432|  94.7k|            else
  433|  94.7k|            {
  434|  3.16M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (434:28): [True: 3.06M, False: 94.7k]
  ------------------
  435|  3.06M|                    pu2_dst[two_nt + 1 + i] = 0;
  436|  94.7k|            }
  437|       |
  438|   330k|            if(nbr_flags & 0xF000)
  ------------------
  |  Branch (438:16): [True: 154k, False: 176k]
  ------------------
  439|   154k|            {
  440|  5.08M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (440:29): [True: 4.93M, False: 154k]
  ------------------
  441|  4.93M|                    pu2_dst[two_nt + 1 + i] = pu2_top[i];
  442|   154k|            }
  443|   176k|            else
  444|   176k|            {
  445|  5.86M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (445:29): [True: 5.68M, False: 176k]
  ------------------
  446|  5.68M|                    pu2_dst[two_nt + 1 + i] = 0;
  447|   176k|            }
  448|       |            /* compute trailing ones based on mbr_flag for substitution process of below left see section . */
  449|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  450|   330k|            {
  451|   330k|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 8; /* for below left and left */
  ------------------
  |  |   43|   330k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 20.5k, False: 310k]
  |  |  ------------------
  ------------------
  452|       |
  453|   330k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (453:20): [True: 20.5k, False: 310k]
  ------------------
  454|  20.5k|                {
  455|       |                    /* for top left : 1 pel per nbr bit */
  456|  20.5k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (456:24): [True: 20.5k, False: 10]
  ------------------
  457|  20.5k|                    {
  458|       |                        /* top left not available */
  459|  20.5k|                        nbr_id_from_bl++;
  460|       |                        /* top and top right;  8 pels per nbr bit */
  461|  20.5k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 8;
  ------------------
  |  |   43|  20.5k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 20.5k]
  |  |  ------------------
  ------------------
  462|  20.5k|                    }
  463|  20.5k|                }
  464|       |                /* Reverse Substitution Process */
  465|   330k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (465:20): [True: 260k, False: 70.7k]
  ------------------
  466|   260k|                {
  467|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  468|   260k|                    pu2_ref = pu2_dst[nbr_id_from_bl];
  469|  9.25M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (469:51): [True: 8.99M, False: 260k]
  ------------------
  470|  8.99M|                        pu2_dst[i] = pu2_ref;
  471|   260k|                }
  472|   330k|            }
  473|       |
  474|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  475|  4.81M|            while(nbr_id_from_bl < ((T32_4NT) + 1))
  ------------------
  |  |   65|  4.81M|#define T32_4NT 128
  ------------------
  |  Branch (475:19): [True: 4.47M, False: 330k]
  ------------------
  476|  4.47M|            {
  477|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  478|       |                /* Devide by 8 to obtain the original index */
  479|  4.47M|                frwd_nbr_flag = (nbr_id_from_bl >> 3);
  480|       |
  481|       |                /* The Top-left flag is at the last bit location of nbr_flags */
  482|  4.47M|                if(nbr_id_from_bl == (T32_4NT / 2))
  ------------------
  |  |   65|  4.47M|#define T32_4NT 128
  ------------------
  |  Branch (482:20): [True: 310k, False: 4.16M]
  ------------------
  483|   310k|                {
  484|   310k|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|   310k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  485|       |                    /* only pel substitution for TL */
  486|   310k|                    if(!get_bits)
  ------------------
  |  Branch (486:24): [True: 95.8k, False: 214k]
  ------------------
  487|  95.8k|                        pu2_dst[nbr_id_from_bl] = pu2_dst[nbr_id_from_bl - 1];
  488|   310k|                }
  489|  4.16M|                else
  490|  4.16M|                {
  491|  4.16M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  4.16M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  492|  4.16M|                    if(!get_bits)
  ------------------
  |  Branch (492:24): [True: 1.10M, False: 3.06M]
  ------------------
  493|  1.10M|                    {
  494|       |                        /* 8 pel substitution (other than TL) */
  495|  1.10M|                        pu2_ref = pu2_dst[nbr_id_from_bl - 1];
  496|  9.94M|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (496:36): [True: 8.83M, False: 1.10M]
  ------------------
  497|  8.83M|                            pu2_dst[nbr_id_from_bl + i] = pu2_ref;
  498|  1.10M|                    }
  499|  4.16M|                }
  500|  4.47M|                nbr_id_from_bl += (nbr_id_from_bl == (T32_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   65|  4.47M|#define T32_4NT 128
  ------------------
  |  Branch (500:35): [True: 310k, False: 4.16M]
  ------------------
  501|  4.47M|            }
  502|   330k|        }
  503|  2.24M|    }
  504|  2.26M|}
ihevc_hbd_intra_pred_ref_filtering:
  547|  2.27M|{
  548|  2.27M|    WORD32 filter_flag;
  549|  2.27M|    WORD32 i; /* Generic indexing variable */
  550|  2.27M|    WORD32 four_nt = 4 * nt;
  551|  2.27M|    UWORD16 au2_flt[(4 * MAX_CU_SIZE) + 1];
  552|  2.27M|    WORD32 bi_linear_int_flag = 0;
  553|  2.27M|    WORD32 abs_cond_left_flag = 0;
  554|  2.27M|    WORD32 abs_cond_top_flag = 0;
  555|  2.27M|    WORD32 dc_val = 1 << (bit_depth - 5);
  556|  2.27M|    WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3);
  557|  2.27M|    WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1;
  558|       |
  559|  2.27M|    filter_flag = intra_smoothing_disabled ?
  ------------------
  |  Branch (559:19): [True: 33.2k, False: 2.23M]
  ------------------
  560|  2.23M|                    0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)));
  561|  2.27M|    if(0 == filter_flag)
  ------------------
  |  Branch (561:8): [True: 1.65M, False: 614k]
  ------------------
  562|  1.65M|    {
  563|  1.65M|        if(pu2_src == pu2_dst)
  ------------------
  |  Branch (563:12): [True: 1.65M, False: 109]
  ------------------
  564|  1.65M|        {
  565|  1.65M|            return;
  566|  1.65M|        }
  567|    109|        else
  568|    109|        {
  569|    109|            for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (569:24): [True: 0, False: 109]
  ------------------
  570|      0|                pu2_dst[i] = pu2_src[i];
  571|    109|        }
  572|  1.65M|    }
  573|   614k|    else
  574|   614k|    {
  575|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  576|   614k|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (576:12): [True: 133k, False: 480k]
  |  Branch (576:57): [True: 8.88k, False: 124k]
  ------------------
  577|  8.88k|        {
  578|       |            /* Strong Intra Filtering */
  579|  8.88k|            abs_cond_top_flag = (ABS(pu2_src[2 * nt] + pu2_src[4 * nt]
  ------------------
  |  |   45|  8.88k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.77k, False: 6.10k]
  |  |  ------------------
  ------------------
  580|  8.88k|                                            - (2 * pu2_src[3 * nt]))) < dc_val;
  581|  8.88k|            abs_cond_left_flag = (ABS(pu2_src[2 * nt] + pu2_src[0]
  ------------------
  |  |   45|  8.88k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.20k, False: 6.67k]
  |  |  ------------------
  ------------------
  582|  8.88k|                                            - (2 * pu2_src[nt]))) < dc_val;
  583|       |
  584|  8.88k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (584:35): [True: 5.83k, False: 3.05k]
  ------------------
  585|  5.83k|                                    && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (585:40): [True: 3.70k, False: 2.12k]
  ------------------
  586|  8.88k|        }
  587|       |        /* Extremities Untouched */
  588|   614k|        au2_flt[0] = pu2_src[0];
  589|   614k|        au2_flt[4 * nt] = pu2_src[4 * nt];
  590|       |
  591|       |        /* Strong filtering of reference samples */
  592|   614k|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (592:12): [True: 3.70k, False: 610k]
  ------------------
  593|  3.70k|        {
  594|  3.70k|            au2_flt[2 * nt] = pu2_src[2 * nt];
  595|       |
  596|   237k|            for(i = 1; i < (2 * nt) ; i++ )
  ------------------
  |  Branch (596:24): [True: 233k, False: 3.70k]
  ------------------
  597|   233k|                au2_flt[i] = (((2 * nt) - i) * pu2_src[0] + i * pu2_src[2 * nt] + 32) >> 6;
  598|       |
  599|   237k|            for(i = 1; i < (2 * nt) ; i++ )
  ------------------
  |  Branch (599:24): [True: 233k, False: 3.70k]
  ------------------
  600|   233k|                au2_flt[i + (2 * nt)] = (((2 * nt) - i) * pu2_src[2 * nt] + i * pu2_src[4 * nt] + 32) >> 6;
  601|  3.70k|        }
  602|   610k|        else
  603|   610k|        {
  604|       |            /* Perform bilinear filtering of Reference Samples */
  605|  48.0M|            for(i = 0; i < (four_nt - 1); i++)
  ------------------
  |  Branch (605:24): [True: 47.4M, False: 610k]
  ------------------
  606|  47.4M|            {
  607|  47.4M|                au2_flt[i + 1] = (pu2_src[i] + 2 * pu2_src[i + 1]
  608|  47.4M|                                + pu2_src[i + 2] + 2) >> 2;
  609|  47.4M|            }
  610|   610k|        }
  611|       |
  612|  49.7M|        for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (612:20): [True: 49.1M, False: 614k]
  ------------------
  613|  49.1M|            pu2_dst[i] = au2_flt[i];
  614|   614k|    }
  615|  2.27M|}
ihevc_hbd_intra_pred_luma_planar:
  665|   739k|{
  666|   739k|    WORD32 row, col;
  667|   739k|    WORD32 log2nt = 5;
  668|   739k|    WORD32 two_nt, three_nt;
  669|       |
  670|   739k|    switch(nt)
  671|   739k|    {
  672|   131k|        case 32:
  ------------------
  |  Branch (672:9): [True: 131k, False: 608k]
  ------------------
  673|   131k|            log2nt = 5;
  674|   131k|            break;
  675|   153k|        case 16:
  ------------------
  |  Branch (675:9): [True: 153k, False: 585k]
  ------------------
  676|   153k|            log2nt = 4;
  677|   153k|            break;
  678|   130k|        case 8:
  ------------------
  |  Branch (678:9): [True: 130k, False: 609k]
  ------------------
  679|   130k|            log2nt = 3;
  680|   130k|            break;
  681|   324k|        case 4:
  ------------------
  |  Branch (681:9): [True: 324k, False: 415k]
  ------------------
  682|   324k|            log2nt = 2;
  683|   324k|            break;
  684|      0|        default:
  ------------------
  |  Branch (684:9): [True: 0, False: 739k]
  ------------------
  685|      0|            break;
  686|   739k|    }
  687|   739k|    two_nt = 2 * nt;
  688|   739k|    three_nt = 3 * nt;
  689|       |
  690|       |    /* Planar filtering */
  691|  9.60M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (691:18): [True: 8.86M, False: 739k]
  ------------------
  692|  8.86M|    {
  693|   191M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (693:22): [True: 182M, False: 8.86M]
  ------------------
  694|   182M|        {
  695|   182M|            pu2_dst[row * dst_strd + col] = ((nt - 1 - col)
  696|   182M|                            * pu2_ref[two_nt - 1 - row]
  697|   182M|                            + (col + 1) * pu2_ref[three_nt + 1]
  698|   182M|                            + (nt - 1 - row) * pu2_ref[two_nt + 1 + col]
  699|   182M|                            + (row + 1) * pu2_ref[nt - 1] + nt) >> (log2nt + 1);
  700|   182M|        }
  701|  8.86M|    }
  702|   739k|}
ihevc_hbd_intra_pred_luma_dc:
  752|   410k|{
  753|   410k|    WORD32 acc_dc;
  754|   410k|    WORD32 dc_val, two_dc_val, three_dc_val;
  755|   410k|    WORD32 i;
  756|   410k|    WORD32 row, col;
  757|   410k|    WORD32 log2nt = 5;
  758|   410k|    WORD32 two_nt, three_nt;
  759|       |
  760|   410k|    switch(nt)
  761|   410k|    {
  762|  51.6k|        case 32:
  ------------------
  |  Branch (762:9): [True: 51.6k, False: 358k]
  ------------------
  763|  51.6k|            log2nt = 5;
  764|  51.6k|            break;
  765|   110k|        case 16:
  ------------------
  |  Branch (765:9): [True: 110k, False: 300k]
  ------------------
  766|   110k|            log2nt = 4;
  767|   110k|            break;
  768|  80.5k|        case 8:
  ------------------
  |  Branch (768:9): [True: 80.5k, False: 329k]
  ------------------
  769|  80.5k|            log2nt = 3;
  770|  80.5k|            break;
  771|   167k|        case 4:
  ------------------
  |  Branch (771:9): [True: 167k, False: 242k]
  ------------------
  772|   167k|            log2nt = 2;
  773|   167k|            break;
  774|      0|        default:
  ------------------
  |  Branch (774:9): [True: 0, False: 410k]
  ------------------
  775|      0|            break;
  776|   410k|    }
  777|   410k|    two_nt = 2 * nt;
  778|   410k|    three_nt = 3 * nt;
  779|       |
  780|   410k|    acc_dc = 0;
  781|       |    /* Calculate DC value for the transform block */
  782|  5.14M|    for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (782:17): [True: 4.73M, False: 410k]
  ------------------
  783|  4.73M|        acc_dc += pu2_ref[i];
  784|       |
  785|  5.14M|    for(i = (two_nt + 1); i <= three_nt; i++)
  ------------------
  |  Branch (785:27): [True: 4.73M, False: 410k]
  ------------------
  786|  4.73M|        acc_dc += pu2_ref[i];
  787|       |
  788|   410k|    dc_val = (acc_dc + nt) >> (log2nt + 1);
  789|       |
  790|   410k|    two_dc_val = 2 * dc_val;
  791|   410k|    three_dc_val = 3 * dc_val;
  792|       |
  793|       |
  794|   410k|    if(nt == 32)
  ------------------
  |  Branch (794:8): [True: 51.6k, False: 358k]
  ------------------
  795|  51.6k|    {
  796|  1.69M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (796:22): [True: 1.64M, False: 51.6k]
  ------------------
  797|  54.1M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (797:26): [True: 52.4M, False: 1.64M]
  ------------------
  798|  52.4M|                pu2_dst[(row * dst_strd) + col] = dc_val;
  799|  51.6k|    }
  800|   358k|    else
  801|   358k|    {
  802|       |        /* DC filtering for the first top row and first left column */
  803|   358k|        pu2_dst[0] = ((pu2_ref[two_nt - 1] + two_dc_val + pu2_ref[two_nt + 1] + 2)
  804|   358k|                        >> 2);
  805|       |
  806|  3.08M|        for(col = 1; col < nt; col++)
  ------------------
  |  Branch (806:22): [True: 2.72M, False: 358k]
  ------------------
  807|  2.72M|            pu2_dst[col] = (pu2_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2;
  808|       |
  809|  3.08M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (809:22): [True: 2.72M, False: 358k]
  ------------------
  810|  2.72M|            pu2_dst[row * dst_strd] = (pu2_ref[two_nt - 1 - row] + three_dc_val + 2)
  811|  2.72M|                            >> 2;
  812|       |
  813|       |        /* Fill the remaining rows with DC value */
  814|  3.08M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (814:22): [True: 2.72M, False: 358k]
  ------------------
  815|  33.0M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (815:26): [True: 30.2M, False: 2.72M]
  ------------------
  816|  30.2M|                pu2_dst[(row * dst_strd) + col] = dc_val;
  817|   358k|    }
  818|   410k|}
ihevc_hbd_intra_pred_luma_horz:
  869|  18.5k|{
  870|       |
  871|  18.5k|    WORD32 row, col;
  872|  18.5k|    WORD32 two_nt;
  873|  18.5k|    WORD16 s2_predpixel;
  874|       |
  875|  18.5k|    two_nt = 2 * nt;
  876|       |
  877|  18.5k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (877:8): [True: 2.84k, False: 15.7k]
  |  Branch (877:20): [True: 735, False: 14.9k]
  ------------------
  878|  3.57k|    {
  879|  97.5k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (879:22): [True: 93.9k, False: 3.57k]
  ------------------
  880|  3.01M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (880:26): [True: 2.92M, False: 93.9k]
  ------------------
  881|  2.92M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt - 1 - row];
  882|  3.57k|    }
  883|  14.9k|    else
  884|  14.9k|    {
  885|       |        /* Filtering done for the 1st row */
  886|   116k|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (886:22): [True: 101k, False: 14.9k]
  ------------------
  887|   101k|        {
  888|   101k|            s2_predpixel = pu2_ref[two_nt - 1]
  889|   101k|                            + ((pu2_ref[two_nt + 1 + col] - pu2_ref[two_nt]) >> 1);
  890|       |
  891|   101k|            pu2_dst[col] = CLIP3(s2_predpixel,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|   101k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.11k, False: 99.9k]
  |  |  |  Branch (40:53): [True: 471, False: 99.5k]
  |  |  ------------------
  ------------------
  892|       |
  893|   101k|        }
  894|       |
  895|       |        /* Replication to next rows */
  896|   101k|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (896:22): [True: 86.1k, False: 14.9k]
  ------------------
  897|   918k|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (897:26): [True: 832k, False: 86.1k]
  ------------------
  898|   832k|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt - 1 - row];
  899|  14.9k|    }
  900|  18.5k|}
ihevc_hbd_intra_pred_luma_ver:
  948|   289k|{
  949|   289k|    WORD32 row, col;
  950|   289k|    WORD16 s2_predpixel;
  951|   289k|    WORD32 two_nt = 2 * nt;
  952|       |
  953|   289k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (953:8): [True: 62.6k, False: 226k]
  |  Branch (953:20): [True: 3.26k, False: 223k]
  ------------------
  954|  66.0k|    {
  955|       |        /* Replication to next columns */
  956|  2.06M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (956:22): [True: 2.00M, False: 66.0k]
  ------------------
  957|  65.4M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (957:26): [True: 63.4M, False: 2.00M]
  ------------------
  958|  63.4M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt + 1 + col];
  959|  66.0k|    }
  960|   223k|    else
  961|   223k|    {
  962|       |        /* Filtering done for the 1st column */
  963|  2.17M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (963:22): [True: 1.95M, False: 223k]
  ------------------
  964|  1.95M|        {
  965|  1.95M|            s2_predpixel = pu2_ref[two_nt + 1]
  966|  1.95M|                            + ((pu2_ref[two_nt - 1 - row] - pu2_ref[two_nt]) >> 1);
  967|       |
  968|  1.95M|            pu2_dst[row * dst_strd] = CLIP3(s2_predpixel,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.95M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 16.9k, False: 1.93M]
  |  |  |  Branch (40:53): [True: 5.65k, False: 1.92M]
  |  |  ------------------
  ------------------
  969|  1.95M|        }
  970|       |
  971|       |        /* Replication to next columns */
  972|  2.17M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (972:22): [True: 1.94M, False: 223k]
  ------------------
  973|  22.5M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (973:26): [True: 20.6M, False: 1.94M]
  ------------------
  974|  20.6M|                pu2_dst[(row * dst_strd) + col] = pu2_ref[two_nt + 1 + col];
  975|   223k|    }
  976|   289k|}
ihevc_hbd_intra_pred_luma_mode2:
 1024|   215k|{
 1025|   215k|    WORD32 row, col;
 1026|   215k|    WORD32 two_nt = 2 * nt;
 1027|   215k|    WORD32 intra_pred_ang = 32;
 1028|   215k|    WORD32 idx =0 ;
 1029|       |
 1030|       |    /* For the angle 45, replication is done from the corresponding angle */
 1031|       |    /* intra_pred_ang = tan(angle) in q5 format */
 1032|  1.72M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1032:18): [True: 1.50M, False: 215k]
  ------------------
 1033|  1.50M|    {
 1034|  1.50M|        idx = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
 1035|       |
 1036|  23.8M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1036:22): [True: 22.3M, False: 1.50M]
  ------------------
 1037|  22.3M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[two_nt - row - idx - 1];
 1038|  1.50M|    }
 1039|   215k|}
ihevc_hbd_intra_pred_luma_mode_18_34:
 1087|  38.4k|{
 1088|  38.4k|    WORD32 row, col;
 1089|  38.4k|    WORD32 intra_pred_ang;
 1090|  38.4k|    WORD32 idx = 0;
 1091|  38.4k|    WORD32 two_nt = 2 * nt;
 1092|       |
 1093|  38.4k|    intra_pred_ang = 32;    /* Default value */
 1094|       |
 1095|       |    /* For mode 18, angle is -45degree */
 1096|  38.4k|    if(mode == 18)
  ------------------
  |  Branch (1096:8): [True: 17.8k, False: 20.5k]
  ------------------
 1097|  17.8k|        intra_pred_ang = -32;
 1098|       |    /* For mode 34, angle is 45degree */
 1099|  20.5k|    else if(mode == 34)
  ------------------
  |  Branch (1099:13): [True: 20.5k, False: 18.4E]
  ------------------
 1100|  20.5k|        intra_pred_ang = 32;
 1101|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
 1102|       |    /* No interpolation is done for 45 degree */
 1103|   396k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1103:18): [True: 357k, False: 38.4k]
  ------------------
 1104|   357k|    {
 1105|   357k|        idx = ((row + 1) * intra_pred_ang) >> 5;
 1106|       |#if OPT
 1107|       |        if(mode == 18)
 1108|       |            idx--;
 1109|       |        if(mode == 34)
 1110|       |            idx++;
 1111|       |#endif
 1112|  6.74M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1112:22): [True: 6.39M, False: 357k]
  ------------------
 1113|  6.39M|            pu2_dst[col + (row * dst_strd)] = pu2_ref[two_nt + col + idx + 1];
 1114|   357k|    }
 1115|  38.4k|}
ihevc_hbd_intra_pred_luma_mode_3_to_9:
 1165|   174k|{
 1166|   174k|    WORD32 row, col;
 1167|   174k|    WORD32 two_nt = 2 * nt;
 1168|   174k|    WORD32 intra_pred_ang;
 1169|   174k|    WORD32 idx, ref_main_idx;
 1170|   174k|    WORD32 pos, fract;
 1171|       |
 1172|       |    /* Intra Pred Angle according to the mode */
 1173|   174k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1174|       |
 1175|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1176|       |    /* samples dependent on distance to obtain destination sample */
 1177|       |
 1178|  1.92M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1178:18): [True: 1.75M, False: 174k]
  ------------------
 1179|  1.75M|    {
 1180|  1.75M|        pos = ((col + 1) * intra_pred_ang);
 1181|  1.75M|        idx = pos >> 5;
 1182|  1.75M|        fract = pos & (31);
 1183|       |
 1184|       |        // Do linear filtering
 1185|  36.0M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1185:22): [True: 34.3M, False: 1.75M]
  ------------------
 1186|  34.3M|        {
 1187|  34.3M|            ref_main_idx = two_nt - row - idx - 1;
 1188|  34.3M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract)
 1189|  34.3M|                            * pu2_ref[ref_main_idx]
 1190|  34.3M|                            + fract * pu2_ref[ref_main_idx - 1] + 16) >> 5 );
 1191|  34.3M|        }
 1192|  1.75M|    }
 1193|   174k|}
ihevc_hbd_intra_pred_luma_mode_11_to_17:
 1242|   123k|{
 1243|       |    /* This function and ihevc_intra_pred_luma_mode_19_to_25 are same except */
 1244|       |    /* for ref main & side samples assignment,can be combined for */
 1245|       |    /* optimzation */
 1246|       |
 1247|   123k|    WORD32 row, col, k;
 1248|   123k|    WORD32 two_nt;
 1249|   123k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1250|   123k|    WORD32 idx, ref_main_idx, ref_idx;
 1251|   123k|    WORD32 pos, fract;
 1252|       |
 1253|   123k|    UWORD16 ref_temp[2 * MAX_CU_SIZE + 1];
 1254|   123k|    UWORD16 *ref_main;
 1255|       |
 1256|   123k|    inv_ang_sum = 128;
 1257|   123k|    two_nt    = 2 * nt;
 1258|       |
 1259|   123k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1260|       |
 1261|   123k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1262|       |    /* Intermediate reference samples for negative angle modes */
 1263|       |    /* This have to be removed during optimization */
 1264|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1265|       |
 1266|   123k|    ref_main = ref_temp + nt - 1;
 1267|  1.55M|    for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (1267:16): [True: 1.42M, False: 123k]
  ------------------
 1268|  1.42M|        ref_temp[k + nt - 1] = pu2_ref[two_nt - k];
 1269|       |
 1270|   123k|    ref_main = ref_temp + nt - 1 ;
 1271|   123k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1272|       |
 1273|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1274|       |    /* For negative angled derive the main reference samples from side */
 1275|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1276|   614k|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1276:17): [True: 490k, False: 123k]
  ------------------
 1277|   490k|    {
 1278|   490k|        inv_ang_sum += inv_ang;
 1279|   490k|        ref_main[k] = pu2_ref[two_nt + (inv_ang_sum >> 8)];
 1280|   490k|    }
 1281|       |
 1282|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1283|       |    /* samples dependent on distance to obtain destination sample */
 1284|  1.42M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1284:18): [True: 1.30M, False: 123k]
  ------------------
 1285|  1.30M|    {
 1286|  1.30M|        pos = ((col + 1) * intra_pred_ang);
 1287|  1.30M|        idx = pos >> 5;
 1288|  1.30M|        fract = pos & (31);
 1289|       |
 1290|       |        // Do linear filtering
 1291|  26.1M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1291:22): [True: 24.8M, False: 1.30M]
  ------------------
 1292|  24.8M|        {
 1293|  24.8M|            ref_main_idx = row + idx + 1;
 1294|  24.8M|            pu2_dst[col + (dst_strd * row)] = (UWORD16)(((32 - fract)
 1295|  24.8M|                            * ref_main[ref_main_idx]
 1296|  24.8M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5 );
 1297|  24.8M|        }
 1298|  1.30M|    }
 1299|   123k|}
ihevc_hbd_intra_pred_luma_mode_19_to_25:
 1350|   136k|{
 1351|   136k|    WORD32 row, col, k;
 1352|   136k|    WORD32 two_nt, intra_pred_ang, idx;
 1353|   136k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1354|   136k|    WORD32 ref_main_idx, ref_idx;
 1355|   136k|    UWORD16 ref_temp[(2 * MAX_CU_SIZE) + 1];
 1356|   136k|    UWORD16 *ref_main;
 1357|       |
 1358|   136k|    two_nt = 2 * nt;
 1359|   136k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1360|   136k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 12];
 1361|       |
 1362|       |    /* Intermediate reference samples for negative angle modes */
 1363|       |    /* This have to be removed during optimization */
 1364|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1365|   136k|    ref_main = ref_temp + nt - 1;
 1366|  1.67M|    for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (1366:16): [True: 1.54M, False: 136k]
  ------------------
 1367|  1.54M|        ref_temp[k + nt - 1] = pu2_ref[two_nt + k];
 1368|       |
 1369|   136k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1370|   136k|    inv_ang_sum = 128;
 1371|       |
 1372|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1373|       |    /* For negative angled derive the main reference samples from side */
 1374|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1375|   608k|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1375:17): [True: 471k, False: 136k]
  ------------------
 1376|   471k|    {
 1377|   471k|        inv_ang_sum += inv_ang;
 1378|   471k|        ref_main[k] = pu2_ref[two_nt - (inv_ang_sum >> 8)];
 1379|   471k|    }
 1380|       |
 1381|  1.53M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1381:18): [True: 1.40M, False: 136k]
  ------------------
 1382|  1.40M|    {
 1383|  1.40M|        pos = ((row + 1) * intra_pred_ang);
 1384|  1.40M|        idx = pos >> 5;
 1385|  1.40M|        fract = pos & (31);
 1386|       |
 1387|       |        // Do linear filtering
 1388|  27.0M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1388:22): [True: 25.6M, False: 1.40M]
  ------------------
 1389|  25.6M|        {
 1390|  25.6M|            ref_main_idx = col + idx + 1;
 1391|  25.6M|            pu2_dst[(row * dst_strd) + col] = (UWORD16)(((32 - fract)
 1392|  25.6M|                            * ref_main[ref_main_idx]
 1393|  25.6M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5 );
 1394|  25.6M|        }
 1395|  1.40M|    }
 1396|   136k|}
ihevc_hbd_intra_pred_luma_mode_27_to_33:
 1445|   132k|{
 1446|   132k|    WORD32 row, col;
 1447|   132k|    WORD32 two_nt, pos, fract;
 1448|   132k|    WORD32 intra_pred_ang;
 1449|   132k|    WORD32 idx, ref_main_idx;
 1450|       |
 1451|   132k|    two_nt = 2 * nt;
 1452|   132k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1453|       |
 1454|  1.46M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1454:18): [True: 1.33M, False: 132k]
  ------------------
 1455|  1.33M|    {
 1456|  1.33M|        pos = ((row + 1) * intra_pred_ang);
 1457|  1.33M|        idx = pos >> 5;
 1458|  1.33M|        fract = pos & (31);
 1459|       |
 1460|       |        // Do linear filtering
 1461|  25.1M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1461:22): [True: 23.8M, False: 1.33M]
  ------------------
 1462|  23.8M|        {
 1463|  23.8M|            ref_main_idx = two_nt + col + idx + 1;
 1464|  23.8M|            pu2_dst[col + (row * dst_strd)] = (((32 - fract)
 1465|  23.8M|                            * pu2_ref[ref_main_idx]
 1466|  23.8M|                            + fract * pu2_ref[ref_main_idx + 1] + 16) >> 5 );
 1467|  23.8M|        }
 1468|  1.33M|    }
 1469|   132k|}

ihevc_hbd_itrans_recon_4x4_ttype1:
  110|   455k|{
  111|   455k|    WORD32 i, c[4];
  112|   455k|    WORD32 add;
  113|   455k|    WORD32 shift;
  114|   455k|    WORD16 *pi2_tmp_orig;
  115|   455k|    WORD32 trans_size;
  116|   455k|    WORD16 clip_limit;
  117|       |
  118|   455k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   455k|#define TRANS_SIZE_4   4
  ------------------
  119|       |
  120|   455k|    pi2_tmp_orig = pi2_tmp;
  121|       |
  122|       |    /* Inverse Transform 1st stage */
  123|   455k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   455k|#define IT_SHIFT_STAGE_1 7
  ------------------
  124|   455k|    add = 1 << (shift - 1);
  125|       |
  126|  2.27M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (126:16): [True: 1.82M, False: 455k]
  ------------------
  127|  1.82M|    {
  128|       |        /* Checking for Zero Cols */
  129|  1.82M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (129:12): [True: 504k, False: 1.31M]
  ------------------
  130|   504k|        {
  131|   504k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  132|   504k|        }
  133|  1.31M|        else
  134|  1.31M|        {
  135|       |            // Intermediate Variables
  136|  1.31M|            c[0] = pi2_src[0] + pi2_src[2 * src_strd];
  137|  1.31M|            c[1] = pi2_src[2 * src_strd] + pi2_src[3 * src_strd];
  138|  1.31M|            c[2] = pi2_src[0] - pi2_src[3 * src_strd];
  139|  1.31M|            c[3] = 74 * pi2_src[src_strd];
  140|       |
  141|  1.31M|            pi2_tmp[0] =
  142|  1.31M|                            CLIP_S16(( 29 * c[0] + 55 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.31M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.31M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.45k, False: 1.30M]
  |  |  |  |  |  Branch (40:53): [True: 750, False: 1.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|  1.31M|            pi2_tmp[1] =
  144|  1.31M|                            CLIP_S16(( 55 * c[2] - 29 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.31M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.31M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.83k, False: 1.31M]
  |  |  |  |  |  Branch (40:53): [True: 306, False: 1.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  1.31M|            pi2_tmp[2] =
  146|  1.31M|                            CLIP_S16(( 74 * (pi2_src[0] - pi2_src[2 * src_strd ] + pi2_src[3 * src_strd ]) + add ) >> shift );
  ------------------
  |  |   53|  1.31M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.31M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 824, False: 1.31M]
  |  |  |  |  |  Branch (40:53): [True: 803, False: 1.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|  1.31M|            pi2_tmp[3] =
  148|  1.31M|                            CLIP_S16(( 55 * c[0] + 29 * c[2] - c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.31M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.31M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 805, False: 1.31M]
  |  |  |  |  |  Branch (40:53): [True: 907, False: 1.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|  1.31M|        }
  150|  1.82M|        pi2_src++;
  151|  1.82M|        pi2_tmp += trans_size;
  152|  1.82M|        zero_cols = zero_cols >> 1;
  153|  1.82M|    }
  154|       |
  155|   455k|    pi2_tmp = pi2_tmp_orig;
  156|       |
  157|       |    /* Inverse Transform 2nd stage */
  158|   455k|    shift = 20 - u1_bit_depth;
  159|   455k|    add = 1 << (shift - 1);
  160|   455k|    clip_limit = (1 << u1_bit_depth) - 1;
  161|       |
  162|  2.27M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (162:16): [True: 1.82M, False: 455k]
  ------------------
  163|  1.82M|    {
  164|  1.82M|        WORD32 itrans_out;
  165|       |        // Intermediate Variables
  166|  1.82M|        c[0] = pi2_tmp[0] + pi2_tmp[2 * trans_size];
  167|  1.82M|        c[1] = pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size];
  168|  1.82M|        c[2] = pi2_tmp[0] - pi2_tmp[3 * trans_size];
  169|  1.82M|        c[3] = 74 * pi2_tmp[trans_size];
  170|       |
  171|  1.82M|        itrans_out =
  172|  1.82M|                        CLIP_S16(( 29 * c[0] + 55 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.82M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  1.82M|        pu2_dst[0] = CLIP3( (itrans_out + pu2_pred[0] ), 0, clip_limit );
  ------------------
  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 243k, False: 1.57M]
  |  |  |  Branch (40:53): [True: 41.4k, False: 1.53M]
  |  |  ------------------
  ------------------
  174|  1.82M|        itrans_out =
  175|  1.82M|                        CLIP_S16(( 55 * c[2] - 29 * c[1] + c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.82M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|  1.82M|        pu2_dst[1] = CLIP3( (itrans_out + pu2_pred[1] ), 0, clip_limit );
  ------------------
  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 170k, False: 1.65M]
  |  |  |  Branch (40:53): [True: 100k, False: 1.54M]
  |  |  ------------------
  ------------------
  177|  1.82M|        itrans_out =
  178|  1.82M|                        CLIP_S16(( 74 * (pi2_tmp[0] - pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]) + add ) >> shift );
  ------------------
  |  |   53|  1.82M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|  1.82M|        pu2_dst[2] = CLIP3( (itrans_out+ pu2_pred[2] ), 0, clip_limit );
  ------------------
  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 194k, False: 1.62M]
  |  |  |  Branch (40:53): [True: 134k, False: 1.49M]
  |  |  ------------------
  ------------------
  180|  1.82M|        itrans_out =
  181|  1.82M|                        CLIP_S16(( 55 * c[0] + 29 * c[2] - c[3] + add ) >> shift );
  ------------------
  |  |   53|  1.82M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.82M|        pu2_dst[3] = CLIP3( (itrans_out+ pu2_pred[3] ), 0, clip_limit );
  ------------------
  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 215k, False: 1.60M]
  |  |  |  Branch (40:53): [True: 144k, False: 1.46M]
  |  |  ------------------
  ------------------
  183|  1.82M|        pi2_tmp++;
  184|  1.82M|        pu2_pred += pred_strd;
  185|  1.82M|        pu2_dst += dst_strd;
  186|  1.82M|    }
  187|   455k|}
ihevc_hbd_itrans_recon_4x4:
  247|  4.72k|{
  248|  4.72k|    WORD32 j;
  249|  4.72k|    WORD32 e[2], o[2];
  250|  4.72k|    WORD32 add;
  251|  4.72k|    WORD32 shift;
  252|  4.72k|    WORD16 *pi2_tmp_orig;
  253|  4.72k|    WORD32 trans_size;
  254|  4.72k|    WORD16 clip_limit;
  255|       |
  256|  4.72k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  4.72k|#define TRANS_SIZE_4   4
  ------------------
  257|       |
  258|  4.72k|    pi2_tmp_orig = pi2_tmp;
  259|       |
  260|       |    /* Inverse Transform 1st stage */
  261|  4.72k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  4.72k|#define IT_SHIFT_STAGE_1 7
  ------------------
  262|  4.72k|    add = 1 << (shift - 1);
  263|       |
  264|  23.6k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (264:16): [True: 18.9k, False: 4.72k]
  ------------------
  265|  18.9k|    {
  266|       |        /* Checking for Zero Cols */
  267|  18.9k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (267:12): [True: 5.28k, False: 13.6k]
  ------------------
  268|  5.28k|        {
  269|  5.28k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  270|  5.28k|        }
  271|  13.6k|        else
  272|  13.6k|        {
  273|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  274|  13.6k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  275|  13.6k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  276|  13.6k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  277|  13.6k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  278|  13.6k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  279|  13.6k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  280|  13.6k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  281|  13.6k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  282|       |
  283|  13.6k|            pi2_tmp[0] =
  284|  13.6k|                            CLIP_S16( ((e[0] + o[0] + add)>>shift) );
  ------------------
  |  |   53|  13.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  13.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 328, False: 13.2k]
  |  |  |  |  |  Branch (40:53): [True: 333, False: 12.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|  13.6k|            pi2_tmp[1] =
  286|  13.6k|                            CLIP_S16( ((e[1] + o[1] + add)>>shift) );
  ------------------
  |  |   53|  13.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  13.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 236, False: 13.3k]
  |  |  |  |  |  Branch (40:53): [True: 252, False: 13.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|  13.6k|            pi2_tmp[2] =
  288|  13.6k|                            CLIP_S16( ((e[1] - o[1] + add)>>shift) );
  ------------------
  |  |   53|  13.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  13.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 204, False: 13.4k]
  |  |  |  |  |  Branch (40:53): [True: 348, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|  13.6k|            pi2_tmp[3] =
  290|  13.6k|                            CLIP_S16( ((e[0] - o[0] + add)>>shift) );
  ------------------
  |  |   53|  13.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  13.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 208, False: 13.4k]
  |  |  |  |  |  Branch (40:53): [True: 385, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|  13.6k|        }
  292|  18.9k|        pi2_src++;
  293|  18.9k|        pi2_tmp += trans_size;
  294|  18.9k|        zero_cols = zero_cols >> 1;
  295|  18.9k|    }
  296|       |
  297|  4.72k|    pi2_tmp = pi2_tmp_orig;
  298|       |
  299|       |    /* Inverse Transform 2nd stage */
  300|  4.72k|    shift = 20 - u1_bit_depth;
  301|  4.72k|    add = 1 << (shift - 1);
  302|  4.72k|    clip_limit = (1 << u1_bit_depth) - 1;
  303|       |
  304|  23.6k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (304:16): [True: 18.9k, False: 4.72k]
  ------------------
  305|  18.9k|    {
  306|  18.9k|        WORD32 itrans_out;
  307|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  308|  18.9k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  309|  18.9k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  310|  18.9k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  311|  18.9k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  312|  18.9k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  313|  18.9k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  314|  18.9k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  315|  18.9k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  316|       |
  317|  18.9k|        itrans_out =
  318|  18.9k|                        CLIP_S16( ((e[0] + o[0] + add)>>shift ) );
  ------------------
  |  |   53|  18.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.9k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|  18.9k|        pu2_dst[0] = CLIP3( (itrans_out + pu2_pred[0] ), 0, clip_limit);
  ------------------
  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.75k, False: 15.1k]
  |  |  |  Branch (40:53): [True: 4.28k, False: 10.8k]
  |  |  ------------------
  ------------------
  320|  18.9k|        itrans_out =
  321|  18.9k|                        CLIP_S16( ((e[1] + o[1] + add)>>shift ) );
  ------------------
  |  |   53|  18.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.9k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|  18.9k|        pu2_dst[1] = CLIP3( (itrans_out + pu2_pred[1] ), 0, clip_limit );
  ------------------
  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.26k, False: 15.6k]
  |  |  |  Branch (40:53): [True: 4.45k, False: 11.1k]
  |  |  ------------------
  ------------------
  323|  18.9k|        itrans_out =
  324|  18.9k|                        CLIP_S16( ((e[1] - o[1] + add)>>shift ) );
  ------------------
  |  |   53|  18.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.9k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|  18.9k|        pu2_dst[2] = CLIP3( (itrans_out + pu2_pred[2] ), 0, clip_limit );
  ------------------
  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.44k, False: 16.4k]
  |  |  |  Branch (40:53): [True: 4.48k, False: 11.9k]
  |  |  ------------------
  ------------------
  326|  18.9k|        itrans_out =
  327|  18.9k|                        CLIP_S16( ((e[0] - o[0] + add)>>shift ));
  ------------------
  |  |   53|  18.9k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.9k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  328|  18.9k|        pu2_dst[3] = CLIP3( (itrans_out + pu2_pred[3] ), 0, clip_limit );
  ------------------
  |  |   40|  18.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.48k, False: 16.4k]
  |  |  |  Branch (40:53): [True: 4.26k, False: 12.1k]
  |  |  ------------------
  ------------------
  329|       |
  330|  18.9k|        pi2_tmp++;
  331|  18.9k|        pu2_pred += pred_strd;
  332|  18.9k|        pu2_dst += dst_strd;
  333|  18.9k|    }
  334|  4.72k|}

ihevc_hbd_itrans_recon_16x16:
  106|   117k|{
  107|   117k|    WORD32 j, k;
  108|   117k|    WORD32 e[8], o[8];
  109|   117k|    WORD32 ee[4], eo[4];
  110|   117k|    WORD32 eee[2], eeo[2];
  111|   117k|    WORD32 add;
  112|   117k|    WORD32 shift;
  113|   117k|    WORD16 *pi2_tmp_orig;
  114|   117k|    WORD32 trans_size;
  115|   117k|    WORD32 zero_rows_2nd_stage = zero_cols;
  116|   117k|    WORD32 row_limit_2nd_stage;
  117|   117k|    WORD16 clip_limit;
  118|       |
  119|   117k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (119:8): [True: 66.8k, False: 51.0k]
  ------------------
  120|  66.8k|        row_limit_2nd_stage = 4;
  121|  51.0k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (121:13): [True: 14.8k, False: 36.1k]
  ------------------
  122|  14.8k|        row_limit_2nd_stage = 8;
  123|  36.1k|    else
  124|  36.1k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  36.1k|#define TRANS_SIZE_16 16
  ------------------
  125|       |
  126|   117k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   117k|#define TRANS_SIZE_16 16
  ------------------
  127|   117k|    pi2_tmp_orig = pi2_tmp;
  128|   117k|    clip_limit = (1 << u1_bit_depth) - 1;
  129|       |
  130|   117k|    if((zero_rows & 0xFFF0) == 0xFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (130:8): [True: 71.7k, False: 46.1k]
  ------------------
  131|  71.7k|    {
  132|       |        /* Inverse Transform 1st stage */
  133|       |        /************************************************************************************************/
  134|       |        /**********************************START - IT_RECON_16x16****************************************/
  135|       |        /************************************************************************************************/
  136|       |
  137|  71.7k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  71.7k|#define IT_SHIFT_STAGE_1 7
  ------------------
  138|  71.7k|        add = 1 << (shift - 1);
  139|       |
  140|   503k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (140:20): [True: 431k, False: 71.7k]
  ------------------
  141|   431k|        {
  142|       |            /* Checking for Zero Cols */
  143|   431k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (143:16): [True: 245k, False: 186k]
  ------------------
  144|   245k|            {
  145|   245k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  146|   245k|            }
  147|   186k|            else
  148|   186k|            {
  149|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  150|  1.67M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (150:28): [True: 1.49M, False: 186k]
  ------------------
  151|  1.49M|                {
  152|  1.49M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  153|  1.49M|                                    + g_ai2_ihevc_trans_16[3][k]
  154|  1.49M|                                                    * pi2_src[3 * src_strd];
  155|  1.49M|                }
  156|   933k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (156:28): [True: 747k, False: 186k]
  ------------------
  157|   747k|                {
  158|   747k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  159|   747k|                }
  160|   186k|                eeo[0] = 0;
  161|   186k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  162|   186k|                eeo[1] = 0;
  163|   186k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  164|       |
  165|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  166|   559k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (166:28): [True: 373k, False: 186k]
  ------------------
  167|   373k|                {
  168|   373k|                    ee[k] = eee[k] + eeo[k];
  169|   373k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  170|   373k|                }
  171|   933k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (171:28): [True: 747k, False: 186k]
  ------------------
  172|   747k|                {
  173|   747k|                    e[k] = ee[k] + eo[k];
  174|   747k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  175|   747k|                }
  176|  1.68M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (176:28): [True: 1.49M, False: 186k]
  ------------------
  177|  1.49M|                {
  178|  1.49M|                    pi2_tmp[k] =
  179|  1.49M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  1.49M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.49M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 223, False: 1.49M]
  |  |  |  |  |  Branch (40:53): [True: 275, False: 1.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  1.49M|                    pi2_tmp[k + 8] =
  181|  1.49M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  1.49M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.49M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 122, False: 1.49M]
  |  |  |  |  |  Branch (40:53): [True: 259, False: 1.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.49M|                }
  183|   186k|            }
  184|   431k|            pi2_src++;
  185|   431k|            pi2_tmp += trans_size;
  186|   431k|            zero_cols = zero_cols >> 1;
  187|   431k|        }
  188|       |
  189|  71.7k|        pi2_tmp = pi2_tmp_orig;
  190|       |
  191|       |        /* Inverse Transform 2nd stage */
  192|  71.7k|        shift = 20 - u1_bit_depth;
  193|  71.7k|        add = 1 << (shift - 1);
  194|       |
  195|  71.7k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (195:12): [True: 52.9k, False: 18.7k]
  ------------------
  196|  52.9k|        {
  197|   896k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (197:24): [True: 843k, False: 52.9k]
  ------------------
  198|   843k|            {
  199|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  200|  7.59M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (200:28): [True: 6.74M, False: 843k]
  ------------------
  201|  6.74M|                {
  202|  6.74M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  203|  6.74M|                                    + g_ai2_ihevc_trans_16[3][k]
  204|  6.74M|                                                    * pi2_tmp[3 * trans_size];
  205|  6.74M|                }
  206|  4.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (206:28): [True: 3.37M, False: 843k]
  ------------------
  207|  3.37M|                {
  208|  3.37M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  209|  3.37M|                }
  210|   843k|                eeo[0] = 0;
  211|   843k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  212|   843k|                eeo[1] = 0;
  213|   843k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  214|       |
  215|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  216|  2.52M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (216:28): [True: 1.68M, False: 843k]
  ------------------
  217|  1.68M|                {
  218|  1.68M|                    ee[k] = eee[k] + eeo[k];
  219|  1.68M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  220|  1.68M|                }
  221|  4.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (221:28): [True: 3.37M, False: 843k]
  ------------------
  222|  3.37M|                {
  223|  3.37M|                    e[k] = ee[k] + eo[k];
  224|  3.37M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  225|  3.37M|                }
  226|  7.58M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (226:28): [True: 6.74M, False: 843k]
  ------------------
  227|  6.74M|                {
  228|  6.74M|                    WORD32 itrans_out;
  229|  6.74M|                    itrans_out =
  230|  6.74M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  6.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  6.74M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  6.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 81.2k, False: 6.66M]
  |  |  |  Branch (40:53): [True: 39.8k, False: 6.62M]
  |  |  ------------------
  ------------------
  232|  6.74M|                    itrans_out =
  233|  6.74M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  6.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  6.74M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  6.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 141k, False: 6.60M]
  |  |  |  Branch (40:53): [True: 39.3k, False: 6.56M]
  |  |  ------------------
  ------------------
  235|  6.74M|                }
  236|   843k|                pi2_tmp++;
  237|   843k|                pu2_pred += pred_strd;
  238|   843k|                pu2_dst += dst_strd;
  239|   843k|            }
  240|  52.9k|        }
  241|  18.7k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (241:17): [True: 9.93k, False: 8.81k]
  ------------------
  242|  9.93k|        {
  243|   168k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (243:24): [True: 158k, False: 9.93k]
  ------------------
  244|   158k|            {
  245|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  246|  1.42M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (246:28): [True: 1.26M, False: 158k]
  ------------------
  247|  1.26M|                {
  248|  1.26M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  249|  1.26M|                                    + g_ai2_ihevc_trans_16[3][k]
  250|  1.26M|                                                    * pi2_tmp[3 * trans_size]
  251|  1.26M|                                    + g_ai2_ihevc_trans_16[5][k]
  252|  1.26M|                                                    * pi2_tmp[5 * trans_size]
  253|  1.26M|                                    + g_ai2_ihevc_trans_16[7][k]
  254|  1.26M|                                                    * pi2_tmp[7 * trans_size];
  255|  1.26M|                }
  256|   791k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (256:28): [True: 633k, False: 158k]
  ------------------
  257|   633k|                {
  258|   633k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  259|   633k|                                    + g_ai2_ihevc_trans_16[6][k]
  260|   633k|                                                    * pi2_tmp[6 * trans_size];
  261|   633k|                }
  262|   158k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  263|   158k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  264|   158k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  265|   158k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  266|       |
  267|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  268|   474k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (268:28): [True: 316k, False: 158k]
  ------------------
  269|   316k|                {
  270|   316k|                    ee[k] = eee[k] + eeo[k];
  271|   316k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  272|   316k|                }
  273|   791k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (273:28): [True: 633k, False: 158k]
  ------------------
  274|   633k|                {
  275|   633k|                    e[k] = ee[k] + eo[k];
  276|   633k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  277|   633k|                }
  278|  1.42M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (278:28): [True: 1.26M, False: 158k]
  ------------------
  279|  1.26M|                {
  280|  1.26M|                    WORD32 itrans_out;
  281|  1.26M|                    itrans_out =
  282|  1.26M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.26M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.26M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.26M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  1.26M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.26M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 139k, False: 1.12M]
  |  |  |  Branch (40:53): [True: 13.4k, False: 1.11M]
  |  |  ------------------
  ------------------
  284|  1.26M|                    itrans_out =
  285|  1.26M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.26M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.26M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.26M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|  1.26M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.26M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 165k, False: 1.09M]
  |  |  |  Branch (40:53): [True: 13.2k, False: 1.08M]
  |  |  ------------------
  ------------------
  287|  1.26M|                }
  288|   158k|                pi2_tmp++;
  289|   158k|                pu2_pred += pred_strd;
  290|   158k|                pu2_dst += dst_strd;
  291|   158k|            }
  292|  9.93k|        }
  293|  8.81k|        else /* All rows of output of 1st stage are non-zero */
  294|  8.81k|        {
  295|   144k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (295:24): [True: 135k, False: 8.81k]
  ------------------
  296|   135k|            {
  297|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  298|  1.21M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (298:28): [True: 1.08M, False: 135k]
  ------------------
  299|  1.08M|                {
  300|  1.08M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  301|  1.08M|                                    + g_ai2_ihevc_trans_16[3][k]
  302|  1.08M|                                                    * pi2_tmp[3 * trans_size]
  303|  1.08M|                                    + g_ai2_ihevc_trans_16[5][k]
  304|  1.08M|                                                    * pi2_tmp[5 * trans_size]
  305|  1.08M|                                    + g_ai2_ihevc_trans_16[7][k]
  306|  1.08M|                                                    * pi2_tmp[7 * trans_size]
  307|  1.08M|                                    + g_ai2_ihevc_trans_16[9][k]
  308|  1.08M|                                                    * pi2_tmp[9 * trans_size]
  309|  1.08M|                                    + g_ai2_ihevc_trans_16[11][k]
  310|  1.08M|                                                    * pi2_tmp[11 * trans_size]
  311|  1.08M|                                    + g_ai2_ihevc_trans_16[13][k]
  312|  1.08M|                                                    * pi2_tmp[13 * trans_size]
  313|  1.08M|                                    + g_ai2_ihevc_trans_16[15][k]
  314|  1.08M|                                                    * pi2_tmp[15 * trans_size];
  315|  1.08M|                }
  316|   681k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (316:28): [True: 545k, False: 135k]
  ------------------
  317|   545k|                {
  318|   545k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  319|   545k|                                    + g_ai2_ihevc_trans_16[6][k]
  320|   545k|                                                    * pi2_tmp[6 * trans_size]
  321|   545k|                                    + g_ai2_ihevc_trans_16[10][k]
  322|   545k|                                                    * pi2_tmp[10 * trans_size]
  323|   545k|                                    + g_ai2_ihevc_trans_16[14][k]
  324|   545k|                                                    * pi2_tmp[14 * trans_size];
  325|   545k|                }
  326|   135k|                eeo[0] =
  327|   135k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  328|   135k|                                                + g_ai2_ihevc_trans_16[12][0]
  329|   135k|                                                                * pi2_tmp[12
  330|   135k|                                                                                * trans_size];
  331|   135k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  332|   135k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  333|   135k|                eeo[1] =
  334|   135k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  335|   135k|                                                + g_ai2_ihevc_trans_16[12][1]
  336|   135k|                                                                * pi2_tmp[12
  337|   135k|                                                                                * trans_size];
  338|   135k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  339|   135k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  340|       |
  341|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  342|   407k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (342:28): [True: 271k, False: 135k]
  ------------------
  343|   271k|                {
  344|   271k|                    ee[k] = eee[k] + eeo[k];
  345|   271k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  346|   271k|                }
  347|   679k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (347:28): [True: 544k, False: 135k]
  ------------------
  348|   544k|                {
  349|   544k|                    e[k] = ee[k] + eo[k];
  350|   544k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  351|   544k|                }
  352|  1.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (352:28): [True: 1.07M, False: 135k]
  ------------------
  353|  1.07M|                {
  354|  1.07M|                    WORD32 itrans_out;
  355|  1.07M|                    itrans_out =
  356|  1.07M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.07M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.07M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  1.07M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 120k, False: 951k]
  |  |  |  Branch (40:53): [True: 21.3k, False: 930k]
  |  |  ------------------
  ------------------
  358|  1.07M|                    itrans_out =
  359|  1.07M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.07M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.07M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|  1.07M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.07M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 227k, False: 845k]
  |  |  |  Branch (40:53): [True: 17.9k, False: 827k]
  |  |  ------------------
  ------------------
  361|  1.07M|                }
  362|   135k|                pi2_tmp++;
  363|   135k|                pu2_pred += pred_strd;
  364|   135k|                pu2_dst += dst_strd;
  365|   135k|            }
  366|  8.81k|        }
  367|       |        /************************************************************************************************/
  368|       |        /************************************END - IT_RECON_16x16****************************************/
  369|       |        /************************************************************************************************/
  370|  71.7k|    }
  371|  46.1k|    else if((zero_rows & 0xFF00) == 0xFF00)  /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (371:13): [True: 13.4k, False: 32.6k]
  ------------------
  372|  13.4k|    {
  373|       |        /* Inverse Transform 1st stage */
  374|       |        /************************************************************************************************/
  375|       |        /**********************************START - IT_RECON_16x16****************************************/
  376|       |        /************************************************************************************************/
  377|       |
  378|  13.4k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  13.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  379|  13.4k|        add = 1 << (shift - 1);
  380|       |
  381|   107k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (381:20): [True: 94.1k, False: 13.4k]
  ------------------
  382|  94.1k|        {
  383|       |            /* Checking for Zero Cols */
  384|  94.1k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (384:16): [True: 30.8k, False: 63.3k]
  ------------------
  385|  30.8k|            {
  386|  30.8k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  387|  30.8k|            }
  388|  63.3k|            else
  389|  63.3k|            {
  390|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  391|   570k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (391:28): [True: 506k, False: 63.3k]
  ------------------
  392|   506k|                {
  393|   506k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  394|   506k|                                    + g_ai2_ihevc_trans_16[3][k]
  395|   506k|                                                    * pi2_src[3 * src_strd]
  396|   506k|                                    + g_ai2_ihevc_trans_16[5][k]
  397|   506k|                                                    * pi2_src[5 * src_strd]
  398|   506k|                                    + g_ai2_ihevc_trans_16[7][k]
  399|   506k|                                                    * pi2_src[7 * src_strd];
  400|   506k|                }
  401|   316k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (401:28): [True: 253k, False: 63.3k]
  ------------------
  402|   253k|                {
  403|   253k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  404|   253k|                                    + g_ai2_ihevc_trans_16[6][k]
  405|   253k|                                                    * pi2_src[6 * src_strd];
  406|   253k|                }
  407|  63.3k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  408|  63.3k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  409|  63.3k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  410|  63.3k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  411|       |
  412|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  413|   190k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (413:28): [True: 126k, False: 63.3k]
  ------------------
  414|   126k|                {
  415|   126k|                    ee[k] = eee[k] + eeo[k];
  416|   126k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  417|   126k|                }
  418|   316k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (418:28): [True: 253k, False: 63.3k]
  ------------------
  419|   253k|                {
  420|   253k|                    e[k] = ee[k] + eo[k];
  421|   253k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  422|   253k|                }
  423|   570k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (423:28): [True: 507k, False: 63.3k]
  ------------------
  424|   507k|                {
  425|   507k|                    pi2_tmp[k] =
  426|   507k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   507k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   507k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 146, False: 506k]
  |  |  |  |  |  Branch (40:53): [True: 364, False: 506k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|   507k|                    pi2_tmp[k + 8] =
  428|   507k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|   507k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   507k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 124, False: 506k]
  |  |  |  |  |  Branch (40:53): [True: 92, False: 506k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|   507k|                }
  430|  63.3k|            }
  431|  94.1k|            pi2_src++;
  432|  94.1k|            pi2_tmp += trans_size;
  433|  94.1k|            zero_cols = zero_cols >> 1;
  434|  94.1k|        }
  435|       |
  436|  13.4k|        pi2_tmp = pi2_tmp_orig;
  437|       |
  438|       |        /* Inverse Transform 2nd stage */
  439|  13.4k|        shift = 20 - u1_bit_depth;
  440|  13.4k|        add = 1 << (shift - 1);
  441|       |
  442|  13.4k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (442:12): [True: 8.01k, False: 5.47k]
  ------------------
  443|  8.01k|        {
  444|   135k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (444:24): [True: 127k, False: 8.01k]
  ------------------
  445|   127k|            {
  446|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  447|  1.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (447:28): [True: 1.01M, False: 127k]
  ------------------
  448|  1.01M|                {
  449|  1.01M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  450|  1.01M|                                    + g_ai2_ihevc_trans_16[3][k]
  451|  1.01M|                                                    * pi2_tmp[3 * trans_size];
  452|  1.01M|                }
  453|   635k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (453:28): [True: 508k, False: 127k]
  ------------------
  454|   508k|                {
  455|   508k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  456|   508k|                }
  457|   127k|                eeo[0] = 0;
  458|   127k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  459|   127k|                eeo[1] = 0;
  460|   127k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  461|       |
  462|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  463|   381k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (463:28): [True: 254k, False: 127k]
  ------------------
  464|   254k|                {
  465|   254k|                    ee[k] = eee[k] + eeo[k];
  466|   254k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  467|   254k|                }
  468|   635k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (468:28): [True: 508k, False: 127k]
  ------------------
  469|   508k|                {
  470|   508k|                    e[k] = ee[k] + eo[k];
  471|   508k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  472|   508k|                }
  473|  1.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (473:28): [True: 1.01M, False: 127k]
  ------------------
  474|  1.01M|                {
  475|  1.01M|                    WORD32 itrans_out;
  476|  1.01M|                    itrans_out =
  477|  1.01M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  1.01M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.01M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.01M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  1.01M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.01M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 104k, False: 910k]
  |  |  |  Branch (40:53): [True: 17.7k, False: 892k]
  |  |  ------------------
  ------------------
  479|  1.01M|                    itrans_out =
  480|  1.01M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  1.01M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.01M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.01M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|  1.01M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  1.01M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 91.5k, False: 923k]
  |  |  |  Branch (40:53): [True: 18.3k, False: 905k]
  |  |  ------------------
  ------------------
  482|  1.01M|                }
  483|   127k|                pi2_tmp++;
  484|   127k|                pu2_pred += pred_strd;
  485|   127k|                pu2_dst += dst_strd;
  486|   127k|            }
  487|  8.01k|        }
  488|  5.47k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (488:17): [True: 3.19k, False: 2.28k]
  ------------------
  489|  3.19k|        {
  490|  54.2k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (490:24): [True: 51.0k, False: 3.19k]
  ------------------
  491|  51.0k|            {
  492|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  493|   459k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (493:28): [True: 408k, False: 51.0k]
  ------------------
  494|   408k|                {
  495|   408k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  496|   408k|                                    + g_ai2_ihevc_trans_16[3][k]
  497|   408k|                                                    * pi2_tmp[3 * trans_size]
  498|   408k|                                    + g_ai2_ihevc_trans_16[5][k]
  499|   408k|                                                    * pi2_tmp[5 * trans_size]
  500|   408k|                                    + g_ai2_ihevc_trans_16[7][k]
  501|   408k|                                                    * pi2_tmp[7 * trans_size];
  502|   408k|                }
  503|   255k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (503:28): [True: 204k, False: 51.0k]
  ------------------
  504|   204k|                {
  505|   204k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  506|   204k|                                    + g_ai2_ihevc_trans_16[6][k]
  507|   204k|                                                    * pi2_tmp[6 * trans_size];
  508|   204k|                }
  509|  51.0k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  510|  51.0k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  511|  51.0k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  512|  51.0k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  513|       |
  514|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  515|   153k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (515:28): [True: 102k, False: 51.0k]
  ------------------
  516|   102k|                {
  517|   102k|                    ee[k] = eee[k] + eeo[k];
  518|   102k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  519|   102k|                }
  520|   255k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (520:28): [True: 204k, False: 51.0k]
  ------------------
  521|   204k|                {
  522|   204k|                    e[k] = ee[k] + eo[k];
  523|   204k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  524|   204k|                }
  525|   459k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (525:28): [True: 408k, False: 51.0k]
  ------------------
  526|   408k|                {
  527|   408k|                    WORD32 itrans_out;
  528|   408k|                    itrans_out =
  529|   408k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   408k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   408k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 408k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 408k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  530|   408k|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   408k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 68.2k, False: 340k]
  |  |  |  Branch (40:53): [True: 8.18k, False: 332k]
  |  |  ------------------
  ------------------
  531|   408k|                    itrans_out =
  532|   408k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   408k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   408k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 408k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 408k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|   408k|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|   408k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 49.0k, False: 359k]
  |  |  |  Branch (40:53): [True: 17.9k, False: 341k]
  |  |  ------------------
  ------------------
  534|   408k|                }
  535|  51.0k|                pi2_tmp++;
  536|  51.0k|                pu2_pred += pred_strd;
  537|  51.0k|                pu2_dst += dst_strd;
  538|  51.0k|            }
  539|  3.19k|        }
  540|  2.28k|        else /* All rows of output of 1st stage are non-zero */
  541|  2.28k|        {
  542|  38.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (542:24): [True: 36.5k, False: 2.28k]
  ------------------
  543|  36.5k|            {
  544|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  545|   329k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (545:28): [True: 292k, False: 36.5k]
  ------------------
  546|   292k|                {
  547|   292k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  548|   292k|                                    + g_ai2_ihevc_trans_16[3][k]
  549|   292k|                                                    * pi2_tmp[3 * trans_size]
  550|   292k|                                    + g_ai2_ihevc_trans_16[5][k]
  551|   292k|                                                    * pi2_tmp[5 * trans_size]
  552|   292k|                                    + g_ai2_ihevc_trans_16[7][k]
  553|   292k|                                                    * pi2_tmp[7 * trans_size]
  554|   292k|                                    + g_ai2_ihevc_trans_16[9][k]
  555|   292k|                                                    * pi2_tmp[9 * trans_size]
  556|   292k|                                    + g_ai2_ihevc_trans_16[11][k]
  557|   292k|                                                    * pi2_tmp[11 * trans_size]
  558|   292k|                                    + g_ai2_ihevc_trans_16[13][k]
  559|   292k|                                                    * pi2_tmp[13 * trans_size]
  560|   292k|                                    + g_ai2_ihevc_trans_16[15][k]
  561|   292k|                                                    * pi2_tmp[15 * trans_size];
  562|   292k|                }
  563|   182k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (563:28): [True: 146k, False: 36.5k]
  ------------------
  564|   146k|                {
  565|   146k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  566|   146k|                                    + g_ai2_ihevc_trans_16[6][k]
  567|   146k|                                                    * pi2_tmp[6 * trans_size]
  568|   146k|                                    + g_ai2_ihevc_trans_16[10][k]
  569|   146k|                                                    * pi2_tmp[10 * trans_size]
  570|   146k|                                    + g_ai2_ihevc_trans_16[14][k]
  571|   146k|                                                    * pi2_tmp[14 * trans_size];
  572|   146k|                }
  573|  36.5k|                eeo[0] =
  574|  36.5k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  575|  36.5k|                                                + g_ai2_ihevc_trans_16[12][0]
  576|  36.5k|                                                                * pi2_tmp[12
  577|  36.5k|                                                                                * trans_size];
  578|  36.5k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  579|  36.5k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  580|  36.5k|                eeo[1] =
  581|  36.5k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  582|  36.5k|                                                + g_ai2_ihevc_trans_16[12][1]
  583|  36.5k|                                                                * pi2_tmp[12
  584|  36.5k|                                                                                * trans_size];
  585|  36.5k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  586|  36.5k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  587|       |
  588|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  589|   109k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (589:28): [True: 73.1k, False: 36.5k]
  ------------------
  590|  73.1k|                {
  591|  73.1k|                    ee[k] = eee[k] + eeo[k];
  592|  73.1k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  593|  73.1k|                }
  594|   182k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (594:28): [True: 146k, False: 36.5k]
  ------------------
  595|   146k|                {
  596|   146k|                    e[k] = ee[k] + eo[k];
  597|   146k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  598|   146k|                }
  599|   329k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (599:28): [True: 292k, False: 36.5k]
  ------------------
  600|   292k|                {
  601|   292k|                    WORD32 itrans_out;
  602|   292k|                    itrans_out =
  603|   292k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   292k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   292k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 292k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|   292k|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   292k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.2k, False: 280k]
  |  |  |  Branch (40:53): [True: 7.26k, False: 273k]
  |  |  ------------------
  ------------------
  605|   292k|                    itrans_out =
  606|   292k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   292k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   292k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 292k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 292k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|   292k|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|   292k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.3k, False: 280k]
  |  |  |  Branch (40:53): [True: 9.13k, False: 271k]
  |  |  ------------------
  ------------------
  608|   292k|                }
  609|  36.5k|                pi2_tmp++;
  610|  36.5k|                pu2_pred += pred_strd;
  611|  36.5k|                pu2_dst += dst_strd;
  612|  36.5k|            }
  613|  2.28k|        }
  614|       |        /************************************************************************************************/
  615|       |        /************************************END - IT_RECON_16x16****************************************/
  616|       |        /************************************************************************************************/
  617|  13.4k|    }
  618|  32.6k|    else  /* All rows of input are non-zero */
  619|  32.6k|    {
  620|       |        /* Inverse Transform 1st stage */
  621|       |        /************************************************************************************************/
  622|       |        /**********************************START - IT_RECON_16x16****************************************/
  623|       |        /************************************************************************************************/
  624|       |
  625|  32.6k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  32.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  626|  32.6k|        add = 1 << (shift - 1);
  627|       |
  628|   471k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (628:20): [True: 438k, False: 32.6k]
  ------------------
  629|   438k|        {
  630|       |            /* Checking for Zero Cols */
  631|   438k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (631:16): [True: 178k, False: 260k]
  ------------------
  632|   178k|            {
  633|   178k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  634|   178k|            }
  635|   260k|            else
  636|   260k|            {
  637|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  638|  2.34M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (638:28): [True: 2.08M, False: 260k]
  ------------------
  639|  2.08M|                {
  640|  2.08M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  641|  2.08M|                                    + g_ai2_ihevc_trans_16[3][k]
  642|  2.08M|                                                    * pi2_src[3 * src_strd]
  643|  2.08M|                                    + g_ai2_ihevc_trans_16[5][k]
  644|  2.08M|                                                    * pi2_src[5 * src_strd]
  645|  2.08M|                                    + g_ai2_ihevc_trans_16[7][k]
  646|  2.08M|                                                    * pi2_src[7 * src_strd]
  647|  2.08M|                                    + g_ai2_ihevc_trans_16[9][k]
  648|  2.08M|                                                    * pi2_src[9 * src_strd]
  649|  2.08M|                                    + g_ai2_ihevc_trans_16[11][k]
  650|  2.08M|                                                    * pi2_src[11 * src_strd]
  651|  2.08M|                                    + g_ai2_ihevc_trans_16[13][k]
  652|  2.08M|                                                    * pi2_src[13 * src_strd]
  653|  2.08M|                                    + g_ai2_ihevc_trans_16[15][k]
  654|  2.08M|                                                    * pi2_src[15 * src_strd];
  655|  2.08M|                }
  656|  1.30M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (656:28): [True: 1.04M, False: 260k]
  ------------------
  657|  1.04M|                {
  658|  1.04M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  659|  1.04M|                                    + g_ai2_ihevc_trans_16[6][k]
  660|  1.04M|                                                    * pi2_src[6 * src_strd]
  661|  1.04M|                                    + g_ai2_ihevc_trans_16[10][k]
  662|  1.04M|                                                    * pi2_src[10 * src_strd]
  663|  1.04M|                                    + g_ai2_ihevc_trans_16[14][k]
  664|  1.04M|                                                    * pi2_src[14 * src_strd];
  665|  1.04M|                }
  666|   260k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  667|   260k|                                + g_ai2_ihevc_trans_16[12][0]
  668|   260k|                                                * pi2_src[12 * src_strd];
  669|   260k|                eee[0] =
  670|   260k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  671|   260k|                                                + g_ai2_ihevc_trans_16[8][0]
  672|   260k|                                                                * pi2_src[8
  673|   260k|                                                                                * src_strd];
  674|   260k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  675|   260k|                                + g_ai2_ihevc_trans_16[12][1]
  676|   260k|                                                * pi2_src[12 * src_strd];
  677|   260k|                eee[1] =
  678|   260k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  679|   260k|                                                + g_ai2_ihevc_trans_16[8][1]
  680|   260k|                                                                * pi2_src[8
  681|   260k|                                                                                * src_strd];
  682|       |
  683|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  684|   781k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (684:28): [True: 520k, False: 260k]
  ------------------
  685|   520k|                {
  686|   520k|                    ee[k] = eee[k] + eeo[k];
  687|   520k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  688|   520k|                }
  689|  1.30M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (689:28): [True: 1.04M, False: 260k]
  ------------------
  690|  1.04M|                {
  691|  1.04M|                    e[k] = ee[k] + eo[k];
  692|  1.04M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  693|  1.04M|                }
  694|  2.34M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (694:28): [True: 2.08M, False: 260k]
  ------------------
  695|  2.08M|                {
  696|  2.08M|                    pi2_tmp[k] =
  697|  2.08M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  2.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.56k, False: 2.08M]
  |  |  |  |  |  Branch (40:53): [True: 766, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  2.08M|                    pi2_tmp[k + 8] =
  699|  2.08M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift) );
  ------------------
  |  |   53|  2.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 398, False: 2.08M]
  |  |  |  |  |  Branch (40:53): [True: 463, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  2.08M|                }
  701|   260k|            }
  702|   438k|            pi2_src++;
  703|   438k|            pi2_tmp += trans_size;
  704|   438k|            zero_cols = zero_cols >> 1;
  705|   438k|        }
  706|       |
  707|  32.6k|        pi2_tmp = pi2_tmp_orig;
  708|       |
  709|       |        /* Inverse Transform 2nd stage */
  710|  32.6k|        shift = 20 - u1_bit_depth;
  711|  32.6k|        add = 1 << (shift - 1);
  712|       |
  713|  32.6k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (713:12): [True: 5.82k, False: 26.8k]
  ------------------
  714|  5.82k|        {
  715|  98.3k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (715:24): [True: 92.5k, False: 5.82k]
  ------------------
  716|  92.5k|            {
  717|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  718|   832k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (718:28): [True: 740k, False: 92.5k]
  ------------------
  719|   740k|                {
  720|   740k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  721|   740k|                                    + g_ai2_ihevc_trans_16[3][k]
  722|   740k|                                                    * pi2_tmp[3 * trans_size];
  723|   740k|                }
  724|   462k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (724:28): [True: 370k, False: 92.5k]
  ------------------
  725|   370k|                {
  726|   370k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  727|   370k|                }
  728|  92.5k|                eeo[0] = 0;
  729|  92.5k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  730|  92.5k|                eeo[1] = 0;
  731|  92.5k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  732|       |
  733|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  734|   277k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (734:28): [True: 185k, False: 92.5k]
  ------------------
  735|   185k|                {
  736|   185k|                    ee[k] = eee[k] + eeo[k];
  737|   185k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  738|   185k|                }
  739|   462k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (739:28): [True: 370k, False: 92.5k]
  ------------------
  740|   370k|                {
  741|   370k|                    e[k] = ee[k] + eo[k];
  742|   370k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  743|   370k|                }
  744|   831k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (744:28): [True: 739k, False: 92.5k]
  ------------------
  745|   739k|                {
  746|   739k|                    WORD32 itrans_out;
  747|   739k|                    itrans_out =
  748|   739k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   739k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   739k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 739k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 739k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|   739k|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   739k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 72.0k, False: 667k]
  |  |  |  Branch (40:53): [True: 22.9k, False: 644k]
  |  |  ------------------
  ------------------
  750|   739k|                    itrans_out =
  751|   739k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   739k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   739k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 739k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 739k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|   739k|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|   739k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 72.0k, False: 667k]
  |  |  |  Branch (40:53): [True: 24.3k, False: 642k]
  |  |  ------------------
  ------------------
  753|   739k|                }
  754|  92.5k|                pi2_tmp++;
  755|  92.5k|                pu2_pred += pred_strd;
  756|  92.5k|                pu2_dst += dst_strd;
  757|  92.5k|            }
  758|  5.82k|        }
  759|  26.8k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (759:17): [True: 1.76k, False: 25.0k]
  ------------------
  760|  1.76k|        {
  761|  29.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (761:24): [True: 28.0k, False: 1.76k]
  ------------------
  762|  28.0k|            {
  763|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  764|   252k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (764:28): [True: 224k, False: 28.0k]
  ------------------
  765|   224k|                {
  766|   224k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  767|   224k|                                    + g_ai2_ihevc_trans_16[3][k]
  768|   224k|                                                    * pi2_tmp[3 * trans_size]
  769|   224k|                                    + g_ai2_ihevc_trans_16[5][k]
  770|   224k|                                                    * pi2_tmp[5 * trans_size]
  771|   224k|                                    + g_ai2_ihevc_trans_16[7][k]
  772|   224k|                                                    * pi2_tmp[7 * trans_size];
  773|   224k|                }
  774|   140k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (774:28): [True: 112k, False: 28.0k]
  ------------------
  775|   112k|                {
  776|   112k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  777|   112k|                                    + g_ai2_ihevc_trans_16[6][k]
  778|   112k|                                                    * pi2_tmp[6 * trans_size];
  779|   112k|                }
  780|  28.0k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  781|  28.0k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  782|  28.0k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  783|  28.0k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  784|       |
  785|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  786|  84.2k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (786:28): [True: 56.1k, False: 28.0k]
  ------------------
  787|  56.1k|                {
  788|  56.1k|                    ee[k] = eee[k] + eeo[k];
  789|  56.1k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  790|  56.1k|                }
  791|   140k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (791:28): [True: 112k, False: 28.0k]
  ------------------
  792|   112k|                {
  793|   112k|                    e[k] = ee[k] + eo[k];
  794|   112k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  795|   112k|                }
  796|   252k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (796:28): [True: 224k, False: 28.0k]
  ------------------
  797|   224k|                {
  798|   224k|                    WORD32 itrans_out;
  799|   224k|                    itrans_out =
  800|   224k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   224k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   224k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 224k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 224k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|   224k|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   224k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 10.4k, False: 214k]
  |  |  |  Branch (40:53): [True: 6.93k, False: 207k]
  |  |  ------------------
  ------------------
  802|   224k|                    itrans_out =
  803|   224k|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|   224k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   224k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 224k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 224k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  804|   224k|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|   224k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 11.2k, False: 213k]
  |  |  |  Branch (40:53): [True: 6.61k, False: 206k]
  |  |  ------------------
  ------------------
  805|   224k|                }
  806|  28.0k|                pi2_tmp++;
  807|  28.0k|                pu2_pred += pred_strd;
  808|  28.0k|                pu2_dst += dst_strd;
  809|  28.0k|            }
  810|  1.76k|        }
  811|  25.0k|        else /* All rows of output of 1st stage are non-zero */
  812|  25.0k|        {
  813|   425k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (813:24): [True: 400k, False: 25.0k]
  ------------------
  814|   400k|            {
  815|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  816|  3.60M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (816:28): [True: 3.20M, False: 400k]
  ------------------
  817|  3.20M|                {
  818|  3.20M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  819|  3.20M|                                    + g_ai2_ihevc_trans_16[3][k]
  820|  3.20M|                                                    * pi2_tmp[3 * trans_size]
  821|  3.20M|                                    + g_ai2_ihevc_trans_16[5][k]
  822|  3.20M|                                                    * pi2_tmp[5 * trans_size]
  823|  3.20M|                                    + g_ai2_ihevc_trans_16[7][k]
  824|  3.20M|                                                    * pi2_tmp[7 * trans_size]
  825|  3.20M|                                    + g_ai2_ihevc_trans_16[9][k]
  826|  3.20M|                                                    * pi2_tmp[9 * trans_size]
  827|  3.20M|                                    + g_ai2_ihevc_trans_16[11][k]
  828|  3.20M|                                                    * pi2_tmp[11 * trans_size]
  829|  3.20M|                                    + g_ai2_ihevc_trans_16[13][k]
  830|  3.20M|                                                    * pi2_tmp[13 * trans_size]
  831|  3.20M|                                    + g_ai2_ihevc_trans_16[15][k]
  832|  3.20M|                                                    * pi2_tmp[15 * trans_size];
  833|  3.20M|                }
  834|  2.00M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (834:28): [True: 1.60M, False: 400k]
  ------------------
  835|  1.60M|                {
  836|  1.60M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  837|  1.60M|                                    + g_ai2_ihevc_trans_16[6][k]
  838|  1.60M|                                                    * pi2_tmp[6 * trans_size]
  839|  1.60M|                                    + g_ai2_ihevc_trans_16[10][k]
  840|  1.60M|                                                    * pi2_tmp[10 * trans_size]
  841|  1.60M|                                    + g_ai2_ihevc_trans_16[14][k]
  842|  1.60M|                                                    * pi2_tmp[14 * trans_size];
  843|  1.60M|                }
  844|   400k|                eeo[0] =
  845|   400k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  846|   400k|                                                + g_ai2_ihevc_trans_16[12][0]
  847|   400k|                                                                * pi2_tmp[12
  848|   400k|                                                                                * trans_size];
  849|   400k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  850|   400k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  851|   400k|                eeo[1] =
  852|   400k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  853|   400k|                                                + g_ai2_ihevc_trans_16[12][1]
  854|   400k|                                                                * pi2_tmp[12
  855|   400k|                                                                                * trans_size];
  856|   400k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  857|   400k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  858|       |
  859|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  860|  1.20M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (860:28): [True: 801k, False: 400k]
  ------------------
  861|   801k|                {
  862|   801k|                    ee[k] = eee[k] + eeo[k];
  863|   801k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  864|   801k|                }
  865|  2.00M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (865:28): [True: 1.60M, False: 400k]
  ------------------
  866|  1.60M|                {
  867|  1.60M|                    e[k] = ee[k] + eo[k];
  868|  1.60M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  869|  1.60M|                }
  870|  3.60M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (870:28): [True: 3.20M, False: 400k]
  ------------------
  871|  3.20M|                {
  872|  3.20M|                    WORD32 itrans_out;
  873|  3.20M|                    itrans_out =
  874|  3.20M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  3.20M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.20M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.20M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|  3.20M|                    pu2_dst[k] = CLIP3((itrans_out+ pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  3.20M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 92.5k, False: 3.10M]
  |  |  |  Branch (40:53): [True: 53.2k, False: 3.05M]
  |  |  ------------------
  ------------------
  876|  3.20M|                    itrans_out =
  877|  3.20M|                                    CLIP_S16( ((e[7-k] - o[7-k] + add)>>shift ) );
  ------------------
  |  |   53|  3.20M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.20M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.20M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  878|  3.20M|                    pu2_dst[k + 8] = CLIP3((itrans_out + pu2_pred[k+8]), 0, clip_limit);
  ------------------
  |  |   40|  3.20M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 77.0k, False: 3.12M]
  |  |  |  Branch (40:53): [True: 39.8k, False: 3.08M]
  |  |  ------------------
  ------------------
  879|  3.20M|                }
  880|   400k|                pi2_tmp++;
  881|   400k|                pu2_pred += pred_strd;
  882|   400k|                pu2_dst += dst_strd;
  883|   400k|            }
  884|  25.0k|        }
  885|       |        /************************************************************************************************/
  886|       |        /************************************END - IT_RECON_16x16****************************************/
  887|       |        /************************************************************************************************/
  888|  32.6k|    }
  889|   117k|}

ihevc_hbd_itrans_recon_32x32:
  107|   148k|{
  108|   148k|    WORD32 j, k;
  109|   148k|    WORD32 e[16], o[16];
  110|   148k|    WORD32 ee[8], eo[8];
  111|   148k|    WORD32 eee[4], eeo[4];
  112|   148k|    WORD32 eeee[2], eeeo[2];
  113|   148k|    WORD32 add;
  114|   148k|    WORD32 shift;
  115|   148k|    WORD16 *pi2_tmp_orig;
  116|   148k|    WORD32 trans_size;
  117|   148k|    WORD32 zero_rows_2nd_stage = zero_cols;
  118|   148k|    WORD32 row_limit_2nd_stage;
  119|   148k|    WORD16 clip_limit;
  120|       |
  121|   148k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|   148k|#define TRANS_SIZE_32 32
  ------------------
  122|   148k|    pi2_tmp_orig = pi2_tmp;
  123|   148k|    clip_limit = (1 << u1_bit_depth) - 1;
  124|       |
  125|   148k|    if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0)
  ------------------
  |  Branch (125:8): [True: 91.1k, False: 57.7k]
  ------------------
  126|  91.1k|        row_limit_2nd_stage = 4;
  127|  57.7k|    else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00)
  ------------------
  |  Branch (127:13): [True: 19.5k, False: 38.1k]
  ------------------
  128|  19.5k|        row_limit_2nd_stage = 8;
  129|  38.1k|    else
  130|  38.1k|        row_limit_2nd_stage = TRANS_SIZE_32;
  ------------------
  |  |  432|  38.1k|#define TRANS_SIZE_32 32
  ------------------
  131|       |
  132|   148k|    if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (132:8): [True: 66.0k, False: 82.7k]
  ------------------
  133|  66.0k|    {
  134|       |        /************************************************************************************************/
  135|       |        /**********************************START - IT_RECON_32x32****************************************/
  136|       |        /************************************************************************************************/
  137|       |        /* Inverse Transform 1st stage */
  138|  66.0k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  66.0k|#define IT_SHIFT_STAGE_1 7
  ------------------
  139|  66.0k|        add = 1 << (shift - 1);
  140|       |
  141|   879k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (141:20): [True: 813k, False: 66.0k]
  ------------------
  142|   813k|        {
  143|       |            /* Checking for Zero Cols */
  144|   813k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (144:16): [True: 608k, False: 205k]
  ------------------
  145|   608k|            {
  146|   608k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  147|   608k|            }
  148|   205k|            else
  149|   205k|            {
  150|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  151|  3.53M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (151:28): [True: 3.33M, False: 205k]
  ------------------
  152|  3.33M|                {
  153|  3.33M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  154|  3.33M|                                    + g_ai2_ihevc_trans_32[3][k]
  155|  3.33M|                                                    * pi2_src[3 * src_strd];
  156|  3.33M|                }
  157|  1.87M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (157:28): [True: 1.66M, False: 205k]
  ------------------
  158|  1.66M|                {
  159|  1.66M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd];
  160|  1.66M|                }
  161|   205k|                {
  162|   205k|                    eeo[0] = 0;
  163|   205k|                    eeo[1] = 0;
  164|   205k|                    eeo[2] = 0;
  165|   205k|                    eeo[3] = 0;
  166|   205k|                }
  167|   205k|                eeeo[0] = 0;
  168|   205k|                eeeo[1] = 0;
  169|   205k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  170|   205k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
  171|       |
  172|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  173|   205k|                eee[0] = eeee[0] + eeeo[0];
  174|   205k|                eee[3] = eeee[0] - eeeo[0];
  175|   205k|                eee[1] = eeee[1] + eeeo[1];
  176|   205k|                eee[2] = eeee[1] - eeeo[1];
  177|  1.04M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (177:28): [True: 835k, False: 205k]
  ------------------
  178|   835k|                {
  179|   835k|                    ee[k] = eee[k] + eeo[k];
  180|   835k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  181|   835k|                }
  182|  1.87M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (182:28): [True: 1.66M, False: 205k]
  ------------------
  183|  1.66M|                {
  184|  1.66M|                    e[k] = ee[k] + eo[k];
  185|  1.66M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  186|  1.66M|                }
  187|  3.54M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (187:28): [True: 3.33M, False: 205k]
  ------------------
  188|  3.33M|                {
  189|  3.33M|                    pi2_tmp[k] =
  190|  3.33M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift) );
  ------------------
  |  |   53|  3.33M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.33M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 264, False: 3.33M]
  |  |  |  |  |  Branch (40:53): [True: 518, False: 3.33M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  3.33M|                    pi2_tmp[k + 16] =
  192|  3.33M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  3.33M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.33M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 311, False: 3.33M]
  |  |  |  |  |  Branch (40:53): [True: 274, False: 3.33M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  3.33M|                }
  194|   205k|            }
  195|   813k|            pi2_src++;
  196|   813k|            pi2_tmp += trans_size;
  197|   813k|            zero_cols = zero_cols >> 1;
  198|   813k|        }
  199|       |
  200|  66.0k|        pi2_tmp = pi2_tmp_orig;
  201|       |
  202|       |        /* Inverse Transform 2nd stage */
  203|  66.0k|        shift = 20 - u1_bit_depth;
  204|  66.0k|        add = 1 << (shift - 1);
  205|  66.0k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (205:12): [True: 37.8k, False: 28.1k]
  ------------------
  206|  37.8k|        {
  207|  1.22M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (207:24): [True: 1.18M, False: 37.8k]
  ------------------
  208|  1.18M|            {
  209|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  210|  19.9M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (210:28): [True: 18.8M, False: 1.18M]
  ------------------
  211|  18.8M|                {
  212|  18.8M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  213|  18.8M|                                    + g_ai2_ihevc_trans_32[3][k]
  214|  18.8M|                                                    * pi2_tmp[3 * trans_size];
  215|  18.8M|                }
  216|  10.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (216:28): [True: 9.43M, False: 1.18M]
  ------------------
  217|  9.43M|                {
  218|  9.43M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  219|  9.43M|                }
  220|  1.18M|                {
  221|  1.18M|                    eeo[0] = 0;
  222|  1.18M|                    eeo[1] = 0;
  223|  1.18M|                    eeo[2] = 0;
  224|  1.18M|                    eeo[3] = 0;
  225|  1.18M|                }
  226|  1.18M|                eeeo[0] = 0;
  227|  1.18M|                eeeo[1] = 0;
  228|  1.18M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  229|  1.18M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  230|       |
  231|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  232|  1.18M|                eee[0] = eeee[0] + eeeo[0];
  233|  1.18M|                eee[3] = eeee[0] - eeeo[0];
  234|  1.18M|                eee[1] = eeee[1] + eeeo[1];
  235|  1.18M|                eee[2] = eeee[1] - eeeo[1];
  236|  5.89M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (236:28): [True: 4.70M, False: 1.18M]
  ------------------
  237|  4.70M|                {
  238|  4.70M|                    ee[k] = eee[k] + eeo[k];
  239|  4.70M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  240|  4.70M|                }
  241|  10.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (241:28): [True: 9.48M, False: 1.18M]
  ------------------
  242|  9.48M|                {
  243|  9.48M|                    e[k] = ee[k] + eo[k];
  244|  9.48M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  245|  9.48M|                }
  246|  20.0M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (246:28): [True: 18.9M, False: 1.18M]
  ------------------
  247|  18.9M|                {
  248|  18.9M|                    WORD32 itrans_out;
  249|  18.9M|                    itrans_out =
  250|  18.9M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  18.9M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.9M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  18.9M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  18.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 432k, False: 18.4M]
  |  |  |  Branch (40:53): [True: 88.0k, False: 18.3M]
  |  |  ------------------
  ------------------
  252|  18.9M|                    itrans_out =
  253|  18.9M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  18.9M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.9M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  18.9M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  18.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 400k, False: 18.5M]
  |  |  |  Branch (40:53): [True: 90.2k, False: 18.4M]
  |  |  ------------------
  ------------------
  255|  18.9M|                }
  256|  1.18M|                pi2_tmp++;
  257|  1.18M|                pu2_pred += pred_strd;
  258|  1.18M|                pu2_dst += dst_strd;
  259|  1.18M|            }
  260|  37.8k|        }
  261|  28.1k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (261:17): [True: 9.80k, False: 18.3k]
  ------------------
  262|  9.80k|        {
  263|   310k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (263:24): [True: 301k, False: 9.80k]
  ------------------
  264|   301k|            {
  265|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  266|  5.11M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (266:28): [True: 4.81M, False: 301k]
  ------------------
  267|  4.81M|                {
  268|  4.81M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  269|  4.81M|                                    + g_ai2_ihevc_trans_32[3][k]
  270|  4.81M|                                                    * pi2_tmp[3 * trans_size]
  271|  4.81M|                                    + g_ai2_ihevc_trans_32[5][k]
  272|  4.81M|                                                    * pi2_tmp[5 * trans_size]
  273|  4.81M|                                    + g_ai2_ihevc_trans_32[7][k]
  274|  4.81M|                                                    * pi2_tmp[7 * trans_size];
  275|  4.81M|                }
  276|  2.68M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (276:28): [True: 2.38M, False: 301k]
  ------------------
  277|  2.38M|                {
  278|  2.38M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  279|  2.38M|                                    + g_ai2_ihevc_trans_32[6][k]
  280|  2.38M|                                                    * pi2_tmp[6 * trans_size];
  281|  2.38M|                }
  282|  1.51M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (282:28): [True: 1.20M, False: 301k]
  ------------------
  283|  1.20M|                {
  284|  1.20M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  285|  1.20M|                }
  286|   301k|                eeeo[0] = 0;
  287|   301k|                eeeo[1] = 0;
  288|   301k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  289|   301k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  290|       |
  291|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  292|   301k|                eee[0] = eeee[0] + eeeo[0];
  293|   301k|                eee[3] = eeee[0] - eeeo[0];
  294|   301k|                eee[1] = eeee[1] + eeeo[1];
  295|   301k|                eee[2] = eeee[1] - eeeo[1];
  296|  1.50M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (296:28): [True: 1.20M, False: 301k]
  ------------------
  297|  1.20M|                {
  298|  1.20M|                    ee[k] = eee[k] + eeo[k];
  299|  1.20M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  300|  1.20M|                }
  301|  2.70M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (301:28): [True: 2.40M, False: 301k]
  ------------------
  302|  2.40M|                {
  303|  2.40M|                    e[k] = ee[k] + eo[k];
  304|  2.40M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  305|  2.40M|                }
  306|  4.97M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (306:28): [True: 4.66M, False: 301k]
  ------------------
  307|  4.66M|                {
  308|  4.66M|                    WORD32 itrans_out;
  309|  4.66M|                    itrans_out =
  310|  4.66M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  4.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.66M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.66M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  4.66M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  4.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 315k, False: 4.35M]
  |  |  |  Branch (40:53): [True: 15.9k, False: 4.33M]
  |  |  ------------------
  ------------------
  312|  4.66M|                    itrans_out =
  313|  4.66M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  4.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.66M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.66M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|  4.66M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  4.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 327k, False: 4.34M]
  |  |  |  Branch (40:53): [True: 17.3k, False: 4.32M]
  |  |  ------------------
  ------------------
  315|  4.66M|                }
  316|   301k|                pi2_tmp++;
  317|   301k|                pu2_pred += pred_strd;
  318|   301k|                pu2_dst += dst_strd;
  319|   301k|            }
  320|  9.80k|        }
  321|  18.3k|        else /* All rows of output of 1st stage are non-zero */
  322|  18.3k|        {
  323|   581k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (323:24): [True: 563k, False: 18.3k]
  ------------------
  324|   563k|            {
  325|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  326|  9.55M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (326:28): [True: 8.99M, False: 563k]
  ------------------
  327|  8.99M|                {
  328|  8.99M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  329|  8.99M|                                    + g_ai2_ihevc_trans_32[3][k]
  330|  8.99M|                                                    * pi2_tmp[3 * trans_size]
  331|  8.99M|                                    + g_ai2_ihevc_trans_32[5][k]
  332|  8.99M|                                                    * pi2_tmp[5 * trans_size]
  333|  8.99M|                                    + g_ai2_ihevc_trans_32[7][k]
  334|  8.99M|                                                    * pi2_tmp[7 * trans_size]
  335|  8.99M|                                    + g_ai2_ihevc_trans_32[9][k]
  336|  8.99M|                                                    * pi2_tmp[9 * trans_size]
  337|  8.99M|                                    + g_ai2_ihevc_trans_32[11][k]
  338|  8.99M|                                                    * pi2_tmp[11 * trans_size]
  339|  8.99M|                                    + g_ai2_ihevc_trans_32[13][k]
  340|  8.99M|                                                    * pi2_tmp[13 * trans_size]
  341|  8.99M|                                    + g_ai2_ihevc_trans_32[15][k]
  342|  8.99M|                                                    * pi2_tmp[15 * trans_size]
  343|  8.99M|                                    + g_ai2_ihevc_trans_32[17][k]
  344|  8.99M|                                                    * pi2_tmp[17 * trans_size]
  345|  8.99M|                                    + g_ai2_ihevc_trans_32[19][k]
  346|  8.99M|                                                    * pi2_tmp[19 * trans_size]
  347|  8.99M|                                    + g_ai2_ihevc_trans_32[21][k]
  348|  8.99M|                                                    * pi2_tmp[21 * trans_size]
  349|  8.99M|                                    + g_ai2_ihevc_trans_32[23][k]
  350|  8.99M|                                                    * pi2_tmp[23 * trans_size]
  351|  8.99M|                                    + g_ai2_ihevc_trans_32[25][k]
  352|  8.99M|                                                    * pi2_tmp[25 * trans_size]
  353|  8.99M|                                    + g_ai2_ihevc_trans_32[27][k]
  354|  8.99M|                                                    * pi2_tmp[27 * trans_size]
  355|  8.99M|                                    + g_ai2_ihevc_trans_32[29][k]
  356|  8.99M|                                                    * pi2_tmp[29 * trans_size]
  357|  8.99M|                                    + g_ai2_ihevc_trans_32[31][k]
  358|  8.99M|                                                    * pi2_tmp[31 * trans_size];
  359|  8.99M|                }
  360|  5.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (360:28): [True: 4.57M, False: 563k]
  ------------------
  361|  4.57M|                {
  362|  4.57M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  363|  4.57M|                                    + g_ai2_ihevc_trans_32[6][k]
  364|  4.57M|                                                    * pi2_tmp[6 * trans_size]
  365|  4.57M|                                    + g_ai2_ihevc_trans_32[10][k]
  366|  4.57M|                                                    * pi2_tmp[10 * trans_size]
  367|  4.57M|                                    + g_ai2_ihevc_trans_32[14][k]
  368|  4.57M|                                                    * pi2_tmp[14 * trans_size]
  369|  4.57M|                                    + g_ai2_ihevc_trans_32[18][k]
  370|  4.57M|                                                    * pi2_tmp[18 * trans_size]
  371|  4.57M|                                    + g_ai2_ihevc_trans_32[22][k]
  372|  4.57M|                                                    * pi2_tmp[22 * trans_size]
  373|  4.57M|                                    + g_ai2_ihevc_trans_32[26][k]
  374|  4.57M|                                                    * pi2_tmp[26 * trans_size]
  375|  4.57M|                                    + g_ai2_ihevc_trans_32[30][k]
  376|  4.57M|                                                    * pi2_tmp[30 * trans_size];
  377|  4.57M|                }
  378|  2.85M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (378:28): [True: 2.28M, False: 563k]
  ------------------
  379|  2.28M|                {
  380|  2.28M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  381|  2.28M|                                    + g_ai2_ihevc_trans_32[12][k]
  382|  2.28M|                                                    * pi2_tmp[12 * trans_size]
  383|  2.28M|                                    + g_ai2_ihevc_trans_32[20][k]
  384|  2.28M|                                                    * pi2_tmp[20 * trans_size]
  385|  2.28M|                                    + g_ai2_ihevc_trans_32[28][k]
  386|  2.28M|                                                    * pi2_tmp[28 * trans_size];
  387|  2.28M|                }
  388|   563k|                eeeo[0] =
  389|   563k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  390|   563k|                                                + g_ai2_ihevc_trans_32[24][0]
  391|   563k|                                                                * pi2_tmp[24
  392|   563k|                                                                                * trans_size];
  393|   563k|                eeeo[1] =
  394|   563k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  395|   563k|                                                + g_ai2_ihevc_trans_32[24][1]
  396|   563k|                                                                * pi2_tmp[24
  397|   563k|                                                                                * trans_size];
  398|   563k|                eeee[0] =
  399|   563k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  400|   563k|                                                + g_ai2_ihevc_trans_32[16][0]
  401|   563k|                                                                * pi2_tmp[16
  402|   563k|                                                                                * trans_size];
  403|   563k|                eeee[1] =
  404|   563k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  405|   563k|                                                + g_ai2_ihevc_trans_32[16][1]
  406|   563k|                                                                * pi2_tmp[16
  407|   563k|                                                                                * trans_size];
  408|       |
  409|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  410|   563k|                eee[0] = eeee[0] + eeeo[0];
  411|   563k|                eee[3] = eeee[0] - eeeo[0];
  412|   563k|                eee[1] = eeee[1] + eeeo[1];
  413|   563k|                eee[2] = eeee[1] - eeeo[1];
  414|  2.87M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (414:28): [True: 2.31M, False: 563k]
  ------------------
  415|  2.31M|                {
  416|  2.31M|                    ee[k] = eee[k] + eeo[k];
  417|  2.31M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  418|  2.31M|                }
  419|  5.12M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (419:28): [True: 4.55M, False: 563k]
  ------------------
  420|  4.55M|                {
  421|  4.55M|                    e[k] = ee[k] + eo[k];
  422|  4.55M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  423|  4.55M|                }
  424|  9.41M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (424:28): [True: 8.84M, False: 563k]
  ------------------
  425|  8.84M|                {
  426|  8.84M|                    WORD32 itrans_out;
  427|  8.84M|                    itrans_out =
  428|  8.84M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  8.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|  8.84M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  8.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 706k, False: 8.14M]
  |  |  |  Branch (40:53): [True: 41.5k, False: 8.10M]
  |  |  ------------------
  ------------------
  430|  8.84M|                    itrans_out =
  431|  8.84M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  8.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|  8.84M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  8.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 752k, False: 8.09M]
  |  |  |  Branch (40:53): [True: 33.0k, False: 8.06M]
  |  |  ------------------
  ------------------
  433|  8.84M|                }
  434|   563k|                pi2_tmp++;
  435|   563k|                pu2_pred += pred_strd;
  436|   563k|                pu2_dst += dst_strd;
  437|   563k|            }
  438|  18.3k|        }
  439|       |        /************************************************************************************************/
  440|       |        /************************************END - IT_RECON_32x32****************************************/
  441|       |        /************************************************************************************************/
  442|  66.0k|    }
  443|  82.7k|    else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (443:13): [True: 17.7k, False: 64.9k]
  ------------------
  444|  17.7k|    {
  445|       |        /************************************************************************************************/
  446|       |        /**********************************START - IT_RECON_32x32****************************************/
  447|       |        /************************************************************************************************/
  448|       |        /* Inverse Transform 1st stage */
  449|  17.7k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  17.7k|#define IT_SHIFT_STAGE_1 7
  ------------------
  450|  17.7k|        add = 1 << (shift - 1);
  451|       |
  452|   213k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (452:20): [True: 195k, False: 17.7k]
  ------------------
  453|   195k|        {
  454|       |            /* Checking for Zero Cols */
  455|   195k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (455:16): [True: 134k, False: 61.2k]
  ------------------
  456|   134k|            {
  457|   134k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  458|   134k|            }
  459|  61.2k|            else
  460|  61.2k|            {
  461|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  462|  1.04M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (462:28): [True: 983k, False: 61.2k]
  ------------------
  463|   983k|                {
  464|   983k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  465|   983k|                                    + g_ai2_ihevc_trans_32[3][k]
  466|   983k|                                                    * pi2_src[3 * src_strd]
  467|   983k|                                    + g_ai2_ihevc_trans_32[5][k]
  468|   983k|                                                    * pi2_src[5 * src_strd]
  469|   983k|                                    + g_ai2_ihevc_trans_32[7][k]
  470|   983k|                                                    * pi2_src[7 * src_strd];
  471|   983k|                }
  472|   552k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (472:28): [True: 491k, False: 61.2k]
  ------------------
  473|   491k|                {
  474|   491k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  475|   491k|                                    + g_ai2_ihevc_trans_32[6][k]
  476|   491k|                                                    * pi2_src[6 * src_strd];
  477|   491k|                }
  478|   307k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (478:28): [True: 246k, False: 61.2k]
  ------------------
  479|   246k|                {
  480|   246k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd];
  481|   246k|                }
  482|  61.2k|                eeeo[0] = 0;
  483|  61.2k|                eeeo[1] = 0;
  484|  61.2k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  485|  61.2k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
  486|       |
  487|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  488|  61.2k|                eee[0] = eeee[0] + eeeo[0];
  489|  61.2k|                eee[3] = eeee[0] - eeeo[0];
  490|  61.2k|                eee[1] = eeee[1] + eeeo[1];
  491|  61.2k|                eee[2] = eeee[1] - eeeo[1];
  492|   307k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (492:28): [True: 245k, False: 61.2k]
  ------------------
  493|   245k|                {
  494|   245k|                    ee[k] = eee[k] + eeo[k];
  495|   245k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  496|   245k|                }
  497|   553k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (497:28): [True: 491k, False: 61.2k]
  ------------------
  498|   491k|                {
  499|   491k|                    e[k] = ee[k] + eo[k];
  500|   491k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  501|   491k|                }
  502|  1.04M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (502:28): [True: 983k, False: 61.2k]
  ------------------
  503|   983k|                {
  504|   983k|                    pi2_tmp[k] =
  505|   983k|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift) );
  ------------------
  |  |   53|   983k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   983k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 362, False: 983k]
  |  |  |  |  |  Branch (40:53): [True: 905, False: 982k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|   983k|                    pi2_tmp[k + 16] =
  507|   983k|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   983k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   983k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 359, False: 983k]
  |  |  |  |  |  Branch (40:53): [True: 102, False: 982k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|   983k|                }
  509|  61.2k|            }
  510|   195k|            pi2_src++;
  511|   195k|            pi2_tmp += trans_size;
  512|   195k|            zero_cols = zero_cols >> 1;
  513|   195k|        }
  514|       |
  515|  17.7k|        pi2_tmp = pi2_tmp_orig;
  516|       |
  517|       |        /* Inverse Transform 2nd stage */
  518|  17.7k|        shift = 20 - u1_bit_depth;
  519|  17.7k|        add = 1 << (shift - 1);
  520|  17.7k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (520:12): [True: 9.77k, False: 8.00k]
  ------------------
  521|  9.77k|        {
  522|   317k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (522:24): [True: 308k, False: 9.77k]
  ------------------
  523|   308k|            {
  524|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  525|  5.18M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (525:28): [True: 4.88M, False: 308k]
  ------------------
  526|  4.88M|                {
  527|  4.88M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  528|  4.88M|                                    + g_ai2_ihevc_trans_32[3][k]
  529|  4.88M|                                                    * pi2_tmp[3 * trans_size];
  530|  4.88M|                }
  531|  2.76M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (531:28): [True: 2.45M, False: 308k]
  ------------------
  532|  2.45M|                {
  533|  2.45M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  534|  2.45M|                }
  535|   308k|                {
  536|   308k|                    eeo[0] = 0;
  537|   308k|                    eeo[1] = 0;
  538|   308k|                    eeo[2] = 0;
  539|   308k|                    eeo[3] = 0;
  540|   308k|                }
  541|   308k|                eeeo[0] = 0;
  542|   308k|                eeeo[1] = 0;
  543|   308k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  544|   308k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  545|       |
  546|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  547|   308k|                eee[0] = eeee[0] + eeeo[0];
  548|   308k|                eee[3] = eeee[0] - eeeo[0];
  549|   308k|                eee[1] = eeee[1] + eeeo[1];
  550|   308k|                eee[2] = eeee[1] - eeeo[1];
  551|  1.53M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (551:28): [True: 1.22M, False: 308k]
  ------------------
  552|  1.22M|                {
  553|  1.22M|                    ee[k] = eee[k] + eeo[k];
  554|  1.22M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  555|  1.22M|                }
  556|  2.75M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (556:28): [True: 2.44M, False: 308k]
  ------------------
  557|  2.44M|                {
  558|  2.44M|                    e[k] = ee[k] + eo[k];
  559|  2.44M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  560|  2.44M|                }
  561|  5.17M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (561:28): [True: 4.86M, False: 308k]
  ------------------
  562|  4.86M|                {
  563|  4.86M|                    WORD32 itrans_out;
  564|  4.86M|                    itrans_out =
  565|  4.86M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  4.86M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.86M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|  4.86M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  4.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 79.8k, False: 4.78M]
  |  |  |  Branch (40:53): [True: 10.8k, False: 4.77M]
  |  |  ------------------
  ------------------
  567|  4.86M|                    itrans_out =
  568|  4.86M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  4.86M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.86M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|  4.86M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  4.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 68.9k, False: 4.79M]
  |  |  |  Branch (40:53): [True: 10.6k, False: 4.78M]
  |  |  ------------------
  ------------------
  570|  4.86M|                }
  571|   308k|                pi2_tmp++;
  572|   308k|                pu2_pred += pred_strd;
  573|   308k|                pu2_dst += dst_strd;
  574|   308k|            }
  575|  9.77k|        }
  576|  8.00k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (576:17): [True: 4.12k, False: 3.88k]
  ------------------
  577|  4.12k|        {
  578|   130k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (578:24): [True: 126k, False: 4.12k]
  ------------------
  579|   126k|            {
  580|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  581|  2.13M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (581:28): [True: 2.00M, False: 126k]
  ------------------
  582|  2.00M|                {
  583|  2.00M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  584|  2.00M|                                    + g_ai2_ihevc_trans_32[3][k]
  585|  2.00M|                                                    * pi2_tmp[3 * trans_size]
  586|  2.00M|                                    + g_ai2_ihevc_trans_32[5][k]
  587|  2.00M|                                                    * pi2_tmp[5 * trans_size]
  588|  2.00M|                                    + g_ai2_ihevc_trans_32[7][k]
  589|  2.00M|                                                    * pi2_tmp[7 * trans_size];
  590|  2.00M|                }
  591|  1.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (591:28): [True: 1.01M, False: 126k]
  ------------------
  592|  1.01M|                {
  593|  1.01M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  594|  1.01M|                                    + g_ai2_ihevc_trans_32[6][k]
  595|  1.01M|                                                    * pi2_tmp[6 * trans_size];
  596|  1.01M|                }
  597|   640k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (597:28): [True: 513k, False: 126k]
  ------------------
  598|   513k|                {
  599|   513k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  600|   513k|                }
  601|   126k|                eeeo[0] = 0;
  602|   126k|                eeeo[1] = 0;
  603|   126k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  604|   126k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  605|       |
  606|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  607|   126k|                eee[0] = eeee[0] + eeeo[0];
  608|   126k|                eee[3] = eeee[0] - eeeo[0];
  609|   126k|                eee[1] = eeee[1] + eeeo[1];
  610|   126k|                eee[2] = eeee[1] - eeeo[1];
  611|   639k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (611:28): [True: 512k, False: 126k]
  ------------------
  612|   512k|                {
  613|   512k|                    ee[k] = eee[k] + eeo[k];
  614|   512k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  615|   512k|                }
  616|  1.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (616:28): [True: 1.02M, False: 126k]
  ------------------
  617|  1.02M|                {
  618|  1.02M|                    e[k] = ee[k] + eo[k];
  619|  1.02M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  620|  1.02M|                }
  621|  2.10M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (621:28): [True: 1.98M, False: 126k]
  ------------------
  622|  1.98M|                {
  623|  1.98M|                    WORD32 itrans_out;
  624|  1.98M|                    itrans_out =
  625|  1.98M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  1.98M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.98M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|  1.98M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 202k, False: 1.77M]
  |  |  |  Branch (40:53): [True: 38.7k, False: 1.73M]
  |  |  ------------------
  ------------------
  627|  1.98M|                    itrans_out =
  628|  1.98M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  1.98M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.98M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|  1.98M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  1.98M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 203k, False: 1.77M]
  |  |  |  Branch (40:53): [True: 51.5k, False: 1.72M]
  |  |  ------------------
  ------------------
  630|  1.98M|                }
  631|   126k|                pi2_tmp++;
  632|   126k|                pu2_pred += pred_strd;
  633|   126k|                pu2_dst += dst_strd;
  634|   126k|            }
  635|  4.12k|        }
  636|  3.88k|        else /* All rows of output of 1st stage are non-zero */
  637|  3.88k|        {
  638|   126k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (638:24): [True: 122k, False: 3.88k]
  ------------------
  639|   122k|            {
  640|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  641|  2.04M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (641:28): [True: 1.92M, False: 122k]
  ------------------
  642|  1.92M|                {
  643|  1.92M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  644|  1.92M|                                    + g_ai2_ihevc_trans_32[3][k]
  645|  1.92M|                                                    * pi2_tmp[3 * trans_size]
  646|  1.92M|                                    + g_ai2_ihevc_trans_32[5][k]
  647|  1.92M|                                                    * pi2_tmp[5 * trans_size]
  648|  1.92M|                                    + g_ai2_ihevc_trans_32[7][k]
  649|  1.92M|                                                    * pi2_tmp[7 * trans_size]
  650|  1.92M|                                    + g_ai2_ihevc_trans_32[9][k]
  651|  1.92M|                                                    * pi2_tmp[9 * trans_size]
  652|  1.92M|                                    + g_ai2_ihevc_trans_32[11][k]
  653|  1.92M|                                                    * pi2_tmp[11 * trans_size]
  654|  1.92M|                                    + g_ai2_ihevc_trans_32[13][k]
  655|  1.92M|                                                    * pi2_tmp[13 * trans_size]
  656|  1.92M|                                    + g_ai2_ihevc_trans_32[15][k]
  657|  1.92M|                                                    * pi2_tmp[15 * trans_size]
  658|  1.92M|                                    + g_ai2_ihevc_trans_32[17][k]
  659|  1.92M|                                                    * pi2_tmp[17 * trans_size]
  660|  1.92M|                                    + g_ai2_ihevc_trans_32[19][k]
  661|  1.92M|                                                    * pi2_tmp[19 * trans_size]
  662|  1.92M|                                    + g_ai2_ihevc_trans_32[21][k]
  663|  1.92M|                                                    * pi2_tmp[21 * trans_size]
  664|  1.92M|                                    + g_ai2_ihevc_trans_32[23][k]
  665|  1.92M|                                                    * pi2_tmp[23 * trans_size]
  666|  1.92M|                                    + g_ai2_ihevc_trans_32[25][k]
  667|  1.92M|                                                    * pi2_tmp[25 * trans_size]
  668|  1.92M|                                    + g_ai2_ihevc_trans_32[27][k]
  669|  1.92M|                                                    * pi2_tmp[27 * trans_size]
  670|  1.92M|                                    + g_ai2_ihevc_trans_32[29][k]
  671|  1.92M|                                                    * pi2_tmp[29 * trans_size]
  672|  1.92M|                                    + g_ai2_ihevc_trans_32[31][k]
  673|  1.92M|                                                    * pi2_tmp[31 * trans_size];
  674|  1.92M|                }
  675|  1.09M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (675:28): [True: 971k, False: 122k]
  ------------------
  676|   971k|                {
  677|   971k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  678|   971k|                                    + g_ai2_ihevc_trans_32[6][k]
  679|   971k|                                                    * pi2_tmp[6 * trans_size]
  680|   971k|                                    + g_ai2_ihevc_trans_32[10][k]
  681|   971k|                                                    * pi2_tmp[10 * trans_size]
  682|   971k|                                    + g_ai2_ihevc_trans_32[14][k]
  683|   971k|                                                    * pi2_tmp[14 * trans_size]
  684|   971k|                                    + g_ai2_ihevc_trans_32[18][k]
  685|   971k|                                                    * pi2_tmp[18 * trans_size]
  686|   971k|                                    + g_ai2_ihevc_trans_32[22][k]
  687|   971k|                                                    * pi2_tmp[22 * trans_size]
  688|   971k|                                    + g_ai2_ihevc_trans_32[26][k]
  689|   971k|                                                    * pi2_tmp[26 * trans_size]
  690|   971k|                                    + g_ai2_ihevc_trans_32[30][k]
  691|   971k|                                                    * pi2_tmp[30 * trans_size];
  692|   971k|                }
  693|   615k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (693:28): [True: 493k, False: 122k]
  ------------------
  694|   493k|                {
  695|   493k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  696|   493k|                                    + g_ai2_ihevc_trans_32[12][k]
  697|   493k|                                                    * pi2_tmp[12 * trans_size]
  698|   493k|                                    + g_ai2_ihevc_trans_32[20][k]
  699|   493k|                                                    * pi2_tmp[20 * trans_size]
  700|   493k|                                    + g_ai2_ihevc_trans_32[28][k]
  701|   493k|                                                    * pi2_tmp[28 * trans_size];
  702|   493k|                }
  703|   122k|                eeeo[0] =
  704|   122k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  705|   122k|                                                + g_ai2_ihevc_trans_32[24][0]
  706|   122k|                                                                * pi2_tmp[24
  707|   122k|                                                                                * trans_size];
  708|   122k|                eeeo[1] =
  709|   122k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  710|   122k|                                                + g_ai2_ihevc_trans_32[24][1]
  711|   122k|                                                                * pi2_tmp[24
  712|   122k|                                                                                * trans_size];
  713|   122k|                eeee[0] =
  714|   122k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  715|   122k|                                                + g_ai2_ihevc_trans_32[16][0]
  716|   122k|                                                                * pi2_tmp[16
  717|   122k|                                                                                * trans_size];
  718|   122k|                eeee[1] =
  719|   122k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  720|   122k|                                                + g_ai2_ihevc_trans_32[16][1]
  721|   122k|                                                                * pi2_tmp[16
  722|   122k|                                                                                * trans_size];
  723|       |
  724|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  725|   122k|                eee[0] = eeee[0] + eeeo[0];
  726|   122k|                eee[3] = eeee[0] - eeeo[0];
  727|   122k|                eee[1] = eeee[1] + eeeo[1];
  728|   122k|                eee[2] = eeee[1] - eeeo[1];
  729|   609k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (729:28): [True: 486k, False: 122k]
  ------------------
  730|   486k|                {
  731|   486k|                    ee[k] = eee[k] + eeo[k];
  732|   486k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  733|   486k|                }
  734|  1.09M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (734:28): [True: 967k, False: 122k]
  ------------------
  735|   967k|                {
  736|   967k|                    e[k] = ee[k] + eo[k];
  737|   967k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  738|   967k|                }
  739|  2.04M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (739:28): [True: 1.92M, False: 122k]
  ------------------
  740|  1.92M|                {
  741|  1.92M|                    WORD32 itrans_out;
  742|  1.92M|                    itrans_out =
  743|  1.92M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  1.92M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.92M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|  1.92M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  1.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 161k, False: 1.76M]
  |  |  |  Branch (40:53): [True: 114k, False: 1.64M]
  |  |  ------------------
  ------------------
  745|  1.92M|                    itrans_out =
  746|  1.92M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  1.92M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.92M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  1.92M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  1.92M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 182k, False: 1.74M]
  |  |  |  Branch (40:53): [True: 101k, False: 1.64M]
  |  |  ------------------
  ------------------
  748|  1.92M|                }
  749|   122k|                pi2_tmp++;
  750|   122k|                pu2_pred += pred_strd;
  751|   122k|                pu2_dst += dst_strd;
  752|   122k|            }
  753|  3.88k|        }
  754|       |        /************************************************************************************************/
  755|       |        /************************************END - IT_RECON_32x32****************************************/
  756|       |        /************************************************************************************************/
  757|  17.7k|    }
  758|  64.9k|    else  /* All rows of input are non-zero */
  759|  64.9k|    {
  760|       |        /************************************************************************************************/
  761|       |        /**********************************START - IT_RECON_32x32****************************************/
  762|       |        /************************************************************************************************/
  763|       |        /* Inverse Transform 1st stage */
  764|  64.9k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  64.9k|#define IT_SHIFT_STAGE_1 7
  ------------------
  765|  64.9k|        add = 1 << (shift - 1);
  766|       |
  767|   787k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (767:20): [True: 722k, False: 64.9k]
  ------------------
  768|   722k|        {
  769|       |            /* Checking for Zero Cols */
  770|   722k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (770:16): [True: 388k, False: 333k]
  ------------------
  771|   388k|            {
  772|   388k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  773|   388k|            }
  774|   333k|            else
  775|   333k|            {
  776|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  777|  5.68M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (777:28): [True: 5.35M, False: 333k]
  ------------------
  778|  5.35M|                {
  779|  5.35M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  780|  5.35M|                                    + g_ai2_ihevc_trans_32[3][k]
  781|  5.35M|                                                    * pi2_src[3 * src_strd]
  782|  5.35M|                                    + g_ai2_ihevc_trans_32[5][k]
  783|  5.35M|                                                    * pi2_src[5 * src_strd]
  784|  5.35M|                                    + g_ai2_ihevc_trans_32[7][k]
  785|  5.35M|                                                    * pi2_src[7 * src_strd]
  786|  5.35M|                                    + g_ai2_ihevc_trans_32[9][k]
  787|  5.35M|                                                    * pi2_src[9 * src_strd]
  788|  5.35M|                                    + g_ai2_ihevc_trans_32[11][k]
  789|  5.35M|                                                    * pi2_src[11 * src_strd]
  790|  5.35M|                                    + g_ai2_ihevc_trans_32[13][k]
  791|  5.35M|                                                    * pi2_src[13 * src_strd]
  792|  5.35M|                                    + g_ai2_ihevc_trans_32[15][k]
  793|  5.35M|                                                    * pi2_src[15 * src_strd]
  794|  5.35M|                                    + g_ai2_ihevc_trans_32[17][k]
  795|  5.35M|                                                    * pi2_src[17 * src_strd]
  796|  5.35M|                                    + g_ai2_ihevc_trans_32[19][k]
  797|  5.35M|                                                    * pi2_src[19 * src_strd]
  798|  5.35M|                                    + g_ai2_ihevc_trans_32[21][k]
  799|  5.35M|                                                    * pi2_src[21 * src_strd]
  800|  5.35M|                                    + g_ai2_ihevc_trans_32[23][k]
  801|  5.35M|                                                    * pi2_src[23 * src_strd]
  802|  5.35M|                                    + g_ai2_ihevc_trans_32[25][k]
  803|  5.35M|                                                    * pi2_src[25 * src_strd]
  804|  5.35M|                                    + g_ai2_ihevc_trans_32[27][k]
  805|  5.35M|                                                    * pi2_src[27 * src_strd]
  806|  5.35M|                                    + g_ai2_ihevc_trans_32[29][k]
  807|  5.35M|                                                    * pi2_src[29 * src_strd]
  808|  5.35M|                                    + g_ai2_ihevc_trans_32[31][k]
  809|  5.35M|                                                    * pi2_src[31 * src_strd];
  810|  5.35M|                }
  811|  3.01M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (811:28): [True: 2.67M, False: 333k]
  ------------------
  812|  2.67M|                {
  813|  2.67M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  814|  2.67M|                                    + g_ai2_ihevc_trans_32[6][k]
  815|  2.67M|                                                    * pi2_src[6 * src_strd]
  816|  2.67M|                                    + g_ai2_ihevc_trans_32[10][k]
  817|  2.67M|                                                    * pi2_src[10 * src_strd]
  818|  2.67M|                                    + g_ai2_ihevc_trans_32[14][k]
  819|  2.67M|                                                    * pi2_src[14 * src_strd]
  820|  2.67M|                                    + g_ai2_ihevc_trans_32[18][k]
  821|  2.67M|                                                    * pi2_src[18 * src_strd]
  822|  2.67M|                                    + g_ai2_ihevc_trans_32[22][k]
  823|  2.67M|                                                    * pi2_src[22 * src_strd]
  824|  2.67M|                                    + g_ai2_ihevc_trans_32[26][k]
  825|  2.67M|                                                    * pi2_src[26 * src_strd]
  826|  2.67M|                                    + g_ai2_ihevc_trans_32[30][k]
  827|  2.67M|                                                    * pi2_src[30 * src_strd];
  828|  2.67M|                }
  829|  1.67M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (829:28): [True: 1.34M, False: 333k]
  ------------------
  830|  1.34M|                {
  831|  1.34M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]
  832|  1.34M|                                    + g_ai2_ihevc_trans_32[12][k]
  833|  1.34M|                                                    * pi2_src[12 * src_strd]
  834|  1.34M|                                    + g_ai2_ihevc_trans_32[20][k]
  835|  1.34M|                                                    * pi2_src[20 * src_strd]
  836|  1.34M|                                    + g_ai2_ihevc_trans_32[28][k]
  837|  1.34M|                                                    * pi2_src[28 * src_strd];
  838|  1.34M|                }
  839|   333k|                eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd]
  840|   333k|                                + g_ai2_ihevc_trans_32[24][0]
  841|   333k|                                                * pi2_src[24 * src_strd];
  842|   333k|                eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd]
  843|   333k|                                + g_ai2_ihevc_trans_32[24][1]
  844|   333k|                                                * pi2_src[24 * src_strd];
  845|   333k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]
  846|   333k|                                + g_ai2_ihevc_trans_32[16][0]
  847|   333k|                                                * pi2_src[16 * src_strd];
  848|   333k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]
  849|   333k|                                + g_ai2_ihevc_trans_32[16][1]
  850|   333k|                                                * pi2_src[16 * src_strd];
  851|       |
  852|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  853|   333k|                eee[0] = eeee[0] + eeeo[0];
  854|   333k|                eee[3] = eeee[0] - eeeo[0];
  855|   333k|                eee[1] = eeee[1] + eeeo[1];
  856|   333k|                eee[2] = eeee[1] - eeeo[1];
  857|  1.67M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (857:28): [True: 1.33M, False: 333k]
  ------------------
  858|  1.33M|                {
  859|  1.33M|                    ee[k] = eee[k] + eeo[k];
  860|  1.33M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  861|  1.33M|                }
  862|  3.01M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (862:28): [True: 2.67M, False: 333k]
  ------------------
  863|  2.67M|                {
  864|  2.67M|                    e[k] = ee[k] + eo[k];
  865|  2.67M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  866|  2.67M|                }
  867|  5.69M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (867:28): [True: 5.35M, False: 333k]
  ------------------
  868|  5.35M|                {
  869|  5.35M|                    pi2_tmp[k] =
  870|  5.35M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift) );
  ------------------
  |  |   53|  5.35M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.35M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.31k, False: 5.34M]
  |  |  |  |  |  Branch (40:53): [True: 2.84k, False: 5.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  871|  5.35M|                    pi2_tmp[k + 16] =
  872|  5.35M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  5.35M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.35M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.45k, False: 5.35M]
  |  |  |  |  |  Branch (40:53): [True: 1.24k, False: 5.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  873|  5.35M|                }
  874|   333k|            }
  875|   722k|            pi2_src++;
  876|   722k|            pi2_tmp += trans_size;
  877|   722k|            zero_cols = zero_cols >> 1;
  878|   722k|        }
  879|       |
  880|  64.9k|        pi2_tmp = pi2_tmp_orig;
  881|       |
  882|       |        /* Inverse Transform 2nd stage */
  883|  64.9k|        shift = 20 - u1_bit_depth;
  884|  64.9k|        add = 1 << (shift - 1);
  885|  64.9k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (885:12): [True: 43.5k, False: 21.3k]
  ------------------
  886|  43.5k|        {
  887|  1.34M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (887:24): [True: 1.29M, False: 43.5k]
  ------------------
  888|  1.29M|            {
  889|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  890|  21.9M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (890:28): [True: 20.6M, False: 1.29M]
  ------------------
  891|  20.6M|                {
  892|  20.6M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  893|  20.6M|                                    + g_ai2_ihevc_trans_32[3][k]
  894|  20.6M|                                                    * pi2_tmp[3 * trans_size];
  895|  20.6M|                }
  896|  11.7M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (896:28): [True: 10.4M, False: 1.29M]
  ------------------
  897|  10.4M|                {
  898|  10.4M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  899|  10.4M|                }
  900|  1.29M|                {
  901|  1.29M|                    eeo[0] = 0;
  902|  1.29M|                    eeo[1] = 0;
  903|  1.29M|                    eeo[2] = 0;
  904|  1.29M|                    eeo[3] = 0;
  905|  1.29M|                }
  906|  1.29M|                eeeo[0] = 0;
  907|  1.29M|                eeeo[1] = 0;
  908|  1.29M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  909|  1.29M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  910|       |
  911|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  912|  1.29M|                eee[0] = eeee[0] + eeeo[0];
  913|  1.29M|                eee[3] = eeee[0] - eeeo[0];
  914|  1.29M|                eee[1] = eeee[1] + eeeo[1];
  915|  1.29M|                eee[2] = eeee[1] - eeeo[1];
  916|  6.56M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (916:28): [True: 5.26M, False: 1.29M]
  ------------------
  917|  5.26M|                {
  918|  5.26M|                    ee[k] = eee[k] + eeo[k];
  919|  5.26M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  920|  5.26M|                }
  921|  11.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (921:28): [True: 10.3M, False: 1.29M]
  ------------------
  922|  10.3M|                {
  923|  10.3M|                    e[k] = ee[k] + eo[k];
  924|  10.3M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  925|  10.3M|                }
  926|  21.6M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (926:28): [True: 20.3M, False: 1.29M]
  ------------------
  927|  20.3M|                {
  928|  20.3M|                    WORD32 itrans_out;
  929|  20.3M|                    itrans_out =
  930|  20.3M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  20.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  20.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 20.3M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 20.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|  20.3M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  20.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.49M, False: 18.8M]
  |  |  |  Branch (40:53): [True: 122k, False: 18.7M]
  |  |  ------------------
  ------------------
  932|  20.3M|                    itrans_out =
  933|  20.3M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  20.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  20.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 20.3M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 20.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|  20.3M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  20.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.48M, False: 18.8M]
  |  |  |  Branch (40:53): [True: 94.1k, False: 18.7M]
  |  |  ------------------
  ------------------
  935|  20.3M|                }
  936|  1.29M|                pi2_tmp++;
  937|  1.29M|                pu2_pred += pred_strd;
  938|  1.29M|                pu2_dst += dst_strd;
  939|  1.29M|            }
  940|  43.5k|        }
  941|  21.3k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (941:17): [True: 5.64k, False: 15.7k]
  ------------------
  942|  5.64k|        {
  943|   177k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (943:24): [True: 171k, False: 5.64k]
  ------------------
  944|   171k|            {
  945|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  946|  2.90M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (946:28): [True: 2.72M, False: 171k]
  ------------------
  947|  2.72M|                {
  948|  2.72M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  949|  2.72M|                                    + g_ai2_ihevc_trans_32[3][k]
  950|  2.72M|                                                    * pi2_tmp[3 * trans_size]
  951|  2.72M|                                    + g_ai2_ihevc_trans_32[5][k]
  952|  2.72M|                                                    * pi2_tmp[5 * trans_size]
  953|  2.72M|                                    + g_ai2_ihevc_trans_32[7][k]
  954|  2.72M|                                                    * pi2_tmp[7 * trans_size];
  955|  2.72M|                }
  956|  1.55M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (956:28): [True: 1.38M, False: 171k]
  ------------------
  957|  1.38M|                {
  958|  1.38M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  959|  1.38M|                                    + g_ai2_ihevc_trans_32[6][k]
  960|  1.38M|                                                    * pi2_tmp[6 * trans_size];
  961|  1.38M|                }
  962|   866k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (962:28): [True: 694k, False: 171k]
  ------------------
  963|   694k|                {
  964|   694k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  965|   694k|                }
  966|   171k|                eeeo[0] = 0;
  967|   171k|                eeeo[1] = 0;
  968|   171k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  969|   171k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  970|       |
  971|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  972|   171k|                eee[0] = eeee[0] + eeeo[0];
  973|   171k|                eee[3] = eeee[0] - eeeo[0];
  974|   171k|                eee[1] = eeee[1] + eeeo[1];
  975|   171k|                eee[2] = eeee[1] - eeeo[1];
  976|   866k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (976:28): [True: 695k, False: 171k]
  ------------------
  977|   695k|                {
  978|   695k|                    ee[k] = eee[k] + eeo[k];
  979|   695k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  980|   695k|                }
  981|  1.52M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (981:28): [True: 1.35M, False: 171k]
  ------------------
  982|  1.35M|                {
  983|  1.35M|                    e[k] = ee[k] + eo[k];
  984|  1.35M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  985|  1.35M|                }
  986|  2.88M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (986:28): [True: 2.71M, False: 171k]
  ------------------
  987|  2.71M|                {
  988|  2.71M|                    WORD32 itrans_out;
  989|  2.71M|                    itrans_out =
  990|  2.71M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  2.71M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.71M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  991|  2.71M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 34.9k, False: 2.68M]
  |  |  |  Branch (40:53): [True: 14.3k, False: 2.66M]
  |  |  ------------------
  ------------------
  992|  2.71M|                    itrans_out =
  993|  2.71M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  2.71M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.71M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.71M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  2.71M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  2.71M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 33.2k, False: 2.68M]
  |  |  |  Branch (40:53): [True: 14.4k, False: 2.66M]
  |  |  ------------------
  ------------------
  995|  2.71M|                }
  996|   171k|                pi2_tmp++;
  997|   171k|                pu2_pred += pred_strd;
  998|   171k|                pu2_dst += dst_strd;
  999|   171k|            }
 1000|  5.64k|        }
 1001|  15.7k|        else /* All rows of output of 1st stage are non-zero */
 1002|  15.7k|        {
 1003|   510k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1003:24): [True: 494k, False: 15.7k]
  ------------------
 1004|   494k|            {
 1005|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1006|  8.34M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1006:28): [True: 7.85M, False: 494k]
  ------------------
 1007|  7.85M|                {
 1008|  7.85M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1009|  7.85M|                                    + g_ai2_ihevc_trans_32[3][k]
 1010|  7.85M|                                                    * pi2_tmp[3 * trans_size]
 1011|  7.85M|                                    + g_ai2_ihevc_trans_32[5][k]
 1012|  7.85M|                                                    * pi2_tmp[5 * trans_size]
 1013|  7.85M|                                    + g_ai2_ihevc_trans_32[7][k]
 1014|  7.85M|                                                    * pi2_tmp[7 * trans_size]
 1015|  7.85M|                                    + g_ai2_ihevc_trans_32[9][k]
 1016|  7.85M|                                                    * pi2_tmp[9 * trans_size]
 1017|  7.85M|                                    + g_ai2_ihevc_trans_32[11][k]
 1018|  7.85M|                                                    * pi2_tmp[11 * trans_size]
 1019|  7.85M|                                    + g_ai2_ihevc_trans_32[13][k]
 1020|  7.85M|                                                    * pi2_tmp[13 * trans_size]
 1021|  7.85M|                                    + g_ai2_ihevc_trans_32[15][k]
 1022|  7.85M|                                                    * pi2_tmp[15 * trans_size]
 1023|  7.85M|                                    + g_ai2_ihevc_trans_32[17][k]
 1024|  7.85M|                                                    * pi2_tmp[17 * trans_size]
 1025|  7.85M|                                    + g_ai2_ihevc_trans_32[19][k]
 1026|  7.85M|                                                    * pi2_tmp[19 * trans_size]
 1027|  7.85M|                                    + g_ai2_ihevc_trans_32[21][k]
 1028|  7.85M|                                                    * pi2_tmp[21 * trans_size]
 1029|  7.85M|                                    + g_ai2_ihevc_trans_32[23][k]
 1030|  7.85M|                                                    * pi2_tmp[23 * trans_size]
 1031|  7.85M|                                    + g_ai2_ihevc_trans_32[25][k]
 1032|  7.85M|                                                    * pi2_tmp[25 * trans_size]
 1033|  7.85M|                                    + g_ai2_ihevc_trans_32[27][k]
 1034|  7.85M|                                                    * pi2_tmp[27 * trans_size]
 1035|  7.85M|                                    + g_ai2_ihevc_trans_32[29][k]
 1036|  7.85M|                                                    * pi2_tmp[29 * trans_size]
 1037|  7.85M|                                    + g_ai2_ihevc_trans_32[31][k]
 1038|  7.85M|                                                    * pi2_tmp[31 * trans_size];
 1039|  7.85M|                }
 1040|  4.46M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1040:28): [True: 3.97M, False: 494k]
  ------------------
 1041|  3.97M|                {
 1042|  3.97M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1043|  3.97M|                                    + g_ai2_ihevc_trans_32[6][k]
 1044|  3.97M|                                                    * pi2_tmp[6 * trans_size]
 1045|  3.97M|                                    + g_ai2_ihevc_trans_32[10][k]
 1046|  3.97M|                                                    * pi2_tmp[10 * trans_size]
 1047|  3.97M|                                    + g_ai2_ihevc_trans_32[14][k]
 1048|  3.97M|                                                    * pi2_tmp[14 * trans_size]
 1049|  3.97M|                                    + g_ai2_ihevc_trans_32[18][k]
 1050|  3.97M|                                                    * pi2_tmp[18 * trans_size]
 1051|  3.97M|                                    + g_ai2_ihevc_trans_32[22][k]
 1052|  3.97M|                                                    * pi2_tmp[22 * trans_size]
 1053|  3.97M|                                    + g_ai2_ihevc_trans_32[26][k]
 1054|  3.97M|                                                    * pi2_tmp[26 * trans_size]
 1055|  3.97M|                                    + g_ai2_ihevc_trans_32[30][k]
 1056|  3.97M|                                                    * pi2_tmp[30 * trans_size];
 1057|  3.97M|                }
 1058|  2.50M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1058:28): [True: 2.01M, False: 494k]
  ------------------
 1059|  2.01M|                {
 1060|  2.01M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1061|  2.01M|                                    + g_ai2_ihevc_trans_32[12][k]
 1062|  2.01M|                                                    * pi2_tmp[12 * trans_size]
 1063|  2.01M|                                    + g_ai2_ihevc_trans_32[20][k]
 1064|  2.01M|                                                    * pi2_tmp[20 * trans_size]
 1065|  2.01M|                                    + g_ai2_ihevc_trans_32[28][k]
 1066|  2.01M|                                                    * pi2_tmp[28 * trans_size];
 1067|  2.01M|                }
 1068|   494k|                eeeo[0] =
 1069|   494k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1070|   494k|                                                + g_ai2_ihevc_trans_32[24][0]
 1071|   494k|                                                                * pi2_tmp[24
 1072|   494k|                                                                                * trans_size];
 1073|   494k|                eeeo[1] =
 1074|   494k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1075|   494k|                                                + g_ai2_ihevc_trans_32[24][1]
 1076|   494k|                                                                * pi2_tmp[24
 1077|   494k|                                                                                * trans_size];
 1078|   494k|                eeee[0] =
 1079|   494k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1080|   494k|                                                + g_ai2_ihevc_trans_32[16][0]
 1081|   494k|                                                                * pi2_tmp[16
 1082|   494k|                                                                                * trans_size];
 1083|   494k|                eeee[1] =
 1084|   494k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1085|   494k|                                                + g_ai2_ihevc_trans_32[16][1]
 1086|   494k|                                                                * pi2_tmp[16
 1087|   494k|                                                                                * trans_size];
 1088|       |
 1089|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1090|   494k|                eee[0] = eeee[0] + eeeo[0];
 1091|   494k|                eee[3] = eeee[0] - eeeo[0];
 1092|   494k|                eee[1] = eeee[1] + eeeo[1];
 1093|   494k|                eee[2] = eeee[1] - eeeo[1];
 1094|  2.48M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1094:28): [True: 1.99M, False: 494k]
  ------------------
 1095|  1.99M|                {
 1096|  1.99M|                    ee[k] = eee[k] + eeo[k];
 1097|  1.99M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1098|  1.99M|                }
 1099|  4.47M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1099:28): [True: 3.98M, False: 494k]
  ------------------
 1100|  3.98M|                {
 1101|  3.98M|                    e[k] = ee[k] + eo[k];
 1102|  3.98M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1103|  3.98M|                }
 1104|  8.36M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1104:28): [True: 7.86M, False: 494k]
  ------------------
 1105|  7.86M|                {
 1106|  7.86M|                    WORD32 itrans_out;
 1107|  7.86M|                    itrans_out =
 1108|  7.86M|                                    CLIP_S16( ((e[k] + o[k] + add) >> shift ) );
  ------------------
  |  |   53|  7.86M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.23k, False: 7.86M]
  |  |  |  |  |  Branch (40:53): [True: 30, False: 7.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1109|  7.86M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  7.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 582k, False: 7.28M]
  |  |  |  Branch (40:53): [True: 510k, False: 6.77M]
  |  |  ------------------
  ------------------
 1110|  7.86M|                    itrans_out =
 1111|  7.86M|                                    CLIP_S16( ((e[15 - k] - o[15 - k] + add) >> shift ));
  ------------------
  |  |   53|  7.86M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.86M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  7.86M|                    pu2_dst[k + 16] = CLIP3((itrans_out + pu2_pred[k+16]), 0, clip_limit);
  ------------------
  |  |   40|  7.86M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 502k, False: 7.36M]
  |  |  |  Branch (40:53): [True: 434k, False: 6.93M]
  |  |  ------------------
  ------------------
 1113|  7.86M|                }
 1114|   494k|                pi2_tmp++;
 1115|   494k|                pu2_pred += pred_strd;
 1116|   494k|                pu2_dst += dst_strd;
 1117|   494k|            }
 1118|  15.7k|        }
 1119|       |        /************************************************************************************************/
 1120|       |        /************************************END - IT_RECON_32x32****************************************/
 1121|       |        /************************************************************************************************/
 1122|  64.9k|    }
 1123|   148k|}

ihevc_hbd_itrans_recon_8x8:
  106|   178k|{
  107|   178k|    WORD32 j, k;
  108|   178k|    WORD32 e[4], o[4];
  109|   178k|    WORD32 ee[2], eo[2];
  110|   178k|    WORD32 add;
  111|   178k|    WORD32 shift;
  112|   178k|    WORD16 *pi2_tmp_orig;
  113|   178k|    WORD32 trans_size;
  114|   178k|    WORD32 zero_rows_2nd_stage = zero_cols;
  115|   178k|    WORD32 row_limit_2nd_stage;
  116|   178k|    WORD16 clip_limit;
  117|       |
  118|   178k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   178k|#define TRANS_SIZE_8   8
  ------------------
  119|   178k|    clip_limit = (1 << u1_bit_depth) - 1;
  120|       |
  121|   178k|    pi2_tmp_orig = pi2_tmp;
  122|       |
  123|   178k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (123:8): [True: 88.2k, False: 89.8k]
  ------------------
  124|  88.2k|        row_limit_2nd_stage = 4;
  125|  89.8k|    else
  126|  89.8k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  89.8k|#define TRANS_SIZE_8   8
  ------------------
  127|       |
  128|       |
  129|   178k|    if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (129:8): [True: 89.8k, False: 88.2k]
  ------------------
  130|  89.8k|    {
  131|       |        /************************************************************************************************/
  132|       |        /**********************************START - IT_RECON_8x8******************************************/
  133|       |        /************************************************************************************************/
  134|       |
  135|       |        /* Inverse Transform 1st stage */
  136|  89.8k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  89.8k|#define IT_SHIFT_STAGE_1 7
  ------------------
  137|  89.8k|        add = 1 << (shift - 1);
  138|       |
  139|   508k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (139:20): [True: 418k, False: 89.8k]
  ------------------
  140|   418k|        {
  141|       |            /* Checking for Zero Cols */
  142|   418k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (142:16): [True: 211k, False: 207k]
  ------------------
  143|   211k|            {
  144|   211k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  145|   211k|            }
  146|   207k|            else
  147|   207k|            {
  148|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  149|  1.03M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (149:28): [True: 830k, False: 207k]
  ------------------
  150|   830k|                {
  151|   830k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  152|   830k|                                    + g_ai2_ihevc_trans_8[3][k]
  153|   830k|                                                    * pi2_src[3 * src_strd];
  154|   830k|                }
  155|   207k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd];
  156|   207k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd];
  157|   207k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0];
  158|   207k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0];
  159|       |
  160|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  161|   207k|                e[0] = ee[0] + eo[0];
  162|   207k|                e[3] = ee[0] - eo[0];
  163|   207k|                e[1] = ee[1] + eo[1];
  164|   207k|                e[2] = ee[1] - eo[1];
  165|  1.03M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (165:28): [True: 830k, False: 207k]
  ------------------
  166|   830k|                {
  167|   830k|                    pi2_tmp[k] =
  168|   830k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|   830k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   830k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 358, False: 829k]
  |  |  |  |  |  Branch (40:53): [True: 421, False: 829k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|   830k|                    pi2_tmp[k + 4] =
  170|   830k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift) );
  ------------------
  |  |   53|   830k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   830k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 114, False: 830k]
  |  |  |  |  |  Branch (40:53): [True: 176, False: 829k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|   830k|                }
  172|   207k|            }
  173|   418k|            pi2_src++;
  174|   418k|            pi2_tmp += trans_size;
  175|   418k|            zero_cols = zero_cols >> 1;
  176|   418k|        }
  177|       |
  178|  89.8k|        pi2_tmp = pi2_tmp_orig;
  179|       |
  180|       |        /* Inverse Transform 2nd stage */
  181|  89.8k|        shift = 20 - u1_bit_depth;
  182|  89.8k|        add = 1 << (shift - 1);
  183|  89.8k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (183:12): [True: 74.8k, False: 14.9k]
  ------------------
  184|  74.8k|        {
  185|   672k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (185:24): [True: 597k, False: 74.8k]
  ------------------
  186|   597k|            {
  187|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  188|  2.98M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (188:28): [True: 2.39M, False: 597k]
  ------------------
  189|  2.39M|                {
  190|  2.39M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  191|  2.39M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  192|  2.39M|                }
  193|   597k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  194|   597k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  195|   597k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  196|   597k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  197|       |
  198|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  199|   597k|                e[0] = ee[0] + eo[0];
  200|   597k|                e[3] = ee[0] - eo[0];
  201|   597k|                e[1] = ee[1] + eo[1];
  202|   597k|                e[2] = ee[1] - eo[1];
  203|  2.98M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 2.39M, False: 597k]
  ------------------
  204|  2.39M|                {
  205|  2.39M|                    WORD32 itrans_out;
  206|  2.39M|                    itrans_out =
  207|  2.39M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  2.39M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.39M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|  2.39M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 192k, False: 2.19M]
  |  |  |  Branch (40:53): [True: 67.4k, False: 2.13M]
  |  |  ------------------
  ------------------
  209|  2.39M|                    itrans_out =
  210|  2.39M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|  2.39M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.39M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  2.39M|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 195k, False: 2.19M]
  |  |  |  Branch (40:53): [True: 69.2k, False: 2.12M]
  |  |  ------------------
  ------------------
  212|  2.39M|                }
  213|   597k|                pi2_tmp++;
  214|   597k|                pu2_pred += pred_strd;
  215|   597k|                pu2_dst += dst_strd;
  216|   597k|            }
  217|  74.8k|        }
  218|  14.9k|        else /* All rows of output of 1st stage are non-zero */
  219|  14.9k|        {
  220|   134k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (220:24): [True: 119k, False: 14.9k]
  ------------------
  221|   119k|            {
  222|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  223|   599k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (223:28): [True: 479k, False: 119k]
  ------------------
  224|   479k|                {
  225|   479k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  226|   479k|                                    + g_ai2_ihevc_trans_8[3][k]
  227|   479k|                                                    * pi2_tmp[3 * trans_size]
  228|   479k|                                    + g_ai2_ihevc_trans_8[5][k]
  229|   479k|                                                    * pi2_tmp[5 * trans_size]
  230|   479k|                                    + g_ai2_ihevc_trans_8[7][k]
  231|   479k|                                                    * pi2_tmp[7 * trans_size];
  232|   479k|                }
  233|       |
  234|   119k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  235|   119k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  236|   119k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  237|   119k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  238|   119k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  239|   119k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  240|   119k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  241|   119k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  242|       |
  243|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  244|   119k|                e[0] = ee[0] + eo[0];
  245|   119k|                e[3] = ee[0] - eo[0];
  246|   119k|                e[1] = ee[1] + eo[1];
  247|   119k|                e[2] = ee[1] - eo[1];
  248|   598k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (248:28): [True: 479k, False: 119k]
  ------------------
  249|   479k|                {
  250|   479k|                    WORD32 itrans_out;
  251|   479k|                    itrans_out =
  252|   479k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   479k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   479k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 479k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 479k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   479k|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   479k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 51.2k, False: 427k]
  |  |  |  Branch (40:53): [True: 22.4k, False: 405k]
  |  |  ------------------
  ------------------
  254|   479k|                    itrans_out =
  255|   479k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|   479k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   479k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 479k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 479k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|   479k|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|   479k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 69.9k, False: 409k]
  |  |  |  Branch (40:53): [True: 15.0k, False: 394k]
  |  |  ------------------
  ------------------
  257|   479k|                }
  258|   119k|                pi2_tmp++;
  259|   119k|                pu2_pred += pred_strd;
  260|   119k|                pu2_dst += dst_strd;
  261|   119k|            }
  262|  14.9k|        }
  263|       |        /************************************************************************************************/
  264|       |        /************************************END - IT_RECON_8x8******************************************/
  265|       |        /************************************************************************************************/
  266|  89.8k|    }
  267|  88.2k|    else /* All rows of input are non-zero */
  268|  88.2k|    {
  269|       |        /************************************************************************************************/
  270|       |        /**********************************START - IT_RECON_8x8******************************************/
  271|       |        /************************************************************************************************/
  272|       |
  273|       |        /* Inverse Transform 1st stage */
  274|  88.2k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  88.2k|#define IT_SHIFT_STAGE_1 7
  ------------------
  275|  88.2k|        add = 1 << (shift - 1);
  276|       |
  277|   740k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (277:20): [True: 652k, False: 88.2k]
  ------------------
  278|   652k|        {
  279|       |            /* Checking for Zero Cols */
  280|   652k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (280:16): [True: 239k, False: 413k]
  ------------------
  281|   239k|            {
  282|   239k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  283|   239k|            }
  284|   413k|            else
  285|   413k|            {
  286|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  287|  2.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (287:28): [True: 1.65M, False: 413k]
  ------------------
  288|  1.65M|                {
  289|  1.65M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  290|  1.65M|                                    + g_ai2_ihevc_trans_8[3][k]
  291|  1.65M|                                                    * pi2_src[3 * src_strd]
  292|  1.65M|                                    + g_ai2_ihevc_trans_8[5][k]
  293|  1.65M|                                                    * pi2_src[5 * src_strd]
  294|  1.65M|                                    + g_ai2_ihevc_trans_8[7][k]
  295|  1.65M|                                                    * pi2_src[7 * src_strd];
  296|  1.65M|                }
  297|       |
  298|   413k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  299|   413k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  300|   413k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  301|   413k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  302|   413k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  303|   413k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  304|   413k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  305|   413k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd];
  306|       |
  307|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  308|   413k|                e[0] = ee[0] + eo[0];
  309|   413k|                e[3] = ee[0] - eo[0];
  310|   413k|                e[1] = ee[1] + eo[1];
  311|   413k|                e[2] = ee[1] - eo[1];
  312|  2.06M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (312:28): [True: 1.65M, False: 413k]
  ------------------
  313|  1.65M|                {
  314|  1.65M|                    pi2_tmp[k] =
  315|  1.65M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift) );
  ------------------
  |  |   53|  1.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 582, False: 1.65M]
  |  |  |  |  |  Branch (40:53): [True: 396, False: 1.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  1.65M|                    pi2_tmp[k + 4] =
  317|  1.65M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift) );
  ------------------
  |  |   53|  1.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 168, False: 1.65M]
  |  |  |  |  |  Branch (40:53): [True: 178, False: 1.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  1.65M|                }
  319|   413k|            }
  320|   652k|            pi2_src++;
  321|   652k|            pi2_tmp += trans_size;
  322|   652k|            zero_cols = zero_cols >> 1;
  323|   652k|        }
  324|       |
  325|  88.2k|        pi2_tmp = pi2_tmp_orig;
  326|       |
  327|       |        /* Inverse Transform 2nd stage */
  328|  88.2k|        shift = 20 - u1_bit_depth;
  329|  88.2k|        add = 1 << (shift - 1);
  330|  88.2k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (330:12): [True: 13.4k, False: 74.8k]
  ------------------
  331|  13.4k|        {
  332|   120k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (332:24): [True: 107k, False: 13.4k]
  ------------------
  333|   107k|            {
  334|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  335|   535k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (335:28): [True: 428k, False: 107k]
  ------------------
  336|   428k|                {
  337|   428k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  338|   428k|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  339|   428k|                }
  340|   107k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  341|   107k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  342|   107k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  343|   107k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  344|       |
  345|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  346|   107k|                e[0] = ee[0] + eo[0];
  347|   107k|                e[3] = ee[0] - eo[0];
  348|   107k|                e[1] = ee[1] + eo[1];
  349|   107k|                e[2] = ee[1] - eo[1];
  350|   535k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (350:28): [True: 428k, False: 107k]
  ------------------
  351|   428k|                {
  352|   428k|                    WORD32 itrans_out;
  353|   428k|                    itrans_out =
  354|   428k|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|   428k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   428k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 428k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 428k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|   428k|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|   428k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 47.8k, False: 380k]
  |  |  |  Branch (40:53): [True: 15.4k, False: 364k]
  |  |  ------------------
  ------------------
  356|   428k|                    itrans_out =
  357|   428k|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|   428k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   428k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 428k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 428k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|   428k|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|   428k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 43.8k, False: 384k]
  |  |  |  Branch (40:53): [True: 15.4k, False: 368k]
  |  |  ------------------
  ------------------
  359|   428k|                }
  360|   107k|                pi2_tmp++;
  361|   107k|                pu2_pred += pred_strd;
  362|   107k|                pu2_dst += dst_strd;
  363|   107k|            }
  364|  13.4k|        }
  365|  74.8k|        else /* All rows of output of 1st stage are non-zero */
  366|  74.8k|        {
  367|   673k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (367:24): [True: 599k, False: 74.8k]
  ------------------
  368|   599k|            {
  369|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  370|  2.99M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (370:28): [True: 2.39M, False: 599k]
  ------------------
  371|  2.39M|                {
  372|  2.39M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  373|  2.39M|                                    + g_ai2_ihevc_trans_8[3][k]
  374|  2.39M|                                                    * pi2_tmp[3 * trans_size]
  375|  2.39M|                                    + g_ai2_ihevc_trans_8[5][k]
  376|  2.39M|                                                    * pi2_tmp[5 * trans_size]
  377|  2.39M|                                    + g_ai2_ihevc_trans_8[7][k]
  378|  2.39M|                                                    * pi2_tmp[7 * trans_size];
  379|  2.39M|                }
  380|       |
  381|   599k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  382|   599k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  383|   599k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  384|   599k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  385|   599k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  386|   599k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  387|   599k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  388|   599k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  389|       |
  390|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  391|   599k|                e[0] = ee[0] + eo[0];
  392|   599k|                e[3] = ee[0] - eo[0];
  393|   599k|                e[1] = ee[1] + eo[1];
  394|   599k|                e[2] = ee[1] - eo[1];
  395|  2.99M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (395:28): [True: 2.39M, False: 599k]
  ------------------
  396|  2.39M|                {
  397|  2.39M|                    WORD32 itrans_out;
  398|  2.39M|                    itrans_out =
  399|  2.39M|                                    CLIP_S16( ((e[k] + o[k] + add)>>shift ) );
  ------------------
  |  |   53|  2.39M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.39M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|  2.39M|                    pu2_dst[k] = CLIP3((itrans_out + pu2_pred[k]), 0, clip_limit);
  ------------------
  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 62.9k, False: 2.33M]
  |  |  |  Branch (40:53): [True: 17.3k, False: 2.31M]
  |  |  ------------------
  ------------------
  401|  2.39M|                    itrans_out =
  402|  2.39M|                                    CLIP_S16( ((e[3-k] - o[3-k] + add)>>shift ) );
  ------------------
  |  |   53|  2.39M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.39M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.39M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|  2.39M|                    pu2_dst[k + 4] = CLIP3((itrans_out + pu2_pred[k + 4] ), 0, clip_limit);
  ------------------
  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 50.8k, False: 2.34M]
  |  |  |  Branch (40:53): [True: 15.5k, False: 2.32M]
  |  |  ------------------
  ------------------
  404|  2.39M|                }
  405|   599k|                pi2_tmp++;
  406|   599k|                pu2_pred += pred_strd;
  407|   599k|                pu2_dst += dst_strd;
  408|   599k|            }
  409|  74.8k|        }
  410|       |        /************************************************************************************************/
  411|       |        /************************************END - IT_RECON_8x8******************************************/
  412|       |        /************************************************************************************************/
  413|  88.2k|    }
  414|   178k|}

ihevc_hbd_pad_top:
  262|  48.0k|{
  263|  48.0k|    WORD32 row;
  264|       |
  265|  3.60M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (265:18): [True: 3.55M, False: 48.0k]
  ------------------
  266|  3.55M|    {
  267|  3.55M|        memcpy(pu2_src - row * src_strd, pu2_src, wd * sizeof(UWORD16));
  268|  3.55M|    }
  269|  48.0k|}
ihevc_hbd_pad_bottom:
  313|  48.0k|{
  314|  48.0k|    WORD32 row;
  315|       |
  316|  3.60M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (316:18): [True: 3.55M, False: 48.0k]
  ------------------
  317|  3.55M|    {
  318|  3.55M|        memcpy(pu2_src + (row - 1) * src_strd,
  319|  3.55M|               pu2_src - 1 * src_strd, wd * sizeof(UWORD16));
  320|  3.55M|    }
  321|  48.0k|}
ihevc_hbd_pad_left_luma:
  367|   155k|{
  368|   155k|    WORD32 row, col;
  369|       |
  370|  8.36M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (370:18): [True: 8.20M, False: 155k]
  ------------------
  371|  8.20M|    {
  372|   664M|        for(col = 0; col < pad_size; col++)
  ------------------
  |  Branch (372:22): [True: 656M, False: 8.20M]
  ------------------
  373|   656M|        {
  374|   656M|            pu2_src[col - pad_size] = *pu2_src;
  375|   656M|        }
  376|  8.20M|        pu2_src += src_strd;
  377|  8.20M|    }
  378|   155k|}
ihevc_hbd_pad_left_chroma:
  424|   177k|{
  425|   177k|    WORD32 row;
  426|   177k|    WORD32 col;
  427|   177k|    UWORD32 *pu4_src = (UWORD32 *)pu2_src;
  428|       |
  429|   177k|    src_strd >>= 1;
  430|   177k|    pad_size >>= 1;
  431|       |
  432|  6.98M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (432:18): [True: 6.80M, False: 177k]
  ------------------
  433|  6.80M|    {
  434|  6.80M|        UWORD32 u4_uv_val;
  435|       |
  436|  6.80M|        u4_uv_val = pu4_src[0];
  437|   279M|        for(col = -pad_size; col < 0; col++)
  ------------------
  |  Branch (437:30): [True: 272M, False: 6.80M]
  ------------------
  438|   272M|            pu4_src[col] = u4_uv_val;
  439|       |
  440|  6.80M|        pu4_src += src_strd;
  441|  6.80M|    }
  442|   177k|}
ihevc_hbd_pad_right_luma:
  488|   155k|{
  489|   155k|    WORD32 row, col;
  490|       |
  491|  8.36M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (491:18): [True: 8.20M, False: 155k]
  ------------------
  492|  8.20M|    {
  493|   664M|        for(col = 0; col < pad_size; col++)
  ------------------
  |  Branch (493:22): [True: 656M, False: 8.20M]
  ------------------
  494|   656M|        {
  495|   656M|            pu2_src[col] = *(pu2_src - 1);
  496|   656M|        }
  497|       |
  498|  8.20M|        pu2_src += src_strd;
  499|  8.20M|    }
  500|   155k|}
ihevc_hbd_pad_right_chroma:
  545|   153k|{
  546|   153k|    WORD32 row;
  547|   153k|    WORD32 col;
  548|   153k|    UWORD32 *pu4_src = (UWORD32 *)pu2_src;
  549|       |
  550|   153k|    src_strd >>= 1;
  551|   153k|    pad_size >>= 1;
  552|       |
  553|  6.96M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (553:18): [True: 6.80M, False: 153k]
  ------------------
  554|  6.80M|    {
  555|  6.80M|        UWORD32 u4_uv_val;
  556|       |
  557|  6.80M|        u4_uv_val = pu4_src[-1];
  558|   279M|        for(col = 0; col < pad_size; col++)
  ------------------
  |  Branch (558:22): [True: 272M, False: 6.80M]
  ------------------
  559|   272M|            pu4_src[col] = u4_uv_val;
  560|       |
  561|  6.80M|        pu4_src += src_strd;
  562|  6.80M|    }
  563|   153k|}

ihevc_hbd_recon_4x4_ttype1:
  100|   296k|{
  101|   296k|    WORD32 i, j;
  102|   296k|    WORD32 trans_size;
  103|   296k|    WORD16 clip_limit;
  104|       |
  105|   296k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   296k|#define TRANS_SIZE_4   4
  ------------------
  106|   296k|    clip_limit = (1 << u1_bit_depth) - 1;
  107|       |
  108|       |    /* Reconstruction */
  109|       |
  110|  1.48M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (110:16): [True: 1.18M, False: 296k]
  ------------------
  111|  1.18M|    {
  112|       |        /* Checking for Zero Cols */
  113|  1.18M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (113:12): [True: 267k, False: 918k]
  ------------------
  114|   267k|        {
  115|  1.33M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (115:24): [True: 1.06M, False: 267k]
  ------------------
  116|  1.06M|            {
  117|  1.06M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  118|  1.06M|            }
  119|   267k|        }
  120|   918k|        else
  121|   918k|        {
  122|  4.59M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (122:24): [True: 3.67M, False: 918k]
  ------------------
  123|  3.67M|            {
  124|  3.67M|                pu2_dst[j * dst_strd] =
  125|  3.67M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  3.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 234k, False: 3.43M]
  |  |  |  Branch (40:53): [True: 22.8k, False: 3.41M]
  |  |  ------------------
  ------------------
  126|  3.67M|            }
  127|   918k|        }
  128|  1.18M|        pi2_src++;
  129|  1.18M|        pu2_dst++;
  130|  1.18M|        pu2_pred++;
  131|  1.18M|        zero_cols = zero_cols >> 1;
  132|  1.18M|    }
  133|   296k|}
ihevc_hbd_recon_4x4:
  183|  3.67k|{
  184|  3.67k|    WORD32 i, j;
  185|  3.67k|    WORD32 trans_size;
  186|  3.67k|    WORD16 clip_limit;
  187|       |
  188|  3.67k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  3.67k|#define TRANS_SIZE_4   4
  ------------------
  189|  3.67k|    clip_limit = (1 << u1_bit_depth) - 1;
  190|       |
  191|       |    /* Reconstruction */
  192|       |
  193|  18.3k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (193:16): [True: 14.7k, False: 3.67k]
  ------------------
  194|  14.7k|    {
  195|       |        /* Checking for Zero Cols */
  196|  14.7k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (196:12): [True: 4.33k, False: 10.3k]
  ------------------
  197|  4.33k|        {
  198|  21.6k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (198:24): [True: 17.3k, False: 4.33k]
  ------------------
  199|  17.3k|            {
  200|  17.3k|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  201|  17.3k|            }
  202|  4.33k|        }
  203|  10.3k|        else
  204|  10.3k|        {
  205|  51.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (205:24): [True: 41.4k, False: 10.3k]
  ------------------
  206|  41.4k|            {
  207|  41.4k|                pu2_dst[j * dst_strd] =
  208|  41.4k|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  41.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.29k, False: 36.1k]
  |  |  |  Branch (40:53): [True: 4.74k, False: 31.4k]
  |  |  ------------------
  ------------------
  209|  41.4k|            }
  210|  10.3k|        }
  211|  14.7k|        pi2_src++;
  212|  14.7k|        pu2_dst++;
  213|  14.7k|        pu2_pred++;
  214|  14.7k|        zero_cols = zero_cols >> 1;
  215|  14.7k|    }
  216|  3.67k|}
ihevc_hbd_recon_8x8:
  266|  35.1k|{
  267|  35.1k|    WORD32 i, j;
  268|  35.1k|    WORD32 trans_size;
  269|  35.1k|    WORD16 clip_limit;
  270|       |
  271|  35.1k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  35.1k|#define TRANS_SIZE_8   8
  ------------------
  272|  35.1k|    clip_limit = (1 << u1_bit_depth) - 1;
  273|       |
  274|       |    /* Reconstruction */
  275|       |
  276|   316k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (276:16): [True: 281k, False: 35.1k]
  ------------------
  277|   281k|    {
  278|       |        /* Checking for Zero Cols */
  279|   281k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (279:12): [True: 150k, False: 130k]
  ------------------
  280|   150k|        {
  281|  1.35M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (281:24): [True: 1.20M, False: 150k]
  ------------------
  282|  1.20M|            {
  283|  1.20M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  284|  1.20M|            }
  285|   150k|        }
  286|   130k|        else
  287|   130k|        {
  288|  1.17M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (288:24): [True: 1.04M, False: 130k]
  ------------------
  289|  1.04M|            {
  290|  1.04M|                pu2_dst[j * dst_strd] =
  291|  1.04M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  1.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 16.3k, False: 1.03M]
  |  |  |  Branch (40:53): [True: 5.75k, False: 1.02M]
  |  |  ------------------
  ------------------
  292|  1.04M|            }
  293|   130k|        }
  294|   281k|        pi2_src++;
  295|   281k|        pu2_dst++;
  296|   281k|        pu2_pred++;
  297|   281k|        zero_cols = zero_cols >> 1;
  298|   281k|    }
  299|  35.1k|}
ihevc_hbd_recon_16x16:
  349|  14.0k|{
  350|  14.0k|    WORD32 i, j;
  351|  14.0k|    WORD32 trans_size;
  352|  14.0k|    WORD16 clip_limit;
  353|       |
  354|  14.0k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  14.0k|#define TRANS_SIZE_16 16
  ------------------
  355|  14.0k|    clip_limit = (1 << u1_bit_depth) - 1;
  356|       |
  357|       |    /* Reconstruction */
  358|       |
  359|   238k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (359:16): [True: 224k, False: 14.0k]
  ------------------
  360|   224k|    {
  361|       |        /* Checking for Zero Cols */
  362|   224k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (362:12): [True: 165k, False: 59.0k]
  ------------------
  363|   165k|        {
  364|  2.81M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (364:24): [True: 2.65M, False: 165k]
  ------------------
  365|  2.65M|            {
  366|  2.65M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  367|  2.65M|            }
  368|   165k|        }
  369|  59.0k|        else
  370|  59.0k|        {
  371|  1.00M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (371:24): [True: 945k, False: 59.0k]
  ------------------
  372|   945k|            {
  373|   945k|                pu2_dst[j * dst_strd] =
  374|   945k|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|   945k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.13k, False: 941k]
  |  |  |  Branch (40:53): [True: 3.85k, False: 937k]
  |  |  ------------------
  ------------------
  375|   945k|            }
  376|  59.0k|        }
  377|   224k|        pi2_src++;
  378|   224k|        pu2_dst++;
  379|   224k|        pu2_pred++;
  380|   224k|        zero_cols = zero_cols >> 1;
  381|   224k|    }
  382|  14.0k|}
ihevc_hbd_recon_32x32:
  432|  26.7k|{
  433|  26.7k|    WORD32 i, j;
  434|  26.7k|    WORD32 trans_size;
  435|  26.7k|    WORD16 clip_limit;
  436|       |
  437|  26.7k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|  26.7k|#define TRANS_SIZE_32 32
  ------------------
  438|  26.7k|    clip_limit = (1 << u1_bit_depth) - 1;
  439|       |
  440|       |    /* Reconstruction */
  441|       |
  442|   874k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (442:16): [True: 847k, False: 26.7k]
  ------------------
  443|   847k|    {
  444|       |        /* Checking for Zero Cols */
  445|   847k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (445:12): [True: 731k, False: 115k]
  ------------------
  446|   731k|        {
  447|  24.1M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (447:24): [True: 23.3M, False: 731k]
  ------------------
  448|  23.3M|            {
  449|  23.3M|                pu2_dst[j * dst_strd] = pu2_pred[j * pred_strd];
  450|  23.3M|            }
  451|   731k|        }
  452|   115k|        else
  453|   115k|        {
  454|  3.77M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (454:24): [True: 3.66M, False: 115k]
  ------------------
  455|  3.66M|            {
  456|  3.66M|                pu2_dst[j * dst_strd] =
  457|  3.66M|                                CLIP3((pi2_src[j*src_strd] + pu2_pred[j*pred_strd]), 0, clip_limit);
  ------------------
  |  |   40|  3.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 23.6k, False: 3.63M]
  |  |  |  Branch (40:53): [True: 24.5k, False: 3.61M]
  |  |  ------------------
  ------------------
  458|  3.66M|            }
  459|   115k|        }
  460|   847k|        pi2_src++;
  461|   847k|        pu2_dst++;
  462|   847k|        pu2_pred++;
  463|   847k|        zero_cols = zero_cols >> 1;
  464|   847k|    }
  465|  26.7k|}

ihevc_hbd_sao_band_offset_luma:
   72|   344k|{
   73|   344k|    WORD32 band_shift;
   74|   344k|    WORD32 band_table[NUM_BAND_TABLE];
   75|   344k|    WORD32 i;
   76|   344k|    WORD32 row, col;
   77|       |
   78|       |    /* Updating left and top and top-left */
   79|  8.40M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (79:18): [True: 8.06M, False: 344k]
  ------------------
   80|  8.06M|    {
   81|  8.06M|        pu2_src_left[row] = pu2_src[row * src_strd + (wd - 1)];
   82|  8.06M|    }
   83|   344k|    pu2_src_top_left[0] = pu2_src_top[wd - 1];
   84|  8.42M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (84:18): [True: 8.08M, False: 344k]
  ------------------
   85|  8.08M|    {
   86|  8.08M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
   87|  8.08M|    }
   88|       |
   89|   344k|    band_shift = u4_bit_depth - 5;
   90|  11.3M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   47|  11.3M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (90:16): [True: 11.0M, False: 344k]
  ------------------
   91|  11.0M|    {
   92|  11.0M|        band_table[i] = 0;
   93|  11.0M|    }
   94|  1.72M|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (94:16): [True: 1.37M, False: 344k]
  ------------------
   95|  1.37M|    {
   96|  1.37M|        band_table[(i + sao_band_pos) & 31] = i + 1;
   97|  1.37M|    }
   98|       |
   99|  8.34M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (99:18): [True: 8.00M, False: 344k]
  ------------------
  100|  8.00M|    {
  101|   220M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (101:22): [True: 212M, False: 8.00M]
  ------------------
  102|   212M|        {
  103|   212M|            WORD32 band_idx;
  104|   212M|            WORD32 idx = pu2_src[col] >> band_shift;
  105|       |
  106|   212M|            band_idx = (idx < NUM_BAND_TABLE) ? band_table[idx] : 0;
  ------------------
  |  |   47|   212M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (106:24): [True: 212M, False: 1.48k]
  ------------------
  107|   212M|            pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   212M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 56.7k, False: 212M]
  |  |  |  Branch (40:53): [True: 29.1k, False: 212M]
  |  |  ------------------
  ------------------
  108|   212M|        }
  109|  8.00M|        pu2_src += src_strd;
  110|  8.00M|    }
  111|   344k|}
ihevc_hbd_sao_band_offset_chroma:
  125|   242k|{
  126|   242k|    WORD32 band_shift;
  127|   242k|    WORD32 band_table_u[NUM_BAND_TABLE];
  128|   242k|    WORD32 band_table_v[NUM_BAND_TABLE];
  129|   242k|    WORD32 i;
  130|   242k|    WORD32 row, col;
  131|       |
  132|       |    /* Updating left and top and top-left */
  133|  6.20M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (133:18): [True: 5.95M, False: 242k]
  ------------------
  134|  5.95M|    {
  135|  5.95M|        pu2_src_left[2 * row] = pu2_src[row * src_strd + (wd - 2)];
  136|  5.95M|        pu2_src_left[2 * row + 1] = pu2_src[row * src_strd + (wd - 1)];
  137|  5.95M|    }
  138|   242k|    pu2_src_top_left[0] = pu2_src_top[wd - 2];
  139|   242k|    pu2_src_top_left[1] = pu2_src_top[wd - 1];
  140|  6.83M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (140:18): [True: 6.58M, False: 242k]
  ------------------
  141|  6.58M|    {
  142|  6.58M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
  143|  6.58M|    }
  144|       |
  145|   242k|    band_shift = u4_bit_depth - 5;
  146|  7.98M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   47|  7.98M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (146:16): [True: 7.74M, False: 242k]
  ------------------
  147|  7.74M|    {
  148|  7.74M|        band_table_u[i] = 0;
  149|  7.74M|        band_table_v[i] = 0;
  150|  7.74M|    }
  151|  1.21M|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (151:16): [True: 968k, False: 242k]
  ------------------
  152|   968k|    {
  153|   968k|        band_table_u[(i + sao_band_pos_u) & 31] = i + 1;
  154|   968k|        band_table_v[(i + sao_band_pos_v) & 31] = i + 1;
  155|   968k|    }
  156|       |
  157|  6.05M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (157:18): [True: 5.81M, False: 242k]
  ------------------
  158|  5.81M|    {
  159|   179M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (159:22): [True: 173M, False: 5.81M]
  ------------------
  160|   173M|        {
  161|   173M|            WORD32 band_idx;
  162|   173M|            WORD8 *pi1_sao_offset;
  163|   173M|            WORD32 idx = pu2_src[col] >> band_shift;
  164|       |
  165|   173M|            pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (165:30): [True: 86.7M, False: 86.7M]
  ------------------
  166|   173M|            if(idx < NUM_BAND_TABLE)
  ------------------
  |  |   47|   173M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (166:16): [True: 172M, False: 1.45M]
  ------------------
  167|   172M|            {
  168|   172M|                band_idx = (0 == col % 2) ? band_table_u[idx] : band_table_v[idx];
  ------------------
  |  Branch (168:28): [True: 86.4M, False: 85.6M]
  ------------------
  169|   172M|            }
  170|  1.45M|            else
  171|  1.45M|            {
  172|  1.45M|                band_idx = 0;
  173|  1.45M|            }
  174|   173M|            pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   173M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.47M, False: 172M]
  |  |  |  Branch (40:53): [True: 19.6k, False: 172M]
  |  |  ------------------
  ------------------
  175|   173M|        }
  176|  5.81M|        pu2_src += src_strd;
  177|  5.81M|    }
  178|   242k|}
ihevc_hbd_sao_edge_offset_class0:
  192|   167k|{
  193|   167k|    WORD32 row, col;
  194|   167k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  195|   167k|    UWORD16 au2_src_left_tmp[MAX_CTB_SIZE];
  196|   167k|    WORD8 u1_sign_left, u1_sign_right;
  197|       |
  198|       |    /* Initialize the mask values */
  199|   167k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|   167k|#define MAX_CTB_SIZE        64
  ------------------
  200|       |
  201|       |    /* Update top and top-left arrays */
  202|   167k|    *pu2_src_top_left = pu2_src_top[wd - 1];
  203|  3.27M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (203:18): [True: 3.10M, False: 167k]
  ------------------
  204|  3.10M|    {
  205|  3.10M|        au2_src_left_tmp[row] = pu2_src[row * src_strd + wd - 1];
  206|  3.10M|    }
  207|  3.25M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (207:18): [True: 3.09M, False: 167k]
  ------------------
  208|  3.09M|    {
  209|  3.09M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
  210|  3.09M|    }
  211|       |
  212|       |    /* Update masks based on the availability flags */
  213|   167k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (213:8): [True: 25.2k, False: 141k]
  ------------------
  214|  25.2k|    {
  215|  25.2k|        au1_mask[0] = 0;
  216|  25.2k|    }
  217|   167k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (217:8): [True: 20.0k, False: 147k]
  ------------------
  218|  20.0k|    {
  219|  20.0k|        au1_mask[wd - 1] = 0;
  220|  20.0k|    }
  221|       |
  222|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  223|   167k|    {
  224|  3.24M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (224:22): [True: 3.07M, False: 167k]
  ------------------
  225|  3.07M|        {
  226|  3.07M|            u1_sign_left = SIGN(pu2_src[0] - pu2_src_left[row]);
  ------------------
  |  |   44|  3.07M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.40M, False: 673k]
  |  |  |  Branch (44:34): [True: 944k, False: 1.45M]
  |  |  ------------------
  ------------------
  227|  66.1M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (227:26): [True: 63.1M, False: 3.07M]
  ------------------
  228|  63.1M|            {
  229|  63.1M|                WORD32 edge_idx;
  230|       |
  231|  63.1M|                u1_sign_right = SIGN(pu2_src[col] - pu2_src[col + 1]);
  ------------------
  |  |   44|  63.1M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 49.7M, False: 13.3M]
  |  |  |  Branch (44:34): [True: 8.96M, False: 40.8M]
  |  |  ------------------
  ------------------
  232|  63.1M|                edge_idx = 2 + u1_sign_left + u1_sign_right;
  233|  63.1M|                u1_sign_left = -u1_sign_right;
  234|       |
  235|  63.1M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
  236|       |
  237|  63.1M|                if(0 != edge_idx)
  ------------------
  |  Branch (237:20): [True: 10.4M, False: 52.6M]
  ------------------
  238|  10.4M|                {
  239|  10.4M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  10.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.00k, False: 10.4M]
  |  |  |  Branch (40:53): [True: 657, False: 10.4M]
  |  |  ------------------
  ------------------
  240|  10.4M|                }
  241|  63.1M|            }
  242|       |
  243|  3.07M|            pu2_src += src_strd;
  244|  3.07M|        }
  245|   167k|    }
  246|       |
  247|       |    /* Update left array */
  248|  3.27M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (248:18): [True: 3.10M, False: 167k]
  ------------------
  249|  3.10M|    {
  250|  3.10M|        pu2_src_left[row] = au2_src_left_tmp[row];
  251|  3.10M|    }
  252|   167k|}
ihevc_hbd_sao_edge_offset_class0_chroma:
  267|  53.6k|{
  268|  53.6k|    WORD32 row, col;
  269|  53.6k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  270|  53.6k|    UWORD16 au2_src_left_tmp[2 * MAX_CTB_SIZE];
  271|  53.6k|    WORD8 u1_sign_left_u, u1_sign_right_u;
  272|  53.6k|    WORD8 u1_sign_left_v, u1_sign_right_v;
  273|       |
  274|       |    /* Initialize the mask values */
  275|  53.6k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  53.6k|#define MAX_CTB_SIZE        64
  ------------------
  276|       |
  277|       |    /* Update left, top and top-left arrays */
  278|  53.6k|    pu2_src_top_left[0] = pu2_src_top[wd - 2];
  279|  53.6k|    pu2_src_top_left[1] = pu2_src_top[wd - 1];
  280|  1.46M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (280:18): [True: 1.41M, False: 53.6k]
  ------------------
  281|  1.41M|    {
  282|  1.41M|        au2_src_left_tmp[2 * row] = pu2_src[row * src_strd + wd - 2];
  283|  1.41M|        au2_src_left_tmp[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
  284|  1.41M|    }
  285|  1.57M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (285:18): [True: 1.51M, False: 53.6k]
  ------------------
  286|  1.51M|    {
  287|  1.51M|        pu2_src_top[col] = pu2_src[(ht - 1) * src_strd + col];
  288|  1.51M|    }
  289|       |
  290|       |    /* Update masks based on the availability flags */
  291|  53.6k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (291:8): [True: 8.11k, False: 45.4k]
  ------------------
  292|  8.11k|    {
  293|  8.11k|        au1_mask[0] = 0;
  294|  8.11k|    }
  295|  53.6k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (295:8): [True: 3.10k, False: 50.5k]
  ------------------
  296|  3.10k|    {
  297|  3.10k|        au1_mask[(wd - 1) >> 1] = 0;
  298|  3.10k|    }
  299|       |
  300|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  301|  53.6k|    {
  302|  1.46M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (302:22): [True: 1.40M, False: 53.6k]
  ------------------
  303|  1.40M|        {
  304|  1.40M|            u1_sign_left_u = SIGN(pu2_src[0] - pu2_src_left[2 * row]);
  ------------------
  |  |   44|  1.40M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.27M, False: 137k]
  |  |  |  Branch (44:34): [True: 172k, False: 1.09M]
  |  |  ------------------
  ------------------
  305|  1.40M|            u1_sign_left_v = SIGN(pu2_src[1] - pu2_src_left[2 * row + 1]);
  ------------------
  |  |   44|  1.40M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.28M, False: 121k]
  |  |  |  Branch (44:34): [True: 183k, False: 1.10M]
  |  |  ------------------
  ------------------
  306|  44.3M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (306:26): [True: 42.9M, False: 1.40M]
  ------------------
  307|  42.9M|            {
  308|  42.9M|                WORD32 edge_idx;
  309|  42.9M|                WORD8 *pi1_sao_offset;
  310|       |
  311|  42.9M|                if(0 == col % 2)
  ------------------
  |  Branch (311:20): [True: 21.4M, False: 21.4M]
  ------------------
  312|  21.4M|                {
  313|  21.4M|                    pi1_sao_offset = pi1_sao_offset_u;
  314|  21.4M|                    u1_sign_right_u = SIGN(pu2_src[col] - pu2_src[col + 2]);
  ------------------
  |  |   44|  21.4M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 20.3M, False: 1.15M]
  |  |  |  Branch (44:34): [True: 1.25M, False: 19.0M]
  |  |  ------------------
  ------------------
  315|  21.4M|                    edge_idx = 2 + u1_sign_left_u + u1_sign_right_u;
  316|  21.4M|                    u1_sign_left_u = -u1_sign_right_u;
  317|  21.4M|                }
  318|  21.4M|                else
  319|  21.4M|                {
  320|  21.4M|                    pi1_sao_offset = pi1_sao_offset_v;
  321|  21.4M|                    u1_sign_right_v = SIGN(pu2_src[col] - pu2_src[col + 2]);
  ------------------
  |  |   44|  21.4M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 20.3M, False: 1.13M]
  |  |  |  Branch (44:34): [True: 1.15M, False: 19.1M]
  |  |  ------------------
  ------------------
  322|  21.4M|                    edge_idx = 2 + u1_sign_left_v + u1_sign_right_v;
  323|  21.4M|                    u1_sign_left_v = -u1_sign_right_v;
  324|  21.4M|                }
  325|       |
  326|  42.9M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  327|       |
  328|  42.9M|                if(0 != edge_idx)
  ------------------
  |  Branch (328:20): [True: 2.76M, False: 40.2M]
  ------------------
  329|  2.76M|                {
  330|  2.76M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  2.76M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 28.3k, False: 2.73M]
  |  |  |  Branch (40:53): [True: 4.14k, False: 2.73M]
  |  |  ------------------
  ------------------
  331|  2.76M|                }
  332|  42.9M|            }
  333|       |
  334|  1.40M|            pu2_src += src_strd;
  335|  1.40M|        }
  336|  53.6k|    }
  337|       |
  338|  2.87M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (338:18): [True: 2.82M, False: 53.6k]
  ------------------
  339|  2.82M|    {
  340|  2.82M|        pu2_src_left[row] = au2_src_left_tmp[row];
  341|  2.82M|    }
  342|  53.6k|}
ihevc_hbd_sao_edge_offset_class1:
  356|  37.9k|{
  357|  37.9k|    WORD32 row, col;
  358|  37.9k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  359|  37.9k|    UWORD16 au2_src_top_tmp[MAX_CTB_SIZE];
  360|  37.9k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  361|  37.9k|    WORD8 u1_sign_down;
  362|       |
  363|       |    /* Initialize the mask values */
  364|  37.9k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  37.9k|#define MAX_CTB_SIZE        64
  ------------------
  365|       |
  366|       |    /* Update left, top and top-left arrays */
  367|  37.9k|    *pu2_src_top_left = pu2_src_top[wd - 1];
  368|  1.05M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (368:18): [True: 1.01M, False: 37.9k]
  ------------------
  369|  1.01M|    {
  370|  1.01M|        pu2_src_left[row] = pu2_src[row * src_strd + wd - 1];
  371|  1.01M|    }
  372|  1.06M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (372:18): [True: 1.02M, False: 37.9k]
  ------------------
  373|  1.02M|    {
  374|  1.02M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  375|  1.02M|    }
  376|       |
  377|       |    /* Update height and source pointers based on the availability flags */
  378|  37.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (378:8): [True: 10.3k, False: 27.5k]
  ------------------
  379|  10.3k|    {
  380|  10.3k|        pu2_src += src_strd;
  381|  10.3k|        ht--;
  382|   328k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (382:22): [True: 318k, False: 10.3k]
  ------------------
  383|   318k|        {
  384|   318k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - src_strd]);
  ------------------
  |  |   44|   318k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 250k, False: 67.4k]
  |  |  |  Branch (44:34): [True: 37.9k, False: 212k]
  |  |  ------------------
  ------------------
  385|   318k|        }
  386|  10.3k|    }
  387|  27.5k|    else
  388|  27.5k|    {
  389|   736k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (389:22): [True: 709k, False: 27.5k]
  ------------------
  390|   709k|        {
  391|   709k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col]);
  ------------------
  |  |   44|   709k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 511k, False: 197k]
  |  |  |  Branch (44:34): [True: 215k, False: 295k]
  |  |  ------------------
  ------------------
  392|   709k|        }
  393|  27.5k|    }
  394|  37.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (394:8): [True: 867, False: 37.0k]
  ------------------
  395|    867|    {
  396|    867|        ht--;
  397|    867|    }
  398|       |
  399|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  400|  37.9k|    {
  401|  1.04M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (401:22): [True: 1.00M, False: 37.9k]
  ------------------
  402|  1.00M|        {
  403|  31.2M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (403:26): [True: 30.2M, False: 1.00M]
  ------------------
  404|  30.2M|            {
  405|  30.2M|                WORD32 edge_idx;
  406|       |
  407|  30.2M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + src_strd]);
  ------------------
  |  |   44|  30.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 23.1M, False: 7.11M]
  |  |  |  Branch (44:34): [True: 7.86M, False: 15.2M]
  |  |  ------------------
  ------------------
  408|  30.2M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  409|  30.2M|                au1_sign_up[col] = -u1_sign_down;
  410|       |
  411|  30.2M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
  412|       |
  413|  30.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (413:20): [True: 4.37M, False: 25.8M]
  ------------------
  414|  4.37M|                {
  415|  4.37M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  4.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 612, False: 4.37M]
  |  |  |  Branch (40:53): [True: 379, False: 4.37M]
  |  |  ------------------
  ------------------
  416|  4.37M|                }
  417|  30.2M|            }
  418|       |
  419|  1.00M|            pu2_src += src_strd;
  420|  1.00M|        }
  421|  37.9k|    }
  422|       |
  423|  1.06M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (423:18): [True: 1.02M, False: 37.9k]
  ------------------
  424|  1.02M|    {
  425|  1.02M|        pu2_src_top[col] = au2_src_top_tmp[col];
  426|  1.02M|    }
  427|  37.9k|}
ihevc_hbd_sao_edge_offset_class1_chroma:
  442|  32.9k|{
  443|  32.9k|    WORD32 row, col;
  444|  32.9k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  445|  32.9k|    UWORD16 au2_src_top_tmp[2 * MAX_CTB_SIZE];
  446|  32.9k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
  447|  32.9k|    WORD8 u1_sign_down;
  448|       |
  449|       |    /* Initialize the mask values */
  450|  32.9k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  32.9k|#define MAX_CTB_SIZE        64
  ------------------
  451|       |
  452|       |    /* Update left, top and top-left arrays */
  453|  32.9k|    pu2_src_top_left[0] = pu2_src_top[wd - 2];
  454|  32.9k|    pu2_src_top_left[1] = pu2_src_top[wd - 1];
  455|   856k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (455:18): [True: 823k, False: 32.9k]
  ------------------
  456|   823k|    {
  457|   823k|        pu2_src_left[2 * row] = pu2_src[row * src_strd + wd - 2];
  458|   823k|        pu2_src_left[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
  459|   823k|    }
  460|   947k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (460:18): [True: 914k, False: 32.9k]
  ------------------
  461|   914k|    {
  462|   914k|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  463|   914k|    }
  464|       |
  465|       |    /* Update height and source pointers based on the availability flags */
  466|  32.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (466:8): [True: 5.01k, False: 27.9k]
  ------------------
  467|  5.01k|    {
  468|  5.01k|        pu2_src += src_strd;
  469|  5.01k|        ht--;
  470|   158k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (470:22): [True: 153k, False: 5.01k]
  ------------------
  471|   153k|        {
  472|   153k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - src_strd]);
  ------------------
  |  |   44|   153k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 149k, False: 3.83k]
  |  |  |  Branch (44:34): [True: 5.30k, False: 144k]
  |  |  ------------------
  ------------------
  473|   153k|        }
  474|  5.01k|    }
  475|  27.9k|    else
  476|  27.9k|    {
  477|   789k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (477:22): [True: 761k, False: 27.9k]
  ------------------
  478|   761k|        {
  479|   761k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col]);
  ------------------
  |  |   44|   761k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 669k, False: 92.4k]
  |  |  |  Branch (44:34): [True: 83.1k, False: 586k]
  |  |  ------------------
  ------------------
  480|   761k|        }
  481|  27.9k|    }
  482|  32.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (482:8): [True: 606, False: 32.3k]
  ------------------
  483|    606|    {
  484|    606|        ht--;
  485|    606|    }
  486|       |
  487|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  488|  32.9k|    {
  489|   845k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (489:22): [True: 812k, False: 32.9k]
  ------------------
  490|   812k|        {
  491|  25.4M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (491:26): [True: 24.6M, False: 812k]
  ------------------
  492|  24.6M|            {
  493|  24.6M|                WORD32 edge_idx;
  494|  24.6M|                WORD8 *pi1_sao_offset;
  495|       |
  496|  24.6M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (496:34): [True: 12.3M, False: 12.3M]
  ------------------
  497|       |
  498|  24.6M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + src_strd]);
  ------------------
  |  |   44|  24.6M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 22.8M, False: 1.78M]
  |  |  |  Branch (44:34): [True: 1.86M, False: 20.9M]
  |  |  ------------------
  ------------------
  499|  24.6M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  500|  24.6M|                au1_sign_up[col] = -u1_sign_down;
  501|       |
  502|  24.6M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  503|       |
  504|  24.6M|                if(0 != edge_idx)
  ------------------
  |  Branch (504:20): [True: 2.14M, False: 22.4M]
  ------------------
  505|  2.14M|                {
  506|  2.14M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  2.14M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 69.6k, False: 2.07M]
  |  |  |  Branch (40:53): [True: 868, False: 2.07M]
  |  |  ------------------
  ------------------
  507|  2.14M|                }
  508|  24.6M|            }
  509|       |
  510|   812k|            pu2_src += src_strd;
  511|   812k|        }
  512|  32.9k|    }
  513|       |
  514|   947k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (514:18): [True: 914k, False: 32.9k]
  ------------------
  515|   914k|    {
  516|   914k|        pu2_src_top[col] = au2_src_top_tmp[col];
  517|   914k|    }
  518|  32.9k|}
ihevc_hbd_sao_edge_offset_class2:
  532|  38.4k|{
  533|  38.4k|    WORD32 row, col;
  534|  38.4k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  535|  38.4k|    UWORD16 au2_src_left_tmp[MAX_CTB_SIZE], au2_src_top_tmp[MAX_CTB_SIZE];
  536|  38.4k|    UWORD16 u2_src_top_left_tmp;
  537|  38.4k|    WORD8 au1_sign_up[MAX_CTB_SIZE + 1], au1_sign_up_tmp[MAX_CTB_SIZE + 1];
  538|  38.4k|    WORD8 u1_sign_down;
  539|  38.4k|    WORD8 *pu1_sign_up;
  540|  38.4k|    WORD8 *pu1_sign_up_tmp;
  541|  38.4k|    UWORD16 *pu2_src_left_cpy;
  542|       |
  543|  38.4k|    UWORD16 u2_pos_0_0_tmp;
  544|  38.4k|    UWORD16 u2_pos_wd_ht_tmp;
  545|       |
  546|  38.4k|    pu1_sign_up = au1_sign_up;
  547|  38.4k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  548|  38.4k|    pu2_src_left_cpy = pu2_src_left;
  549|       |
  550|       |    /* Initialize the mask values */
  551|  38.4k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  38.4k|#define MAX_CTB_SIZE        64
  ------------------
  552|       |
  553|       |    /* Update left, top and top-left arrays */
  554|  38.4k|    u2_src_top_left_tmp = pu2_src_top[wd - 1];
  555|  1.02M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (555:18): [True: 985k, False: 38.4k]
  ------------------
  556|   985k|    {
  557|   985k|        au2_src_left_tmp[row] = pu2_src[row * src_strd + wd - 1];
  558|   985k|    }
  559|  1.02M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (559:18): [True: 989k, False: 38.4k]
  ------------------
  560|   989k|    {
  561|   989k|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  562|   989k|    }
  563|       |
  564|       |    /* If top-left is available, process separately */
  565|  38.4k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (565:8): [True: 27.5k, False: 10.8k]
  ------------------
  566|  27.5k|    {
  567|  27.5k|        WORD32 edge_idx;
  568|       |
  569|  27.5k|        edge_idx = 2 + SIGN(pu2_src[0] - pu2_src_top_left[0]) +
  ------------------
  |  |   44|  27.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 19.3k, False: 8.17k]
  |  |  |  Branch (44:34): [True: 11.4k, False: 7.87k]
  |  |  ------------------
  ------------------
  570|  27.5k|                        SIGN(pu2_src[0] - pu2_src[1 + src_strd]);
  ------------------
  |  |   44|  27.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 17.6k, False: 9.89k]
  |  |  |  Branch (44:34): [True: 8.17k, False: 9.44k]
  |  |  ------------------
  ------------------
  571|       |
  572|  27.5k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  573|       |
  574|  27.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (574:12): [True: 7.60k, False: 19.9k]
  ------------------
  575|  7.60k|        {
  576|  7.60k|            u2_pos_0_0_tmp = CLIP3(pu2_src[0] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  7.60k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 36, False: 7.56k]
  |  |  |  Branch (40:53): [True: 76, False: 7.49k]
  |  |  ------------------
  ------------------
  577|  7.60k|        }
  578|  19.9k|        else
  579|  19.9k|        {
  580|  19.9k|            u2_pos_0_0_tmp = pu2_src[0];
  581|  19.9k|        }
  582|  27.5k|    }
  583|  10.8k|    else
  584|  10.8k|    {
  585|  10.8k|        u2_pos_0_0_tmp = pu2_src[0];
  586|  10.8k|    }
  587|       |
  588|       |    /* If bottom-right is available, process separately */
  589|  38.4k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (589:8): [True: 35.0k, False: 3.38k]
  ------------------
  590|  35.0k|    {
  591|  35.0k|        WORD32 edge_idx;
  592|       |
  593|  35.0k|        edge_idx = 2 + SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd- 1 - src_strd]) +
  ------------------
  |  |   44|  35.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.6k, False: 8.33k]
  |  |  |  Branch (44:34): [True: 14.2k, False: 12.4k]
  |  |  ------------------
  ------------------
  594|  35.0k|                        SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  35.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 20.2k, False: 14.7k]
  |  |  |  Branch (44:34): [True: 11.1k, False: 9.16k]
  |  |  ------------------
  ------------------
  595|       |
  596|  35.0k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  597|       |
  598|  35.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (598:12): [True: 10.8k, False: 24.1k]
  ------------------
  599|  10.8k|        {
  600|  10.8k|            u2_pos_wd_ht_tmp = CLIP3(pu2_src[wd - 1 + (ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  10.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 69, False: 10.7k]
  |  |  |  Branch (40:53): [True: 19, False: 10.7k]
  |  |  ------------------
  ------------------
  601|  10.8k|        }
  602|  24.1k|        else
  603|  24.1k|        {
  604|  24.1k|            u2_pos_wd_ht_tmp = pu2_src[wd - 1 + (ht - 1) * src_strd];
  605|  24.1k|        }
  606|  35.0k|    }
  607|  3.38k|    else
  608|  3.38k|    {
  609|  3.38k|        u2_pos_wd_ht_tmp = pu2_src[wd - 1 + (ht - 1) * src_strd];
  610|  3.38k|    }
  611|       |
  612|       |    /* If Left is not available */
  613|  38.4k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (613:8): [True: 4.71k, False: 33.6k]
  ------------------
  614|  4.71k|    {
  615|  4.71k|        au1_mask[0] = 0;
  616|  4.71k|    }
  617|       |
  618|       |    /* If Top is not available */
  619|  38.4k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (619:8): [True: 7.28k, False: 31.1k]
  ------------------
  620|  7.28k|    {
  621|  7.28k|        pu2_src += src_strd;
  622|  7.28k|        ht--;
  623|  7.28k|        pu2_src_left_cpy += 1;
  624|   209k|        for(col = 1;col < wd; col++)
  ------------------
  |  Branch (624:21): [True: 202k, False: 7.28k]
  ------------------
  625|   202k|        {
  626|   202k|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - 1 - src_strd]);
  ------------------
  |  |   44|   202k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 133k, False: 68.7k]
  |  |  |  Branch (44:34): [True: 50.0k, False: 83.8k]
  |  |  ------------------
  ------------------
  627|   202k|        }
  628|  7.28k|    }
  629|  31.1k|    else
  630|  31.1k|    {
  631|   779k|        for(col = 1;col < wd; col++)
  ------------------
  |  Branch (631:21): [True: 748k, False: 31.1k]
  ------------------
  632|   748k|        {
  633|   748k|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col - 1]);
  ------------------
  |  |   44|   748k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 518k, False: 229k]
  |  |  |  Branch (44:34): [True: 296k, False: 221k]
  |  |  ------------------
  ------------------
  634|   748k|        }
  635|  31.1k|    }
  636|       |
  637|       |    /* If Right is not available */
  638|  38.4k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (638:8): [True: 2.73k, False: 35.6k]
  ------------------
  639|  2.73k|    {
  640|  2.73k|        au1_mask[wd - 1] = 0;
  641|  2.73k|    }
  642|       |
  643|       |    /* If Bottom is not available */
  644|  38.4k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (644:8): [True: 739, False: 37.6k]
  ------------------
  645|    739|    {
  646|    739|        ht--;
  647|    739|    }
  648|       |
  649|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  650|  38.4k|    {
  651|  1.00M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (651:22): [True: 970k, False: 38.4k]
  ------------------
  652|   970k|        {
  653|   970k|            pu1_sign_up[0] = SIGN(pu2_src[0] - pu2_src_left_cpy[row - 1]);
  ------------------
  |  |   44|   970k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 658k, False: 312k]
  |  |  |  Branch (44:34): [True: 399k, False: 258k]
  |  |  ------------------
  ------------------
  654|  29.4M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (654:26): [True: 28.4M, False: 970k]
  ------------------
  655|  28.4M|            {
  656|  28.4M|                WORD32 edge_idx;
  657|       |
  658|  28.4M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + 1 + src_strd]);
  ------------------
  |  |   44|  28.4M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 18.8M, False: 9.63M]
  |  |  |  Branch (44:34): [True: 9.07M, False: 9.76M]
  |  |  ------------------
  ------------------
  659|  28.4M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  660|  28.4M|                pu1_sign_up_tmp[col + 1] = -u1_sign_down;
  661|       |
  662|  28.4M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
  663|       |
  664|  28.4M|                if(0 != edge_idx)
  ------------------
  |  Branch (664:20): [True: 6.73M, False: 21.7M]
  ------------------
  665|  6.73M|                {
  666|  6.73M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  6.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.94k, False: 6.73M]
  |  |  |  Branch (40:53): [True: 1.74k, False: 6.73M]
  |  |  ------------------
  ------------------
  667|  6.73M|                }
  668|  28.4M|            }
  669|       |
  670|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  671|   970k|            {
  672|   970k|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  673|   970k|                pu1_sign_up = pu1_sign_up_tmp;
  674|   970k|                pu1_sign_up_tmp = pu1_swap_tmp;
  675|   970k|            }
  676|       |
  677|   970k|            pu2_src += src_strd;
  678|   970k|        }
  679|       |
  680|  38.4k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd] = u2_pos_0_0_tmp;
  ------------------
  |  Branch (680:20): [True: 31.1k, False: 7.24k]
  ------------------
  681|  38.4k|        pu2_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u2_pos_wd_ht_tmp;
  ------------------
  |  Branch (681:18): [True: 37.7k, False: 698]
  ------------------
  682|  38.4k|    }
  683|       |
  684|  38.4k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (684:8): [True: 7.28k, False: 31.1k]
  ------------------
  685|  7.28k|        ht++;
  686|  38.4k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (686:8): [True: 739, False: 37.6k]
  ------------------
  687|    739|        ht++;
  688|  38.4k|    *pu2_src_top_left = u2_src_top_left_tmp;
  689|  1.02M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (689:18): [True: 985k, False: 38.4k]
  ------------------
  690|   985k|    {
  691|   985k|        pu2_src_left[row] = au2_src_left_tmp[row];
  692|   985k|    }
  693|  1.02M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (693:18): [True: 989k, False: 38.4k]
  ------------------
  694|   989k|    {
  695|   989k|        pu2_src_top[col] = au2_src_top_tmp[col];
  696|   989k|    }
  697|  38.4k|}
ihevc_hbd_sao_edge_offset_class2_chroma:
  712|   121k|{
  713|   121k|    WORD32 row, col;
  714|   121k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  715|   121k|    UWORD16 au2_src_left_tmp[2 * MAX_CTB_SIZE], au2_src_top_tmp[2 * MAX_CTB_SIZE];
  716|   121k|    UWORD16 au2_src_top_left_tmp[2];
  717|   121k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE + 2], au1_sign_up_tmp[2 * MAX_CTB_SIZE + 2];
  718|   121k|    WORD8 u1_sign_down;
  719|   121k|    WORD8 *pu1_sign_up;
  720|   121k|    WORD8 *pu1_sign_up_tmp;
  721|   121k|    UWORD16 *pu2_src_left_cpy;
  722|       |
  723|   121k|    UWORD16 u2_pos_0_0_tmp_u;
  724|   121k|    UWORD16 u2_pos_0_0_tmp_v;
  725|   121k|    UWORD16 u2_pos_wd_ht_tmp_u;
  726|   121k|    UWORD16 u2_pos_wd_ht_tmp_v;
  727|       |
  728|   121k|    pu1_sign_up = au1_sign_up;
  729|   121k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  730|   121k|    pu2_src_left_cpy = pu2_src_left;
  731|       |
  732|       |    /* Initialize the mask values */
  733|   121k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|   121k|#define MAX_CTB_SIZE        64
  ------------------
  734|       |
  735|       |    /* Update left, top and top-left arrays */
  736|   121k|    au2_src_top_left_tmp[0] = pu2_src_top[wd - 2];
  737|   121k|    au2_src_top_left_tmp[1] = pu2_src_top[wd - 1];
  738|  1.94M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (738:18): [True: 1.82M, False: 121k]
  ------------------
  739|  1.82M|    {
  740|  1.82M|        au2_src_left_tmp[2 * row] = pu2_src[row * src_strd + wd - 2];
  741|  1.82M|        au2_src_left_tmp[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
  742|  1.82M|    }
  743|  2.63M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (743:18): [True: 2.51M, False: 121k]
  ------------------
  744|  2.51M|    {
  745|  2.51M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  746|  2.51M|    }
  747|       |
  748|       |    /* If top-left is available, process separately */
  749|   121k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (749:8): [True: 89.4k, False: 31.5k]
  ------------------
  750|  89.4k|    {
  751|  89.4k|        WORD32 edge_idx;
  752|       |
  753|       |        /* U */
  754|  89.4k|        edge_idx = 2 + SIGN(pu2_src[0] - pu2_src_top_left[0]) +
  ------------------
  |  |   44|  89.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 77.3k, False: 12.1k]
  |  |  |  Branch (44:34): [True: 8.54k, False: 68.7k]
  |  |  ------------------
  ------------------
  755|  89.4k|                        SIGN(pu2_src[0] - pu2_src[2 + src_strd]);
  ------------------
  |  |   44|  89.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 74.3k, False: 15.1k]
  |  |  |  Branch (44:34): [True: 12.8k, False: 61.4k]
  |  |  ------------------
  ------------------
  756|       |
  757|  89.4k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  758|       |
  759|  89.4k|        if(0 != edge_idx)
  ------------------
  |  Branch (759:12): [True: 22.9k, False: 66.4k]
  ------------------
  760|  22.9k|        {
  761|  22.9k|            u2_pos_0_0_tmp_u = CLIP3(pu2_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  22.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.95k, False: 20.0k]
  |  |  |  Branch (40:53): [True: 5.89k, False: 14.1k]
  |  |  ------------------
  ------------------
  762|  22.9k|        }
  763|  66.4k|        else
  764|  66.4k|        {
  765|  66.4k|            u2_pos_0_0_tmp_u = pu2_src[0];
  766|  66.4k|        }
  767|       |
  768|       |        /* V */
  769|  89.4k|        edge_idx = 2 + SIGN(pu2_src[1] - pu2_src_top_left[1]) +
  ------------------
  |  |   44|  89.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 77.9k, False: 11.5k]
  |  |  |  Branch (44:34): [True: 18.9k, False: 58.9k]
  |  |  ------------------
  ------------------
  770|  89.4k|                        SIGN(pu2_src[1] - pu2_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  89.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 61.9k, False: 27.5k]
  |  |  |  Branch (44:34): [True: 8.66k, False: 53.2k]
  |  |  ------------------
  ------------------
  771|       |
  772|  89.4k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  773|       |
  774|  89.4k|        if(0 != edge_idx)
  ------------------
  |  Branch (774:12): [True: 20.1k, False: 69.3k]
  ------------------
  775|  20.1k|        {
  776|  20.1k|            u2_pos_0_0_tmp_v = CLIP3(pu2_src[1] + pi1_sao_offset_v[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  20.1k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.16k, False: 17.9k]
  |  |  |  Branch (40:53): [True: 357, False: 17.5k]
  |  |  ------------------
  ------------------
  777|  20.1k|        }
  778|  69.3k|        else
  779|  69.3k|        {
  780|  69.3k|            u2_pos_0_0_tmp_v = pu2_src[1];
  781|  69.3k|        }
  782|  89.4k|    }
  783|  31.5k|    else
  784|  31.5k|    {
  785|  31.5k|        u2_pos_0_0_tmp_u = pu2_src[0];
  786|  31.5k|        u2_pos_0_0_tmp_v = pu2_src[1];
  787|  31.5k|    }
  788|       |
  789|       |    /* If bottom-right is available, process separately */
  790|   121k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (790:8): [True: 106k, False: 14.7k]
  ------------------
  791|   106k|    {
  792|   106k|        WORD32 edge_idx;
  793|       |
  794|       |        /* U */
  795|   106k|        edge_idx = 2 + SIGN(pu2_src[wd - 2 + (ht - 1) * src_strd] - pu2_src[wd - 2 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|   106k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 90.8k, False: 15.4k]
  |  |  |  Branch (44:34): [True: 11.9k, False: 78.8k]
  |  |  ------------------
  ------------------
  796|   106k|                        SIGN(pu2_src[wd - 2 + (ht - 1) * src_strd] - pu2_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|   106k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 94.2k, False: 12.0k]
  |  |  |  Branch (44:34): [True: 17.2k, False: 76.9k]
  |  |  ------------------
  ------------------
  797|       |
  798|   106k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  799|       |
  800|   106k|        if(0 != edge_idx)
  ------------------
  |  Branch (800:12): [True: 21.2k, False: 85.0k]
  ------------------
  801|  21.2k|        {
  802|  21.2k|            u2_pos_wd_ht_tmp_u = CLIP3(pu2_src[wd - 2 + (ht - 1) * src_strd] + pi1_sao_offset_u[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  21.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.88k, False: 18.3k]
  |  |  |  Branch (40:53): [True: 2.44k, False: 15.8k]
  |  |  ------------------
  ------------------
  803|  21.2k|        }
  804|  85.0k|        else
  805|  85.0k|        {
  806|  85.0k|            u2_pos_wd_ht_tmp_u = pu2_src[wd - 2 + (ht - 1) * src_strd];
  807|  85.0k|        }
  808|       |
  809|       |        /* V */
  810|   106k|        edge_idx = 2 + SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|   106k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 78.6k, False: 27.6k]
  |  |  |  Branch (44:34): [True: 19.0k, False: 59.5k]
  |  |  ------------------
  ------------------
  811|   106k|                        SIGN(pu2_src[wd - 1 + (ht - 1) * src_strd] - pu2_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|   106k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 84.4k, False: 21.7k]
  |  |  |  Branch (44:34): [True: 18.4k, False: 65.9k]
  |  |  ------------------
  ------------------
  812|       |
  813|   106k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  814|       |
  815|   106k|        if(0 != edge_idx)
  ------------------
  |  Branch (815:12): [True: 34.0k, False: 72.1k]
  ------------------
  816|  34.0k|        {
  817|  34.0k|            u2_pos_wd_ht_tmp_v = CLIP3(pu2_src[wd - 1 + (ht - 1) * src_strd] + pi1_sao_offset_v[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  34.0k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.18k, False: 31.8k]
  |  |  |  Branch (40:53): [True: 328, False: 31.5k]
  |  |  ------------------
  ------------------
  818|  34.0k|        }
  819|  72.1k|        else
  820|  72.1k|        {
  821|  72.1k|            u2_pos_wd_ht_tmp_v = pu2_src[wd - 1 + (ht - 1) * src_strd];
  822|  72.1k|        }
  823|   106k|    }
  824|  14.7k|    else
  825|  14.7k|    {
  826|  14.7k|        u2_pos_wd_ht_tmp_u = pu2_src[wd - 2 + (ht - 1) * src_strd];
  827|  14.7k|        u2_pos_wd_ht_tmp_v = pu2_src[wd - 1 + (ht - 1) * src_strd];
  828|  14.7k|    }
  829|       |
  830|       |    /* If Left is not available */
  831|   121k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (831:8): [True: 14.6k, False: 106k]
  ------------------
  832|  14.6k|    {
  833|  14.6k|        au1_mask[0] = 0;
  834|  14.6k|    }
  835|       |
  836|       |    /* If Top is not available */
  837|   121k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (837:8): [True: 19.6k, False: 101k]
  ------------------
  838|  19.6k|    {
  839|  19.6k|        pu2_src += src_strd;
  840|  19.6k|        pu2_src_left_cpy += 2;
  841|  19.6k|        ht--;
  842|   445k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (842:22): [True: 425k, False: 19.6k]
  ------------------
  843|   425k|        {
  844|   425k|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col - 2 - src_strd]);
  ------------------
  |  |   44|   425k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 411k, False: 14.3k]
  |  |  |  Branch (44:34): [True: 14.9k, False: 396k]
  |  |  ------------------
  ------------------
  845|   425k|        }
  846|  19.6k|    }
  847|   101k|    else
  848|   101k|    {
  849|  1.94M|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (849:22): [True: 1.84M, False: 101k]
  ------------------
  850|  1.84M|        {
  851|  1.84M|            pu1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col - 2]);
  ------------------
  |  |   44|  1.84M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.61M, False: 227k]
  |  |  |  Branch (44:34): [True: 204k, False: 1.41M]
  |  |  ------------------
  ------------------
  852|  1.84M|        }
  853|   101k|    }
  854|       |
  855|       |    /* If Right is not available */
  856|   121k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (856:8): [True: 14.1k, False: 106k]
  ------------------
  857|  14.1k|    {
  858|  14.1k|        au1_mask[(wd - 1) >> 1] = 0;
  859|  14.1k|    }
  860|       |
  861|       |    /* If Bottom is not available */
  862|   121k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (862:8): [True: 915, False: 120k]
  ------------------
  863|    915|    {
  864|    915|        ht--;
  865|    915|    }
  866|       |
  867|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  868|   121k|    {
  869|  1.90M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (869:22): [True: 1.78M, False: 121k]
  ------------------
  870|  1.78M|        {
  871|  1.78M|            pu1_sign_up[0] = SIGN(pu2_src[0] - pu2_src_left_cpy[2 * (row - 1)]);
  ------------------
  |  |   44|  1.78M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.56M, False: 220k]
  |  |  |  Branch (44:34): [True: 241k, False: 1.32M]
  |  |  ------------------
  ------------------
  872|  1.78M|            pu1_sign_up[1] = SIGN(pu2_src[1] - pu2_src_left_cpy[2 * (row - 1) + 1]);
  ------------------
  |  |   44|  1.78M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.51M, False: 268k]
  |  |  |  Branch (44:34): [True: 316k, False: 1.20M]
  |  |  ------------------
  ------------------
  873|  47.9M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (873:26): [True: 46.1M, False: 1.78M]
  ------------------
  874|  46.1M|            {
  875|  46.1M|                WORD32 edge_idx;
  876|  46.1M|                WORD8 *pi1_sao_offset;
  877|       |
  878|  46.1M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (878:34): [True: 23.0M, False: 23.0M]
  ------------------
  879|       |
  880|  46.1M|                u1_sign_down = SIGN(pu2_src[col] - pu2_src[col + 2 + src_strd]);
  ------------------
  |  |   44|  46.1M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 40.8M, False: 5.33M]
  |  |  |  Branch (44:34): [True: 4.58M, False: 36.2M]
  |  |  ------------------
  ------------------
  881|  46.1M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  882|  46.1M|                pu1_sign_up_tmp[col + 2] = -u1_sign_down;
  883|       |
  884|  46.1M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  885|       |
  886|  46.1M|                if(0 != edge_idx)
  ------------------
  |  Branch (886:20): [True: 7.42M, False: 38.7M]
  ------------------
  887|  7.42M|                {
  888|  7.42M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  7.42M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 538k, False: 6.88M]
  |  |  |  Branch (40:53): [True: 209k, False: 6.67M]
  |  |  ------------------
  ------------------
  889|  7.42M|                }
  890|  46.1M|            }
  891|       |
  892|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  893|  1.78M|            {
  894|  1.78M|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  895|  1.78M|                pu1_sign_up = pu1_sign_up_tmp;
  896|  1.78M|                pu1_sign_up_tmp = pu1_swap_tmp;
  897|  1.78M|            }
  898|       |
  899|  1.78M|            pu2_src += src_strd;
  900|  1.78M|        }
  901|       |
  902|   121k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd] = u2_pos_0_0_tmp_u;
  ------------------
  |  Branch (902:20): [True: 101k, False: 19.6k]
  ------------------
  903|   121k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + 1] = u2_pos_0_0_tmp_v;
  ------------------
  |  Branch (903:20): [True: 101k, False: 19.6k]
  ------------------
  904|   121k|        pu2_src[(pu1_avail[3] ? wd - 2 - src_strd : wd - 2)] = u2_pos_wd_ht_tmp_u;
  ------------------
  |  Branch (904:18): [True: 120k, False: 898]
  ------------------
  905|   121k|        pu2_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u2_pos_wd_ht_tmp_v;
  ------------------
  |  Branch (905:18): [True: 120k, False: 896]
  ------------------
  906|   121k|    }
  907|       |
  908|   121k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (908:8): [True: 19.6k, False: 101k]
  ------------------
  909|  19.6k|        ht++;
  910|   121k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (910:8): [True: 915, False: 120k]
  ------------------
  911|    915|        ht++;
  912|   121k|    pu2_src_top_left[0] = au2_src_top_left_tmp[0];
  913|   121k|    pu2_src_top_left[1] = au2_src_top_left_tmp[1];
  914|  3.76M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (914:18): [True: 3.64M, False: 121k]
  ------------------
  915|  3.64M|    {
  916|  3.64M|        pu2_src_left[row] = au2_src_left_tmp[row];
  917|  3.64M|    }
  918|  2.63M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (918:18): [True: 2.51M, False: 121k]
  ------------------
  919|  2.51M|    {
  920|  2.51M|        pu2_src_top[col] = au2_src_top_tmp[col];
  921|  2.51M|    }
  922|   121k|}
ihevc_hbd_sao_edge_offset_class3:
  936|  51.2k|{
  937|  51.2k|    WORD32 row, col;
  938|  51.2k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  939|  51.2k|    UWORD16 au2_src_top_tmp[MAX_CTB_SIZE];
  940|  51.2k|    UWORD16 au2_src_left_tmp[MAX_CTB_SIZE];
  941|  51.2k|    UWORD16 u2_src_top_left_tmp;
  942|  51.2k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  943|  51.2k|    UWORD16 *pu2_src_left_cpy;
  944|  51.2k|    WORD8 u1_sign_down;
  945|       |
  946|  51.2k|    UWORD16 u2_pos_0_ht_tmp;
  947|  51.2k|    UWORD16 u2_pos_wd_0_tmp;
  948|       |
  949|  51.2k|    pu2_src_left_cpy = pu2_src_left;
  950|       |
  951|       |    /* Initialize the mask values */
  952|  51.2k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  51.2k|#define MAX_CTB_SIZE        64
  ------------------
  953|       |
  954|       |    /* Update left, top and top-left arrays */
  955|  51.2k|    u2_src_top_left_tmp = pu2_src_top[wd - 1];
  956|  1.16M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (956:18): [True: 1.11M, False: 51.2k]
  ------------------
  957|  1.11M|    {
  958|  1.11M|        au2_src_left_tmp[row] = pu2_src[row * src_strd + wd - 1];
  959|  1.11M|    }
  960|  1.19M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (960:18): [True: 1.14M, False: 51.2k]
  ------------------
  961|  1.14M|    {
  962|  1.14M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
  963|  1.14M|    }
  964|       |
  965|       |    /* If top-right is available, process separately */
  966|  51.2k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (966:8): [True: 37.5k, False: 13.7k]
  ------------------
  967|  37.5k|    {
  968|  37.5k|        WORD32 edge_idx;
  969|       |
  970|  37.5k|        edge_idx = 2 + SIGN(pu2_src[wd - 1] - pu2_src_top_right[0]) +
  ------------------
  |  |   44|  37.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 28.1k, False: 9.38k]
  |  |  |  Branch (44:34): [True: 12.6k, False: 15.4k]
  |  |  ------------------
  ------------------
  971|  37.5k|                        SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  37.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.5k, False: 9.99k]
  |  |  |  Branch (44:34): [True: 9.97k, False: 17.5k]
  |  |  ------------------
  ------------------
  972|       |
  973|  37.5k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  974|       |
  975|  37.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (975:12): [True: 8.56k, False: 28.9k]
  ------------------
  976|  8.56k|        {
  977|  8.56k|            u2_pos_wd_0_tmp = CLIP3(pu2_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  8.56k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 73, False: 8.49k]
  |  |  |  Branch (40:53): [True: 20, False: 8.47k]
  |  |  ------------------
  ------------------
  978|  8.56k|        }
  979|  28.9k|        else
  980|  28.9k|        {
  981|  28.9k|            u2_pos_wd_0_tmp = pu2_src[wd - 1];
  982|  28.9k|        }
  983|  37.5k|    }
  984|  13.7k|    else
  985|  13.7k|    {
  986|  13.7k|        u2_pos_wd_0_tmp = pu2_src[wd - 1];
  987|  13.7k|    }
  988|       |
  989|       |    /* If bottom-left is available, process separately */
  990|  51.2k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (990:8): [True: 42.5k, False: 8.73k]
  ------------------
  991|  42.5k|    {
  992|  42.5k|        WORD32 edge_idx;
  993|       |
  994|  42.5k|        edge_idx = 2 + SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  42.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 30.2k, False: 12.2k]
  |  |  |  Branch (44:34): [True: 12.3k, False: 17.9k]
  |  |  ------------------
  ------------------
  995|  42.5k|                        SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src_bot_left[0]);
  ------------------
  |  |   44|  42.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.3k, False: 13.1k]
  |  |  |  Branch (44:34): [True: 13.3k, False: 15.9k]
  |  |  ------------------
  ------------------
  996|       |
  997|  42.5k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
  998|       |
  999|  42.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (999:12): [True: 8.27k, False: 34.2k]
  ------------------
 1000|  8.27k|        {
 1001|  8.27k|            u2_pos_0_ht_tmp = CLIP3(pu2_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  8.27k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 59, False: 8.21k]
  |  |  |  Branch (40:53): [True: 20, False: 8.19k]
  |  |  ------------------
  ------------------
 1002|  8.27k|        }
 1003|  34.2k|        else
 1004|  34.2k|        {
 1005|  34.2k|            u2_pos_0_ht_tmp = pu2_src[(ht - 1) * src_strd];
 1006|  34.2k|        }
 1007|  42.5k|    }
 1008|  8.73k|    else
 1009|  8.73k|    {
 1010|  8.73k|        u2_pos_0_ht_tmp = pu2_src[(ht - 1) * src_strd];
 1011|  8.73k|    }
 1012|       |
 1013|       |    /* If Left is not available */
 1014|  51.2k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1014:8): [True: 8.02k, False: 43.2k]
  ------------------
 1015|  8.02k|    {
 1016|  8.02k|        au1_mask[0] = 0;
 1017|  8.02k|    }
 1018|       |
 1019|       |    /* If Top is not available */
 1020|  51.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1020:8): [True: 9.81k, False: 41.4k]
  ------------------
 1021|  9.81k|    {
 1022|  9.81k|        pu2_src += src_strd;
 1023|  9.81k|        ht--;
 1024|  9.81k|        pu2_src_left_cpy += 1;
 1025|   253k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1025:22): [True: 243k, False: 9.81k]
  ------------------
 1026|   243k|        {
 1027|   243k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col + 1 - src_strd]);
  ------------------
  |  |   44|   243k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 207k, False: 36.6k]
  |  |  |  Branch (44:34): [True: 34.3k, False: 172k]
  |  |  ------------------
  ------------------
 1028|   243k|        }
 1029|  9.81k|    }
 1030|  41.4k|    else
 1031|  41.4k|    {
 1032|   889k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1032:22): [True: 847k, False: 41.4k]
  ------------------
 1033|   847k|        {
 1034|   847k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col + 1]);
  ------------------
  |  |   44|   847k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 608k, False: 239k]
  |  |  |  Branch (44:34): [True: 249k, False: 359k]
  |  |  ------------------
  ------------------
 1035|   847k|        }
 1036|  41.4k|    }
 1037|       |
 1038|       |    /* If Right is not available */
 1039|  51.2k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1039:8): [True: 4.93k, False: 46.3k]
  ------------------
 1040|  4.93k|    {
 1041|  4.93k|        au1_mask[wd - 1] = 0;
 1042|  4.93k|    }
 1043|       |
 1044|       |    /* If Bottom is not available */
 1045|  51.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1045:8): [True: 943, False: 50.3k]
  ------------------
 1046|    943|    {
 1047|    943|        ht--;
 1048|    943|    }
 1049|       |
 1050|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1051|  51.2k|    {
 1052|  1.14M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1052:22): [True: 1.09M, False: 51.2k]
  ------------------
 1053|  1.09M|        {
 1054|  1.09M|            au1_sign_up[wd - 1] = SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 + 1 - src_strd]);
  ------------------
  |  |   44|  1.09M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 820k, False: 277k]
  |  |  |  Branch (44:34): [True: 326k, False: 493k]
  |  |  ------------------
  ------------------
 1055|  30.9M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1055:26): [True: 29.8M, False: 1.09M]
  ------------------
 1056|  29.8M|            {
 1057|  29.8M|                WORD32 edge_idx;
 1058|       |
 1059|  29.8M|                u1_sign_down = SIGN(pu2_src[col] - ((col == 0) ? pu2_src_left_cpy[row + 1] :
  ------------------
  |  |   44|  59.7M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 22.8M, False: 6.99M]
  |  |  |  Branch (44:23): [True: 1.09M, False: 28.7M]
  |  |  |  Branch (44:34): [True: 7.62M, False: 15.2M]
  |  |  |  Branch (44:35): [True: 799k, False: 22.0M]
  |  |  ------------------
  ------------------
 1060|  29.8M|                                                            pu2_src[col - 1 + src_strd]));
 1061|  29.8M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1062|  29.8M|                if(col > 0)
  ------------------
  |  Branch (1062:20): [True: 28.8M, False: 1.08M]
  ------------------
 1063|  28.8M|                    au1_sign_up[col - 1] = -u1_sign_down;
 1064|       |
 1065|  29.8M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col];
 1066|       |
 1067|  29.8M|                if(0 != edge_idx)
  ------------------
  |  Branch (1067:20): [True: 4.96M, False: 24.9M]
  ------------------
 1068|  4.96M|                {
 1069|  4.96M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  4.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.38k, False: 4.95M]
  |  |  |  Branch (40:53): [True: 1.59k, False: 4.95M]
  |  |  ------------------
  ------------------
 1070|  4.96M|                }
 1071|  29.8M|            }
 1072|       |
 1073|  1.09M|            pu2_src += src_strd;
 1074|  1.09M|        }
 1075|       |
 1076|  51.2k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u2_pos_wd_0_tmp;
  ------------------
  |  Branch (1076:20): [True: 41.4k, False: 9.77k]
  ------------------
 1077|  51.2k|        pu2_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u2_pos_0_ht_tmp;
  ------------------
  |  Branch (1077:18): [True: 50.3k, False: 904]
  ------------------
 1078|  51.2k|    }
 1079|       |
 1080|  51.2k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1080:8): [True: 9.81k, False: 41.4k]
  ------------------
 1081|  9.81k|        ht++;
 1082|  51.2k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1082:8): [True: 943, False: 50.3k]
  ------------------
 1083|    943|        ht++;
 1084|  51.2k|    *pu2_src_top_left = u2_src_top_left_tmp;
 1085|  1.16M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1085:18): [True: 1.11M, False: 51.2k]
  ------------------
 1086|  1.11M|    {
 1087|  1.11M|        pu2_src_left[row] = au2_src_left_tmp[row];
 1088|  1.11M|    }
 1089|  1.19M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1089:18): [True: 1.14M, False: 51.2k]
  ------------------
 1090|  1.14M|    {
 1091|  1.14M|        pu2_src_top[col] = au2_src_top_tmp[col];
 1092|  1.14M|    }
 1093|  51.2k|}
ihevc_hbd_sao_edge_offset_class3_chroma:
 1109|   181k|{
 1110|   181k|    WORD32 row, col;
 1111|   181k|    UWORD8 au1_mask[MAX_CTB_SIZE];
 1112|   181k|    UWORD16 au2_src_left_tmp[2 * MAX_CTB_SIZE], au2_src_top_tmp[2 * MAX_CTB_SIZE];
 1113|   181k|    UWORD16 au2_src_top_left_tmp[2];
 1114|   181k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
 1115|   181k|    UWORD16 *pu2_src_left_cpy;
 1116|   181k|    WORD8 u1_sign_down;
 1117|       |
 1118|   181k|    UWORD16 u2_pos_wd_0_tmp_u;
 1119|   181k|    UWORD16 u2_pos_wd_0_tmp_v;
 1120|   181k|    UWORD16 u2_pos_0_ht_tmp_u;
 1121|   181k|    UWORD16 u2_pos_0_ht_tmp_v;
 1122|       |
 1123|   181k|    pu2_src_left_cpy = pu2_src_left;
 1124|       |
 1125|       |    /* Initialize the mask values */
 1126|   181k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|   181k|#define MAX_CTB_SIZE        64
  ------------------
 1127|       |
 1128|       |    /* Update left, top and top-left arrays */
 1129|   181k|    au2_src_top_left_tmp[0] = pu2_src_top[wd - 2];
 1130|   181k|    au2_src_top_left_tmp[1] = pu2_src_top[wd - 1];
 1131|  2.74M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1131:18): [True: 2.56M, False: 181k]
  ------------------
 1132|  2.56M|    {
 1133|  2.56M|        au2_src_left_tmp[2 * row] = pu2_src[row * src_strd + wd - 2];
 1134|  2.56M|        au2_src_left_tmp[2 * row + 1] = pu2_src[row * src_strd + wd - 1];
 1135|  2.56M|    }
 1136|  3.85M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1136:18): [True: 3.67M, False: 181k]
  ------------------
 1137|  3.67M|    {
 1138|  3.67M|        au2_src_top_tmp[col] = pu2_src[(ht - 1) * src_strd + col];
 1139|  3.67M|    }
 1140|       |
 1141|       |    /* If top-right is available, process separately */
 1142|   181k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1142:8): [True: 142k, False: 38.3k]
  ------------------
 1143|   142k|    {
 1144|   142k|        WORD32 edge_idx;
 1145|       |
 1146|       |        /* U */
 1147|   142k|        edge_idx = 2 + SIGN(pu2_src[wd - 2] - pu2_src_top_right[0]) +
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 124k, False: 17.9k]
  |  |  |  Branch (44:34): [True: 12.5k, False: 112k]
  |  |  ------------------
  ------------------
 1148|   142k|                        SIGN(pu2_src[wd - 2] - pu2_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 131k, False: 11.8k]
  |  |  |  Branch (44:34): [True: 13.8k, False: 117k]
  |  |  ------------------
  ------------------
 1149|       |
 1150|   142k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1151|       |
 1152|   142k|        if(0 != edge_idx)
  ------------------
  |  Branch (1152:12): [True: 21.4k, False: 121k]
  ------------------
 1153|  21.4k|        {
 1154|  21.4k|            u2_pos_wd_0_tmp_u = CLIP3(pu2_src[wd - 2] + pi1_sao_offset_u[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  21.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 600, False: 20.8k]
  |  |  |  Branch (40:53): [True: 147, False: 20.7k]
  |  |  ------------------
  ------------------
 1155|  21.4k|        }
 1156|   121k|        else
 1157|   121k|        {
 1158|   121k|            u2_pos_wd_0_tmp_u = pu2_src[wd - 2];
 1159|   121k|        }
 1160|       |
 1161|       |        /* V */
 1162|   142k|        edge_idx = 2 + SIGN(pu2_src[wd - 1] - pu2_src_top_right[1]) +
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 99.8k, False: 43.0k]
  |  |  |  Branch (44:34): [True: 9.19k, False: 90.6k]
  |  |  ------------------
  ------------------
 1163|   142k|                        SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 79.3k, False: 63.5k]
  |  |  |  Branch (44:34): [True: 33.8k, False: 45.4k]
  |  |  ------------------
  ------------------
 1164|       |
 1165|   142k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1166|       |
 1167|   142k|        if(0 != edge_idx)
  ------------------
  |  Branch (1167:12): [True: 71.8k, False: 70.9k]
  ------------------
 1168|  71.8k|        {
 1169|  71.8k|            u2_pos_wd_0_tmp_v = CLIP3(pu2_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  71.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 48.3k, False: 23.4k]
  |  |  |  Branch (40:53): [True: 71, False: 23.4k]
  |  |  ------------------
  ------------------
 1170|  71.8k|        }
 1171|  70.9k|        else
 1172|  70.9k|        {
 1173|  70.9k|            u2_pos_wd_0_tmp_v = pu2_src[wd - 1];
 1174|  70.9k|        }
 1175|   142k|    }
 1176|  38.3k|    else
 1177|  38.3k|    {
 1178|  38.3k|        u2_pos_wd_0_tmp_u = pu2_src[wd - 2];
 1179|  38.3k|        u2_pos_wd_0_tmp_v = pu2_src[wd - 1];
 1180|  38.3k|    }
 1181|       |
 1182|       |    /* If bottom-left is available, process separately */
 1183|   181k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1183:8): [True: 142k, False: 38.9k]
  ------------------
 1184|   142k|    {
 1185|   142k|        WORD32 edge_idx;
 1186|       |
 1187|       |        /* U */
 1188|   142k|        edge_idx = 2 + SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 117k, False: 24.7k]
  |  |  |  Branch (44:34): [True: 13.4k, False: 104k]
  |  |  ------------------
  ------------------
 1189|   142k|                        SIGN(pu2_src[(ht - 1) * src_strd] - pu2_src_bot_left[0]);
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 127k, False: 14.4k]
  |  |  |  Branch (44:34): [True: 20.5k, False: 107k]
  |  |  ------------------
  ------------------
 1190|       |
 1191|   142k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1192|       |
 1193|   142k|        if(0 != edge_idx)
  ------------------
  |  Branch (1193:12): [True: 26.7k, False: 115k]
  ------------------
 1194|  26.7k|        {
 1195|  26.7k|            u2_pos_0_ht_tmp_u = CLIP3(pu2_src[(ht - 1) * src_strd] + pi1_sao_offset_u[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  26.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 546, False: 26.2k]
  |  |  |  Branch (40:53): [True: 85, False: 26.1k]
  |  |  ------------------
  ------------------
 1196|  26.7k|        }
 1197|   115k|        else
 1198|   115k|        {
 1199|   115k|            u2_pos_0_ht_tmp_u = pu2_src[(ht - 1) * src_strd];
 1200|   115k|        }
 1201|       |
 1202|       |        /* V */
 1203|   142k|        edge_idx = 2 + SIGN(pu2_src[(ht - 1) * src_strd + 1] - pu2_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 59.0k, False: 83.2k]
  |  |  |  Branch (44:34): [True: 14.8k, False: 44.2k]
  |  |  ------------------
  ------------------
 1204|   142k|                        SIGN(pu2_src[(ht - 1) * src_strd + 1] - pu2_src_bot_left[1]);
  ------------------
  |  |   44|   142k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 130k, False: 11.9k]
  |  |  |  Branch (44:34): [True: 45.5k, False: 84.8k]
  |  |  ------------------
  ------------------
 1205|       |
 1206|   142k|        edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx];
 1207|       |
 1208|   142k|        if(0 != edge_idx)
  ------------------
  |  Branch (1208:12): [True: 67.4k, False: 74.8k]
  ------------------
 1209|  67.4k|        {
 1210|  67.4k|            u2_pos_0_ht_tmp_v = CLIP3(pu2_src[(ht - 1) * src_strd + 1] + pi1_sao_offset_v[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  67.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 47.2k, False: 20.2k]
  |  |  |  Branch (40:53): [True: 44, False: 20.1k]
  |  |  ------------------
  ------------------
 1211|  67.4k|        }
 1212|  74.8k|        else
 1213|  74.8k|        {
 1214|  74.8k|            u2_pos_0_ht_tmp_v = pu2_src[(ht - 1) * src_strd + 1];
 1215|  74.8k|        }
 1216|   142k|    }
 1217|  38.9k|    else
 1218|  38.9k|    {
 1219|  38.9k|        u2_pos_0_ht_tmp_u = pu2_src[(ht - 1) * src_strd];
 1220|  38.9k|        u2_pos_0_ht_tmp_v = pu2_src[(ht - 1) * src_strd + 1];
 1221|  38.9k|    }
 1222|       |
 1223|       |    /* If Left is not available */
 1224|   181k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1224:8): [True: 32.7k, False: 148k]
  ------------------
 1225|  32.7k|    {
 1226|  32.7k|        au1_mask[0] = 0;
 1227|  32.7k|    }
 1228|       |
 1229|       |    /* If Top is not available */
 1230|   181k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1230:8): [True: 17.9k, False: 163k]
  ------------------
 1231|  17.9k|    {
 1232|  17.9k|        pu2_src += src_strd;
 1233|  17.9k|        ht--;
 1234|  17.9k|        pu2_src_left_cpy += 2;
 1235|   551k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1235:22): [True: 533k, False: 17.9k]
  ------------------
 1236|   533k|        {
 1237|   533k|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src[col + 2 - src_strd]);
  ------------------
  |  |   44|   533k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 464k, False: 69.3k]
  |  |  |  Branch (44:34): [True: 91.7k, False: 372k]
  |  |  ------------------
  ------------------
 1238|   533k|        }
 1239|  17.9k|    }
 1240|   163k|    else
 1241|   163k|    {
 1242|  2.94M|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1242:22): [True: 2.78M, False: 163k]
  ------------------
 1243|  2.78M|        {
 1244|  2.78M|            au1_sign_up[col] = SIGN(pu2_src[col] - pu2_src_top[col + 2]);
  ------------------
  |  |   44|  2.78M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.40M, False: 380k]
  |  |  |  Branch (44:34): [True: 329k, False: 2.07M]
  |  |  ------------------
  ------------------
 1245|  2.78M|        }
 1246|   163k|    }
 1247|       |
 1248|       |    /* If Right is not available */
 1249|   181k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1249:8): [True: 22.0k, False: 159k]
  ------------------
 1250|  22.0k|    {
 1251|  22.0k|        au1_mask[(wd - 1) >> 1] = 0;
 1252|  22.0k|    }
 1253|       |
 1254|       |    /* If Bottom is not available */
 1255|   181k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1255:8): [True: 7.97k, False: 173k]
  ------------------
 1256|  7.97k|    {
 1257|  7.97k|        ht--;
 1258|  7.97k|    }
 1259|       |
 1260|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1261|   181k|    {
 1262|  2.67M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1262:22): [True: 2.49M, False: 181k]
  ------------------
 1263|  2.49M|        {
 1264|  2.49M|            au1_sign_up[wd - 2] = SIGN(pu2_src[wd - 2] - pu2_src[wd - 2 + 2 - src_strd]);
  ------------------
  |  |   44|  2.49M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.04M, False: 451k]
  |  |  |  Branch (44:34): [True: 479k, False: 1.56M]
  |  |  ------------------
  ------------------
 1265|  2.49M|            au1_sign_up[wd - 1] = SIGN(pu2_src[wd - 1] - pu2_src[wd - 1 + 2 - src_strd]);
  ------------------
  |  |   44|  2.49M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.76M, False: 725k]
  |  |  |  Branch (44:34): [True: 450k, False: 1.31M]
  |  |  ------------------
  ------------------
 1266|  65.3M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1266:26): [True: 62.8M, False: 2.49M]
  ------------------
 1267|  62.8M|            {
 1268|  62.8M|                WORD32 edge_idx;
 1269|  62.8M|                WORD8 *pi1_sao_offset;
 1270|       |
 1271|  62.8M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (1271:34): [True: 31.4M, False: 31.4M]
  ------------------
 1272|       |
 1273|  62.8M|                u1_sign_down = SIGN(pu2_src[col] - ((col < 2) ? pu2_src_left_cpy[2 * (row + 1) + col] :
  ------------------
  |  |   44|   125M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 51.9M, False: 10.9M]
  |  |  |  Branch (44:23): [True: 4.98M, False: 57.8M]
  |  |  |  Branch (44:34): [True: 11.8M, False: 40.1M]
  |  |  |  Branch (44:35): [True: 3.96M, False: 47.9M]
  |  |  ------------------
  ------------------
 1274|  62.8M|                                                                    pu2_src[col - 2 + src_strd]));
 1275|  62.8M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1276|  62.8M|                if(col > 1)
  ------------------
  |  Branch (1276:20): [True: 57.9M, False: 4.96M]
  ------------------
 1277|  57.9M|                    au1_sign_up[col - 2] = -u1_sign_down;
 1278|       |
 1279|  62.8M|                edge_idx = gi4_ihevc_hbd_table_edge_idx[edge_idx] & au1_mask[col >> 1];
 1280|       |
 1281|  62.8M|                if(0 != edge_idx)
  ------------------
  |  Branch (1281:20): [True: 14.4M, False: 48.4M]
  ------------------
 1282|  14.4M|                {
 1283|  14.4M|                    pu2_src[col] = CLIP3(pu2_src[col] + pi1_sao_offset[edge_idx], 0, (1 << u4_bit_depth) - 1);
  ------------------
  |  |   40|  14.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.58M, False: 11.8M]
  |  |  |  Branch (40:53): [True: 9.04k, False: 11.8M]
  |  |  ------------------
  ------------------
 1284|  14.4M|                }
 1285|  62.8M|            }
 1286|       |
 1287|  2.49M|            pu2_src += src_strd;
 1288|  2.49M|        }
 1289|       |
 1290|   181k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 2] = u2_pos_wd_0_tmp_u;
  ------------------
  |  Branch (1290:20): [True: 162k, False: 18.6k]
  ------------------
 1291|   181k|        pu2_src[- (pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u2_pos_wd_0_tmp_v;
  ------------------
  |  Branch (1291:20): [True: 162k, False: 18.6k]
  ------------------
 1292|   181k|        pu2_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u2_pos_0_ht_tmp_u;
  ------------------
  |  Branch (1292:18): [True: 172k, False: 8.55k]
  ------------------
 1293|   181k|        pu2_src[(pu1_avail[3] ?  (-src_strd) : 0) + 1] = u2_pos_0_ht_tmp_v;
  ------------------
  |  Branch (1293:18): [True: 172k, False: 8.52k]
  ------------------
 1294|   181k|    }
 1295|       |
 1296|   181k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1296:8): [True: 17.9k, False: 163k]
  ------------------
 1297|  17.9k|        ht++;
 1298|   181k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1298:8): [True: 7.97k, False: 173k]
  ------------------
 1299|  7.97k|        ht++;
 1300|   181k|    pu2_src_top_left[0] = au2_src_top_left_tmp[0];
 1301|   181k|    pu2_src_top_left[1] = au2_src_top_left_tmp[1];
 1302|  5.30M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1302:18): [True: 5.11M, False: 181k]
  ------------------
 1303|  5.11M|    {
 1304|  5.11M|        pu2_src_left[row] = au2_src_left_tmp[row];
 1305|  5.11M|    }
 1306|  3.84M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1306:18): [True: 3.66M, False: 181k]
  ------------------
 1307|  3.66M|    {
 1308|  3.66M|        pu2_src_top[col] = au2_src_top_tmp[col];
 1309|  3.66M|    }
 1310|   181k|}

ihevc_hbd_weighted_pred_uni:
  112|  53.0k|{
  113|  53.0k|    WORD32 row, col;
  114|  53.0k|    WORD32 tmp;
  115|       |
  116|   493k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (116:18): [True: 440k, False: 53.0k]
  ------------------
  117|   440k|    {
  118|  4.97M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (118:22): [True: 4.52M, False: 440k]
  ------------------
  119|  4.52M|        {
  120|  4.52M|            tmp = (pi2_src[col] + lvl_shift) * wgt0;
  121|  4.52M|            tmp += 1 << (shift - 1);
  122|  4.52M|            tmp = (tmp >> shift) + off0;
  123|       |
  124|  4.52M|            pu2_dst[col] = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  4.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 588k, False: 3.94M]
  |  |  |  Branch (40:53): [True: 117k, False: 3.82M]
  |  |  ------------------
  ------------------
  125|  4.52M|        }
  126|       |
  127|   440k|        pi2_src += src_strd;
  128|   440k|        pu2_dst += dst_strd;
  129|   440k|    }
  130|  53.0k|}
ihevc_hbd_weighted_pred_chroma_uni:
  198|  53.0k|{
  199|  53.0k|    WORD32 row, col;
  200|  53.0k|    WORD32 tmp;
  201|       |
  202|   380k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (202:18): [True: 327k, False: 53.0k]
  ------------------
  203|   327k|    {
  204|  2.10M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (204:22): [True: 1.77M, False: 327k]
  ------------------
  205|  1.77M|        {
  206|  1.77M|            tmp = (pi2_src[col] + lvl_shift) * wgt0_cb;
  207|  1.77M|            tmp += 1 << (shift - 1);
  208|  1.77M|            tmp = (tmp >> shift) + off0_cb;
  209|       |
  210|  1.77M|            pu2_dst[col] = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 64.5k, False: 1.70M]
  |  |  |  Branch (40:53): [True: 36.1k, False: 1.67M]
  |  |  ------------------
  ------------------
  211|       |
  212|  1.77M|            tmp = (pi2_src[col + 1] + lvl_shift) * wgt0_cr;
  213|  1.77M|            tmp += 1 << (shift - 1);
  214|  1.77M|            tmp = (tmp >> shift) + off0_cr;
  215|       |
  216|  1.77M|            pu2_dst[col+1] = CLIP3(tmp,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  1.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 153k, False: 1.61M]
  |  |  |  Branch (40:53): [True: 51.1k, False: 1.56M]
  |  |  ------------------
  ------------------
  217|  1.77M|        }
  218|       |
  219|   327k|        pi2_src += src_strd;
  220|   327k|        pu2_dst += dst_strd;
  221|   327k|    }
  222|  53.0k|}
ihevc_hbd_weighted_pred_bi:
  305|   155k|{
  306|   155k|    WORD32 row, col;
  307|   155k|    WORD32 tmp;
  308|       |
  309|  1.45M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (309:18): [True: 1.29M, False: 155k]
  ------------------
  310|  1.29M|    {
  311|  14.4M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (311:22): [True: 13.1M, False: 1.29M]
  ------------------
  312|  13.1M|        {
  313|  13.1M|            tmp = (pi2_src1[col] + lvl_shift1) * wgt0;
  314|  13.1M|            tmp += (pi2_src2[col] + lvl_shift2) * wgt1;
  315|  13.1M|            tmp += (off0 + off1 + 1) << (shift - 1);
  316|       |
  317|  13.1M|            pu2_dst[col] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  13.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.33M, False: 11.8M]
  |  |  |  Branch (40:53): [True: 1.59M, False: 10.2M]
  |  |  ------------------
  ------------------
  318|  13.1M|        }
  319|       |
  320|  1.29M|        pi2_src1 += src_strd1;
  321|  1.29M|        pi2_src2 += src_strd2;
  322|  1.29M|        pu2_dst += dst_strd;
  323|  1.29M|    }
  324|   155k|}
ihevc_hbd_weighted_pred_chroma_bi:
  411|   149k|{
  412|   149k|    WORD32 row, col;
  413|   149k|    WORD32 tmp;
  414|       |
  415|  1.08M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (415:18): [True: 939k, False: 149k]
  ------------------
  416|   939k|    {
  417|  5.91M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (417:22): [True: 4.97M, False: 939k]
  ------------------
  418|  4.97M|        {
  419|  4.97M|            tmp = (pi2_src1[col] + lvl_shift1) * wgt0_cb;
  420|  4.97M|            tmp += (pi2_src2[col] + lvl_shift2) * wgt1_cb;
  421|  4.97M|            tmp += (off0_cb + off1_cb + 1) << (shift - 1);
  422|       |
  423|  4.97M|            pu2_dst[col] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  4.97M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 138k, False: 4.83M]
  |  |  |  Branch (40:53): [True: 88.2k, False: 4.74M]
  |  |  ------------------
  ------------------
  424|       |
  425|  4.97M|            tmp = (pi2_src1[col + 1] + lvl_shift1) * wgt0_cr;
  426|  4.97M|            tmp += (pi2_src2[col + 1] + lvl_shift2) * wgt1_cr;
  427|  4.97M|            tmp += (off0_cr + off1_cr + 1) << (shift - 1);
  428|       |
  429|  4.97M|            pu2_dst[col+1] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  4.97M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 546k, False: 4.42M]
  |  |  |  Branch (40:53): [True: 162k, False: 4.26M]
  |  |  ------------------
  ------------------
  430|  4.97M|        }
  431|       |
  432|   939k|        pi2_src1 += src_strd1;
  433|   939k|        pi2_src2 += src_strd2;
  434|   939k|        pu2_dst += dst_strd;
  435|   939k|    }
  436|   149k|}
ihevc_hbd_weighted_pred_bi_default:
  499|   206k|{
  500|   206k|    WORD32 row, col;
  501|   206k|    WORD32 tmp;
  502|   206k|    WORD32 shift;
  503|       |
  504|   206k|    shift = 14 - bit_depth + 1;
  505|  1.60M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (505:18): [True: 1.39M, False: 206k]
  ------------------
  506|  1.39M|    {
  507|  15.0M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (507:22): [True: 13.6M, False: 1.39M]
  ------------------
  508|  13.6M|        {
  509|  13.6M|            tmp = pi2_src1[col] + lvl_shift1;
  510|  13.6M|            tmp += pi2_src2[col] + lvl_shift2;
  511|  13.6M|            tmp += 1 << (shift - 1);
  512|       |
  513|  13.6M|            pu2_dst[col] = CLIP3(tmp >> shift,0,((1<<bit_depth)-1));
  ------------------
  |  |   40|  13.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.26k, False: 13.6M]
  |  |  |  Branch (40:53): [True: 24.0k, False: 13.5M]
  |  |  ------------------
  ------------------
  514|  13.6M|        }
  515|       |
  516|  1.39M|        pi2_src1 += src_strd1;
  517|  1.39M|        pi2_src2 += src_strd2;
  518|  1.39M|        pu2_dst += dst_strd;
  519|  1.39M|    }
  520|   206k|}

ihevc_inter_pred_luma_copy:
  133|   607k|{
  134|   607k|    WORD32 row, col;
  135|   607k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   607k|#define UNUSED(x) ((void)(x))
  ------------------
  136|  5.31M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (136:18): [True: 4.71M, False: 607k]
  ------------------
  137|  4.71M|    {
  138|  46.1M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (138:22): [True: 41.4M, False: 4.71M]
  ------------------
  139|  41.4M|        {
  140|  41.4M|            pu1_dst[col] = pu1_src[col];
  141|  41.4M|        }
  142|       |
  143|  4.71M|        pu1_src += src_strd;
  144|  4.71M|        pu1_dst += dst_strd;
  145|  4.71M|    }
  146|   607k|}
ihevc_inter_pred_luma_horz:
  195|   350k|{
  196|   350k|    WORD32 row, col, i;
  197|   350k|    WORD16 i2_tmp;
  198|       |
  199|  3.03M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (199:18): [True: 2.68M, False: 350k]
  ------------------
  200|  2.68M|    {
  201|  23.8M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (201:22): [True: 21.1M, False: 2.68M]
  ------------------
  202|  21.1M|        {
  203|  21.1M|            i2_tmp = 0;
  204|   186M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   186M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (204:24): [True: 165M, False: 21.1M]
  ------------------
  205|   165M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3)];
  206|       |
  207|  21.1M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  21.1M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  21.1M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  21.1M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  21.1M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  21.1M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  208|  21.1M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  21.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  21.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 138k, False: 20.9M]
  |  |  |  |  |  Branch (40:53): [True: 169k, False: 20.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|       |
  210|  21.1M|            pu1_dst[col] = (UWORD8)i2_tmp;
  211|  21.1M|        }
  212|       |
  213|  2.68M|        pu1_src += src_strd;
  214|  2.68M|        pu1_dst += dst_strd;
  215|  2.68M|    }
  216|       |
  217|   350k|}
ihevc_inter_pred_luma_vert:
  268|   450k|{
  269|   450k|    WORD32 row, col, i;
  270|   450k|    WORD16 i2_tmp;
  271|       |
  272|  3.75M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (272:18): [True: 3.30M, False: 450k]
  ------------------
  273|  3.30M|    {
  274|  30.5M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (274:22): [True: 27.2M, False: 3.30M]
  ------------------
  275|  27.2M|        {
  276|  27.2M|            i2_tmp = 0;
  277|   243M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   243M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (277:24): [True: 216M, False: 27.2M]
  ------------------
  278|   216M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3) * src_strd];
  279|       |
  280|  27.2M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  27.2M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  27.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  27.2M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  27.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  27.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  281|  27.2M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  27.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  27.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 175k, False: 27.0M]
  |  |  |  |  |  Branch (40:53): [True: 204k, False: 26.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|       |
  283|  27.2M|            pu1_dst[col] = (UWORD8)i2_tmp;
  284|  27.2M|        }
  285|       |
  286|  3.30M|        pu1_src += src_strd;
  287|  3.30M|        pu1_dst += dst_strd;
  288|  3.30M|    }
  289|       |
  290|   450k|}
ihevc_inter_pred_luma_copy_w16out:
  341|  38.8M|{
  342|  38.8M|    WORD32 row, col;
  343|  38.8M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  38.8M|#define UNUSED(x) ((void)(x))
  ------------------
  344|   336M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (344:18): [True: 297M, False: 38.8M]
  ------------------
  345|   297M|    {
  346|  2.78G|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (346:22): [True: 2.48G, False: 297M]
  ------------------
  347|  2.48G|        {
  348|  2.48G|            pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.48G|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.48G|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  349|  2.48G|        }
  350|       |
  351|   297M|        pu1_src += src_strd;
  352|   297M|        pi2_dst += dst_strd;
  353|   297M|    }
  354|       |
  355|  38.8M|}
ihevc_inter_pred_luma_horz_w16out:
  407|  4.84M|{
  408|  4.84M|    WORD32 row, col, i;
  409|  4.84M|    WORD16 i2_tmp;
  410|       |
  411|  53.1M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (411:18): [True: 48.2M, False: 4.84M]
  ------------------
  412|  48.2M|    {
  413|   426M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (413:22): [True: 378M, False: 48.2M]
  ------------------
  414|   378M|        {
  415|   378M|            i2_tmp = 0;
  416|  3.35G|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  3.35G|#define NTAPS_LUMA 8
  ------------------
  |  Branch (416:24): [True: 2.97G, False: 378M]
  ------------------
  417|  2.97G|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3)];
  418|       |
  419|   378M|            pi2_dst[col] = i2_tmp;
  420|   378M|        }
  421|       |
  422|  48.2M|        pu1_src += src_strd;
  423|  48.2M|        pi2_dst += dst_strd;
  424|  48.2M|    }
  425|       |
  426|  4.84M|}
ihevc_inter_pred_luma_vert_w16out:
  478|  1.41M|{
  479|  1.41M|    WORD32 row, col, i;
  480|  1.41M|    WORD16 i2_tmp;
  481|       |
  482|  11.6M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (482:18): [True: 10.2M, False: 1.41M]
  ------------------
  483|  10.2M|    {
  484|  92.8M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (484:22): [True: 82.6M, False: 10.2M]
  ------------------
  485|  82.6M|        {
  486|  82.6M|            i2_tmp = 0;
  487|   735M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   735M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (487:24): [True: 653M, False: 82.6M]
  ------------------
  488|   653M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3) * src_strd];
  489|       |
  490|  82.6M|            pi2_dst[col] = i2_tmp;
  491|  82.6M|        }
  492|       |
  493|  10.2M|        pu1_src += src_strd;
  494|  10.2M|        pi2_dst += dst_strd;
  495|  10.2M|    }
  496|       |
  497|  1.41M|}
ihevc_inter_pred_luma_vert_w16inp:
  548|   480k|{
  549|   480k|    WORD32 row, col, i;
  550|   480k|    WORD32 i4_tmp;
  551|       |
  552|  4.21M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (552:18): [True: 3.73M, False: 480k]
  ------------------
  553|  3.73M|    {
  554|  35.1M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (554:22): [True: 31.4M, False: 3.73M]
  ------------------
  555|  31.4M|        {
  556|  31.4M|            i4_tmp = 0;
  557|   280M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   280M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (557:24): [True: 249M, False: 31.4M]
  ------------------
  558|   249M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  559|       |
  560|  31.4M|            i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  31.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  31.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  31.4M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  31.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  31.4M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  31.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  31.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  561|  31.4M|            i4_tmp = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  31.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  31.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 398k, False: 31.0M]
  |  |  |  |  |  Branch (40:53): [True: 765k, False: 30.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|       |
  563|  31.4M|            pu1_dst[col] = i4_tmp;
  564|  31.4M|        }
  565|       |
  566|  3.73M|        pi2_src += src_strd;
  567|  3.73M|        pu1_dst += dst_strd;
  568|  3.73M|    }
  569|       |
  570|   480k|}
ihevc_inter_pred_luma_vert_w16inp_w16out:
  623|  1.73M|{
  624|  1.73M|    WORD32 row, col, i;
  625|  1.73M|    WORD32 i4_tmp;
  626|       |
  627|  14.3M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (627:18): [True: 12.6M, False: 1.73M]
  ------------------
  628|  12.6M|    {
  629|   128M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (629:22): [True: 115M, False: 12.6M]
  ------------------
  630|   115M|        {
  631|   115M|            i4_tmp = 0;
  632|  1.03G|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  1.03G|#define NTAPS_LUMA 8
  ------------------
  |  Branch (632:24): [True: 918M, False: 115M]
  ------------------
  633|   918M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  634|       |
  635|   115M|            i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) - OFFSET14;
  ------------------
  |  |   41|   115M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   115M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) - OFFSET14;
  ------------------
  |  |   43|   115M|#define OFFSET14 (1 << (14 - 1))
  ------------------
  636|       |
  637|   115M|            pi2_dst[col] = i4_tmp;
  638|   115M|        }
  639|       |
  640|  12.6M|        pi2_src += src_strd;
  641|  12.6M|        pi2_dst += dst_strd;
  642|  12.6M|    }
  643|       |
  644|  1.73M|}
ihevc_inter_pred_chroma_copy:
  695|   336k|{
  696|   336k|    WORD32 row, col;
  697|   336k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   336k|#define UNUSED(x) ((void)(x))
  ------------------
  698|  1.69M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (698:18): [True: 1.36M, False: 336k]
  ------------------
  699|  1.36M|    {
  700|  15.0M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (700:22): [True: 13.7M, False: 1.36M]
  ------------------
  701|  13.7M|        {
  702|  13.7M|            pu1_dst[col] = pu1_src[col];
  703|  13.7M|        }
  704|       |
  705|  1.36M|        pu1_src += src_strd;
  706|  1.36M|        pu1_dst += dst_strd;
  707|  1.36M|    }
  708|   336k|}
ihevc_inter_pred_chroma_horz:
  760|   169k|{
  761|   169k|    WORD32 row, col, i;
  762|   169k|    WORD16 i2_tmp_u, i2_tmp_v;
  763|       |
  764|   838k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (764:18): [True: 669k, False: 169k]
  ------------------
  765|   669k|    {
  766|  3.56M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (766:22): [True: 2.89M, False: 669k]
  ------------------
  767|  2.89M|        {
  768|  2.89M|            i2_tmp_u = 0;
  769|  2.89M|            i2_tmp_v = 0;
  770|  14.4M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  14.4M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (770:24): [True: 11.5M, False: 2.89M]
  ------------------
  771|  11.5M|            {
  772|  11.5M|                i2_tmp_u += pi1_coeff[i] * pu1_src[col + (i - 1) * 2];
  773|  11.5M|                i2_tmp_v += pi1_coeff[i] * pu1_src[col + 1 + (i - 1) * 2];
  774|  11.5M|            }
  775|       |
  776|  2.89M|            i2_tmp_u = (i2_tmp_u + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  2.89M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  2.89M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  2.89M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp_u = (i2_tmp_u + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  2.89M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.89M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  777|  2.89M|            i2_tmp_u = CLIP_U8(i2_tmp_u);
  ------------------
  |  |   40|  2.89M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.62k, False: 2.89M]
  |  |  |  |  |  Branch (40:53): [True: 7.57k, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|  2.89M|            i2_tmp_v = (i2_tmp_v + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  2.89M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  2.89M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  2.89M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp_v = (i2_tmp_v + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  2.89M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.89M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  779|  2.89M|            i2_tmp_v = CLIP_U8(i2_tmp_v);
  ------------------
  |  |   40|  2.89M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.26k, False: 2.89M]
  |  |  |  |  |  Branch (40:53): [True: 7.70k, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  780|       |
  781|       |
  782|  2.89M|            pu1_dst[col] = (UWORD8)i2_tmp_u;
  783|  2.89M|            pu1_dst[col + 1] = (UWORD8)i2_tmp_v;
  784|  2.89M|        }
  785|       |
  786|   669k|        pu1_src += src_strd;
  787|   669k|        pu1_dst += dst_strd;
  788|   669k|    }
  789|   169k|}
ihevc_inter_pred_chroma_vert:
  842|   586k|{
  843|   586k|    WORD32 row, col, i;
  844|   586k|    WORD16 i2_tmp;
  845|       |
  846|  2.86M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (846:18): [True: 2.28M, False: 586k]
  ------------------
  847|  2.28M|    {
  848|  20.4M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (848:22): [True: 18.1M, False: 2.28M]
  ------------------
  849|  18.1M|        {
  850|  18.1M|            i2_tmp = 0;
  851|  90.5M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  90.5M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (851:24): [True: 72.4M, False: 18.1M]
  ------------------
  852|  72.4M|            {
  853|  72.4M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 1) * src_strd];
  854|  72.4M|            }
  855|       |
  856|  18.1M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  18.1M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  18.1M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  18.1M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  18.1M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  18.1M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  857|  18.1M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  18.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  18.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.1k, False: 18.1M]
  |  |  |  |  |  Branch (40:53): [True: 29.2k, False: 18.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  858|       |
  859|  18.1M|            pu1_dst[col] = (UWORD8)i2_tmp;
  860|  18.1M|        }
  861|       |
  862|  2.28M|        pu1_src += src_strd;
  863|  2.28M|        pu1_dst += dst_strd;
  864|  2.28M|    }
  865|   586k|}
ihevc_inter_pred_chroma_copy_w16out:
  917|  36.2M|{
  918|  36.2M|    WORD32 row, col;
  919|  36.2M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  36.2M|#define UNUSED(x) ((void)(x))
  ------------------
  920|   180M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (920:18): [True: 144M, False: 36.2M]
  ------------------
  921|   144M|    {
  922|  1.35G|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (922:22): [True: 1.20G, False: 144M]
  ------------------
  923|  1.20G|        {
  924|  1.20G|            pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.20G|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.20G|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  925|  1.20G|        }
  926|       |
  927|   144M|        pu1_src += src_strd;
  928|   144M|        pi2_dst += dst_strd;
  929|   144M|    }
  930|  36.2M|}
ihevc_inter_pred_chroma_horz_w16out:
  983|  5.88M|{
  984|  5.88M|    WORD32 row, col, i;
  985|  5.88M|    WORD16 i2_tmp_u, i2_tmp_v;
  986|       |
  987|  38.7M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (987:18): [True: 32.8M, False: 5.88M]
  ------------------
  988|  32.8M|    {
  989|   172M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (989:22): [True: 139M, False: 32.8M]
  ------------------
  990|   139M|        {
  991|   139M|            i2_tmp_u = 0;
  992|   139M|            i2_tmp_v = 0;
  993|   697M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   697M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (993:24): [True: 558M, False: 139M]
  ------------------
  994|   558M|            {
  995|   558M|                i2_tmp_u += pi1_coeff[i] * pu1_src[col + (i - 1) * 2];
  996|   558M|                i2_tmp_v += pi1_coeff[i] * pu1_src[col + 1 + (i - 1) * 2];
  997|   558M|            }
  998|       |
  999|   139M|            pi2_dst[col] = i2_tmp_u;
 1000|   139M|            pi2_dst[col + 1] = i2_tmp_v;
 1001|   139M|        }
 1002|       |
 1003|  32.8M|        pu1_src += src_strd;
 1004|  32.8M|        pi2_dst += dst_strd;
 1005|  32.8M|    }
 1006|  5.88M|}
ihevc_inter_pred_chroma_vert_w16out:
 1059|  2.81M|{
 1060|  2.81M|    WORD32 row, col, i;
 1061|  2.81M|    WORD16 i2_tmp;
 1062|       |
 1063|  13.7M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1063:18): [True: 10.9M, False: 2.81M]
  ------------------
 1064|  10.9M|    {
 1065|   101M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1065:22): [True: 90.1M, False: 10.9M]
  ------------------
 1066|  90.1M|        {
 1067|  90.1M|            i2_tmp = 0;
 1068|   449M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   449M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1068:24): [True: 359M, False: 90.1M]
  ------------------
 1069|   359M|            {
 1070|   359M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 1) * src_strd];
 1071|   359M|            }
 1072|       |
 1073|  90.1M|            pi2_dst[col] = i2_tmp;
 1074|  90.1M|        }
 1075|       |
 1076|  10.9M|        pu1_src += src_strd;
 1077|  10.9M|        pi2_dst += dst_strd;
 1078|  10.9M|    }
 1079|  2.81M|}
ihevc_inter_pred_chroma_vert_w16inp:
 1130|   791k|{
 1131|   791k|    WORD32 row, col, i;
 1132|   791k|    WORD32 i4_tmp;
 1133|       |
 1134|  3.92M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1134:18): [True: 3.12M, False: 791k]
  ------------------
 1135|  3.12M|    {
 1136|  29.5M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1136:22): [True: 26.4M, False: 3.12M]
  ------------------
 1137|  26.4M|        {
 1138|  26.4M|            i4_tmp = 0;
 1139|   132M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   132M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1139:24): [True: 105M, False: 26.4M]
  ------------------
 1140|   105M|            {
 1141|   105M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 1) * src_strd];
 1142|   105M|            }
 1143|       |
 1144|  26.4M|            i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  26.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  26.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  26.4M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  26.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  26.4M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  26.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  26.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1145|  26.4M|            i4_tmp = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  26.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  26.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 49.9k, False: 26.4M]
  |  |  |  |  |  Branch (40:53): [True: 220k, False: 26.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|       |
 1147|  26.4M|            pu1_dst[col] = i4_tmp;
 1148|  26.4M|        }
 1149|       |
 1150|  3.12M|        pi2_src += src_strd;
 1151|  3.12M|        pu1_dst += dst_strd;
 1152|  3.12M|    }
 1153|       |
 1154|   791k|}
ihevc_inter_pred_chroma_vert_w16inp_w16out:
 1207|  2.63M|{
 1208|  2.63M|    WORD32 row, col, i;
 1209|  2.63M|    WORD32 i4_tmp;
 1210|       |
 1211|  13.3M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1211:18): [True: 10.7M, False: 2.63M]
  ------------------
 1212|  10.7M|    {
 1213|   107M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1213:22): [True: 97.0M, False: 10.7M]
  ------------------
 1214|  97.0M|        {
 1215|  97.0M|            i4_tmp = 0;
 1216|   484M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|   484M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1216:24): [True: 387M, False: 97.0M]
  ------------------
 1217|   387M|            {
 1218|   387M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 1) * src_strd];
 1219|   387M|            }
 1220|       |
 1221|  97.0M|            i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  97.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  97.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1222|       |
 1223|  97.0M|            pi2_dst[col] = i4_tmp;
 1224|  97.0M|        }
 1225|       |
 1226|  10.7M|        pi2_src += src_strd;
 1227|  10.7M|        pi2_dst += dst_strd;
 1228|  10.7M|    }
 1229|       |
 1230|  2.63M|}

ihevc_intra_pred_luma_ref_subst_all_avlble:
  120|   720k|{
  121|       |
  122|   720k|    WORD32 i;
  123|   720k|    WORD32 two_nt = 2 * nt;
  124|   720k|    UNUSED(nbr_flags);
  ------------------
  |  |   38|   720k|#define UNUSED(x) ((void)(x))
  ------------------
  125|   720k|    UNUSED(dst_strd);
  ------------------
  |  |   38|   720k|#define UNUSED(x) ((void)(x))
  ------------------
  126|       |
  127|       |    /* Neighbor Flag Structure*/
  128|       |    /* MSB ---> LSB */
  129|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  130|       |              1         4         4     4         4
  131|       |     */
  132|   720k|    ASSERT((nbr_flags == 0x11188) || (nbr_flags == 0x133CC) || (nbr_flags == 0x1FFFF));
  ------------------
  |  |   55|   720k|#define ASSERT(x) {}
  ------------------
  133|   720k|    {
  134|       |
  135|   720k|        if(nt == 4)
  ------------------
  |  Branch (135:12): [True: 348k, False: 371k]
  ------------------
  136|   348k|        {
  137|       |            /* 1 bit extraction for all the neighboring blocks */
  138|       |
  139|       |
  140|       |            /* Else fill the corresponding samples */
  141|   348k|            pu1_dst[two_nt] = *pu1_top_left;
  142|       |            //if(left)
  143|   348k|            {
  144|  1.74M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (144:28): [True: 1.39M, False: 348k]
  ------------------
  145|  1.39M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  146|   348k|            }
  147|       |//            if(bot_left)
  148|   348k|            {
  149|  1.74M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (149:29): [True: 1.39M, False: 348k]
  ------------------
  150|  1.39M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  151|   348k|            }
  152|       |//            if(top)
  153|   348k|            {
  154|   348k|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  155|   348k|            }
  156|       |//            if(tp_right)
  157|   348k|            {
  158|   348k|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  159|   348k|            }
  160|       |
  161|       |
  162|   348k|        }
  163|   371k|        else
  164|       |
  165|   371k|        {
  166|       |
  167|       |            /* Else fill the corresponding samples */
  168|   371k|            ASSERT((nt == 8) || (nt == 16) || (nt == 32));
  ------------------
  |  |   55|   371k|#define ASSERT(x) {}
  ------------------
  169|   371k|            pu1_dst[two_nt] = *pu1_top_left;
  170|       |
  171|  8.85M|            for(i = 0; i < nt; i++)
  ------------------
  |  Branch (171:24): [True: 8.47M, False: 371k]
  ------------------
  172|  8.47M|                pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  173|       |
  174|  8.87M|            for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (174:25): [True: 8.50M, False: 371k]
  ------------------
  175|  8.50M|                pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  176|       |
  177|   371k|            memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  178|       |
  179|   371k|            memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  180|   371k|        }
  181|       |
  182|   720k|    }
  183|   720k|}
ihevc_intra_pred_luma_ref_substitution:
  194|  4.25M|{
  195|  4.25M|    UWORD8 pu1_ref;
  196|  4.25M|    WORD32 dc_val, i;
  197|  4.25M|    WORD32 total_samples = (4 * nt) + 1;
  198|  4.25M|    WORD32 two_nt = 2 * nt;
  199|       |
  200|  4.25M|    WORD32 three_nt = 3 * nt;
  201|  4.25M|    WORD32 get_bits;
  202|  4.25M|    WORD32 next;
  203|  4.25M|    WORD32 bot_left, left, top, tp_right, tp_left;
  204|       |
  205|  4.25M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  206|  4.25M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  4.25M|#define UNUSED(x) ((void)(x))
  ------------------
  207|       |    /*dc_val = 1 << (BIT_DEPTH - 1);*/
  208|  4.25M|    dc_val = 1 << (8 - 1);
  209|       |
  210|       |
  211|       |    /* Neighbor Flag Structure*/
  212|       |    /* MSB ---> LSB */
  213|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  214|       |              1         4         4     4         4
  215|       |     */
  216|       |    /* If no neighbor flags are present, fill the neighbor samples with DC value */
  217|  4.25M|    if(nbr_flags == 0)
  ------------------
  |  Branch (217:8): [True: 34.0k, False: 4.22M]
  ------------------
  218|  34.0k|    {
  219|  2.22M|        for(i = 0; i < total_samples; i++)
  ------------------
  |  Branch (219:20): [True: 2.19M, False: 34.0k]
  ------------------
  220|  2.19M|        {
  221|  2.19M|            pu1_dst[i] = dc_val;
  222|  2.19M|        }
  223|  34.0k|    }
  224|  4.22M|    else
  225|  4.22M|    {
  226|  4.22M|        if(nt <= 8)
  ------------------
  |  Branch (226:12): [True: 2.42M, False: 1.79M]
  ------------------
  227|  2.42M|        {
  228|       |            /* 1 bit extraction for all the neighboring blocks */
  229|  2.42M|            tp_left = (nbr_flags & 0x10000) >> 16;
  230|  2.42M|            bot_left = (nbr_flags & 0x8) >> 3;
  231|  2.42M|            left = (nbr_flags & 0x80) >> 7;
  232|  2.42M|            top = (nbr_flags & 0x100) >> 8;
  233|  2.42M|            tp_right = (nbr_flags & 0x1000) >> 12;
  234|       |
  235|       |            /* Else fill the corresponding samples */
  236|  2.42M|            if(tp_left)
  ------------------
  |  Branch (236:16): [True: 2.17M, False: 249k]
  ------------------
  237|  2.17M|                pu1_dst[two_nt] = *pu1_top_left;
  238|   249k|            else
  239|   249k|                pu1_dst[two_nt] = 0;
  240|       |
  241|       |
  242|  2.42M|            if(left)
  ------------------
  |  Branch (242:16): [True: 2.31M, False: 109k]
  ------------------
  243|  2.31M|            {
  244|  13.8M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (244:28): [True: 11.5M, False: 2.31M]
  ------------------
  245|  11.5M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  246|  2.31M|            }
  247|   109k|            else
  248|   109k|            {
  249|   109k|                memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  250|   109k|            }
  251|       |
  252|       |
  253|  2.42M|            if(bot_left)
  ------------------
  |  Branch (253:16): [True: 404k, False: 2.02M]
  ------------------
  254|   404k|            {
  255|  2.49M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (255:29): [True: 2.08M, False: 404k]
  ------------------
  256|  2.08M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  257|   404k|            }
  258|  2.02M|            else
  259|  2.02M|            {
  260|  2.02M|                memset(&pu1_dst[two_nt - 1 - (two_nt - 1)], 0, nt);
  261|  2.02M|            }
  262|       |
  263|       |
  264|  2.42M|            if(top)
  ------------------
  |  Branch (264:16): [True: 2.28M, False: 141k]
  ------------------
  265|  2.28M|            {
  266|  2.28M|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  267|  2.28M|            }
  268|   141k|            else
  269|   141k|            {
  270|   141k|                memset(&pu1_dst[two_nt + 1], 0, nt);
  271|   141k|            }
  272|       |
  273|  2.42M|            if(tp_right)
  ------------------
  |  Branch (273:16): [True: 1.33M, False: 1.08M]
  ------------------
  274|  1.33M|            {
  275|  1.33M|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  276|  1.33M|            }
  277|  1.08M|            else
  278|  1.08M|            {
  279|  1.08M|                memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  280|  1.08M|            }
  281|  2.42M|            next = 1;
  282|       |
  283|       |            /* If bottom -left is not available, reverse substitution process*/
  284|  2.42M|            if(bot_left == 0)
  ------------------
  |  Branch (284:16): [True: 2.02M, False: 403k]
  ------------------
  285|  2.02M|            {
  286|  2.02M|                WORD32 a_nbr_flag[5];
  287|  2.02M|                a_nbr_flag[0] = bot_left;
  288|  2.02M|                a_nbr_flag[1] = left;
  289|  2.02M|                a_nbr_flag[2] = tp_left;
  290|  2.02M|                a_nbr_flag[3] = top;
  291|  2.02M|                a_nbr_flag[4] = tp_right;
  292|       |
  293|       |                /* Check for the 1st available sample from bottom-left*/
  294|  2.24M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (294:23): [True: 220k, False: 2.02M]
  ------------------
  295|   220k|                    next++;
  296|       |
  297|       |                /* If Left, top-left are available*/
  298|  2.02M|                if(next <= 2)
  ------------------
  |  Branch (298:20): [True: 1.91M, False: 107k]
  ------------------
  299|  1.91M|                {
  300|  1.91M|                    idx = nt * next;
  301|  1.91M|                    pu1_ref = pu1_dst[idx];
  302|  11.3M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (302:32): [True: 9.47M, False: 1.91M]
  ------------------
  303|  9.47M|                        pu1_dst[i] = pu1_ref;
  304|  1.91M|                }
  305|   107k|                else /* If top, top-right are available */
  306|   107k|                {
  307|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available*/
  308|   107k|                    idx = (nt * (next - 1)) + 1;
  309|   107k|                    pu1_ref = pu1_dst[idx];
  310|  1.22M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (310:32): [True: 1.12M, False: 107k]
  ------------------
  311|  1.12M|                        pu1_dst[i] = pu1_ref;
  312|   107k|                }
  313|  2.02M|            }
  314|       |
  315|       |            /* Forward Substitution Process */
  316|       |            /* If left is Unavailable, copy the last bottom-left value */
  317|  2.42M|            if(left == 0)
  ------------------
  |  Branch (317:16): [True: 110k, False: 2.31M]
  ------------------
  318|   110k|            {
  319|   110k|                memset(&pu1_dst[nt], pu1_dst[nt - 1], nt);
  320|       |
  321|   110k|            }
  322|       |            /* If top-left is Unavailable, copy the last left value */
  323|  2.42M|            if(tp_left == 0)
  ------------------
  |  Branch (323:16): [True: 250k, False: 2.17M]
  ------------------
  324|   250k|                pu1_dst[two_nt] = pu1_dst[two_nt - 1];
  325|       |            /* If top is Unavailable, copy the last top-left value */
  326|  2.42M|            if(top == 0)
  ------------------
  |  Branch (326:16): [True: 140k, False: 2.28M]
  ------------------
  327|   140k|            {
  328|   140k|                memset(&pu1_dst[two_nt + 1], pu1_dst[two_nt], nt);
  329|   140k|            }
  330|       |            /* If to right is Unavailable, copy the last top value */
  331|  2.42M|            if(tp_right == 0)
  ------------------
  |  Branch (331:16): [True: 1.09M, False: 1.32M]
  ------------------
  332|  1.09M|            {
  333|  1.09M|                memset(&pu1_dst[three_nt + 1], pu1_dst[three_nt], nt);
  334|       |
  335|  1.09M|            }
  336|  2.42M|        }
  337|       |
  338|  4.22M|        if(nt == 16)
  ------------------
  |  Branch (338:12): [True: 815k, False: 3.40M]
  ------------------
  339|   815k|        {
  340|   815k|            WORD32 nbr_flags_temp = 0;
  341|   815k|            nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4)
  342|   815k|                            + ((nbr_flags & 0x300) >> 4)
  343|   815k|                            + ((nbr_flags & 0x3000) >> 6)
  344|   815k|                            + ((nbr_flags & 0x10000) >> 8);
  345|       |
  346|       |            /* Else fill the corresponding samples */
  347|   815k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (347:16): [True: 731k, False: 83.4k]
  ------------------
  348|   731k|                pu1_dst[two_nt] = *pu1_top_left;
  349|  83.4k|            else
  350|  83.4k|                pu1_dst[two_nt] = 0;
  351|       |
  352|   815k|            if(nbr_flags & 0xC0)
  ------------------
  |  Branch (352:16): [True: 788k, False: 27.1k]
  ------------------
  353|   788k|            {
  354|  13.3M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (354:28): [True: 12.6M, False: 788k]
  ------------------
  355|  12.6M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  356|   788k|            }
  357|  27.1k|            else
  358|  27.1k|            {
  359|  27.1k|                memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  360|  27.1k|            }
  361|       |
  362|       |            /* Bottom - left availability is checked for every 8x8 TU position and set accordingly */
  363|   815k|            {
  364|   815k|                if(nbr_flags & 0x8)
  ------------------
  |  Branch (364:20): [True: 182k, False: 633k]
  ------------------
  365|   182k|                {
  366|  1.63M|                    for(i = nt; i < (nt + 8); i++)
  ------------------
  |  Branch (366:33): [True: 1.45M, False: 182k]
  ------------------
  367|  1.45M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  368|   182k|                }
  369|   633k|                else
  370|   633k|                {
  371|   633k|                    memset(&pu1_dst[nt - 8], 0, 8);
  372|   633k|                }
  373|       |
  374|   815k|                if(nbr_flags & 0x4)
  ------------------
  |  Branch (374:20): [True: 180k, False: 634k]
  ------------------
  375|   180k|                {
  376|  1.62M|                    for(i = (nt + 8); i < two_nt; i++)
  ------------------
  |  Branch (376:39): [True: 1.44M, False: 180k]
  ------------------
  377|  1.44M|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  378|   180k|                }
  379|   634k|                else
  380|   634k|                {
  381|   634k|                    memset(&pu1_dst[0], 0, 8);
  382|   634k|                }
  383|   815k|            }
  384|       |
  385|   815k|            if(nbr_flags & 0x300)
  ------------------
  |  Branch (385:16): [True: 759k, False: 56.0k]
  ------------------
  386|   759k|            {
  387|   759k|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  388|   759k|            }
  389|  56.0k|            else
  390|  56.0k|            {
  391|  56.0k|                memset(&pu1_dst[two_nt + 1], 0, nt);
  392|  56.0k|            }
  393|       |
  394|   815k|            if(nbr_flags & 0x3000)
  ------------------
  |  Branch (394:16): [True: 464k, False: 350k]
  ------------------
  395|   464k|            {
  396|   464k|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  397|   464k|            }
  398|   350k|            else
  399|   350k|            {
  400|   350k|                memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  401|   350k|            }
  402|       |            /* compute trailing zeors based on nbr_flag for substitution process of below left see section .*/
  403|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  404|   815k|            {
  405|   815k|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 8; /* for below left and left */
  ------------------
  |  |   43|   815k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 27.3k, False: 788k]
  |  |  ------------------
  ------------------
  406|       |
  407|   815k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (407:20): [True: 27.3k, False: 788k]
  ------------------
  408|  27.3k|                    nbr_id_from_bl = 32;
  409|       |
  410|   815k|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (410:20): [True: 27.3k, False: 788k]
  ------------------
  411|  27.3k|                {
  412|       |                    /* for top left : 1 pel per nbr bit */
  413|  27.3k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (413:24): [True: 27.0k, False: 212]
  ------------------
  414|  27.0k|                    {
  415|  27.0k|                        nbr_id_from_bl++;
  416|  27.0k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 8; /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  27.0k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 27.0k]
  |  |  ------------------
  ------------------
  417|       |                        //nbr_id_from_bl += idx * 8;
  418|  27.0k|                    }
  419|  27.3k|                }
  420|       |                /* Reverse Substitution Process*/
  421|   815k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (421:20): [True: 636k, False: 178k]
  ------------------
  422|   636k|                {
  423|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  424|   636k|                    pu1_ref = pu1_dst[nbr_id_from_bl];
  425|  11.2M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (425:51): [True: 10.6M, False: 636k]
  ------------------
  426|  10.6M|                    {
  427|  10.6M|                        pu1_dst[i] = pu1_ref;
  428|  10.6M|                    }
  429|   636k|                }
  430|   815k|            }
  431|       |
  432|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  433|  6.81M|            while(nbr_id_from_bl < ((T16_4NT)+1))
  ------------------
  |  |   71|  6.81M|#define T16_4NT 64
  ------------------
  |  Branch (433:19): [True: 5.99M, False: 815k]
  ------------------
  434|  5.99M|            {
  435|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  436|       |                /* Devide by 8 to obtain the original index */
  437|  5.99M|                frwd_nbr_flag = (nbr_id_from_bl >> 3); /*+ (nbr_id_from_bl & 0x1);*/
  438|       |
  439|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  440|  5.99M|                if(nbr_id_from_bl == (T16_4NT / 2))
  ------------------
  |  |   71|  5.99M|#define T16_4NT 64
  ------------------
  |  Branch (440:20): [True: 790k, False: 5.20M]
  ------------------
  441|   790k|                {
  442|   790k|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|   790k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  443|       |
  444|       |                    /* only pel substitution for TL */
  445|   790k|                    if(!get_bits)
  ------------------
  |  Branch (445:24): [True: 56.9k, False: 733k]
  ------------------
  446|  56.9k|                        pu1_dst[nbr_id_from_bl] = pu1_dst[nbr_id_from_bl - 1];
  447|   790k|                }
  448|  5.20M|                else
  449|  5.20M|                {
  450|  5.20M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  5.20M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  451|  5.20M|                    if(!get_bits)
  ------------------
  |  Branch (451:24): [True: 822k, False: 4.38M]
  ------------------
  452|   822k|                    {
  453|       |                        /* 8 pel substitution (other than TL) */
  454|   822k|                        pu1_ref = pu1_dst[nbr_id_from_bl - 1];
  455|   822k|                        memset(pu1_dst + nbr_id_from_bl, pu1_ref, 8);
  456|       |
  457|       |
  458|   822k|                    }
  459|       |
  460|  5.20M|                }
  461|  5.99M|                nbr_id_from_bl += (nbr_id_from_bl == (T16_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   71|  5.99M|#define T16_4NT 64
  ------------------
  |  Branch (461:35): [True: 789k, False: 5.20M]
  ------------------
  462|  5.99M|            }
  463|       |
  464|       |
  465|   815k|        }
  466|       |
  467|  4.22M|        if(nt == 32)
  ------------------
  |  Branch (467:12): [True: 995k, False: 3.22M]
  ------------------
  468|   995k|        {
  469|       |            /* Else fill the corresponding samples */
  470|   995k|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (470:16): [True: 796k, False: 199k]
  ------------------
  471|   796k|                pu1_dst[two_nt] = *pu1_top_left;
  472|   199k|            else
  473|   199k|                pu1_dst[two_nt] = 0;
  474|       |
  475|   995k|            if(nbr_flags & 0xF0)
  ------------------
  |  Branch (475:16): [True: 967k, False: 27.5k]
  ------------------
  476|   967k|            {
  477|  31.8M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (477:28): [True: 30.8M, False: 967k]
  ------------------
  478|  30.8M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  479|   967k|            }
  480|  27.5k|            else
  481|  27.5k|            {
  482|  27.5k|                memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  483|  27.5k|            }
  484|       |
  485|       |            /* Bottom - left availability is checked for every 8x8 TU position and set accordingly */
  486|   995k|            {
  487|   995k|                if(nbr_flags & 0x8)
  ------------------
  |  Branch (487:20): [True: 81.7k, False: 913k]
  ------------------
  488|  81.7k|                {
  489|   735k|                    for(i = nt; i < (nt + 8); i++)
  ------------------
  |  Branch (489:33): [True: 653k, False: 81.7k]
  ------------------
  490|   653k|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  491|  81.7k|                }
  492|   913k|                else
  493|   913k|                {
  494|   913k|                    memset(&pu1_dst[24], 0, 8);
  495|   913k|                }
  496|       |
  497|   995k|                if(nbr_flags & 0x4)
  ------------------
  |  Branch (497:20): [True: 81.3k, False: 914k]
  ------------------
  498|  81.3k|                {
  499|   732k|                    for(i = (nt + 8); i < (nt + 16); i++)
  ------------------
  |  Branch (499:39): [True: 650k, False: 81.3k]
  ------------------
  500|   650k|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  501|  81.3k|                }
  502|   914k|                else
  503|   914k|                {
  504|   914k|                    memset(&pu1_dst[16], 0, 8);
  505|   914k|                }
  506|       |
  507|   995k|                if(nbr_flags & 0x2)
  ------------------
  |  Branch (507:20): [True: 81.1k, False: 914k]
  ------------------
  508|  81.1k|                {
  509|   730k|                    for(i = (nt + 16); i < (nt + 24); i++)
  ------------------
  |  Branch (509:40): [True: 649k, False: 81.1k]
  ------------------
  510|   649k|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  511|  81.1k|                }
  512|   914k|                else
  513|   914k|                {
  514|   914k|                    memset(&pu1_dst[8], 0, 8);
  515|   914k|                }
  516|       |
  517|   995k|                if(nbr_flags & 0x1)
  ------------------
  |  Branch (517:20): [True: 81.1k, False: 914k]
  ------------------
  518|  81.1k|                {
  519|   730k|                    for(i = (nt + 24); i < (two_nt); i++)
  ------------------
  |  Branch (519:40): [True: 649k, False: 81.1k]
  ------------------
  520|   649k|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  521|  81.1k|                }
  522|   914k|                else
  523|   914k|                {
  524|   914k|                    memset(&pu1_dst[0], 0, 8);
  525|   914k|                }
  526|   995k|            }
  527|       |
  528|       |
  529|   995k|            if(nbr_flags & 0xF00)
  ------------------
  |  Branch (529:16): [True: 826k, False: 168k]
  ------------------
  530|   826k|            {
  531|   826k|                memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  532|   826k|            }
  533|   168k|            else
  534|   168k|            {
  535|   168k|                memset(&pu1_dst[two_nt + 1], 0, nt);
  536|   168k|            }
  537|       |
  538|   995k|            if(nbr_flags & 0xF000)
  ------------------
  |  Branch (538:16): [True: 530k, False: 464k]
  ------------------
  539|   530k|            {
  540|   530k|                memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  541|   530k|            }
  542|   464k|            else
  543|   464k|            {
  544|   464k|                memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  545|   464k|            }
  546|       |            /* compute trailing ones based on mbr_flag for substitution process of below left see section .*/
  547|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  548|   995k|            {
  549|   995k|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 8; /* for below left and left */
  ------------------
  |  |   43|   995k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 27.8k, False: 967k]
  |  |  ------------------
  ------------------
  550|       |
  551|   995k|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (551:20): [True: 27.8k, False: 967k]
  ------------------
  552|  27.8k|                {
  553|       |                    /* for top left : 1 pel per nbr bit */
  554|  27.8k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (554:24): [True: 27.4k, False: 324]
  ------------------
  555|  27.4k|                    {
  556|       |                        /* top left not available */
  557|  27.4k|                        nbr_id_from_bl++;
  558|       |                        /* top and top right;  8 pels per nbr bit */
  559|  27.4k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 8;
  ------------------
  |  |   43|  27.4k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 27.4k]
  |  |  ------------------
  ------------------
  560|  27.4k|                    }
  561|  27.8k|                }
  562|       |                /* Reverse Substitution Process*/
  563|   995k|                if(nbr_id_from_bl)
  ------------------
  |  Branch (563:20): [True: 917k, False: 77.9k]
  ------------------
  564|   917k|                {
  565|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  566|   917k|                    pu1_ref = pu1_dst[nbr_id_from_bl];
  567|  31.1M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (567:51): [True: 30.2M, False: 917k]
  ------------------
  568|  30.2M|                        pu1_dst[i] = pu1_ref;
  569|   917k|                }
  570|   995k|            }
  571|       |
  572|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  573|  14.0M|            while(nbr_id_from_bl < ((T32_4NT)+1))
  ------------------
  |  |   70|  14.0M|#define T32_4NT 128
  ------------------
  |  Branch (573:19): [True: 13.0M, False: 995k]
  ------------------
  574|  13.0M|            {
  575|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  576|       |                /* Devide by 8 to obtain the original index */
  577|  13.0M|                frwd_nbr_flag = (nbr_id_from_bl >> 3); /*+ (nbr_id_from_bl & 0x1);*/
  578|       |
  579|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  580|  13.0M|                if(nbr_id_from_bl == (T32_4NT / 2))
  ------------------
  |  |   70|  13.0M|#define T32_4NT 128
  ------------------
  |  Branch (580:20): [True: 965k, False: 12.1M]
  ------------------
  581|   965k|                {
  582|   965k|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|   965k|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  583|       |                    /* only pel substitution for TL */
  584|   965k|                    if(!get_bits)
  ------------------
  |  Branch (584:24): [True: 173k, False: 792k]
  ------------------
  585|   173k|                        pu1_dst[nbr_id_from_bl] = pu1_dst[nbr_id_from_bl - 1];
  586|   965k|                }
  587|  12.1M|                else
  588|  12.1M|                {
  589|  12.1M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  12.1M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  590|  12.1M|                    if(!get_bits)
  ------------------
  |  Branch (590:24): [True: 2.57M, False: 9.53M]
  ------------------
  591|  2.57M|                    {
  592|       |                        /* 8 pel substitution (other than TL) */
  593|  2.57M|                        pu1_ref = pu1_dst[nbr_id_from_bl - 1];
  594|  2.57M|                        memset(&pu1_dst[nbr_id_from_bl], pu1_ref, 8);
  595|       |
  596|  2.57M|                    }
  597|       |
  598|  12.1M|                }
  599|  13.0M|                nbr_id_from_bl += (nbr_id_from_bl == (T32_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   70|  13.0M|#define T32_4NT 128
  ------------------
  |  Branch (599:35): [True: 964k, False: 12.1M]
  ------------------
  600|  13.0M|            }
  601|   995k|        }
  602|       |
  603|  4.22M|    }
  604|  4.25M|}
ihevc_intra_pred_ref_filtering:
  649|  1.91M|{
  650|  1.91M|    WORD32 filter_flag;
  651|  1.91M|    WORD32 i; /* Generic indexing variable */
  652|  1.91M|    WORD32 four_nt = 4 * nt;
  653|  1.91M|    UWORD8 au1_flt[(4 * MAX_CU_SIZE) + 1];
  654|  1.91M|    WORD32 bi_linear_int_flag = 0;
  655|  1.91M|    WORD32 abs_cond_left_flag = 0;
  656|  1.91M|    WORD32 abs_cond_top_flag = 0;
  657|       |    /*WORD32 dc_val = 1 << (BIT_DEPTH - 5);*/
  658|  1.91M|    WORD32 dc_val = 1 << (8 - 5);
  659|  1.91M|    WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3);
  660|  1.91M|    WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1;
  661|       |
  662|  1.91M|    filter_flag = intra_smoothing_disabled ?
  ------------------
  |  Branch (662:19): [True: 2.06k, False: 1.91M]
  ------------------
  663|  1.91M|                    0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)));
  664|  1.91M|    if(0 == filter_flag)
  ------------------
  |  Branch (664:8): [True: 1.34M, False: 572k]
  ------------------
  665|  1.34M|    {
  666|  1.34M|        if(pu1_src == pu1_dst)
  ------------------
  |  Branch (666:12): [True: 1.34M, False: 18.4E]
  ------------------
  667|  1.34M|        {
  668|  1.34M|            return;
  669|  1.34M|        }
  670|  18.4E|        else
  671|  18.4E|        {
  672|  18.4E|            for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (672:24): [True: 0, False: 18.4E]
  ------------------
  673|      0|                pu1_dst[i] = pu1_src[i];
  674|  18.4E|        }
  675|  1.34M|    }
  676|       |
  677|   572k|    else
  678|   572k|    {
  679|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  680|   572k|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (680:12): [True: 344k, False: 227k]
  |  Branch (680:57): [True: 98.8k, False: 245k]
  ------------------
  681|  98.8k|        {
  682|       |            /* Strong Intra Filtering */
  683|  98.8k|            abs_cond_top_flag = (ABS(pu1_src[2 * nt] + pu1_src[4 * nt]
  ------------------
  |  |   45|  98.8k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 19.7k, False: 79.0k]
  |  |  ------------------
  ------------------
  684|  98.8k|                            - (2 * pu1_src[3 * nt]))) < dc_val;
  685|  98.8k|            abs_cond_left_flag = (ABS(pu1_src[2 * nt] + pu1_src[0]
  ------------------
  |  |   45|  98.8k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 19.3k, False: 79.4k]
  |  |  ------------------
  ------------------
  686|  98.8k|                            - (2 * pu1_src[nt]))) < dc_val;
  687|       |
  688|  98.8k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (688:35): [True: 67.7k, False: 31.0k]
  ------------------
  689|  67.7k|                            && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (689:32): [True: 59.0k, False: 8.70k]
  ------------------
  690|  98.8k|        }
  691|       |        /* Extremities Untouched*/
  692|   572k|        au1_flt[0] = pu1_src[0];
  693|   572k|        au1_flt[4 * nt] = pu1_src[4 * nt];
  694|       |
  695|       |        /* Strong filtering of reference samples */
  696|   572k|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (696:12): [True: 59.0k, False: 513k]
  ------------------
  697|  59.0k|        {
  698|  59.0k|            au1_flt[2 * nt] = pu1_src[2 * nt];
  699|       |
  700|  3.77M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (700:24): [True: 3.71M, False: 59.0k]
  ------------------
  701|  3.71M|                au1_flt[i] = (((2 * nt) - i) * pu1_src[0] + i * pu1_src[2 * nt] + 32) >> 6;
  702|       |
  703|  3.77M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (703:24): [True: 3.71M, False: 59.0k]
  ------------------
  704|  3.71M|                au1_flt[i + (2 * nt)] = (((2 * nt) - i) * pu1_src[2 * nt] + i * pu1_src[4 * nt] + 32) >> 6;
  705|       |
  706|  59.0k|        }
  707|   513k|        else
  708|   513k|        {
  709|       |            /* Perform bilinear filtering of Reference Samples */
  710|  40.5M|            for(i = 0; i < (four_nt - 1); i++)
  ------------------
  |  Branch (710:24): [True: 40.0M, False: 513k]
  ------------------
  711|  40.0M|            {
  712|  40.0M|                au1_flt[i + 1] = (pu1_src[i] + 2 * pu1_src[i + 1]
  713|  40.0M|                                + pu1_src[i + 2] + 2) >> 2;
  714|  40.0M|            }
  715|   513k|        }
  716|       |
  717|       |
  718|  49.2M|        for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (718:20): [True: 48.6M, False: 572k]
  ------------------
  719|  48.6M|            pu1_dst[i] = au1_flt[i];
  720|   572k|    }
  721|       |
  722|  1.91M|}
ihevc_intra_pred_luma_planar:
  769|   549k|{
  770|       |
  771|       |
  772|   549k|    WORD32 row, col;
  773|   549k|    WORD32 log2nt = 5;
  774|   549k|    WORD32 two_nt, three_nt;
  775|   549k|    UNUSED(src_strd);
  ------------------
  |  |   38|   549k|#define UNUSED(x) ((void)(x))
  ------------------
  776|   549k|    UNUSED(mode);
  ------------------
  |  |   38|   549k|#define UNUSED(x) ((void)(x))
  ------------------
  777|   549k|    switch(nt)
  778|   549k|    {
  779|   118k|        case 32:
  ------------------
  |  Branch (779:9): [True: 118k, False: 430k]
  ------------------
  780|   118k|            log2nt = 5;
  781|   118k|            break;
  782|   176k|        case 16:
  ------------------
  |  Branch (782:9): [True: 176k, False: 373k]
  ------------------
  783|   176k|            log2nt = 4;
  784|   176k|            break;
  785|  65.7k|        case 8:
  ------------------
  |  Branch (785:9): [True: 65.7k, False: 483k]
  ------------------
  786|  65.7k|            log2nt = 3;
  787|  65.7k|            break;
  788|   189k|        case 4:
  ------------------
  |  Branch (788:9): [True: 189k, False: 359k]
  ------------------
  789|   189k|            log2nt = 2;
  790|   189k|            break;
  791|      0|        default:
  ------------------
  |  Branch (791:9): [True: 0, False: 549k]
  ------------------
  792|      0|            break;
  793|   549k|    }
  794|   549k|    two_nt = 2 * nt;
  795|   549k|    three_nt = 3 * nt;
  796|       |    /* Planar filtering */
  797|  8.18M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (797:18): [True: 7.63M, False: 549k]
  ------------------
  798|  7.63M|    {
  799|   172M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (799:22): [True: 165M, False: 7.63M]
  ------------------
  800|   165M|        {
  801|   165M|            pu1_dst[row * dst_strd + col] = ((nt - 1 - col)
  802|   165M|                            * pu1_ref[two_nt - 1 - row]
  803|   165M|                            + (col + 1) * pu1_ref[three_nt + 1]
  804|   165M|                            + (nt - 1 - row) * pu1_ref[two_nt + 1 + col]
  805|   165M|                            + (row + 1) * pu1_ref[nt - 1] + nt) >> (log2nt + 1);
  806|   165M|        }
  807|  7.63M|    }
  808|   549k|}
ihevc_intra_pred_luma_dc:
  855|   248k|{
  856|       |
  857|   248k|    WORD32 acc_dc;
  858|   248k|    WORD32 dc_val, two_dc_val, three_dc_val;
  859|   248k|    WORD32 i;
  860|   248k|    WORD32 row, col;
  861|   248k|    WORD32 log2nt = 5;
  862|   248k|    WORD32 two_nt, three_nt;
  863|   248k|    UNUSED(mode);
  ------------------
  |  |   38|   248k|#define UNUSED(x) ((void)(x))
  ------------------
  864|   248k|    UNUSED(src_strd);
  ------------------
  |  |   38|   248k|#define UNUSED(x) ((void)(x))
  ------------------
  865|   248k|    switch(nt)
  866|   248k|    {
  867|  34.1k|        case 32:
  ------------------
  |  Branch (867:9): [True: 34.1k, False: 214k]
  ------------------
  868|  34.1k|            log2nt = 5;
  869|  34.1k|            break;
  870|  60.6k|        case 16:
  ------------------
  |  Branch (870:9): [True: 60.6k, False: 188k]
  ------------------
  871|  60.6k|            log2nt = 4;
  872|  60.6k|            break;
  873|  43.3k|        case 8:
  ------------------
  |  Branch (873:9): [True: 43.3k, False: 205k]
  ------------------
  874|  43.3k|            log2nt = 3;
  875|  43.3k|            break;
  876|   110k|        case 4:
  ------------------
  |  Branch (876:9): [True: 110k, False: 137k]
  ------------------
  877|   110k|            log2nt = 2;
  878|   110k|            break;
  879|      0|        default:
  ------------------
  |  Branch (879:9): [True: 0, False: 248k]
  ------------------
  880|      0|            break;
  881|   248k|    }
  882|   248k|    two_nt = 2 * nt;
  883|   248k|    three_nt = 3 * nt;
  884|       |
  885|   248k|    acc_dc = 0;
  886|       |    /* Calculate DC value for the transform block */
  887|  3.09M|    for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (887:17): [True: 2.84M, False: 248k]
  ------------------
  888|  2.84M|        acc_dc += pu1_ref[i];
  889|       |
  890|  3.09M|    for(i = (two_nt + 1); i <= three_nt; i++)
  ------------------
  |  Branch (890:27): [True: 2.84M, False: 248k]
  ------------------
  891|  2.84M|        acc_dc += pu1_ref[i];
  892|       |
  893|   248k|    dc_val = (acc_dc + nt) >> (log2nt + 1);
  894|       |
  895|   248k|    two_dc_val = 2 * dc_val;
  896|   248k|    three_dc_val = 3 * dc_val;
  897|       |
  898|       |
  899|   248k|    if(nt == 32)
  ------------------
  |  Branch (899:8): [True: 34.1k, False: 214k]
  ------------------
  900|  34.1k|    {
  901|  1.10M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (901:22): [True: 1.07M, False: 34.1k]
  ------------------
  902|  35.3M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (902:26): [True: 34.2M, False: 1.07M]
  ------------------
  903|  34.2M|                pu1_dst[(row * dst_strd) + col] = dc_val;
  904|  34.1k|    }
  905|   214k|    else
  906|   214k|    {
  907|       |        /* DC filtering for the first top row and first left column */
  908|   214k|        pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  909|   214k|                        >> 2);
  910|       |
  911|  1.75M|        for(col = 1; col < nt; col++)
  ------------------
  |  Branch (911:22): [True: 1.54M, False: 214k]
  ------------------
  912|  1.54M|            pu1_dst[col] = (pu1_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2;
  913|       |
  914|  1.75M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (914:22): [True: 1.54M, False: 214k]
  ------------------
  915|  1.54M|            pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  916|  1.54M|                            >> 2;
  917|       |
  918|       |        /* Fill the remaining rows with DC value*/
  919|  1.75M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (919:22): [True: 1.54M, False: 214k]
  ------------------
  920|  18.2M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (920:26): [True: 16.7M, False: 1.54M]
  ------------------
  921|  16.7M|                pu1_dst[(row * dst_strd) + col] = dc_val;
  922|   214k|    }
  923|   248k|}
ihevc_intra_pred_luma_horz:
  971|  28.4k|{
  972|       |
  973|  28.4k|    WORD32 row, col;
  974|  28.4k|    WORD32 two_nt;
  975|  28.4k|    WORD16 s2_predpixel;
  976|  28.4k|    UNUSED(src_strd);
  ------------------
  |  |   38|  28.4k|#define UNUSED(x) ((void)(x))
  ------------------
  977|  28.4k|    two_nt = 2 * nt;
  978|       |
  979|  28.4k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (979:8): [True: 3.22k, False: 25.2k]
  |  Branch (979:20): [True: 1.27k, False: 23.9k]
  ------------------
  980|  4.50k|    {
  981|   112k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (981:22): [True: 108k, False: 4.50k]
  ------------------
  982|  3.43M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (982:26): [True: 3.32M, False: 108k]
  ------------------
  983|  3.32M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];
  984|  4.50k|    }
  985|  23.9k|    else
  986|  23.9k|    {
  987|       |        /*Filtering done for the 1st row */
  988|   196k|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (988:22): [True: 172k, False: 23.9k]
  ------------------
  989|   172k|        {
  990|   172k|            s2_predpixel = pu1_ref[two_nt - 1]
  991|   172k|                            + ((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1);
  992|   172k|            pu1_dst[col] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|   172k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   172k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.4k, False: 157k]
  |  |  |  |  |  Branch (40:53): [True: 7.50k, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|   172k|        }
  994|       |
  995|       |        /* Replication to next rows*/
  996|   172k|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (996:22): [True: 148k, False: 23.9k]
  ------------------
  997|  1.75M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (997:26): [True: 1.61M, False: 148k]
  ------------------
  998|  1.61M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];
  999|  23.9k|    }
 1000|  28.4k|}
ihevc_intra_pred_luma_ver:
 1050|   256k|{
 1051|   256k|    WORD32 row, col;
 1052|   256k|    WORD16 s2_predpixel;
 1053|   256k|    WORD32 two_nt = 2 * nt;
 1054|   256k|    UNUSED(src_strd);
  ------------------
  |  |   38|   256k|#define UNUSED(x) ((void)(x))
  ------------------
 1055|       |
 1056|   256k|    if(nt == 32 || disable_boundary_filter)
  ------------------
  |  Branch (1056:8): [True: 45.0k, False: 211k]
  |  Branch (1056:20): [True: 529, False: 210k]
  ------------------
 1057|  45.6k|    {
 1058|       |        /* Replication to next columns*/
 1059|  1.46M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1059:22): [True: 1.42M, False: 45.6k]
  ------------------
 1060|  46.7M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1060:26): [True: 45.2M, False: 1.42M]
  ------------------
 1061|  45.2M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt + 1 + col];
 1062|  45.6k|    }
 1063|   210k|    else
 1064|   210k|    {
 1065|       |        /*Filtering done for the 1st column */
 1066|  2.26M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1066:22): [True: 2.05M, False: 210k]
  ------------------
 1067|  2.05M|        {
 1068|  2.05M|            s2_predpixel = pu1_ref[two_nt + 1]
 1069|  2.05M|                            + ((pu1_ref[two_nt - 1 - row] - pu1_ref[two_nt]) >> 1);
 1070|  2.05M|            pu1_dst[row * dst_strd] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|  2.05M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.05M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 113k, False: 1.94M]
  |  |  |  |  |  Branch (40:53): [True: 59.0k, False: 1.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1071|  2.05M|        }
 1072|       |
 1073|       |        /* Replication to next columns*/
 1074|  2.25M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1074:22): [True: 2.04M, False: 210k]
  ------------------
 1075|  26.2M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (1075:26): [True: 24.1M, False: 2.04M]
  ------------------
 1076|  24.1M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt + 1 + col];
 1077|   210k|    }
 1078|   256k|}
ihevc_intra_pred_luma_mode2:
 1127|   109k|{
 1128|   109k|    WORD32 row, col;
 1129|   109k|    WORD32 two_nt = 2 * nt;
 1130|   109k|    WORD32 intra_pred_ang = 32;
 1131|   109k|    WORD32 idx = 0;
 1132|   109k|    UNUSED(mode);
  ------------------
  |  |   38|   109k|#define UNUSED(x) ((void)(x))
  ------------------
 1133|   109k|    UNUSED(src_strd);
  ------------------
  |  |   38|   109k|#define UNUSED(x) ((void)(x))
  ------------------
 1134|       |    /* For the angle 45, replication is done from the corresponding angle */
 1135|       |    /* intra_pred_ang = tan(angle) in q5 format */
 1136|  1.42M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1136:18): [True: 1.31M, False: 109k]
  ------------------
 1137|  1.31M|    {
 1138|  1.31M|        idx = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
 1139|       |
 1140|  32.4M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1140:22): [True: 31.0M, False: 1.31M]
  ------------------
 1141|  31.0M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[two_nt - row - idx - 1];
 1142|  1.31M|    }
 1143|       |
 1144|   109k|}
ihevc_intra_pred_luma_mode_18_34:
 1191|  54.0k|{
 1192|  54.0k|    WORD32 row, col;
 1193|  54.0k|    WORD32 intra_pred_ang;
 1194|  54.0k|    WORD32 idx = 0;
 1195|  54.0k|    WORD32 two_nt = 2 * nt;
 1196|  54.0k|    UNUSED(src_strd);
  ------------------
  |  |   38|  54.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1197|  54.0k|    intra_pred_ang = 32;    /*Default value*/
 1198|       |
 1199|       |    /* For mode 18, angle is -45degree */
 1200|  54.0k|    if(mode == 18)
  ------------------
  |  Branch (1200:8): [True: 24.1k, False: 29.8k]
  ------------------
 1201|  24.1k|        intra_pred_ang = -32;
 1202|       |    /* For mode 34, angle is 45degree */
 1203|  29.8k|    else if(mode == 34)
  ------------------
  |  Branch (1203:13): [True: 29.8k, False: 18.4E]
  ------------------
 1204|  29.8k|        intra_pred_ang = 32;
 1205|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
 1206|       |    /* No interpolation is done for 45 degree*/
 1207|   494k|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1207:18): [True: 440k, False: 54.0k]
  ------------------
 1208|   440k|    {
 1209|   440k|        idx = ((row + 1) * intra_pred_ang) >> 5;
 1210|       |#if OPT
 1211|       |        if(mode == 18)
 1212|       |            idx--;
 1213|       |        if(mode == 34)
 1214|       |            idx++;
 1215|       |#endif
 1216|  6.63M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1216:22): [True: 6.19M, False: 440k]
  ------------------
 1217|  6.19M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[two_nt + col + idx + 1];
 1218|       |
 1219|   440k|    }
 1220|       |
 1221|  54.0k|}
ihevc_intra_pred_luma_mode_3_to_9:
 1268|   195k|{
 1269|   195k|    WORD32 row, col;
 1270|   195k|    WORD32 two_nt = 2 * nt;
 1271|   195k|    WORD32 intra_pred_ang;
 1272|   195k|    WORD32 idx, ref_main_idx;
 1273|   195k|    WORD32 pos, fract;
 1274|   195k|    UNUSED(src_strd);
  ------------------
  |  |   38|   195k|#define UNUSED(x) ((void)(x))
  ------------------
 1275|       |    /* Intra Pred Angle according to the mode */
 1276|   195k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1277|       |
 1278|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1279|       |    /* samples dependent on distance to obtain destination sample */
 1280|       |
 1281|  2.35M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1281:18): [True: 2.16M, False: 195k]
  ------------------
 1282|  2.16M|    {
 1283|  2.16M|        pos = ((col + 1) * intra_pred_ang);
 1284|  2.16M|        idx = pos >> 5;
 1285|  2.16M|        fract = pos & (31);
 1286|       |
 1287|       |        // Do linear filtering
 1288|  45.9M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1288:22): [True: 43.8M, False: 2.16M]
  ------------------
 1289|  43.8M|        {
 1290|  43.8M|            ref_main_idx = two_nt - row - idx - 1;
 1291|  43.8M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1292|  43.8M|                            * pu1_ref[ref_main_idx]
 1293|  43.8M|                            + fract * pu1_ref[ref_main_idx - 1] + 16) >> 5);
 1294|  43.8M|        }
 1295|       |
 1296|  2.16M|    }
 1297|       |
 1298|   195k|}
ihevc_intra_pred_luma_mode_11_to_17:
 1345|   148k|{
 1346|       |    /* This function and ihevc_intra_pred_luma_mode_19_to_25 are same except*/
 1347|       |    /* for ref main & side samples assignment,can be combined for */
 1348|       |    /* optimzation*/
 1349|       |
 1350|   148k|    WORD32 row, col, k;
 1351|   148k|    WORD32 two_nt;
 1352|   148k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1353|   148k|    WORD32 idx, ref_main_idx, ref_idx;
 1354|   148k|    WORD32 pos, fract;
 1355|       |
 1356|   148k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 1];
 1357|   148k|    UWORD8 *ref_main;
 1358|   148k|    UNUSED(src_strd);
  ------------------
  |  |   38|   148k|#define UNUSED(x) ((void)(x))
  ------------------
 1359|   148k|    inv_ang_sum = 128;
 1360|   148k|    two_nt    = 2 * nt;
 1361|       |
 1362|   148k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1363|       |
 1364|   148k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1365|       |    /* Intermediate reference samples for negative angle modes */
 1366|       |    /* This have to be removed during optimization*/
 1367|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1368|       |
 1369|   148k|    ref_main = ref_temp + nt - 1;
 1370|  1.60M|    for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (1370:16): [True: 1.45M, False: 148k]
  ------------------
 1371|  1.45M|        ref_temp[k + nt - 1] = pu1_ref[two_nt - k];
 1372|       |
 1373|   148k|    ref_main = ref_temp + nt - 1;
 1374|   148k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1375|       |
 1376|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1377|       |    /* For negative angled derive the main reference samples from side */
 1378|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1379|   634k|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1379:17): [True: 486k, False: 148k]
  ------------------
 1380|   486k|    {
 1381|   486k|        inv_ang_sum += inv_ang;
 1382|   486k|        ref_main[k] = pu1_ref[two_nt + (inv_ang_sum >> 8)];
 1383|   486k|    }
 1384|       |
 1385|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1386|       |    /* samples dependent on distance to obtain destination sample */
 1387|  1.45M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1387:18): [True: 1.30M, False: 148k]
  ------------------
 1388|  1.30M|    {
 1389|  1.30M|        pos = ((col + 1) * intra_pred_ang);
 1390|  1.30M|        idx = pos >> 5;
 1391|  1.30M|        fract = pos & (31);
 1392|       |
 1393|       |        // Do linear filtering
 1394|  22.0M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1394:22): [True: 20.7M, False: 1.30M]
  ------------------
 1395|  20.7M|        {
 1396|  20.7M|            ref_main_idx = row + idx + 1;
 1397|  20.7M|            pu1_dst[col + (dst_strd * row)] = (UWORD8)(((32 - fract)
 1398|  20.7M|                            * ref_main[ref_main_idx]
 1399|  20.7M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5);
 1400|       |
 1401|  20.7M|        }
 1402|       |
 1403|  1.30M|    }
 1404|       |
 1405|   148k|}
ihevc_intra_pred_luma_mode_19_to_25:
 1453|   179k|{
 1454|       |
 1455|   179k|    WORD32 row, col, k;
 1456|   179k|    WORD32 two_nt, intra_pred_ang, idx;
 1457|   179k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1458|   179k|    WORD32 ref_main_idx, ref_idx;
 1459|   179k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 1];
 1460|   179k|    UWORD8 *ref_main;
 1461|   179k|    UNUSED(src_strd);
  ------------------
  |  |   38|   179k|#define UNUSED(x) ((void)(x))
  ------------------
 1462|   179k|    two_nt = 2 * nt;
 1463|   179k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1464|   179k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 12];
 1465|       |
 1466|       |    /* Intermediate reference samples for negative angle modes */
 1467|       |    /* This have to be removed during optimization*/
 1468|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1469|   179k|    ref_main = ref_temp + nt - 1;
 1470|  1.92M|    for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (1470:16): [True: 1.74M, False: 179k]
  ------------------
 1471|  1.74M|        ref_temp[k + nt - 1] = pu1_ref[two_nt + k];
 1472|       |
 1473|   179k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1474|   179k|    inv_ang_sum = 128;
 1475|       |
 1476|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1477|       |    /* For negative angled derive the main reference samples from side */
 1478|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1479|   697k|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1479:17): [True: 517k, False: 179k]
  ------------------
 1480|   517k|    {
 1481|   517k|        inv_ang_sum += inv_ang;
 1482|   517k|        ref_main[k] = pu1_ref[two_nt - (inv_ang_sum >> 8)];
 1483|   517k|    }
 1484|       |
 1485|  1.73M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1485:18): [True: 1.55M, False: 179k]
  ------------------
 1486|  1.55M|    {
 1487|  1.55M|        pos = ((row + 1) * intra_pred_ang);
 1488|  1.55M|        idx = pos >> 5;
 1489|  1.55M|        fract = pos & (31);
 1490|       |
 1491|       |        // Do linear filtering
 1492|  24.7M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1492:22): [True: 23.1M, False: 1.55M]
  ------------------
 1493|  23.1M|        {
 1494|  23.1M|            ref_main_idx = col + idx + 1;
 1495|  23.1M|            pu1_dst[(row * dst_strd) + col] = (UWORD8)(((32 - fract)
 1496|  23.1M|                            * ref_main[ref_main_idx]
 1497|  23.1M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5);
 1498|       |
 1499|  23.1M|        }
 1500|       |
 1501|  1.55M|    }
 1502|       |
 1503|   179k|}
ihevc_intra_pred_luma_mode_27_to_33:
 1551|   176k|{
 1552|   176k|    WORD32 row, col;
 1553|   176k|    WORD32 two_nt, pos, fract;
 1554|   176k|    WORD32 intra_pred_ang;
 1555|   176k|    WORD32 idx, ref_main_idx;
 1556|   176k|    UNUSED(src_strd);
  ------------------
  |  |   38|   176k|#define UNUSED(x) ((void)(x))
  ------------------
 1557|   176k|    two_nt = 2 * nt;
 1558|   176k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1559|       |
 1560|  1.70M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1560:18): [True: 1.53M, False: 176k]
  ------------------
 1561|  1.53M|    {
 1562|  1.53M|        pos = ((row + 1) * intra_pred_ang);
 1563|  1.53M|        idx = pos >> 5;
 1564|  1.53M|        fract = pos & (31);
 1565|       |
 1566|       |        // Do linear filtering
 1567|  25.4M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1567:22): [True: 23.9M, False: 1.53M]
  ------------------
 1568|  23.9M|        {
 1569|  23.9M|            ref_main_idx = two_nt + col + idx + 1;
 1570|  23.9M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1571|  23.9M|                            * pu1_ref[ref_main_idx]
 1572|  23.9M|                            + fract * pu1_ref[ref_main_idx + 1] + 16) >> 5);
 1573|  23.9M|        }
 1574|       |
 1575|  1.53M|    }
 1576|       |
 1577|   176k|}

ihevc_itrans_recon_4x4_ttype1:
  107|   362k|{
  108|   362k|    WORD32 i, c[4];
  109|   362k|    WORD32 add;
  110|   362k|    WORD32 shift;
  111|   362k|    WORD16 *pi2_tmp_orig;
  112|   362k|    WORD32 trans_size;
  113|   362k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   362k|#define UNUSED(x) ((void)(x))
  ------------------
  114|   362k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   362k|#define TRANS_SIZE_4   4
  ------------------
  115|       |
  116|   362k|    pi2_tmp_orig = pi2_tmp;
  117|       |
  118|       |    /* Inverse Transform 1st stage */
  119|   362k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   362k|#define IT_SHIFT_STAGE_1 7
  ------------------
  120|   362k|    add = 1 << (shift - 1);
  121|       |
  122|  1.81M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (122:16): [True: 1.45M, False: 362k]
  ------------------
  123|  1.45M|    {
  124|       |        /* Checking for Zero Cols */
  125|  1.45M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (125:12): [True: 469k, False: 981k]
  ------------------
  126|   469k|        {
  127|   469k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  128|   469k|        }
  129|   981k|        else
  130|   981k|        {
  131|       |            // Intermediate Variables
  132|   981k|            c[0] = pi2_src[0] + pi2_src[2 * src_strd];
  133|   981k|            c[1] = pi2_src[2 * src_strd] + pi2_src[3 * src_strd];
  134|   981k|            c[2] = pi2_src[0] - pi2_src[3 * src_strd];
  135|   981k|            c[3] = 74 * pi2_src[src_strd];
  136|       |
  137|   981k|            pi2_tmp[0] =
  138|   981k|                            CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|   981k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   981k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 18.7k, False: 963k]
  |  |  |  |  |  Branch (40:53): [True: 7.89k, False: 955k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|   981k|            pi2_tmp[1] =
  140|   981k|                            CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|   981k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   981k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.4k, False: 967k]
  |  |  |  |  |  Branch (40:53): [True: 11.8k, False: 955k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|   981k|            pi2_tmp[2] =
  142|   981k|                            CLIP_S16((74 * (pi2_src[0] - pi2_src[2 * src_strd] + pi2_src[3 * src_strd]) + add) >> shift);
  ------------------
  |  |   53|   981k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   981k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.6k, False: 968k]
  |  |  |  |  |  Branch (40:53): [True: 13.6k, False: 954k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|   981k|            pi2_tmp[3] =
  144|   981k|                            CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift);
  ------------------
  |  |   53|   981k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   981k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 19.5k, False: 962k]
  |  |  |  |  |  Branch (40:53): [True: 20.0k, False: 942k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|   981k|        }
  146|  1.45M|        pi2_src++;
  147|  1.45M|        pi2_tmp += trans_size;
  148|  1.45M|        zero_cols = zero_cols >> 1;
  149|  1.45M|    }
  150|       |
  151|   362k|    pi2_tmp = pi2_tmp_orig;
  152|       |
  153|       |    /* Inverse Transform 2nd stage */
  154|   362k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   362k|#define IT_SHIFT_STAGE_2 12
  ------------------
  155|   362k|    add = 1 << (shift - 1);
  156|       |
  157|  1.81M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (157:16): [True: 1.44M, False: 362k]
  ------------------
  158|  1.44M|    {
  159|  1.44M|        WORD32 itrans_out;
  160|       |        // Intermediate Variables
  161|  1.44M|        c[0] = pi2_tmp[0] + pi2_tmp[2 * trans_size];
  162|  1.44M|        c[1] = pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size];
  163|  1.44M|        c[2] = pi2_tmp[0] - pi2_tmp[3 * trans_size];
  164|  1.44M|        c[3] = 74 * pi2_tmp[trans_size];
  165|       |
  166|  1.44M|        itrans_out =
  167|  1.44M|                        CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|  1.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  1.44M|        pu1_dst[0] = CLIP_U8((itrans_out + pu1_pred[0]));
  ------------------
  |  |   40|  1.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 387k, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 240k, False: 820k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  1.44M|        itrans_out =
  170|  1.44M|                        CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|  1.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|  1.44M|        pu1_dst[1] = CLIP_U8((itrans_out + pu1_pred[1]));
  ------------------
  |  |   40|  1.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 331k, False: 1.11M]
  |  |  |  |  |  Branch (40:53): [True: 287k, False: 830k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|  1.44M|        itrans_out =
  173|  1.44M|                        CLIP_S16((74 * (pi2_tmp[0] - pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]) + add) >> shift);
  ------------------
  |  |   53|  1.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|  1.44M|        pu1_dst[2] = CLIP_U8((itrans_out + pu1_pred[2]));
  ------------------
  |  |   40|  1.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 376k, False: 1.07M]
  |  |  |  |  |  Branch (40:53): [True: 287k, False: 785k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|  1.44M|        itrans_out =
  176|  1.44M|                        CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift);
  ------------------
  |  |   53|  1.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  1.44M|        pu1_dst[3] = CLIP_U8((itrans_out + pu1_pred[3]));
  ------------------
  |  |   40|  1.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 387k, False: 1.06M]
  |  |  |  |  |  Branch (40:53): [True: 306k, False: 754k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  1.44M|        pi2_tmp++;
  179|  1.44M|        pu1_pred += pred_strd;
  180|  1.44M|        pu1_dst += dst_strd;
  181|  1.44M|    }
  182|   362k|}
ihevc_itrans_recon_4x4:
  243|  15.6k|{
  244|  15.6k|    WORD32 j;
  245|  15.6k|    WORD32 e[2], o[2];
  246|  15.6k|    WORD32 add;
  247|  15.6k|    WORD32 shift;
  248|  15.6k|    WORD16 *pi2_tmp_orig;
  249|  15.6k|    WORD32 trans_size;
  250|  15.6k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  15.6k|#define UNUSED(x) ((void)(x))
  ------------------
  251|  15.6k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  15.6k|#define TRANS_SIZE_4   4
  ------------------
  252|       |
  253|  15.6k|    pi2_tmp_orig = pi2_tmp;
  254|       |
  255|       |    /* Inverse Transform 1st stage */
  256|  15.6k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  15.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  257|  15.6k|    add = 1 << (shift - 1);
  258|       |
  259|  78.3k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (259:16): [True: 62.6k, False: 15.6k]
  ------------------
  260|  62.6k|    {
  261|       |        /* Checking for Zero Cols */
  262|  62.6k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (262:12): [True: 23.2k, False: 39.4k]
  ------------------
  263|  23.2k|        {
  264|  23.2k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  265|  23.2k|        }
  266|  39.4k|        else
  267|  39.4k|        {
  268|       |
  269|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  270|  39.4k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  271|  39.4k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  272|  39.4k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  273|  39.4k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  274|  39.4k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  275|  39.4k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  276|  39.4k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  277|  39.4k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  278|       |
  279|  39.4k|            pi2_tmp[0] =
  280|  39.4k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  39.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  39.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.04k, False: 34.3k]
  |  |  |  |  |  Branch (40:53): [True: 730, False: 33.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  39.4k|            pi2_tmp[1] =
  282|  39.4k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  39.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  39.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 807, False: 38.6k]
  |  |  |  |  |  Branch (40:53): [True: 1.35k, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  39.4k|            pi2_tmp[2] =
  284|  39.4k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  39.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  39.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 894, False: 38.5k]
  |  |  |  |  |  Branch (40:53): [True: 708, False: 37.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|  39.4k|            pi2_tmp[3] =
  286|  39.4k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  39.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  39.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 783, False: 38.6k]
  |  |  |  |  |  Branch (40:53): [True: 1.44k, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|       |
  288|  39.4k|        }
  289|  62.6k|        pi2_src++;
  290|  62.6k|        pi2_tmp += trans_size;
  291|  62.6k|        zero_cols = zero_cols >> 1;
  292|  62.6k|    }
  293|       |
  294|  15.6k|    pi2_tmp = pi2_tmp_orig;
  295|       |
  296|       |    /* Inverse Transform 2nd stage */
  297|  15.6k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  15.6k|#define IT_SHIFT_STAGE_2 12
  ------------------
  298|  15.6k|    add = 1 << (shift - 1);
  299|       |
  300|  78.3k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (300:16): [True: 62.6k, False: 15.6k]
  ------------------
  301|  62.6k|    {
  302|  62.6k|        WORD32 itrans_out;
  303|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  304|  62.6k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  305|  62.6k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  306|  62.6k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  307|  62.6k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  308|  62.6k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  309|  62.6k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  310|  62.6k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  311|  62.6k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  312|       |
  313|  62.6k|        itrans_out =
  314|  62.6k|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  62.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 62.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 62.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|  62.6k|        pu1_dst[0] = CLIP_U8((itrans_out + pu1_pred[0]));
  ------------------
  |  |   40|  62.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.3k, False: 48.2k]
  |  |  |  |  |  Branch (40:53): [True: 14.6k, False: 33.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  62.6k|        itrans_out =
  317|  62.6k|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  62.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 62.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 62.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  62.6k|        pu1_dst[1] = CLIP_U8((itrans_out + pu1_pred[1]));
  ------------------
  |  |   40|  62.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 10.9k, False: 51.6k]
  |  |  |  |  |  Branch (40:53): [True: 17.7k, False: 33.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|  62.6k|        itrans_out =
  320|  62.6k|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  62.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 62.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 62.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  62.6k|        pu1_dst[2] = CLIP_U8((itrans_out + pu1_pred[2]));
  ------------------
  |  |   40|  62.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.3k, False: 51.3k]
  |  |  |  |  |  Branch (40:53): [True: 15.2k, False: 36.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|  62.6k|        itrans_out =
  323|  62.6k|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  62.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 62.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 62.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  324|  62.6k|        pu1_dst[3] = CLIP_U8((itrans_out + pu1_pred[3]));
  ------------------
  |  |   40|  62.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  62.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 10.8k, False: 51.8k]
  |  |  |  |  |  Branch (40:53): [True: 17.0k, False: 34.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|       |
  326|  62.6k|        pi2_tmp++;
  327|  62.6k|        pu1_pred += pred_strd;
  328|  62.6k|        pu1_dst += dst_strd;
  329|       |
  330|  62.6k|    }
  331|  15.6k|}

ihevc_itrans_recon_16x16:
  106|   298k|{
  107|   298k|    WORD32 j, k;
  108|   298k|    WORD32 e[8], o[8];
  109|   298k|    WORD32 ee[4], eo[4];
  110|   298k|    WORD32 eee[2], eeo[2];
  111|   298k|    WORD32 add;
  112|   298k|    WORD32 shift;
  113|   298k|    WORD16 *pi2_tmp_orig;
  114|   298k|    WORD32 trans_size;
  115|   298k|    WORD32 zero_rows_2nd_stage = zero_cols;
  116|   298k|    WORD32 row_limit_2nd_stage;
  117|       |
  118|   298k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (118:8): [True: 125k, False: 172k]
  ------------------
  119|   125k|        row_limit_2nd_stage = 4;
  120|   172k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (120:13): [True: 84.2k, False: 88.6k]
  ------------------
  121|  84.2k|        row_limit_2nd_stage = 8;
  122|  88.6k|    else
  123|  88.6k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  88.6k|#define TRANS_SIZE_16 16
  ------------------
  124|       |
  125|   298k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   298k|#define TRANS_SIZE_16 16
  ------------------
  126|   298k|    pi2_tmp_orig = pi2_tmp;
  127|   298k|    if((zero_rows & 0xFFF0) == 0xFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (127:8): [True: 158k, False: 139k]
  ------------------
  128|   158k|    {
  129|       |        /* Inverse Transform 1st stage */
  130|       |        /************************************************************************************************/
  131|       |        /**********************************START - IT_RECON_16x16****************************************/
  132|       |        /************************************************************************************************/
  133|       |
  134|   158k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   158k|#define IT_SHIFT_STAGE_1 7
  ------------------
  135|   158k|        add = 1 << (shift - 1);
  136|       |
  137|  1.55M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (137:20): [True: 1.39M, False: 158k]
  ------------------
  138|  1.39M|        {
  139|       |            /* Checking for Zero Cols */
  140|  1.39M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (140:16): [True: 948k, False: 446k]
  ------------------
  141|   948k|            {
  142|   948k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  143|   948k|            }
  144|   446k|            else
  145|   446k|            {
  146|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  147|  4.10M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (147:28): [True: 3.65M, False: 446k]
  ------------------
  148|  3.65M|                {
  149|  3.65M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  150|  3.65M|                                    + g_ai2_ihevc_trans_16[3][k]
  151|  3.65M|                                                    * pi2_src[3 * src_strd];
  152|  3.65M|                }
  153|  2.27M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (153:28): [True: 1.83M, False: 446k]
  ------------------
  154|  1.83M|                {
  155|  1.83M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  156|  1.83M|                }
  157|   446k|                eeo[0] = 0;
  158|   446k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  159|   446k|                eeo[1] = 0;
  160|   446k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  161|       |
  162|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  163|  1.36M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (163:28): [True: 917k, False: 446k]
  ------------------
  164|   917k|                {
  165|   917k|                    ee[k] = eee[k] + eeo[k];
  166|   917k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  167|   917k|                }
  168|  2.28M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (168:28): [True: 1.84M, False: 446k]
  ------------------
  169|  1.84M|                {
  170|  1.84M|                    e[k] = ee[k] + eo[k];
  171|  1.84M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  172|  1.84M|                }
  173|  4.11M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (173:28): [True: 3.66M, False: 446k]
  ------------------
  174|  3.66M|                {
  175|  3.66M|                    pi2_tmp[k] =
  176|  3.66M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.51k, False: 3.66M]
  |  |  |  |  |  Branch (40:53): [True: 4.07k, False: 3.66M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  3.66M|                    pi2_tmp[k + 8] =
  178|  3.66M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.82k, False: 3.66M]
  |  |  |  |  |  Branch (40:53): [True: 3.67k, False: 3.66M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|  3.66M|                }
  180|   446k|            }
  181|  1.39M|            pi2_src++;
  182|  1.39M|            pi2_tmp += trans_size;
  183|  1.39M|            zero_cols = zero_cols >> 1;
  184|  1.39M|        }
  185|       |
  186|   158k|        pi2_tmp = pi2_tmp_orig;
  187|       |
  188|       |        /* Inverse Transform 2nd stage */
  189|   158k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   158k|#define IT_SHIFT_STAGE_2 12
  ------------------
  190|   158k|        add = 1 << (shift - 1);
  191|       |
  192|   158k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (192:12): [True: 58.9k, False: 99.7k]
  ------------------
  193|  58.9k|        {
  194|   967k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (194:24): [True: 908k, False: 58.9k]
  ------------------
  195|   908k|            {
  196|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  197|  8.17M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (197:28): [True: 7.26M, False: 908k]
  ------------------
  198|  7.26M|                {
  199|  7.26M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  200|  7.26M|                                    + g_ai2_ihevc_trans_16[3][k]
  201|  7.26M|                                                    * pi2_tmp[3 * trans_size];
  202|  7.26M|                }
  203|  4.53M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 3.63M, False: 908k]
  ------------------
  204|  3.63M|                {
  205|  3.63M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  206|  3.63M|                }
  207|   908k|                eeo[0] = 0;
  208|   908k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  209|   908k|                eeo[1] = 0;
  210|   908k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  211|       |
  212|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  213|  2.72M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (213:28): [True: 1.81M, False: 908k]
  ------------------
  214|  1.81M|                {
  215|  1.81M|                    ee[k] = eee[k] + eeo[k];
  216|  1.81M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  217|  1.81M|                }
  218|  4.54M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (218:28): [True: 3.64M, False: 908k]
  ------------------
  219|  3.64M|                {
  220|  3.64M|                    e[k] = ee[k] + eo[k];
  221|  3.64M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  222|  3.64M|                }
  223|  8.12M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (223:28): [True: 7.21M, False: 908k]
  ------------------
  224|  7.21M|                {
  225|  7.21M|                    WORD32 itrans_out;
  226|  7.21M|                    itrans_out =
  227|  7.21M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  7.21M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.21M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  7.21M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  7.21M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.46M, False: 5.74M]
  |  |  |  |  |  Branch (40:53): [True: 579k, False: 5.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  7.21M|                    itrans_out =
  230|  7.21M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  7.21M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.21M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  7.21M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  7.21M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.21M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.40M, False: 5.81M]
  |  |  |  |  |  Branch (40:53): [True: 591k, False: 5.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|  7.21M|                }
  233|   908k|                pi2_tmp++;
  234|   908k|                pu1_pred += pred_strd;
  235|   908k|                pu1_dst += dst_strd;
  236|   908k|            }
  237|  58.9k|        }
  238|  99.7k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (238:17): [True: 51.8k, False: 47.9k]
  ------------------
  239|  51.8k|        {
  240|   850k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (240:24): [True: 798k, False: 51.8k]
  ------------------
  241|   798k|            {
  242|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  243|  7.17M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (243:28): [True: 6.37M, False: 798k]
  ------------------
  244|  6.37M|                {
  245|  6.37M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  246|  6.37M|                                    + g_ai2_ihevc_trans_16[3][k]
  247|  6.37M|                                                    * pi2_tmp[3 * trans_size]
  248|  6.37M|                                    + g_ai2_ihevc_trans_16[5][k]
  249|  6.37M|                                                    * pi2_tmp[5 * trans_size]
  250|  6.37M|                                    + g_ai2_ihevc_trans_16[7][k]
  251|  6.37M|                                                    * pi2_tmp[7 * trans_size];
  252|  6.37M|                }
  253|  4.00M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (253:28): [True: 3.20M, False: 798k]
  ------------------
  254|  3.20M|                {
  255|  3.20M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  256|  3.20M|                                    + g_ai2_ihevc_trans_16[6][k]
  257|  3.20M|                                                    * pi2_tmp[6 * trans_size];
  258|  3.20M|                }
  259|   798k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  260|   798k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  261|   798k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  262|   798k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  263|       |
  264|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  265|  2.39M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (265:28): [True: 1.59M, False: 798k]
  ------------------
  266|  1.59M|                {
  267|  1.59M|                    ee[k] = eee[k] + eeo[k];
  268|  1.59M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  269|  1.59M|                }
  270|  3.99M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (270:28): [True: 3.19M, False: 798k]
  ------------------
  271|  3.19M|                {
  272|  3.19M|                    e[k] = ee[k] + eo[k];
  273|  3.19M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  274|  3.19M|                }
  275|  7.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (275:28): [True: 6.34M, False: 798k]
  ------------------
  276|  6.34M|                {
  277|  6.34M|                    WORD32 itrans_out;
  278|  6.34M|                    itrans_out =
  279|  6.34M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.34M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  280|  6.34M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  6.34M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 739k, False: 5.60M]
  |  |  |  |  |  Branch (40:53): [True: 246k, False: 5.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  6.34M|                    itrans_out =
  282|  6.34M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  6.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.34M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|  6.34M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  6.34M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 672k, False: 5.67M]
  |  |  |  |  |  Branch (40:53): [True: 264k, False: 5.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  6.34M|                }
  285|   798k|                pi2_tmp++;
  286|   798k|                pu1_pred += pred_strd;
  287|   798k|                pu1_dst += dst_strd;
  288|   798k|            }
  289|  51.8k|        }
  290|  47.9k|        else /* All rows of output of 1st stage are non-zero */
  291|  47.9k|        {
  292|   756k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (292:24): [True: 708k, False: 47.9k]
  ------------------
  293|   708k|            {
  294|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  295|  6.35M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (295:28): [True: 5.64M, False: 708k]
  ------------------
  296|  5.64M|                {
  297|  5.64M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  298|  5.64M|                                    + g_ai2_ihevc_trans_16[3][k]
  299|  5.64M|                                                    * pi2_tmp[3 * trans_size]
  300|  5.64M|                                    + g_ai2_ihevc_trans_16[5][k]
  301|  5.64M|                                                    * pi2_tmp[5 * trans_size]
  302|  5.64M|                                    + g_ai2_ihevc_trans_16[7][k]
  303|  5.64M|                                                    * pi2_tmp[7 * trans_size]
  304|  5.64M|                                    + g_ai2_ihevc_trans_16[9][k]
  305|  5.64M|                                                    * pi2_tmp[9 * trans_size]
  306|  5.64M|                                    + g_ai2_ihevc_trans_16[11][k]
  307|  5.64M|                                                    * pi2_tmp[11 * trans_size]
  308|  5.64M|                                    + g_ai2_ihevc_trans_16[13][k]
  309|  5.64M|                                                    * pi2_tmp[13 * trans_size]
  310|  5.64M|                                    + g_ai2_ihevc_trans_16[15][k]
  311|  5.64M|                                                    * pi2_tmp[15 * trans_size];
  312|  5.64M|                }
  313|  3.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (313:28): [True: 2.89M, False: 708k]
  ------------------
  314|  2.89M|                {
  315|  2.89M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  316|  2.89M|                                    + g_ai2_ihevc_trans_16[6][k]
  317|  2.89M|                                                    * pi2_tmp[6 * trans_size]
  318|  2.89M|                                    + g_ai2_ihevc_trans_16[10][k]
  319|  2.89M|                                                    * pi2_tmp[10 * trans_size]
  320|  2.89M|                                    + g_ai2_ihevc_trans_16[14][k]
  321|  2.89M|                                                    * pi2_tmp[14 * trans_size];
  322|  2.89M|                }
  323|   708k|                eeo[0] =
  324|   708k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  325|   708k|                                                + g_ai2_ihevc_trans_16[12][0]
  326|   708k|                                                                * pi2_tmp[12
  327|   708k|                                                                                * trans_size];
  328|   708k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  329|   708k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  330|   708k|                eeo[1] =
  331|   708k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  332|   708k|                                                + g_ai2_ihevc_trans_16[12][1]
  333|   708k|                                                                * pi2_tmp[12
  334|   708k|                                                                                * trans_size];
  335|   708k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  336|   708k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  337|       |
  338|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  339|  2.14M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (339:28): [True: 1.43M, False: 708k]
  ------------------
  340|  1.43M|                {
  341|  1.43M|                    ee[k] = eee[k] + eeo[k];
  342|  1.43M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  343|  1.43M|                }
  344|  3.56M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (344:28): [True: 2.85M, False: 708k]
  ------------------
  345|  2.85M|                {
  346|  2.85M|                    e[k] = ee[k] + eo[k];
  347|  2.85M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  348|  2.85M|                }
  349|  6.31M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (349:28): [True: 5.60M, False: 708k]
  ------------------
  350|  5.60M|                {
  351|  5.60M|                    WORD32 itrans_out;
  352|  5.60M|                    itrans_out =
  353|  5.60M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|  5.60M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  5.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.16M, False: 3.44M]
  |  |  |  |  |  Branch (40:53): [True: 130k, False: 3.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  5.60M|                    itrans_out =
  356|  5.60M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  5.60M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.60M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  5.60M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  5.60M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.60M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.03M, False: 4.57M]
  |  |  |  |  |  Branch (40:53): [True: 123k, False: 4.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|  5.60M|                }
  359|   708k|                pi2_tmp++;
  360|   708k|                pu1_pred += pred_strd;
  361|   708k|                pu1_dst += dst_strd;
  362|   708k|            }
  363|  47.9k|        }
  364|       |        /************************************************************************************************/
  365|       |        /************************************END - IT_RECON_16x16****************************************/
  366|       |        /************************************************************************************************/
  367|   158k|    }
  368|   139k|    else if((zero_rows & 0xFF00) == 0xFF00)  /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (368:13): [True: 72.8k, False: 66.9k]
  ------------------
  369|  72.8k|    {
  370|       |        /* Inverse Transform 1st stage */
  371|       |        /************************************************************************************************/
  372|       |        /**********************************START - IT_RECON_16x16****************************************/
  373|       |        /************************************************************************************************/
  374|       |
  375|  72.8k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  72.8k|#define IT_SHIFT_STAGE_1 7
  ------------------
  376|  72.8k|        add = 1 << (shift - 1);
  377|       |
  378|   618k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (378:20): [True: 545k, False: 72.8k]
  ------------------
  379|   545k|        {
  380|       |            /* Checking for Zero Cols */
  381|   545k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (381:16): [True: 283k, False: 261k]
  ------------------
  382|   283k|            {
  383|   283k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  384|   283k|            }
  385|   261k|            else
  386|   261k|            {
  387|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  388|  2.37M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (388:28): [True: 2.11M, False: 261k]
  ------------------
  389|  2.11M|                {
  390|  2.11M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  391|  2.11M|                                    + g_ai2_ihevc_trans_16[3][k]
  392|  2.11M|                                                    * pi2_src[3 * src_strd]
  393|  2.11M|                                    + g_ai2_ihevc_trans_16[5][k]
  394|  2.11M|                                                    * pi2_src[5 * src_strd]
  395|  2.11M|                                    + g_ai2_ihevc_trans_16[7][k]
  396|  2.11M|                                                    * pi2_src[7 * src_strd];
  397|  2.11M|                }
  398|  1.32M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (398:28): [True: 1.06M, False: 261k]
  ------------------
  399|  1.06M|                {
  400|  1.06M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  401|  1.06M|                                    + g_ai2_ihevc_trans_16[6][k]
  402|  1.06M|                                                    * pi2_src[6 * src_strd];
  403|  1.06M|                }
  404|   261k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  405|   261k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  406|   261k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  407|   261k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  408|       |
  409|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  410|   792k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (410:28): [True: 530k, False: 261k]
  ------------------
  411|   530k|                {
  412|   530k|                    ee[k] = eee[k] + eeo[k];
  413|   530k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  414|   530k|                }
  415|  1.32M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (415:28): [True: 1.06M, False: 261k]
  ------------------
  416|  1.06M|                {
  417|  1.06M|                    e[k] = ee[k] + eo[k];
  418|  1.06M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  419|  1.06M|                }
  420|  2.38M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (420:28): [True: 2.12M, False: 261k]
  ------------------
  421|  2.12M|                {
  422|  2.12M|                    pi2_tmp[k] =
  423|  2.12M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.12M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.12M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.7k, False: 2.10M]
  |  |  |  |  |  Branch (40:53): [True: 12.7k, False: 2.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  2.12M|                    pi2_tmp[k + 8] =
  425|  2.12M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.12M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.12M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 12.3k, False: 2.10M]
  |  |  |  |  |  Branch (40:53): [True: 12.2k, False: 2.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  426|  2.12M|                }
  427|   261k|            }
  428|   545k|            pi2_src++;
  429|   545k|            pi2_tmp += trans_size;
  430|   545k|            zero_cols = zero_cols >> 1;
  431|   545k|        }
  432|       |
  433|  72.8k|        pi2_tmp = pi2_tmp_orig;
  434|       |
  435|       |        /* Inverse Transform 2nd stage */
  436|  72.8k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  72.8k|#define IT_SHIFT_STAGE_2 12
  ------------------
  437|  72.8k|        add = 1 << (shift - 1);
  438|       |
  439|  72.8k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (439:12): [True: 38.6k, False: 34.1k]
  ------------------
  440|  38.6k|        {
  441|   637k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (441:24): [True: 598k, False: 38.6k]
  ------------------
  442|   598k|            {
  443|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  444|  5.38M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (444:28): [True: 4.78M, False: 598k]
  ------------------
  445|  4.78M|                {
  446|  4.78M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  447|  4.78M|                                    + g_ai2_ihevc_trans_16[3][k]
  448|  4.78M|                                                    * pi2_tmp[3 * trans_size];
  449|  4.78M|                }
  450|  2.98M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (450:28): [True: 2.38M, False: 598k]
  ------------------
  451|  2.38M|                {
  452|  2.38M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  453|  2.38M|                }
  454|   598k|                eeo[0] = 0;
  455|   598k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  456|   598k|                eeo[1] = 0;
  457|   598k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  458|       |
  459|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  460|  1.79M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (460:28): [True: 1.19M, False: 598k]
  ------------------
  461|  1.19M|                {
  462|  1.19M|                    ee[k] = eee[k] + eeo[k];
  463|  1.19M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  464|  1.19M|                }
  465|  2.99M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (465:28): [True: 2.39M, False: 598k]
  ------------------
  466|  2.39M|                {
  467|  2.39M|                    e[k] = ee[k] + eo[k];
  468|  2.39M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  469|  2.39M|                }
  470|  5.34M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (470:28): [True: 4.74M, False: 598k]
  ------------------
  471|  4.74M|                {
  472|  4.74M|                    WORD32 itrans_out;
  473|  4.74M|                    itrans_out =
  474|  4.74M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|  4.74M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.74M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.32M, False: 3.42M]
  |  |  |  |  |  Branch (40:53): [True: 632k, False: 2.78M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|  4.74M|                    itrans_out =
  477|  4.74M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  4.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  4.74M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  4.74M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.30M, False: 3.44M]
  |  |  |  |  |  Branch (40:53): [True: 644k, False: 2.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  479|  4.74M|                }
  480|   598k|                pi2_tmp++;
  481|   598k|                pu1_pred += pred_strd;
  482|   598k|                pu1_dst += dst_strd;
  483|   598k|            }
  484|  38.6k|        }
  485|  34.1k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (485:17): [True: 18.9k, False: 15.1k]
  ------------------
  486|  18.9k|        {
  487|   313k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (487:24): [True: 294k, False: 18.9k]
  ------------------
  488|   294k|            {
  489|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  490|  2.64M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (490:28): [True: 2.35M, False: 294k]
  ------------------
  491|  2.35M|                {
  492|  2.35M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  493|  2.35M|                                    + g_ai2_ihevc_trans_16[3][k]
  494|  2.35M|                                                    * pi2_tmp[3 * trans_size]
  495|  2.35M|                                    + g_ai2_ihevc_trans_16[5][k]
  496|  2.35M|                                                    * pi2_tmp[5 * trans_size]
  497|  2.35M|                                    + g_ai2_ihevc_trans_16[7][k]
  498|  2.35M|                                                    * pi2_tmp[7 * trans_size];
  499|  2.35M|                }
  500|  1.47M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (500:28): [True: 1.18M, False: 294k]
  ------------------
  501|  1.18M|                {
  502|  1.18M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  503|  1.18M|                                    + g_ai2_ihevc_trans_16[6][k]
  504|  1.18M|                                                    * pi2_tmp[6 * trans_size];
  505|  1.18M|                }
  506|   294k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  507|   294k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  508|   294k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  509|   294k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  510|       |
  511|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  512|   882k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (512:28): [True: 588k, False: 294k]
  ------------------
  513|   588k|                {
  514|   588k|                    ee[k] = eee[k] + eeo[k];
  515|   588k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  516|   588k|                }
  517|  1.47M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (517:28): [True: 1.17M, False: 294k]
  ------------------
  518|  1.17M|                {
  519|  1.17M|                    e[k] = ee[k] + eo[k];
  520|  1.17M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  521|  1.17M|                }
  522|  2.63M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (522:28): [True: 2.34M, False: 294k]
  ------------------
  523|  2.34M|                {
  524|  2.34M|                    WORD32 itrans_out;
  525|  2.34M|                    itrans_out =
  526|  2.34M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.34M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  527|  2.34M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  2.34M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 429k, False: 1.91M]
  |  |  |  |  |  Branch (40:53): [True: 160k, False: 1.75M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|  2.34M|                    itrans_out =
  529|  2.34M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.34M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  530|  2.34M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  2.34M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 386k, False: 1.95M]
  |  |  |  |  |  Branch (40:53): [True: 163k, False: 1.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|  2.34M|                }
  532|   294k|                pi2_tmp++;
  533|   294k|                pu1_pred += pred_strd;
  534|   294k|                pu1_dst += dst_strd;
  535|   294k|            }
  536|  18.9k|        }
  537|  15.1k|        else /* All rows of output of 1st stage are non-zero */
  538|  15.1k|        {
  539|   252k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (539:24): [True: 237k, False: 15.1k]
  ------------------
  540|   237k|            {
  541|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  542|  2.13M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (542:28): [True: 1.89M, False: 237k]
  ------------------
  543|  1.89M|                {
  544|  1.89M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  545|  1.89M|                                    + g_ai2_ihevc_trans_16[3][k]
  546|  1.89M|                                                    * pi2_tmp[3 * trans_size]
  547|  1.89M|                                    + g_ai2_ihevc_trans_16[5][k]
  548|  1.89M|                                                    * pi2_tmp[5 * trans_size]
  549|  1.89M|                                    + g_ai2_ihevc_trans_16[7][k]
  550|  1.89M|                                                    * pi2_tmp[7 * trans_size]
  551|  1.89M|                                    + g_ai2_ihevc_trans_16[9][k]
  552|  1.89M|                                                    * pi2_tmp[9 * trans_size]
  553|  1.89M|                                    + g_ai2_ihevc_trans_16[11][k]
  554|  1.89M|                                                    * pi2_tmp[11 * trans_size]
  555|  1.89M|                                    + g_ai2_ihevc_trans_16[13][k]
  556|  1.89M|                                                    * pi2_tmp[13 * trans_size]
  557|  1.89M|                                    + g_ai2_ihevc_trans_16[15][k]
  558|  1.89M|                                                    * pi2_tmp[15 * trans_size];
  559|  1.89M|                }
  560|  1.19M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (560:28): [True: 960k, False: 237k]
  ------------------
  561|   960k|                {
  562|   960k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  563|   960k|                                    + g_ai2_ihevc_trans_16[6][k]
  564|   960k|                                                    * pi2_tmp[6 * trans_size]
  565|   960k|                                    + g_ai2_ihevc_trans_16[10][k]
  566|   960k|                                                    * pi2_tmp[10 * trans_size]
  567|   960k|                                    + g_ai2_ihevc_trans_16[14][k]
  568|   960k|                                                    * pi2_tmp[14 * trans_size];
  569|   960k|                }
  570|   237k|                eeo[0] =
  571|   237k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  572|   237k|                                                + g_ai2_ihevc_trans_16[12][0]
  573|   237k|                                                                * pi2_tmp[12
  574|   237k|                                                                                * trans_size];
  575|   237k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  576|   237k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  577|   237k|                eeo[1] =
  578|   237k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  579|   237k|                                                + g_ai2_ihevc_trans_16[12][1]
  580|   237k|                                                                * pi2_tmp[12
  581|   237k|                                                                                * trans_size];
  582|   237k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  583|   237k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  584|       |
  585|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  586|   716k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (586:28): [True: 479k, False: 237k]
  ------------------
  587|   479k|                {
  588|   479k|                    ee[k] = eee[k] + eeo[k];
  589|   479k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  590|   479k|                }
  591|  1.19M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (591:28): [True: 959k, False: 237k]
  ------------------
  592|   959k|                {
  593|   959k|                    e[k] = ee[k] + eo[k];
  594|   959k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  595|   959k|                }
  596|  2.13M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (596:28): [True: 1.89M, False: 237k]
  ------------------
  597|  1.89M|                {
  598|  1.89M|                    WORD32 itrans_out;
  599|  1.89M|                    itrans_out =
  600|  1.89M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.89M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.89M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.89M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|  1.89M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  1.89M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 669k, False: 1.22M]
  |  |  |  |  |  Branch (40:53): [True: 279k, False: 947k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|  1.89M|                    itrans_out =
  603|  1.89M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.89M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.89M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.89M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|  1.89M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  1.89M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 556k, False: 1.33M]
  |  |  |  |  |  Branch (40:53): [True: 279k, False: 1.05M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  1.89M|                }
  606|   237k|                pi2_tmp++;
  607|   237k|                pu1_pred += pred_strd;
  608|   237k|                pu1_dst += dst_strd;
  609|   237k|            }
  610|  15.1k|        }
  611|       |        /************************************************************************************************/
  612|       |        /************************************END - IT_RECON_16x16****************************************/
  613|       |        /************************************************************************************************/
  614|  72.8k|    }
  615|  66.9k|    else  /* All rows of input are non-zero */
  616|  66.9k|    {
  617|       |        /* Inverse Transform 1st stage */
  618|       |        /************************************************************************************************/
  619|       |        /**********************************START - IT_RECON_16x16****************************************/
  620|       |        /************************************************************************************************/
  621|       |
  622|  66.9k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  66.9k|#define IT_SHIFT_STAGE_1 7
  ------------------
  623|  66.9k|        add = 1 << (shift - 1);
  624|       |
  625|   690k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (625:20): [True: 624k, False: 66.9k]
  ------------------
  626|   624k|        {
  627|       |            /* Checking for Zero Cols */
  628|   624k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (628:16): [True: 259k, False: 364k]
  ------------------
  629|   259k|            {
  630|   259k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  631|   259k|            }
  632|   364k|            else
  633|   364k|            {
  634|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  635|  3.29M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (635:28): [True: 2.93M, False: 364k]
  ------------------
  636|  2.93M|                {
  637|  2.93M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  638|  2.93M|                                    + g_ai2_ihevc_trans_16[3][k]
  639|  2.93M|                                                    * pi2_src[3 * src_strd]
  640|  2.93M|                                    + g_ai2_ihevc_trans_16[5][k]
  641|  2.93M|                                                    * pi2_src[5 * src_strd]
  642|  2.93M|                                    + g_ai2_ihevc_trans_16[7][k]
  643|  2.93M|                                                    * pi2_src[7 * src_strd]
  644|  2.93M|                                    + g_ai2_ihevc_trans_16[9][k]
  645|  2.93M|                                                    * pi2_src[9 * src_strd]
  646|  2.93M|                                    + g_ai2_ihevc_trans_16[11][k]
  647|  2.93M|                                                    * pi2_src[11 * src_strd]
  648|  2.93M|                                    + g_ai2_ihevc_trans_16[13][k]
  649|  2.93M|                                                    * pi2_src[13 * src_strd]
  650|  2.93M|                                    + g_ai2_ihevc_trans_16[15][k]
  651|  2.93M|                                                    * pi2_src[15 * src_strd];
  652|  2.93M|                }
  653|  1.84M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (653:28): [True: 1.47M, False: 364k]
  ------------------
  654|  1.47M|                {
  655|  1.47M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  656|  1.47M|                                    + g_ai2_ihevc_trans_16[6][k]
  657|  1.47M|                                                    * pi2_src[6 * src_strd]
  658|  1.47M|                                    + g_ai2_ihevc_trans_16[10][k]
  659|  1.47M|                                                    * pi2_src[10 * src_strd]
  660|  1.47M|                                    + g_ai2_ihevc_trans_16[14][k]
  661|  1.47M|                                                    * pi2_src[14 * src_strd];
  662|  1.47M|                }
  663|   364k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  664|   364k|                                + g_ai2_ihevc_trans_16[12][0]
  665|   364k|                                                * pi2_src[12 * src_strd];
  666|   364k|                eee[0] =
  667|   364k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  668|   364k|                                                + g_ai2_ihevc_trans_16[8][0]
  669|   364k|                                                                * pi2_src[8
  670|   364k|                                                                                * src_strd];
  671|   364k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  672|   364k|                                + g_ai2_ihevc_trans_16[12][1]
  673|   364k|                                                * pi2_src[12 * src_strd];
  674|   364k|                eee[1] =
  675|   364k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  676|   364k|                                                + g_ai2_ihevc_trans_16[8][1]
  677|   364k|                                                                * pi2_src[8
  678|   364k|                                                                                * src_strd];
  679|       |
  680|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  681|  1.10M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (681:28): [True: 736k, False: 364k]
  ------------------
  682|   736k|                {
  683|   736k|                    ee[k] = eee[k] + eeo[k];
  684|   736k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  685|   736k|                }
  686|  1.83M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (686:28): [True: 1.47M, False: 364k]
  ------------------
  687|  1.47M|                {
  688|  1.47M|                    e[k] = ee[k] + eo[k];
  689|  1.47M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  690|  1.47M|                }
  691|  3.30M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (691:28): [True: 2.93M, False: 364k]
  ------------------
  692|  2.93M|                {
  693|  2.93M|                    pi2_tmp[k] =
  694|  2.93M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.93M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 44.9k, False: 2.89M]
  |  |  |  |  |  Branch (40:53): [True: 45.1k, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  2.93M|                    pi2_tmp[k + 8] =
  696|  2.93M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.93M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 40.4k, False: 2.89M]
  |  |  |  |  |  Branch (40:53): [True: 39.8k, False: 2.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  697|  2.93M|                }
  698|   364k|            }
  699|   624k|            pi2_src++;
  700|   624k|            pi2_tmp += trans_size;
  701|   624k|            zero_cols = zero_cols >> 1;
  702|   624k|        }
  703|       |
  704|  66.9k|        pi2_tmp = pi2_tmp_orig;
  705|       |
  706|       |        /* Inverse Transform 2nd stage */
  707|  66.9k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  66.9k|#define IT_SHIFT_STAGE_2 12
  ------------------
  708|  66.9k|        add = 1 << (shift - 1);
  709|       |
  710|  66.9k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (710:12): [True: 28.1k, False: 38.8k]
  ------------------
  711|  28.1k|        {
  712|   460k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (712:24): [True: 432k, False: 28.1k]
  ------------------
  713|   432k|            {
  714|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  715|  3.89M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (715:28): [True: 3.45M, False: 432k]
  ------------------
  716|  3.45M|                {
  717|  3.45M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  718|  3.45M|                                    + g_ai2_ihevc_trans_16[3][k]
  719|  3.45M|                                                    * pi2_tmp[3 * trans_size];
  720|  3.45M|                }
  721|  2.16M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (721:28): [True: 1.73M, False: 432k]
  ------------------
  722|  1.73M|                {
  723|  1.73M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  724|  1.73M|                }
  725|   432k|                eeo[0] = 0;
  726|   432k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  727|   432k|                eeo[1] = 0;
  728|   432k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  729|       |
  730|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  731|  1.29M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (731:28): [True: 865k, False: 432k]
  ------------------
  732|   865k|                {
  733|   865k|                    ee[k] = eee[k] + eeo[k];
  734|   865k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  735|   865k|                }
  736|  2.16M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (736:28): [True: 1.73M, False: 432k]
  ------------------
  737|  1.73M|                {
  738|  1.73M|                    e[k] = ee[k] + eo[k];
  739|  1.73M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  740|  1.73M|                }
  741|  3.87M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (741:28): [True: 3.44M, False: 432k]
  ------------------
  742|  3.44M|                {
  743|  3.44M|                    WORD32 itrans_out;
  744|  3.44M|                    itrans_out =
  745|  3.44M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|  3.44M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  3.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.01M, False: 2.42M]
  |  |  |  |  |  Branch (40:53): [True: 879k, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  3.44M|                    itrans_out =
  748|  3.44M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|  3.44M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  3.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 935k, False: 2.50M]
  |  |  |  |  |  Branch (40:53): [True: 929k, False: 1.57M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  750|  3.44M|                }
  751|   432k|                pi2_tmp++;
  752|   432k|                pu1_pred += pred_strd;
  753|   432k|                pu1_dst += dst_strd;
  754|   432k|            }
  755|  28.1k|        }
  756|  38.8k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (756:17): [True: 13.6k, False: 25.1k]
  ------------------
  757|  13.6k|        {
  758|   224k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (758:24): [True: 211k, False: 13.6k]
  ------------------
  759|   211k|            {
  760|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  761|  1.89M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (761:28): [True: 1.68M, False: 211k]
  ------------------
  762|  1.68M|                {
  763|  1.68M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  764|  1.68M|                                    + g_ai2_ihevc_trans_16[3][k]
  765|  1.68M|                                                    * pi2_tmp[3 * trans_size]
  766|  1.68M|                                    + g_ai2_ihevc_trans_16[5][k]
  767|  1.68M|                                                    * pi2_tmp[5 * trans_size]
  768|  1.68M|                                    + g_ai2_ihevc_trans_16[7][k]
  769|  1.68M|                                                    * pi2_tmp[7 * trans_size];
  770|  1.68M|                }
  771|  1.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (771:28): [True: 845k, False: 211k]
  ------------------
  772|   845k|                {
  773|   845k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  774|   845k|                                    + g_ai2_ihevc_trans_16[6][k]
  775|   845k|                                                    * pi2_tmp[6 * trans_size];
  776|   845k|                }
  777|   211k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  778|   211k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  779|   211k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  780|   211k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  781|       |
  782|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  783|   634k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (783:28): [True: 423k, False: 211k]
  ------------------
  784|   423k|                {
  785|   423k|                    ee[k] = eee[k] + eeo[k];
  786|   423k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  787|   423k|                }
  788|  1.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (788:28): [True: 846k, False: 211k]
  ------------------
  789|   846k|                {
  790|   846k|                    e[k] = ee[k] + eo[k];
  791|   846k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  792|   846k|                }
  793|  1.89M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (793:28): [True: 1.67M, False: 211k]
  ------------------
  794|  1.67M|                {
  795|  1.67M|                    WORD32 itrans_out;
  796|  1.67M|                    itrans_out =
  797|  1.67M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.67M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.67M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  798|  1.67M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  1.67M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 474k, False: 1.20M]
  |  |  |  |  |  Branch (40:53): [True: 390k, False: 815k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|  1.67M|                    itrans_out =
  800|  1.67M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.67M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.67M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|  1.67M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  1.67M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 484k, False: 1.19M]
  |  |  |  |  |  Branch (40:53): [True: 394k, False: 800k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  802|  1.67M|                }
  803|   211k|                pi2_tmp++;
  804|   211k|                pu1_pred += pred_strd;
  805|   211k|                pu1_dst += dst_strd;
  806|   211k|            }
  807|  13.6k|        }
  808|  25.1k|        else /* All rows of output of 1st stage are non-zero */
  809|  25.1k|        {
  810|   417k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (810:24): [True: 392k, False: 25.1k]
  ------------------
  811|   392k|            {
  812|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  813|  3.53M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (813:28): [True: 3.13M, False: 392k]
  ------------------
  814|  3.13M|                {
  815|  3.13M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  816|  3.13M|                                    + g_ai2_ihevc_trans_16[3][k]
  817|  3.13M|                                                    * pi2_tmp[3 * trans_size]
  818|  3.13M|                                    + g_ai2_ihevc_trans_16[5][k]
  819|  3.13M|                                                    * pi2_tmp[5 * trans_size]
  820|  3.13M|                                    + g_ai2_ihevc_trans_16[7][k]
  821|  3.13M|                                                    * pi2_tmp[7 * trans_size]
  822|  3.13M|                                    + g_ai2_ihevc_trans_16[9][k]
  823|  3.13M|                                                    * pi2_tmp[9 * trans_size]
  824|  3.13M|                                    + g_ai2_ihevc_trans_16[11][k]
  825|  3.13M|                                                    * pi2_tmp[11 * trans_size]
  826|  3.13M|                                    + g_ai2_ihevc_trans_16[13][k]
  827|  3.13M|                                                    * pi2_tmp[13 * trans_size]
  828|  3.13M|                                    + g_ai2_ihevc_trans_16[15][k]
  829|  3.13M|                                                    * pi2_tmp[15 * trans_size];
  830|  3.13M|                }
  831|  1.96M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (831:28): [True: 1.57M, False: 392k]
  ------------------
  832|  1.57M|                {
  833|  1.57M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  834|  1.57M|                                    + g_ai2_ihevc_trans_16[6][k]
  835|  1.57M|                                                    * pi2_tmp[6 * trans_size]
  836|  1.57M|                                    + g_ai2_ihevc_trans_16[10][k]
  837|  1.57M|                                                    * pi2_tmp[10 * trans_size]
  838|  1.57M|                                    + g_ai2_ihevc_trans_16[14][k]
  839|  1.57M|                                                    * pi2_tmp[14 * trans_size];
  840|  1.57M|                }
  841|   392k|                eeo[0] =
  842|   392k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  843|   392k|                                                + g_ai2_ihevc_trans_16[12][0]
  844|   392k|                                                                * pi2_tmp[12
  845|   392k|                                                                                * trans_size];
  846|   392k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  847|   392k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  848|   392k|                eeo[1] =
  849|   392k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  850|   392k|                                                + g_ai2_ihevc_trans_16[12][1]
  851|   392k|                                                                * pi2_tmp[12
  852|   392k|                                                                                * trans_size];
  853|   392k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  854|   392k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  855|       |
  856|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  857|  1.18M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (857:28): [True: 787k, False: 392k]
  ------------------
  858|   787k|                {
  859|   787k|                    ee[k] = eee[k] + eeo[k];
  860|   787k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  861|   787k|                }
  862|  1.96M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (862:28): [True: 1.57M, False: 392k]
  ------------------
  863|  1.57M|                {
  864|  1.57M|                    e[k] = ee[k] + eo[k];
  865|  1.57M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  866|  1.57M|                }
  867|  3.50M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (867:28): [True: 3.11M, False: 392k]
  ------------------
  868|  3.11M|                {
  869|  3.11M|                    WORD32 itrans_out;
  870|  3.11M|                    itrans_out =
  871|  3.11M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.11M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.11M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.11M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  872|  3.11M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  3.11M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.11M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 917k, False: 2.19M]
  |  |  |  |  |  Branch (40:53): [True: 689k, False: 1.50M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  873|  3.11M|                    itrans_out =
  874|  3.11M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.11M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.11M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.11M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|  3.11M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  3.11M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  3.11M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 876k, False: 2.23M]
  |  |  |  |  |  Branch (40:53): [True: 709k, False: 1.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  3.11M|                }
  877|   392k|                pi2_tmp++;
  878|   392k|                pu1_pred += pred_strd;
  879|   392k|                pu1_dst += dst_strd;
  880|   392k|            }
  881|  25.1k|        }
  882|       |        /************************************************************************************************/
  883|       |        /************************************END - IT_RECON_16x16****************************************/
  884|       |        /************************************************************************************************/
  885|  66.9k|    }
  886|       |
  887|   298k|}

ihevc_itrans_recon_32x32:
  107|   142k|{
  108|   142k|    WORD32 j, k;
  109|   142k|    WORD32 e[16], o[16];
  110|   142k|    WORD32 ee[8], eo[8];
  111|   142k|    WORD32 eee[4], eeo[4];
  112|   142k|    WORD32 eeee[2], eeeo[2];
  113|   142k|    WORD32 add;
  114|   142k|    WORD32 shift;
  115|   142k|    WORD16 *pi2_tmp_orig;
  116|   142k|    WORD32 trans_size;
  117|   142k|    WORD32 zero_rows_2nd_stage = zero_cols;
  118|   142k|    WORD32 row_limit_2nd_stage;
  119|       |
  120|   142k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|   142k|#define TRANS_SIZE_32 32
  ------------------
  121|   142k|    pi2_tmp_orig = pi2_tmp;
  122|       |
  123|   142k|    if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0)
  ------------------
  |  Branch (123:8): [True: 65.9k, False: 76.6k]
  ------------------
  124|  65.9k|        row_limit_2nd_stage = 4;
  125|  76.6k|    else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00)
  ------------------
  |  Branch (125:13): [True: 42.0k, False: 34.6k]
  ------------------
  126|  42.0k|        row_limit_2nd_stage = 8;
  127|  34.6k|    else
  128|  34.6k|        row_limit_2nd_stage = TRANS_SIZE_32;
  ------------------
  |  |  432|  34.6k|#define TRANS_SIZE_32 32
  ------------------
  129|       |
  130|   142k|    if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (130:8): [True: 67.4k, False: 75.1k]
  ------------------
  131|  67.4k|    {
  132|       |        /************************************************************************************************/
  133|       |        /**********************************START - IT_RECON_32x32****************************************/
  134|       |        /************************************************************************************************/
  135|       |        /* Inverse Transform 1st stage */
  136|  67.4k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  67.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  137|  67.4k|        add = 1 << (shift - 1);
  138|       |
  139|   834k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (139:20): [True: 766k, False: 67.4k]
  ------------------
  140|   766k|        {
  141|       |            /* Checking for Zero Cols */
  142|   766k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (142:16): [True: 601k, False: 165k]
  ------------------
  143|   601k|            {
  144|   601k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  145|   601k|            }
  146|   165k|            else
  147|   165k|            {
  148|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  149|  2.82M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (149:28): [True: 2.65M, False: 165k]
  ------------------
  150|  2.65M|                {
  151|  2.65M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  152|  2.65M|                                    + g_ai2_ihevc_trans_32[3][k]
  153|  2.65M|                                                    * pi2_src[3 * src_strd];
  154|  2.65M|                }
  155|  1.49M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (155:28): [True: 1.33M, False: 165k]
  ------------------
  156|  1.33M|                {
  157|  1.33M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd];
  158|  1.33M|                }
  159|       |//                for(k = 0; k < 4; k++)
  160|   165k|                {
  161|   165k|                    eeo[0] = 0;
  162|   165k|                    eeo[1] = 0;
  163|   165k|                    eeo[2] = 0;
  164|   165k|                    eeo[3] = 0;
  165|   165k|                }
  166|   165k|                eeeo[0] = 0;
  167|   165k|                eeeo[1] = 0;
  168|   165k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  169|   165k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
  170|       |
  171|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  172|   165k|                eee[0] = eeee[0] + eeeo[0];
  173|   165k|                eee[3] = eeee[0] - eeeo[0];
  174|   165k|                eee[1] = eeee[1] + eeeo[1];
  175|   165k|                eee[2] = eeee[1] - eeeo[1];
  176|   831k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (176:28): [True: 666k, False: 165k]
  ------------------
  177|   666k|                {
  178|   666k|                    ee[k] = eee[k] + eeo[k];
  179|   666k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  180|   666k|                }
  181|  1.49M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (181:28): [True: 1.33M, False: 165k]
  ------------------
  182|  1.33M|                {
  183|  1.33M|                    e[k] = ee[k] + eo[k];
  184|  1.33M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  185|  1.33M|                }
  186|  2.82M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (186:28): [True: 2.66M, False: 165k]
  ------------------
  187|  2.66M|                {
  188|  2.66M|                    pi2_tmp[k] =
  189|  2.66M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.55k, False: 2.66M]
  |  |  |  |  |  Branch (40:53): [True: 1.70k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  2.66M|                    pi2_tmp[k + 16] =
  191|  2.66M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  2.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.30k, False: 2.66M]
  |  |  |  |  |  Branch (40:53): [True: 1.10k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  2.66M|                }
  193|   165k|            }
  194|   766k|            pi2_src++;
  195|   766k|            pi2_tmp += trans_size;
  196|   766k|            zero_cols = zero_cols >> 1;
  197|   766k|        }
  198|       |
  199|  67.4k|        pi2_tmp = pi2_tmp_orig;
  200|       |
  201|       |        /* Inverse Transform 2nd stage */
  202|  67.4k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  67.4k|#define IT_SHIFT_STAGE_2 12
  ------------------
  203|  67.4k|        add = 1 << (shift - 1);
  204|  67.4k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (204:12): [True: 37.0k, False: 30.3k]
  ------------------
  205|  37.0k|        {
  206|  1.17M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (206:24): [True: 1.13M, False: 37.0k]
  ------------------
  207|  1.13M|            {
  208|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  209|  19.2M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (209:28): [True: 18.0M, False: 1.13M]
  ------------------
  210|  18.0M|                {
  211|  18.0M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  212|  18.0M|                                    + g_ai2_ihevc_trans_32[3][k]
  213|  18.0M|                                                    * pi2_tmp[3 * trans_size];
  214|  18.0M|                }
  215|  10.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (215:28): [True: 9.12M, False: 1.13M]
  ------------------
  216|  9.12M|                {
  217|  9.12M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  218|  9.12M|                }
  219|       |//                for(k = 0; k < 4; k++)
  220|  1.13M|                {
  221|  1.13M|                    eeo[0] = 0;
  222|  1.13M|                    eeo[1] = 0;
  223|  1.13M|                    eeo[2] = 0;
  224|  1.13M|                    eeo[3] = 0;
  225|  1.13M|                }
  226|  1.13M|                eeeo[0] = 0;
  227|  1.13M|                eeeo[1] = 0;
  228|  1.13M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  229|  1.13M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  230|       |
  231|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  232|  1.13M|                eee[0] = eeee[0] + eeeo[0];
  233|  1.13M|                eee[3] = eeee[0] - eeeo[0];
  234|  1.13M|                eee[1] = eeee[1] + eeeo[1];
  235|  1.13M|                eee[2] = eeee[1] - eeeo[1];
  236|  5.70M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (236:28): [True: 4.57M, False: 1.13M]
  ------------------
  237|  4.57M|                {
  238|  4.57M|                    ee[k] = eee[k] + eeo[k];
  239|  4.57M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  240|  4.57M|                }
  241|  10.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (241:28): [True: 9.04M, False: 1.13M]
  ------------------
  242|  9.04M|                {
  243|  9.04M|                    e[k] = ee[k] + eo[k];
  244|  9.04M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  245|  9.04M|                }
  246|  19.0M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (246:28): [True: 17.9M, False: 1.13M]
  ------------------
  247|  17.9M|                {
  248|  17.9M|                    WORD32 itrans_out;
  249|  17.9M|                    itrans_out =
  250|  17.9M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  17.9M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  17.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 17.9M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 17.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  17.9M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  17.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  17.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 607k, False: 17.3M]
  |  |  |  |  |  Branch (40:53): [True: 1.00M, False: 16.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  17.9M|                    itrans_out =
  253|  17.9M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  17.9M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  17.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 17.9M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 17.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  17.9M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  17.9M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  17.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 695k, False: 17.2M]
  |  |  |  |  |  Branch (40:53): [True: 957k, False: 16.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  17.9M|                }
  256|  1.13M|                pi2_tmp++;
  257|  1.13M|                pu1_pred += pred_strd;
  258|  1.13M|                pu1_dst += dst_strd;
  259|  1.13M|            }
  260|  37.0k|        }
  261|  30.3k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (261:17): [True: 14.6k, False: 15.6k]
  ------------------
  262|  14.6k|        {
  263|   448k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (263:24): [True: 433k, False: 14.6k]
  ------------------
  264|   433k|            {
  265|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  266|  7.32M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (266:28): [True: 6.89M, False: 433k]
  ------------------
  267|  6.89M|                {
  268|  6.89M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  269|  6.89M|                                    + g_ai2_ihevc_trans_32[3][k]
  270|  6.89M|                                                    * pi2_tmp[3 * trans_size]
  271|  6.89M|                                    + g_ai2_ihevc_trans_32[5][k]
  272|  6.89M|                                                    * pi2_tmp[5 * trans_size]
  273|  6.89M|                                    + g_ai2_ihevc_trans_32[7][k]
  274|  6.89M|                                                    * pi2_tmp[7 * trans_size];
  275|  6.89M|                }
  276|  3.95M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (276:28): [True: 3.52M, False: 433k]
  ------------------
  277|  3.52M|                {
  278|  3.52M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  279|  3.52M|                                    + g_ai2_ihevc_trans_32[6][k]
  280|  3.52M|                                                    * pi2_tmp[6 * trans_size];
  281|  3.52M|                }
  282|  2.21M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (282:28): [True: 1.78M, False: 433k]
  ------------------
  283|  1.78M|                {
  284|  1.78M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  285|  1.78M|                }
  286|   433k|                eeeo[0] = 0;
  287|   433k|                eeeo[1] = 0;
  288|   433k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  289|   433k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  290|       |
  291|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  292|   433k|                eee[0] = eeee[0] + eeeo[0];
  293|   433k|                eee[3] = eeee[0] - eeeo[0];
  294|   433k|                eee[1] = eeee[1] + eeeo[1];
  295|   433k|                eee[2] = eeee[1] - eeeo[1];
  296|  2.22M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (296:28): [True: 1.78M, False: 433k]
  ------------------
  297|  1.78M|                {
  298|  1.78M|                    ee[k] = eee[k] + eeo[k];
  299|  1.78M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  300|  1.78M|                }
  301|  3.90M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (301:28): [True: 3.47M, False: 433k]
  ------------------
  302|  3.47M|                {
  303|  3.47M|                    e[k] = ee[k] + eo[k];
  304|  3.47M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  305|  3.47M|                }
  306|  7.26M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (306:28): [True: 6.82M, False: 433k]
  ------------------
  307|  6.82M|                {
  308|  6.82M|                    WORD32 itrans_out;
  309|  6.82M|                    itrans_out =
  310|  6.82M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.82M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  6.82M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  6.82M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 796k, False: 6.03M]
  |  |  |  |  |  Branch (40:53): [True: 673k, False: 5.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  312|  6.82M|                    itrans_out =
  313|  6.82M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  6.82M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 6.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 6.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|  6.82M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  6.82M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 781k, False: 6.04M]
  |  |  |  |  |  Branch (40:53): [True: 682k, False: 5.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|  6.82M|                }
  316|   433k|                pi2_tmp++;
  317|   433k|                pu1_pred += pred_strd;
  318|   433k|                pu1_dst += dst_strd;
  319|   433k|            }
  320|  14.6k|        }
  321|  15.6k|        else /* All rows of output of 1st stage are non-zero */
  322|  15.6k|        {
  323|   495k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (323:24): [True: 479k, False: 15.6k]
  ------------------
  324|   479k|            {
  325|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  326|  8.07M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (326:28): [True: 7.59M, False: 479k]
  ------------------
  327|  7.59M|                {
  328|  7.59M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  329|  7.59M|                                    + g_ai2_ihevc_trans_32[3][k]
  330|  7.59M|                                                    * pi2_tmp[3 * trans_size]
  331|  7.59M|                                    + g_ai2_ihevc_trans_32[5][k]
  332|  7.59M|                                                    * pi2_tmp[5 * trans_size]
  333|  7.59M|                                    + g_ai2_ihevc_trans_32[7][k]
  334|  7.59M|                                                    * pi2_tmp[7 * trans_size]
  335|  7.59M|                                    + g_ai2_ihevc_trans_32[9][k]
  336|  7.59M|                                                    * pi2_tmp[9 * trans_size]
  337|  7.59M|                                    + g_ai2_ihevc_trans_32[11][k]
  338|  7.59M|                                                    * pi2_tmp[11 * trans_size]
  339|  7.59M|                                    + g_ai2_ihevc_trans_32[13][k]
  340|  7.59M|                                                    * pi2_tmp[13 * trans_size]
  341|  7.59M|                                    + g_ai2_ihevc_trans_32[15][k]
  342|  7.59M|                                                    * pi2_tmp[15 * trans_size]
  343|  7.59M|                                    + g_ai2_ihevc_trans_32[17][k]
  344|  7.59M|                                                    * pi2_tmp[17 * trans_size]
  345|  7.59M|                                    + g_ai2_ihevc_trans_32[19][k]
  346|  7.59M|                                                    * pi2_tmp[19 * trans_size]
  347|  7.59M|                                    + g_ai2_ihevc_trans_32[21][k]
  348|  7.59M|                                                    * pi2_tmp[21 * trans_size]
  349|  7.59M|                                    + g_ai2_ihevc_trans_32[23][k]
  350|  7.59M|                                                    * pi2_tmp[23 * trans_size]
  351|  7.59M|                                    + g_ai2_ihevc_trans_32[25][k]
  352|  7.59M|                                                    * pi2_tmp[25 * trans_size]
  353|  7.59M|                                    + g_ai2_ihevc_trans_32[27][k]
  354|  7.59M|                                                    * pi2_tmp[27 * trans_size]
  355|  7.59M|                                    + g_ai2_ihevc_trans_32[29][k]
  356|  7.59M|                                                    * pi2_tmp[29 * trans_size]
  357|  7.59M|                                    + g_ai2_ihevc_trans_32[31][k]
  358|  7.59M|                                                    * pi2_tmp[31 * trans_size];
  359|  7.59M|                }
  360|  4.37M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (360:28): [True: 3.89M, False: 479k]
  ------------------
  361|  3.89M|                {
  362|  3.89M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  363|  3.89M|                                    + g_ai2_ihevc_trans_32[6][k]
  364|  3.89M|                                                    * pi2_tmp[6 * trans_size]
  365|  3.89M|                                    + g_ai2_ihevc_trans_32[10][k]
  366|  3.89M|                                                    * pi2_tmp[10 * trans_size]
  367|  3.89M|                                    + g_ai2_ihevc_trans_32[14][k]
  368|  3.89M|                                                    * pi2_tmp[14 * trans_size]
  369|  3.89M|                                    + g_ai2_ihevc_trans_32[18][k]
  370|  3.89M|                                                    * pi2_tmp[18 * trans_size]
  371|  3.89M|                                    + g_ai2_ihevc_trans_32[22][k]
  372|  3.89M|                                                    * pi2_tmp[22 * trans_size]
  373|  3.89M|                                    + g_ai2_ihevc_trans_32[26][k]
  374|  3.89M|                                                    * pi2_tmp[26 * trans_size]
  375|  3.89M|                                    + g_ai2_ihevc_trans_32[30][k]
  376|  3.89M|                                                    * pi2_tmp[30 * trans_size];
  377|  3.89M|                }
  378|  2.46M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (378:28): [True: 1.98M, False: 479k]
  ------------------
  379|  1.98M|                {
  380|  1.98M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  381|  1.98M|                                    + g_ai2_ihevc_trans_32[12][k]
  382|  1.98M|                                                    * pi2_tmp[12 * trans_size]
  383|  1.98M|                                    + g_ai2_ihevc_trans_32[20][k]
  384|  1.98M|                                                    * pi2_tmp[20 * trans_size]
  385|  1.98M|                                    + g_ai2_ihevc_trans_32[28][k]
  386|  1.98M|                                                    * pi2_tmp[28 * trans_size];
  387|  1.98M|                }
  388|   479k|                eeeo[0] =
  389|   479k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  390|   479k|                                                + g_ai2_ihevc_trans_32[24][0]
  391|   479k|                                                                * pi2_tmp[24
  392|   479k|                                                                                * trans_size];
  393|   479k|                eeeo[1] =
  394|   479k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  395|   479k|                                                + g_ai2_ihevc_trans_32[24][1]
  396|   479k|                                                                * pi2_tmp[24
  397|   479k|                                                                                * trans_size];
  398|   479k|                eeee[0] =
  399|   479k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  400|   479k|                                                + g_ai2_ihevc_trans_32[16][0]
  401|   479k|                                                                * pi2_tmp[16
  402|   479k|                                                                                * trans_size];
  403|   479k|                eeee[1] =
  404|   479k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  405|   479k|                                                + g_ai2_ihevc_trans_32[16][1]
  406|   479k|                                                                * pi2_tmp[16
  407|   479k|                                                                                * trans_size];
  408|       |
  409|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  410|   479k|                eee[0] = eeee[0] + eeeo[0];
  411|   479k|                eee[3] = eeee[0] - eeeo[0];
  412|   479k|                eee[1] = eeee[1] + eeeo[1];
  413|   479k|                eee[2] = eeee[1] - eeeo[1];
  414|  2.43M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (414:28): [True: 1.95M, False: 479k]
  ------------------
  415|  1.95M|                {
  416|  1.95M|                    ee[k] = eee[k] + eeo[k];
  417|  1.95M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  418|  1.95M|                }
  419|  4.37M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (419:28): [True: 3.89M, False: 479k]
  ------------------
  420|  3.89M|                {
  421|  3.89M|                    e[k] = ee[k] + eo[k];
  422|  3.89M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  423|  3.89M|                }
  424|  8.09M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (424:28): [True: 7.61M, False: 479k]
  ------------------
  425|  7.61M|                {
  426|  7.61M|                    WORD32 itrans_out;
  427|  7.61M|                    itrans_out =
  428|  7.61M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  7.61M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.61M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.61M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.61M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|  7.61M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  7.61M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.61M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 809k, False: 6.80M]
  |  |  |  |  |  Branch (40:53): [True: 210k, False: 6.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|  7.61M|                    itrans_out =
  431|  7.61M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  7.61M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.61M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.61M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.61M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|  7.61M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  7.61M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.61M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.41M, False: 6.19M]
  |  |  |  |  |  Branch (40:53): [True: 177k, False: 6.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  7.61M|                }
  434|   479k|                pi2_tmp++;
  435|   479k|                pu1_pred += pred_strd;
  436|   479k|                pu1_dst += dst_strd;
  437|   479k|            }
  438|  15.6k|        }
  439|       |        /************************************************************************************************/
  440|       |        /************************************END - IT_RECON_32x32****************************************/
  441|       |        /************************************************************************************************/
  442|  67.4k|    }
  443|  75.1k|    else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (443:13): [True: 45.2k, False: 29.8k]
  ------------------
  444|  45.2k|    {
  445|       |        /************************************************************************************************/
  446|       |        /**********************************START - IT_RECON_32x32****************************************/
  447|       |        /************************************************************************************************/
  448|       |        /* Inverse Transform 1st stage */
  449|  45.2k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  45.2k|#define IT_SHIFT_STAGE_1 7
  ------------------
  450|  45.2k|        add = 1 << (shift - 1);
  451|       |
  452|   556k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (452:20): [True: 510k, False: 45.2k]
  ------------------
  453|   510k|        {
  454|       |            /* Checking for Zero Cols */
  455|   510k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (455:16): [True: 419k, False: 91.4k]
  ------------------
  456|   419k|            {
  457|   419k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  458|   419k|            }
  459|  91.4k|            else
  460|  91.4k|            {
  461|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  462|  1.56M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (462:28): [True: 1.46M, False: 91.4k]
  ------------------
  463|  1.46M|                {
  464|  1.46M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  465|  1.46M|                                    + g_ai2_ihevc_trans_32[3][k]
  466|  1.46M|                                                    * pi2_src[3 * src_strd]
  467|  1.46M|                                    + g_ai2_ihevc_trans_32[5][k]
  468|  1.46M|                                                    * pi2_src[5 * src_strd]
  469|  1.46M|                                    + g_ai2_ihevc_trans_32[7][k]
  470|  1.46M|                                                    * pi2_src[7 * src_strd];
  471|  1.46M|                }
  472|   826k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (472:28): [True: 735k, False: 91.4k]
  ------------------
  473|   735k|                {
  474|   735k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  475|   735k|                                    + g_ai2_ihevc_trans_32[6][k]
  476|   735k|                                                    * pi2_src[6 * src_strd];
  477|   735k|                }
  478|   459k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (478:28): [True: 367k, False: 91.4k]
  ------------------
  479|   367k|                {
  480|   367k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd];
  481|   367k|                }
  482|  91.4k|                eeeo[0] = 0;
  483|  91.4k|                eeeo[1] = 0;
  484|  91.4k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  485|  91.4k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
  486|       |
  487|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  488|  91.4k|                eee[0] = eeee[0] + eeeo[0];
  489|  91.4k|                eee[3] = eeee[0] - eeeo[0];
  490|  91.4k|                eee[1] = eeee[1] + eeeo[1];
  491|  91.4k|                eee[2] = eeee[1] - eeeo[1];
  492|   459k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (492:28): [True: 367k, False: 91.4k]
  ------------------
  493|   367k|                {
  494|   367k|                    ee[k] = eee[k] + eeo[k];
  495|   367k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  496|   367k|                }
  497|   826k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (497:28): [True: 735k, False: 91.4k]
  ------------------
  498|   735k|                {
  499|   735k|                    e[k] = ee[k] + eo[k];
  500|   735k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  501|   735k|                }
  502|  1.56M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (502:28): [True: 1.47M, False: 91.4k]
  ------------------
  503|  1.47M|                {
  504|  1.47M|                    pi2_tmp[k] =
  505|  1.47M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.47M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.47M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.46k, False: 1.46M]
  |  |  |  |  |  Branch (40:53): [True: 2.13k, False: 1.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  1.47M|                    pi2_tmp[k + 16] =
  507|  1.47M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  1.47M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.47M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.05k, False: 1.46M]
  |  |  |  |  |  Branch (40:53): [True: 2.36k, False: 1.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|  1.47M|                }
  509|  91.4k|            }
  510|   510k|            pi2_src++;
  511|   510k|            pi2_tmp += trans_size;
  512|   510k|            zero_cols = zero_cols >> 1;
  513|   510k|        }
  514|       |
  515|  45.2k|        pi2_tmp = pi2_tmp_orig;
  516|       |
  517|       |        /* Inverse Transform 2nd stage */
  518|  45.2k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  45.2k|#define IT_SHIFT_STAGE_2 12
  ------------------
  519|  45.2k|        add = 1 << (shift - 1);
  520|  45.2k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (520:12): [True: 17.4k, False: 27.8k]
  ------------------
  521|  17.4k|        {
  522|   556k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (522:24): [True: 539k, False: 17.4k]
  ------------------
  523|   539k|            {
  524|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  525|  9.08M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (525:28): [True: 8.55M, False: 539k]
  ------------------
  526|  8.55M|                {
  527|  8.55M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  528|  8.55M|                                    + g_ai2_ihevc_trans_32[3][k]
  529|  8.55M|                                                    * pi2_tmp[3 * trans_size];
  530|  8.55M|                }
  531|  4.85M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (531:28): [True: 4.31M, False: 539k]
  ------------------
  532|  4.31M|                {
  533|  4.31M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  534|  4.31M|                }
  535|       |//                for(k = 0; k < 4; k++)
  536|   539k|                {
  537|   539k|                    eeo[0] = 0;
  538|   539k|                    eeo[1] = 0;
  539|   539k|                    eeo[2] = 0;
  540|   539k|                    eeo[3] = 0;
  541|   539k|                }
  542|   539k|                eeeo[0] = 0;
  543|   539k|                eeeo[1] = 0;
  544|   539k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  545|   539k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  546|       |
  547|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  548|   539k|                eee[0] = eeee[0] + eeeo[0];
  549|   539k|                eee[3] = eeee[0] - eeeo[0];
  550|   539k|                eee[1] = eeee[1] + eeeo[1];
  551|   539k|                eee[2] = eeee[1] - eeeo[1];
  552|  2.70M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (552:28): [True: 2.16M, False: 539k]
  ------------------
  553|  2.16M|                {
  554|  2.16M|                    ee[k] = eee[k] + eeo[k];
  555|  2.16M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  556|  2.16M|                }
  557|  4.90M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (557:28): [True: 4.36M, False: 539k]
  ------------------
  558|  4.36M|                {
  559|  4.36M|                    e[k] = ee[k] + eo[k];
  560|  4.36M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  561|  4.36M|                }
  562|  9.07M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (562:28): [True: 8.53M, False: 539k]
  ------------------
  563|  8.53M|                {
  564|  8.53M|                    WORD32 itrans_out;
  565|  8.53M|                    itrans_out =
  566|  8.53M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  8.53M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.53M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.53M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.53M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  567|  8.53M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  8.53M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.53M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.09M, False: 7.44M]
  |  |  |  |  |  Branch (40:53): [True: 298k, False: 7.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|  8.53M|                    itrans_out =
  569|  8.53M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  8.53M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.53M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.53M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.53M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  8.53M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  8.53M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.53M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.05M, False: 7.47M]
  |  |  |  |  |  Branch (40:53): [True: 313k, False: 7.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  571|  8.53M|                }
  572|   539k|                pi2_tmp++;
  573|   539k|                pu1_pred += pred_strd;
  574|   539k|                pu1_dst += dst_strd;
  575|   539k|            }
  576|  17.4k|        }
  577|  27.8k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (577:17): [True: 18.7k, False: 9.12k]
  ------------------
  578|  18.7k|        {
  579|   598k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (579:24): [True: 580k, False: 18.7k]
  ------------------
  580|   580k|            {
  581|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  582|  9.85M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (582:28): [True: 9.27M, False: 580k]
  ------------------
  583|  9.27M|                {
  584|  9.27M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  585|  9.27M|                                    + g_ai2_ihevc_trans_32[3][k]
  586|  9.27M|                                                    * pi2_tmp[3 * trans_size]
  587|  9.27M|                                    + g_ai2_ihevc_trans_32[5][k]
  588|  9.27M|                                                    * pi2_tmp[5 * trans_size]
  589|  9.27M|                                    + g_ai2_ihevc_trans_32[7][k]
  590|  9.27M|                                                    * pi2_tmp[7 * trans_size];
  591|  9.27M|                }
  592|  5.16M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (592:28): [True: 4.58M, False: 580k]
  ------------------
  593|  4.58M|                {
  594|  4.58M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  595|  4.58M|                                    + g_ai2_ihevc_trans_32[6][k]
  596|  4.58M|                                                    * pi2_tmp[6 * trans_size];
  597|  4.58M|                }
  598|  2.90M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (598:28): [True: 2.32M, False: 580k]
  ------------------
  599|  2.32M|                {
  600|  2.32M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  601|  2.32M|                }
  602|   580k|                eeeo[0] = 0;
  603|   580k|                eeeo[1] = 0;
  604|   580k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  605|   580k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  606|       |
  607|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  608|   580k|                eee[0] = eeee[0] + eeeo[0];
  609|   580k|                eee[3] = eeee[0] - eeeo[0];
  610|   580k|                eee[1] = eeee[1] + eeeo[1];
  611|   580k|                eee[2] = eeee[1] - eeeo[1];
  612|  2.89M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (612:28): [True: 2.31M, False: 580k]
  ------------------
  613|  2.31M|                {
  614|  2.31M|                    ee[k] = eee[k] + eeo[k];
  615|  2.31M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  616|  2.31M|                }
  617|  5.19M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (617:28): [True: 4.61M, False: 580k]
  ------------------
  618|  4.61M|                {
  619|  4.61M|                    e[k] = ee[k] + eo[k];
  620|  4.61M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  621|  4.61M|                }
  622|  9.52M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (622:28): [True: 8.94M, False: 580k]
  ------------------
  623|  8.94M|                {
  624|  8.94M|                    WORD32 itrans_out;
  625|  8.94M|                    itrans_out =
  626|  8.94M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  8.94M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.94M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.94M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|  8.94M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  8.94M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.94M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 349k, False: 8.59M]
  |  |  |  |  |  Branch (40:53): [True: 404k, False: 8.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|  8.94M|                    itrans_out =
  629|  8.94M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  8.94M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.94M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.94M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|  8.94M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  8.94M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.94M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 350k, False: 8.59M]
  |  |  |  |  |  Branch (40:53): [True: 380k, False: 8.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  631|  8.94M|                }
  632|   580k|                pi2_tmp++;
  633|   580k|                pu1_pred += pred_strd;
  634|   580k|                pu1_dst += dst_strd;
  635|   580k|            }
  636|  18.7k|        }
  637|  9.12k|        else /* All rows of output of 1st stage are non-zero */
  638|  9.12k|        {
  639|   298k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (639:24): [True: 289k, False: 9.12k]
  ------------------
  640|   289k|            {
  641|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  642|  4.90M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (642:28): [True: 4.61M, False: 289k]
  ------------------
  643|  4.61M|                {
  644|  4.61M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  645|  4.61M|                                    + g_ai2_ihevc_trans_32[3][k]
  646|  4.61M|                                                    * pi2_tmp[3 * trans_size]
  647|  4.61M|                                    + g_ai2_ihevc_trans_32[5][k]
  648|  4.61M|                                                    * pi2_tmp[5 * trans_size]
  649|  4.61M|                                    + g_ai2_ihevc_trans_32[7][k]
  650|  4.61M|                                                    * pi2_tmp[7 * trans_size]
  651|  4.61M|                                    + g_ai2_ihevc_trans_32[9][k]
  652|  4.61M|                                                    * pi2_tmp[9 * trans_size]
  653|  4.61M|                                    + g_ai2_ihevc_trans_32[11][k]
  654|  4.61M|                                                    * pi2_tmp[11 * trans_size]
  655|  4.61M|                                    + g_ai2_ihevc_trans_32[13][k]
  656|  4.61M|                                                    * pi2_tmp[13 * trans_size]
  657|  4.61M|                                    + g_ai2_ihevc_trans_32[15][k]
  658|  4.61M|                                                    * pi2_tmp[15 * trans_size]
  659|  4.61M|                                    + g_ai2_ihevc_trans_32[17][k]
  660|  4.61M|                                                    * pi2_tmp[17 * trans_size]
  661|  4.61M|                                    + g_ai2_ihevc_trans_32[19][k]
  662|  4.61M|                                                    * pi2_tmp[19 * trans_size]
  663|  4.61M|                                    + g_ai2_ihevc_trans_32[21][k]
  664|  4.61M|                                                    * pi2_tmp[21 * trans_size]
  665|  4.61M|                                    + g_ai2_ihevc_trans_32[23][k]
  666|  4.61M|                                                    * pi2_tmp[23 * trans_size]
  667|  4.61M|                                    + g_ai2_ihevc_trans_32[25][k]
  668|  4.61M|                                                    * pi2_tmp[25 * trans_size]
  669|  4.61M|                                    + g_ai2_ihevc_trans_32[27][k]
  670|  4.61M|                                                    * pi2_tmp[27 * trans_size]
  671|  4.61M|                                    + g_ai2_ihevc_trans_32[29][k]
  672|  4.61M|                                                    * pi2_tmp[29 * trans_size]
  673|  4.61M|                                    + g_ai2_ihevc_trans_32[31][k]
  674|  4.61M|                                                    * pi2_tmp[31 * trans_size];
  675|  4.61M|                }
  676|  2.61M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (676:28): [True: 2.32M, False: 289k]
  ------------------
  677|  2.32M|                {
  678|  2.32M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  679|  2.32M|                                    + g_ai2_ihevc_trans_32[6][k]
  680|  2.32M|                                                    * pi2_tmp[6 * trans_size]
  681|  2.32M|                                    + g_ai2_ihevc_trans_32[10][k]
  682|  2.32M|                                                    * pi2_tmp[10 * trans_size]
  683|  2.32M|                                    + g_ai2_ihevc_trans_32[14][k]
  684|  2.32M|                                                    * pi2_tmp[14 * trans_size]
  685|  2.32M|                                    + g_ai2_ihevc_trans_32[18][k]
  686|  2.32M|                                                    * pi2_tmp[18 * trans_size]
  687|  2.32M|                                    + g_ai2_ihevc_trans_32[22][k]
  688|  2.32M|                                                    * pi2_tmp[22 * trans_size]
  689|  2.32M|                                    + g_ai2_ihevc_trans_32[26][k]
  690|  2.32M|                                                    * pi2_tmp[26 * trans_size]
  691|  2.32M|                                    + g_ai2_ihevc_trans_32[30][k]
  692|  2.32M|                                                    * pi2_tmp[30 * trans_size];
  693|  2.32M|                }
  694|  1.45M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (694:28): [True: 1.16M, False: 289k]
  ------------------
  695|  1.16M|                {
  696|  1.16M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  697|  1.16M|                                    + g_ai2_ihevc_trans_32[12][k]
  698|  1.16M|                                                    * pi2_tmp[12 * trans_size]
  699|  1.16M|                                    + g_ai2_ihevc_trans_32[20][k]
  700|  1.16M|                                                    * pi2_tmp[20 * trans_size]
  701|  1.16M|                                    + g_ai2_ihevc_trans_32[28][k]
  702|  1.16M|                                                    * pi2_tmp[28 * trans_size];
  703|  1.16M|                }
  704|   289k|                eeeo[0] =
  705|   289k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  706|   289k|                                                + g_ai2_ihevc_trans_32[24][0]
  707|   289k|                                                                * pi2_tmp[24
  708|   289k|                                                                                * trans_size];
  709|   289k|                eeeo[1] =
  710|   289k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  711|   289k|                                                + g_ai2_ihevc_trans_32[24][1]
  712|   289k|                                                                * pi2_tmp[24
  713|   289k|                                                                                * trans_size];
  714|   289k|                eeee[0] =
  715|   289k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  716|   289k|                                                + g_ai2_ihevc_trans_32[16][0]
  717|   289k|                                                                * pi2_tmp[16
  718|   289k|                                                                                * trans_size];
  719|   289k|                eeee[1] =
  720|   289k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  721|   289k|                                                + g_ai2_ihevc_trans_32[16][1]
  722|   289k|                                                                * pi2_tmp[16
  723|   289k|                                                                                * trans_size];
  724|       |
  725|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  726|   289k|                eee[0] = eeee[0] + eeeo[0];
  727|   289k|                eee[3] = eeee[0] - eeeo[0];
  728|   289k|                eee[1] = eeee[1] + eeeo[1];
  729|   289k|                eee[2] = eeee[1] - eeeo[1];
  730|  1.45M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (730:28): [True: 1.16M, False: 289k]
  ------------------
  731|  1.16M|                {
  732|  1.16M|                    ee[k] = eee[k] + eeo[k];
  733|  1.16M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  734|  1.16M|                }
  735|  2.61M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (735:28): [True: 2.32M, False: 289k]
  ------------------
  736|  2.32M|                {
  737|  2.32M|                    e[k] = ee[k] + eo[k];
  738|  2.32M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  739|  2.32M|                }
  740|  4.91M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (740:28): [True: 4.62M, False: 289k]
  ------------------
  741|  4.62M|                {
  742|  4.62M|                    WORD32 itrans_out;
  743|  4.62M|                    itrans_out =
  744|  4.62M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.62M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.62M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  4.62M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.62M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 332k, False: 4.28M]
  |  |  |  |  |  Branch (40:53): [True: 154k, False: 4.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|  4.62M|                    itrans_out =
  747|  4.62M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  4.62M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.62M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|  4.62M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  4.62M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.62M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 294k, False: 4.32M]
  |  |  |  |  |  Branch (40:53): [True: 148k, False: 4.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|  4.62M|                }
  750|   289k|                pi2_tmp++;
  751|   289k|                pu1_pred += pred_strd;
  752|   289k|                pu1_dst += dst_strd;
  753|   289k|            }
  754|  9.12k|        }
  755|       |        /************************************************************************************************/
  756|       |        /************************************END - IT_RECON_32x32****************************************/
  757|       |        /************************************************************************************************/
  758|  45.2k|    }
  759|  29.8k|    else  /* All rows of input are non-zero */
  760|  29.8k|    {
  761|       |        /************************************************************************************************/
  762|       |        /**********************************START - IT_RECON_32x32****************************************/
  763|       |        /************************************************************************************************/
  764|       |        /* Inverse Transform 1st stage */
  765|  29.8k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  29.8k|#define IT_SHIFT_STAGE_1 7
  ------------------
  766|  29.8k|        add = 1 << (shift - 1);
  767|       |
  768|   456k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (768:20): [True: 426k, False: 29.8k]
  ------------------
  769|   426k|        {
  770|       |            /* Checking for Zero Cols */
  771|   426k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (771:16): [True: 247k, False: 179k]
  ------------------
  772|   247k|            {
  773|   247k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  774|   247k|            }
  775|   179k|            else
  776|   179k|            {
  777|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  778|  3.05M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (778:28): [True: 2.87M, False: 179k]
  ------------------
  779|  2.87M|                {
  780|  2.87M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  781|  2.87M|                                    + g_ai2_ihevc_trans_32[3][k]
  782|  2.87M|                                                    * pi2_src[3 * src_strd]
  783|  2.87M|                                    + g_ai2_ihevc_trans_32[5][k]
  784|  2.87M|                                                    * pi2_src[5 * src_strd]
  785|  2.87M|                                    + g_ai2_ihevc_trans_32[7][k]
  786|  2.87M|                                                    * pi2_src[7 * src_strd]
  787|  2.87M|                                    + g_ai2_ihevc_trans_32[9][k]
  788|  2.87M|                                                    * pi2_src[9 * src_strd]
  789|  2.87M|                                    + g_ai2_ihevc_trans_32[11][k]
  790|  2.87M|                                                    * pi2_src[11 * src_strd]
  791|  2.87M|                                    + g_ai2_ihevc_trans_32[13][k]
  792|  2.87M|                                                    * pi2_src[13 * src_strd]
  793|  2.87M|                                    + g_ai2_ihevc_trans_32[15][k]
  794|  2.87M|                                                    * pi2_src[15 * src_strd]
  795|  2.87M|                                    + g_ai2_ihevc_trans_32[17][k]
  796|  2.87M|                                                    * pi2_src[17 * src_strd]
  797|  2.87M|                                    + g_ai2_ihevc_trans_32[19][k]
  798|  2.87M|                                                    * pi2_src[19 * src_strd]
  799|  2.87M|                                    + g_ai2_ihevc_trans_32[21][k]
  800|  2.87M|                                                    * pi2_src[21 * src_strd]
  801|  2.87M|                                    + g_ai2_ihevc_trans_32[23][k]
  802|  2.87M|                                                    * pi2_src[23 * src_strd]
  803|  2.87M|                                    + g_ai2_ihevc_trans_32[25][k]
  804|  2.87M|                                                    * pi2_src[25 * src_strd]
  805|  2.87M|                                    + g_ai2_ihevc_trans_32[27][k]
  806|  2.87M|                                                    * pi2_src[27 * src_strd]
  807|  2.87M|                                    + g_ai2_ihevc_trans_32[29][k]
  808|  2.87M|                                                    * pi2_src[29 * src_strd]
  809|  2.87M|                                    + g_ai2_ihevc_trans_32[31][k]
  810|  2.87M|                                                    * pi2_src[31 * src_strd];
  811|  2.87M|                }
  812|  1.61M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (812:28): [True: 1.43M, False: 179k]
  ------------------
  813|  1.43M|                {
  814|  1.43M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  815|  1.43M|                                    + g_ai2_ihevc_trans_32[6][k]
  816|  1.43M|                                                    * pi2_src[6 * src_strd]
  817|  1.43M|                                    + g_ai2_ihevc_trans_32[10][k]
  818|  1.43M|                                                    * pi2_src[10 * src_strd]
  819|  1.43M|                                    + g_ai2_ihevc_trans_32[14][k]
  820|  1.43M|                                                    * pi2_src[14 * src_strd]
  821|  1.43M|                                    + g_ai2_ihevc_trans_32[18][k]
  822|  1.43M|                                                    * pi2_src[18 * src_strd]
  823|  1.43M|                                    + g_ai2_ihevc_trans_32[22][k]
  824|  1.43M|                                                    * pi2_src[22 * src_strd]
  825|  1.43M|                                    + g_ai2_ihevc_trans_32[26][k]
  826|  1.43M|                                                    * pi2_src[26 * src_strd]
  827|  1.43M|                                    + g_ai2_ihevc_trans_32[30][k]
  828|  1.43M|                                                    * pi2_src[30 * src_strd];
  829|  1.43M|                }
  830|   898k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (830:28): [True: 719k, False: 179k]
  ------------------
  831|   719k|                {
  832|   719k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]
  833|   719k|                                    + g_ai2_ihevc_trans_32[12][k]
  834|   719k|                                                    * pi2_src[12 * src_strd]
  835|   719k|                                    + g_ai2_ihevc_trans_32[20][k]
  836|   719k|                                                    * pi2_src[20 * src_strd]
  837|   719k|                                    + g_ai2_ihevc_trans_32[28][k]
  838|   719k|                                                    * pi2_src[28 * src_strd];
  839|   719k|                }
  840|   179k|                eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd]
  841|   179k|                                + g_ai2_ihevc_trans_32[24][0]
  842|   179k|                                                * pi2_src[24 * src_strd];
  843|   179k|                eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd]
  844|   179k|                                + g_ai2_ihevc_trans_32[24][1]
  845|   179k|                                                * pi2_src[24 * src_strd];
  846|   179k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]
  847|   179k|                                + g_ai2_ihevc_trans_32[16][0]
  848|   179k|                                                * pi2_src[16 * src_strd];
  849|   179k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]
  850|   179k|                                + g_ai2_ihevc_trans_32[16][1]
  851|   179k|                                                * pi2_src[16 * src_strd];
  852|       |
  853|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  854|   179k|                eee[0] = eeee[0] + eeeo[0];
  855|   179k|                eee[3] = eeee[0] - eeeo[0];
  856|   179k|                eee[1] = eeee[1] + eeeo[1];
  857|   179k|                eee[2] = eeee[1] - eeeo[1];
  858|   898k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (858:28): [True: 719k, False: 179k]
  ------------------
  859|   719k|                {
  860|   719k|                    ee[k] = eee[k] + eeo[k];
  861|   719k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  862|   719k|                }
  863|  1.61M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (863:28): [True: 1.43M, False: 179k]
  ------------------
  864|  1.43M|                {
  865|  1.43M|                    e[k] = ee[k] + eo[k];
  866|  1.43M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  867|  1.43M|                }
  868|  3.05M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (868:28): [True: 2.87M, False: 179k]
  ------------------
  869|  2.87M|                {
  870|  2.87M|                    pi2_tmp[k] =
  871|  2.87M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.87M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.87M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 17.1k, False: 2.85M]
  |  |  |  |  |  Branch (40:53): [True: 16.2k, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  872|  2.87M|                    pi2_tmp[k + 16] =
  873|  2.87M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  2.87M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.87M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 16.2k, False: 2.86M]
  |  |  |  |  |  Branch (40:53): [True: 15.9k, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  874|  2.87M|                }
  875|   179k|            }
  876|   426k|            pi2_src++;
  877|   426k|            pi2_tmp += trans_size;
  878|   426k|            zero_cols = zero_cols >> 1;
  879|   426k|        }
  880|       |
  881|  29.8k|        pi2_tmp = pi2_tmp_orig;
  882|       |
  883|       |        /* Inverse Transform 2nd stage */
  884|  29.8k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  29.8k|#define IT_SHIFT_STAGE_2 12
  ------------------
  885|  29.8k|        add = 1 << (shift - 1);
  886|  29.8k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (886:12): [True: 11.5k, False: 18.3k]
  ------------------
  887|  11.5k|        {
  888|   367k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (888:24): [True: 356k, False: 11.5k]
  ------------------
  889|   356k|            {
  890|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  891|  5.99M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (891:28): [True: 5.63M, False: 356k]
  ------------------
  892|  5.63M|                {
  893|  5.63M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  894|  5.63M|                                    + g_ai2_ihevc_trans_32[3][k]
  895|  5.63M|                                                    * pi2_tmp[3 * trans_size];
  896|  5.63M|                }
  897|  3.21M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (897:28): [True: 2.85M, False: 356k]
  ------------------
  898|  2.85M|                {
  899|  2.85M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  900|  2.85M|                }
  901|       |//                for(k = 0; k < 4; k++)
  902|   356k|                {
  903|   356k|                    eeo[0] = 0;
  904|   356k|                    eeo[1] = 0;
  905|   356k|                    eeo[2] = 0;
  906|   356k|                    eeo[3] = 0;
  907|   356k|                }
  908|   356k|                eeeo[0] = 0;
  909|   356k|                eeeo[1] = 0;
  910|   356k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  911|   356k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  912|       |
  913|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  914|   356k|                eee[0] = eeee[0] + eeeo[0];
  915|   356k|                eee[3] = eeee[0] - eeeo[0];
  916|   356k|                eee[1] = eeee[1] + eeeo[1];
  917|   356k|                eee[2] = eeee[1] - eeeo[1];
  918|  1.78M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (918:28): [True: 1.43M, False: 356k]
  ------------------
  919|  1.43M|                {
  920|  1.43M|                    ee[k] = eee[k] + eeo[k];
  921|  1.43M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  922|  1.43M|                }
  923|  3.20M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (923:28): [True: 2.84M, False: 356k]
  ------------------
  924|  2.84M|                {
  925|  2.84M|                    e[k] = ee[k] + eo[k];
  926|  2.84M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  927|  2.84M|                }
  928|  5.92M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (928:28): [True: 5.56M, False: 356k]
  ------------------
  929|  5.56M|                {
  930|  5.56M|                    WORD32 itrans_out;
  931|  5.56M|                    itrans_out =
  932|  5.56M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.56M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.56M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|  5.56M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  5.56M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 945k, False: 4.62M]
  |  |  |  |  |  Branch (40:53): [True: 145k, False: 4.47M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|  5.56M|                    itrans_out =
  935|  5.56M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  5.56M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.56M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  936|  5.56M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  5.56M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.56M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 960k, False: 4.60M]
  |  |  |  |  |  Branch (40:53): [True: 152k, False: 4.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|  5.56M|                }
  938|   356k|                pi2_tmp++;
  939|   356k|                pu1_pred += pred_strd;
  940|   356k|                pu1_dst += dst_strd;
  941|   356k|            }
  942|  11.5k|        }
  943|  18.3k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (943:17): [True: 8.61k, False: 9.72k]
  ------------------
  944|  8.61k|        {
  945|   269k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (945:24): [True: 260k, False: 8.61k]
  ------------------
  946|   260k|            {
  947|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  948|  4.37M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (948:28): [True: 4.10M, False: 260k]
  ------------------
  949|  4.10M|                {
  950|  4.10M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  951|  4.10M|                                    + g_ai2_ihevc_trans_32[3][k]
  952|  4.10M|                                                    * pi2_tmp[3 * trans_size]
  953|  4.10M|                                    + g_ai2_ihevc_trans_32[5][k]
  954|  4.10M|                                                    * pi2_tmp[5 * trans_size]
  955|  4.10M|                                    + g_ai2_ihevc_trans_32[7][k]
  956|  4.10M|                                                    * pi2_tmp[7 * trans_size];
  957|  4.10M|                }
  958|  2.36M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (958:28): [True: 2.10M, False: 260k]
  ------------------
  959|  2.10M|                {
  960|  2.10M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  961|  2.10M|                                    + g_ai2_ihevc_trans_32[6][k]
  962|  2.10M|                                                    * pi2_tmp[6 * trans_size];
  963|  2.10M|                }
  964|  1.32M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (964:28): [True: 1.06M, False: 260k]
  ------------------
  965|  1.06M|                {
  966|  1.06M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  967|  1.06M|                }
  968|   260k|                eeeo[0] = 0;
  969|   260k|                eeeo[1] = 0;
  970|   260k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  971|   260k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  972|       |
  973|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  974|   260k|                eee[0] = eeee[0] + eeeo[0];
  975|   260k|                eee[3] = eeee[0] - eeeo[0];
  976|   260k|                eee[1] = eeee[1] + eeeo[1];
  977|   260k|                eee[2] = eeee[1] - eeeo[1];
  978|  1.32M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (978:28): [True: 1.06M, False: 260k]
  ------------------
  979|  1.06M|                {
  980|  1.06M|                    ee[k] = eee[k] + eeo[k];
  981|  1.06M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  982|  1.06M|                }
  983|  2.37M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (983:28): [True: 2.11M, False: 260k]
  ------------------
  984|  2.11M|                {
  985|  2.11M|                    e[k] = ee[k] + eo[k];
  986|  2.11M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  987|  2.11M|                }
  988|  4.30M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (988:28): [True: 4.04M, False: 260k]
  ------------------
  989|  4.04M|                {
  990|  4.04M|                    WORD32 itrans_out;
  991|  4.04M|                    itrans_out =
  992|  4.04M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.04M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.04M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|  4.04M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.04M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 299k, False: 3.74M]
  |  |  |  |  |  Branch (40:53): [True: 391k, False: 3.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  4.04M|                    itrans_out =
  995|  4.04M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  4.04M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.04M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  996|  4.04M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  4.04M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 348k, False: 3.69M]
  |  |  |  |  |  Branch (40:53): [True: 385k, False: 3.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  997|  4.04M|                }
  998|   260k|                pi2_tmp++;
  999|   260k|                pu1_pred += pred_strd;
 1000|   260k|                pu1_dst += dst_strd;
 1001|   260k|            }
 1002|  8.61k|        }
 1003|  9.72k|        else /* All rows of output of 1st stage are non-zero */
 1004|  9.72k|        {
 1005|   309k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1005:24): [True: 299k, False: 9.72k]
  ------------------
 1006|   299k|            {
 1007|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1008|  5.07M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1008:28): [True: 4.77M, False: 299k]
  ------------------
 1009|  4.77M|                {
 1010|  4.77M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1011|  4.77M|                                    + g_ai2_ihevc_trans_32[3][k]
 1012|  4.77M|                                                    * pi2_tmp[3 * trans_size]
 1013|  4.77M|                                    + g_ai2_ihevc_trans_32[5][k]
 1014|  4.77M|                                                    * pi2_tmp[5 * trans_size]
 1015|  4.77M|                                    + g_ai2_ihevc_trans_32[7][k]
 1016|  4.77M|                                                    * pi2_tmp[7 * trans_size]
 1017|  4.77M|                                    + g_ai2_ihevc_trans_32[9][k]
 1018|  4.77M|                                                    * pi2_tmp[9 * trans_size]
 1019|  4.77M|                                    + g_ai2_ihevc_trans_32[11][k]
 1020|  4.77M|                                                    * pi2_tmp[11 * trans_size]
 1021|  4.77M|                                    + g_ai2_ihevc_trans_32[13][k]
 1022|  4.77M|                                                    * pi2_tmp[13 * trans_size]
 1023|  4.77M|                                    + g_ai2_ihevc_trans_32[15][k]
 1024|  4.77M|                                                    * pi2_tmp[15 * trans_size]
 1025|  4.77M|                                    + g_ai2_ihevc_trans_32[17][k]
 1026|  4.77M|                                                    * pi2_tmp[17 * trans_size]
 1027|  4.77M|                                    + g_ai2_ihevc_trans_32[19][k]
 1028|  4.77M|                                                    * pi2_tmp[19 * trans_size]
 1029|  4.77M|                                    + g_ai2_ihevc_trans_32[21][k]
 1030|  4.77M|                                                    * pi2_tmp[21 * trans_size]
 1031|  4.77M|                                    + g_ai2_ihevc_trans_32[23][k]
 1032|  4.77M|                                                    * pi2_tmp[23 * trans_size]
 1033|  4.77M|                                    + g_ai2_ihevc_trans_32[25][k]
 1034|  4.77M|                                                    * pi2_tmp[25 * trans_size]
 1035|  4.77M|                                    + g_ai2_ihevc_trans_32[27][k]
 1036|  4.77M|                                                    * pi2_tmp[27 * trans_size]
 1037|  4.77M|                                    + g_ai2_ihevc_trans_32[29][k]
 1038|  4.77M|                                                    * pi2_tmp[29 * trans_size]
 1039|  4.77M|                                    + g_ai2_ihevc_trans_32[31][k]
 1040|  4.77M|                                                    * pi2_tmp[31 * trans_size];
 1041|  4.77M|                }
 1042|  2.73M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1042:28): [True: 2.43M, False: 299k]
  ------------------
 1043|  2.43M|                {
 1044|  2.43M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1045|  2.43M|                                    + g_ai2_ihevc_trans_32[6][k]
 1046|  2.43M|                                                    * pi2_tmp[6 * trans_size]
 1047|  2.43M|                                    + g_ai2_ihevc_trans_32[10][k]
 1048|  2.43M|                                                    * pi2_tmp[10 * trans_size]
 1049|  2.43M|                                    + g_ai2_ihevc_trans_32[14][k]
 1050|  2.43M|                                                    * pi2_tmp[14 * trans_size]
 1051|  2.43M|                                    + g_ai2_ihevc_trans_32[18][k]
 1052|  2.43M|                                                    * pi2_tmp[18 * trans_size]
 1053|  2.43M|                                    + g_ai2_ihevc_trans_32[22][k]
 1054|  2.43M|                                                    * pi2_tmp[22 * trans_size]
 1055|  2.43M|                                    + g_ai2_ihevc_trans_32[26][k]
 1056|  2.43M|                                                    * pi2_tmp[26 * trans_size]
 1057|  2.43M|                                    + g_ai2_ihevc_trans_32[30][k]
 1058|  2.43M|                                                    * pi2_tmp[30 * trans_size];
 1059|  2.43M|                }
 1060|  1.53M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1060:28): [True: 1.23M, False: 299k]
  ------------------
 1061|  1.23M|                {
 1062|  1.23M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1063|  1.23M|                                    + g_ai2_ihevc_trans_32[12][k]
 1064|  1.23M|                                                    * pi2_tmp[12 * trans_size]
 1065|  1.23M|                                    + g_ai2_ihevc_trans_32[20][k]
 1066|  1.23M|                                                    * pi2_tmp[20 * trans_size]
 1067|  1.23M|                                    + g_ai2_ihevc_trans_32[28][k]
 1068|  1.23M|                                                    * pi2_tmp[28 * trans_size];
 1069|  1.23M|                }
 1070|   299k|                eeeo[0] =
 1071|   299k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1072|   299k|                                                + g_ai2_ihevc_trans_32[24][0]
 1073|   299k|                                                                * pi2_tmp[24
 1074|   299k|                                                                                * trans_size];
 1075|   299k|                eeeo[1] =
 1076|   299k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1077|   299k|                                                + g_ai2_ihevc_trans_32[24][1]
 1078|   299k|                                                                * pi2_tmp[24
 1079|   299k|                                                                                * trans_size];
 1080|   299k|                eeee[0] =
 1081|   299k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1082|   299k|                                                + g_ai2_ihevc_trans_32[16][0]
 1083|   299k|                                                                * pi2_tmp[16
 1084|   299k|                                                                                * trans_size];
 1085|   299k|                eeee[1] =
 1086|   299k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1087|   299k|                                                + g_ai2_ihevc_trans_32[16][1]
 1088|   299k|                                                                * pi2_tmp[16
 1089|   299k|                                                                                * trans_size];
 1090|       |
 1091|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1092|   299k|                eee[0] = eeee[0] + eeeo[0];
 1093|   299k|                eee[3] = eeee[0] - eeeo[0];
 1094|   299k|                eee[1] = eeee[1] + eeeo[1];
 1095|   299k|                eee[2] = eeee[1] - eeeo[1];
 1096|  1.53M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1096:28): [True: 1.23M, False: 299k]
  ------------------
 1097|  1.23M|                {
 1098|  1.23M|                    ee[k] = eee[k] + eeo[k];
 1099|  1.23M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1100|  1.23M|                }
 1101|  2.76M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1101:28): [True: 2.46M, False: 299k]
  ------------------
 1102|  2.46M|                {
 1103|  2.46M|                    e[k] = ee[k] + eo[k];
 1104|  2.46M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1105|  2.46M|                }
 1106|  5.04M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1106:28): [True: 4.74M, False: 299k]
  ------------------
 1107|  4.74M|                {
 1108|  4.74M|                    WORD32 itrans_out;
 1109|  4.74M|                    itrans_out =
 1110|  4.74M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|  4.74M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.74M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 970k, False: 3.77M]
  |  |  |  |  |  Branch (40:53): [True: 665k, False: 3.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  4.74M|                    itrans_out =
 1113|  4.74M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  4.74M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.74M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.74M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1114|  4.74M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  4.74M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 919k, False: 3.82M]
  |  |  |  |  |  Branch (40:53): [True: 665k, False: 3.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|  4.74M|                }
 1116|   299k|                pi2_tmp++;
 1117|   299k|                pu1_pred += pred_strd;
 1118|   299k|                pu1_dst += dst_strd;
 1119|   299k|            }
 1120|  9.72k|        }
 1121|       |        /************************************************************************************************/
 1122|       |        /************************************END - IT_RECON_32x32****************************************/
 1123|       |        /************************************************************************************************/
 1124|  29.8k|    }
 1125|   142k|}

ihevc_itrans_recon_8x8:
  106|   153k|{
  107|   153k|    WORD32 j, k;
  108|   153k|    WORD32 e[4], o[4];
  109|   153k|    WORD32 ee[2], eo[2];
  110|   153k|    WORD32 add;
  111|   153k|    WORD32 shift;
  112|   153k|    WORD16 *pi2_tmp_orig;
  113|   153k|    WORD32 trans_size;
  114|   153k|    WORD32 zero_rows_2nd_stage = zero_cols;
  115|   153k|    WORD32 row_limit_2nd_stage;
  116|       |
  117|   153k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|   153k|#define TRANS_SIZE_8   8
  ------------------
  118|       |
  119|   153k|    pi2_tmp_orig = pi2_tmp;
  120|       |
  121|   153k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (121:8): [True: 113k, False: 39.0k]
  ------------------
  122|   113k|        row_limit_2nd_stage = 4;
  123|  39.0k|    else
  124|  39.0k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  39.0k|#define TRANS_SIZE_8   8
  ------------------
  125|       |
  126|       |
  127|   153k|    if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (127:8): [True: 111k, False: 41.3k]
  ------------------
  128|   111k|    {
  129|       |        /************************************************************************************************/
  130|       |        /**********************************START - IT_RECON_8x8******************************************/
  131|       |        /************************************************************************************************/
  132|       |
  133|       |        /* Inverse Transform 1st stage */
  134|   111k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   111k|#define IT_SHIFT_STAGE_1 7
  ------------------
  135|   111k|        add = 1 << (shift - 1);
  136|       |
  137|   647k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (137:20): [True: 535k, False: 111k]
  ------------------
  138|   535k|        {
  139|       |            /* Checking for Zero Cols */
  140|   535k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (140:16): [True: 199k, False: 336k]
  ------------------
  141|   199k|            {
  142|   199k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  143|   199k|            }
  144|   336k|            else
  145|   336k|            {
  146|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  147|  1.68M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (147:28): [True: 1.35M, False: 336k]
  ------------------
  148|  1.35M|                {
  149|  1.35M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  150|  1.35M|                                    + g_ai2_ihevc_trans_8[3][k]
  151|  1.35M|                                                    * pi2_src[3 * src_strd];
  152|  1.35M|                }
  153|   336k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd];
  154|   336k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd];
  155|   336k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0];
  156|   336k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0];
  157|       |
  158|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  159|   336k|                e[0] = ee[0] + eo[0];
  160|   336k|                e[3] = ee[0] - eo[0];
  161|   336k|                e[1] = ee[1] + eo[1];
  162|   336k|                e[2] = ee[1] - eo[1];
  163|  1.68M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (163:28): [True: 1.35M, False: 336k]
  ------------------
  164|  1.35M|                {
  165|  1.35M|                    pi2_tmp[k] =
  166|  1.35M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.35M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.35M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 42.4k, False: 1.30M]
  |  |  |  |  |  Branch (40:53): [True: 20.8k, False: 1.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|  1.35M|                    pi2_tmp[k + 4] =
  168|  1.35M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.35M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.35M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 20.8k, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 18.9k, False: 1.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  1.35M|                }
  170|   336k|            }
  171|   535k|            pi2_src++;
  172|   535k|            pi2_tmp += trans_size;
  173|   535k|            zero_cols = zero_cols >> 1;
  174|   535k|        }
  175|       |
  176|   111k|        pi2_tmp = pi2_tmp_orig;
  177|       |
  178|       |        /* Inverse Transform 2nd stage */
  179|   111k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   111k|#define IT_SHIFT_STAGE_2 12
  ------------------
  180|   111k|        add = 1 << (shift - 1);
  181|   111k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (181:12): [True: 88.6k, False: 23.0k]
  ------------------
  182|  88.6k|        {
  183|   786k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (183:24): [True: 697k, False: 88.6k]
  ------------------
  184|   697k|            {
  185|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  186|  3.48M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (186:28): [True: 2.78M, False: 697k]
  ------------------
  187|  2.78M|                {
  188|  2.78M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  189|  2.78M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  190|  2.78M|                }
  191|   697k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  192|   697k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  193|   697k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  194|   697k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  195|       |
  196|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  197|   697k|                e[0] = ee[0] + eo[0];
  198|   697k|                e[3] = ee[0] - eo[0];
  199|   697k|                e[1] = ee[1] + eo[1];
  200|   697k|                e[2] = ee[1] - eo[1];
  201|  3.48M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (201:28): [True: 2.78M, False: 697k]
  ------------------
  202|  2.78M|                {
  203|  2.78M|                    WORD32 itrans_out;
  204|  2.78M|                    itrans_out =
  205|  2.78M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.78M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.78M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.78M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.78M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|  2.78M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  2.78M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.78M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 587k, False: 2.19M]
  |  |  |  |  |  Branch (40:53): [True: 570k, False: 1.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  2.78M|                    itrans_out =
  208|  2.78M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  2.78M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.78M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.78M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.78M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  2.78M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  2.78M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.78M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 583k, False: 2.20M]
  |  |  |  |  |  Branch (40:53): [True: 572k, False: 1.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  2.78M|                }
  211|   697k|                pi2_tmp++;
  212|   697k|                pu1_pred += pred_strd;
  213|   697k|                pu1_dst += dst_strd;
  214|   697k|            }
  215|  88.6k|        }
  216|  23.0k|        else /* All rows of output of 1st stage are non-zero */
  217|  23.0k|        {
  218|   208k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (218:24): [True: 185k, False: 23.0k]
  ------------------
  219|   185k|            {
  220|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  221|   926k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (221:28): [True: 741k, False: 185k]
  ------------------
  222|   741k|                {
  223|   741k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  224|   741k|                                    + g_ai2_ihevc_trans_8[3][k]
  225|   741k|                                                    * pi2_tmp[3 * trans_size]
  226|   741k|                                    + g_ai2_ihevc_trans_8[5][k]
  227|   741k|                                                    * pi2_tmp[5 * trans_size]
  228|   741k|                                    + g_ai2_ihevc_trans_8[7][k]
  229|   741k|                                                    * pi2_tmp[7 * trans_size];
  230|   741k|                }
  231|       |
  232|   185k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  233|   185k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  234|   185k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  235|   185k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  236|   185k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  237|   185k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  238|   185k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  239|   185k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  240|       |
  241|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  242|   185k|                e[0] = ee[0] + eo[0];
  243|   185k|                e[3] = ee[0] - eo[0];
  244|   185k|                e[1] = ee[1] + eo[1];
  245|   185k|                e[2] = ee[1] - eo[1];
  246|   925k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (246:28): [True: 740k, False: 185k]
  ------------------
  247|   740k|                {
  248|   740k|                    WORD32 itrans_out;
  249|   740k|                    itrans_out =
  250|   740k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   740k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   740k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 740k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 740k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|   740k|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|   740k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   740k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 216k, False: 524k]
  |  |  |  |  |  Branch (40:53): [True: 183k, False: 340k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|   740k|                    itrans_out =
  253|   740k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   740k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   740k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 740k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 740k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|   740k|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|   740k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   740k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 230k, False: 509k]
  |  |  |  |  |  Branch (40:53): [True: 182k, False: 327k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|   740k|                }
  256|   185k|                pi2_tmp++;
  257|   185k|                pu1_pred += pred_strd;
  258|   185k|                pu1_dst += dst_strd;
  259|   185k|            }
  260|  23.0k|        }
  261|       |        /************************************************************************************************/
  262|       |        /************************************END - IT_RECON_8x8******************************************/
  263|       |        /************************************************************************************************/
  264|   111k|    }
  265|  41.3k|    else /* All rows of input are non-zero */
  266|  41.3k|    {
  267|       |        /************************************************************************************************/
  268|       |        /**********************************START - IT_RECON_8x8******************************************/
  269|       |        /************************************************************************************************/
  270|       |
  271|       |        /* Inverse Transform 1st stage */
  272|  41.3k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  41.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
  273|  41.3k|        add = 1 << (shift - 1);
  274|       |
  275|   270k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (275:20): [True: 228k, False: 41.3k]
  ------------------
  276|   228k|        {
  277|       |            /* Checking for Zero Cols */
  278|   228k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (278:16): [True: 68.8k, False: 160k]
  ------------------
  279|  68.8k|            {
  280|  68.8k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  281|  68.8k|            }
  282|   160k|            else
  283|   160k|            {
  284|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  285|   801k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (285:28): [True: 641k, False: 160k]
  ------------------
  286|   641k|                {
  287|   641k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  288|   641k|                                    + g_ai2_ihevc_trans_8[3][k]
  289|   641k|                                                    * pi2_src[3 * src_strd]
  290|   641k|                                    + g_ai2_ihevc_trans_8[5][k]
  291|   641k|                                                    * pi2_src[5 * src_strd]
  292|   641k|                                    + g_ai2_ihevc_trans_8[7][k]
  293|   641k|                                                    * pi2_src[7 * src_strd];
  294|   641k|                }
  295|       |
  296|   160k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  297|   160k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  298|   160k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  299|   160k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  300|   160k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  301|   160k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  302|   160k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  303|   160k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd];
  304|       |
  305|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  306|   160k|                e[0] = ee[0] + eo[0];
  307|   160k|                e[3] = ee[0] - eo[0];
  308|   160k|                e[1] = ee[1] + eo[1];
  309|   160k|                e[2] = ee[1] - eo[1];
  310|   802k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (310:28): [True: 642k, False: 160k]
  ------------------
  311|   642k|                {
  312|   642k|                    pi2_tmp[k] =
  313|   642k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   642k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   642k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 17.2k, False: 625k]
  |  |  |  |  |  Branch (40:53): [True: 14.8k, False: 610k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|   642k|                    pi2_tmp[k + 4] =
  315|   642k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   642k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   642k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.7k, False: 628k]
  |  |  |  |  |  Branch (40:53): [True: 13.3k, False: 615k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|   642k|                }
  317|   160k|            }
  318|   228k|            pi2_src++;
  319|   228k|            pi2_tmp += trans_size;
  320|   228k|            zero_cols = zero_cols >> 1;
  321|   228k|        }
  322|       |
  323|  41.3k|        pi2_tmp = pi2_tmp_orig;
  324|       |
  325|       |        /* Inverse Transform 2nd stage */
  326|  41.3k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  41.3k|#define IT_SHIFT_STAGE_2 12
  ------------------
  327|  41.3k|        add = 1 << (shift - 1);
  328|  41.3k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (328:12): [True: 25.6k, False: 15.6k]
  ------------------
  329|  25.6k|        {
  330|   229k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (330:24): [True: 204k, False: 25.6k]
  ------------------
  331|   204k|            {
  332|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  333|  1.02M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (333:28): [True: 817k, False: 204k]
  ------------------
  334|   817k|                {
  335|   817k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  336|   817k|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  337|   817k|                }
  338|   204k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  339|   204k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  340|   204k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  341|   204k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  342|       |
  343|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  344|   204k|                e[0] = ee[0] + eo[0];
  345|   204k|                e[3] = ee[0] - eo[0];
  346|   204k|                e[1] = ee[1] + eo[1];
  347|   204k|                e[2] = ee[1] - eo[1];
  348|  1.02M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (348:28): [True: 816k, False: 204k]
  ------------------
  349|   816k|                {
  350|   816k|                    WORD32 itrans_out;
  351|   816k|                    itrans_out =
  352|   816k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   816k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   816k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 816k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 816k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|   816k|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|   816k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   816k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 215k, False: 601k]
  |  |  |  |  |  Branch (40:53): [True: 192k, False: 408k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|   816k|                    itrans_out =
  355|   816k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   816k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   816k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 816k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 816k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|   816k|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|   816k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   816k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 213k, False: 602k]
  |  |  |  |  |  Branch (40:53): [True: 186k, False: 415k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|   816k|                }
  358|   204k|                pi2_tmp++;
  359|   204k|                pu1_pred += pred_strd;
  360|   204k|                pu1_dst += dst_strd;
  361|   204k|            }
  362|  25.6k|        }
  363|  15.6k|        else /* All rows of output of 1st stage are non-zero */
  364|  15.6k|        {
  365|   142k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (365:24): [True: 126k, False: 15.6k]
  ------------------
  366|   126k|            {
  367|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  368|   633k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (368:28): [True: 507k, False: 126k]
  ------------------
  369|   507k|                {
  370|   507k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  371|   507k|                                    + g_ai2_ihevc_trans_8[3][k]
  372|   507k|                                                    * pi2_tmp[3 * trans_size]
  373|   507k|                                    + g_ai2_ihevc_trans_8[5][k]
  374|   507k|                                                    * pi2_tmp[5 * trans_size]
  375|   507k|                                    + g_ai2_ihevc_trans_8[7][k]
  376|   507k|                                                    * pi2_tmp[7 * trans_size];
  377|   507k|                }
  378|       |
  379|   126k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  380|   126k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  381|   126k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  382|   126k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  383|   126k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  384|   126k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  385|   126k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  386|   126k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  387|       |
  388|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  389|   126k|                e[0] = ee[0] + eo[0];
  390|   126k|                e[3] = ee[0] - eo[0];
  391|   126k|                e[1] = ee[1] + eo[1];
  392|   126k|                e[2] = ee[1] - eo[1];
  393|   633k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (393:28): [True: 506k, False: 126k]
  ------------------
  394|   506k|                {
  395|   506k|                    WORD32 itrans_out;
  396|   506k|                    itrans_out =
  397|   506k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   506k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   506k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 506k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 506k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  398|   506k|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|   506k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   506k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 100k, False: 405k]
  |  |  |  |  |  Branch (40:53): [True: 83.9k, False: 321k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|   506k|                    itrans_out =
  400|   506k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   506k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   506k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 506k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 506k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|   506k|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|   506k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   506k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 91.2k, False: 415k]
  |  |  |  |  |  Branch (40:53): [True: 82.6k, False: 332k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|   506k|                }
  403|   126k|                pi2_tmp++;
  404|   126k|                pu1_pred += pred_strd;
  405|   126k|                pu1_dst += dst_strd;
  406|   126k|            }
  407|  15.6k|        }
  408|       |        /************************************************************************************************/
  409|       |        /************************************END - IT_RECON_8x8******************************************/
  410|       |        /************************************************************************************************/
  411|  41.3k|    }
  412|   153k|}

ihevc_itrans_res_4x4:
  153|  5.87k|{
  154|  5.87k|    WORD32 j;
  155|  5.87k|    WORD32 e[2], o[2];
  156|  5.87k|    WORD32 add;
  157|  5.87k|    WORD32 shift;
  158|  5.87k|    WORD16 *pi2_tmp_orig;
  159|  5.87k|    WORD32 trans_size;
  160|  5.87k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  5.87k|#define UNUSED(x) ((void)(x))
  ------------------
  161|  5.87k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  5.87k|#define TRANS_SIZE_4   4
  ------------------
  162|       |
  163|  5.87k|    pi2_tmp_orig = pi2_tmp;
  164|       |
  165|       |    /* Inverse Transform 1st stage */
  166|  5.87k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  5.87k|#define IT_SHIFT_STAGE_1 7
  ------------------
  167|  5.87k|    add = 1 << (shift - 1);
  168|       |
  169|  29.3k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (169:16): [True: 23.5k, False: 5.87k]
  ------------------
  170|  23.5k|    {
  171|       |        /* Checking for Zero Cols */
  172|  23.5k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (172:12): [True: 13.1k, False: 10.3k]
  ------------------
  173|  13.1k|        {
  174|  13.1k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  175|  13.1k|        }
  176|  10.3k|        else
  177|  10.3k|        {
  178|       |
  179|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  180|  10.3k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  181|  10.3k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  182|  10.3k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  183|  10.3k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  184|  10.3k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  185|  10.3k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  186|  10.3k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  187|  10.3k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  188|       |
  189|  10.3k|            pi2_tmp[0] =
  190|  10.3k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  10.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  10.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 18, False: 10.3k]
  |  |  |  |  |  Branch (40:53): [True: 99, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  10.3k|            pi2_tmp[1] =
  192|  10.3k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  10.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  10.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 116, False: 10.2k]
  |  |  |  |  |  Branch (40:53): [True: 68, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  10.3k|            pi2_tmp[2] =
  194|  10.3k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  10.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  10.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 34, False: 10.3k]
  |  |  |  |  |  Branch (40:53): [True: 69, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  10.3k|            pi2_tmp[3] =
  196|  10.3k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  10.3k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  10.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 70, False: 10.3k]
  |  |  |  |  |  Branch (40:53): [True: 70, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |
  198|  10.3k|        }
  199|  23.5k|        pi2_src++;
  200|  23.5k|        pi2_tmp += trans_size;
  201|  23.5k|        zero_cols = zero_cols >> 1;
  202|  23.5k|    }
  203|       |
  204|  5.87k|    pi2_tmp = pi2_tmp_orig;
  205|       |
  206|       |    /* Inverse Transform 2nd stage */
  207|  5.87k|    shift = 20 - bit_depth;
  208|  5.87k|    add = 1 << (shift - 1);
  209|       |
  210|  29.3k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (210:16): [True: 23.5k, False: 5.87k]
  ------------------
  211|  23.5k|    {
  212|  23.5k|        WORD32 itrans_out;
  213|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  214|  23.5k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  215|  23.5k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  216|  23.5k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  217|  23.5k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  218|  23.5k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  219|  23.5k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  220|  23.5k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  221|  23.5k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  222|       |
  223|  23.5k|        pi2_dst[0] =
  224|  23.5k|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  23.5k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.5k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|       |
  226|  23.5k|        pi2_dst[1] =
  227|  23.5k|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  23.5k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.5k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|       |
  229|  23.5k|        pi2_dst[2] =
  230|  23.5k|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  23.5k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.5k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|  23.5k|        pi2_dst[3] =
  233|  23.5k|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  23.5k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.5k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|       |
  235|  23.5k|        pi2_tmp++;
  236|  23.5k|        pi2_dst += dst_strd;
  237|       |
  238|  23.5k|    }
  239|  5.87k|}
ihevc_itrans_res_dc:
  247|  23.4k|{
  248|  23.4k|    WORD32 row, col;
  249|  23.4k|    WORD32 add, shift;
  250|  23.4k|    WORD32 dc_value, quant_out;
  251|  23.4k|    WORD32 trans_size;
  252|       |
  253|  23.4k|    trans_size = (1 << log2_trans_size);
  254|       |
  255|  23.4k|    quant_out = i2_coeff_value;
  256|       |
  257|  23.4k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  23.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  258|  23.4k|    add = 1 << (shift - 1);
  259|  23.4k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|  23.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.4k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|  23.4k|    shift = 20 - bit_depth;
  261|  23.4k|    add = 1 << (shift - 1);
  262|  23.4k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|  23.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.4k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|       |
  264|   193k|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (264:18): [True: 170k, False: 23.4k]
  ------------------
  265|  2.17M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (265:22): [True: 1.99M, False: 170k]
  ------------------
  266|  1.99M|            pi2_dst[row * dst_strd + col] = dc_value;
  267|       |
  268|  23.4k|}
ihevc_itrans_res_8x8:
  279|  40.9k|{
  280|  40.9k|    WORD32 j, k;
  281|  40.9k|    WORD32 e[4], o[4];
  282|  40.9k|    WORD32 ee[2], eo[2];
  283|  40.9k|    WORD32 add;
  284|  40.9k|    WORD32 shift;
  285|  40.9k|    WORD16 *pi2_tmp_orig;
  286|  40.9k|    WORD32 trans_size;
  287|  40.9k|    WORD32 zero_rows_2nd_stage = zero_cols;
  288|  40.9k|    WORD32 row_limit_2nd_stage;
  289|       |
  290|  40.9k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  40.9k|#define TRANS_SIZE_8   8
  ------------------
  291|       |
  292|  40.9k|    pi2_tmp_orig = pi2_tmp;
  293|       |
  294|  40.9k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (294:8): [True: 16.1k, False: 24.7k]
  ------------------
  295|  16.1k|        row_limit_2nd_stage = 4;
  296|  24.7k|    else
  297|  24.7k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  430|  24.7k|#define TRANS_SIZE_8   8
  ------------------
  298|       |
  299|       |
  300|  40.9k|    if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (300:8): [True: 12.8k, False: 28.1k]
  ------------------
  301|  12.8k|    {
  302|       |        /************************************************************************************************/
  303|       |        /**********************************START - IT_RECON_8x8******************************************/
  304|       |        /************************************************************************************************/
  305|       |
  306|       |        /* Inverse Transform 1st stage */
  307|  12.8k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  12.8k|#define IT_SHIFT_STAGE_1 7
  ------------------
  308|  12.8k|        add = 1 << (shift - 1);
  309|       |
  310|  82.9k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (310:20): [True: 70.0k, False: 12.8k]
  ------------------
  311|  70.0k|        {
  312|       |            /* Checking for Zero Cols */
  313|  70.0k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (313:16): [True: 28.7k, False: 41.3k]
  ------------------
  314|  28.7k|            {
  315|  28.7k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  316|  28.7k|            }
  317|  41.3k|            else
  318|  41.3k|            {
  319|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  320|   207k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (320:28): [True: 165k, False: 41.3k]
  ------------------
  321|   165k|                {
  322|   165k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  323|   165k|                                    + g_ai2_ihevc_trans_8[3][k]
  324|   165k|                                                    * pi2_src[3 * src_strd];
  325|   165k|                }
  326|  41.3k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd];
  327|  41.3k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd];
  328|  41.3k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0];
  329|  41.3k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0];
  330|       |
  331|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  332|  41.3k|                e[0] = ee[0] + eo[0];
  333|  41.3k|                e[3] = ee[0] - eo[0];
  334|  41.3k|                e[1] = ee[1] + eo[1];
  335|  41.3k|                e[2] = ee[1] - eo[1];
  336|   207k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (336:28): [True: 165k, False: 41.3k]
  ------------------
  337|   165k|                {
  338|   165k|                    pi2_tmp[k] =
  339|   165k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   165k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   165k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 274, False: 165k]
  |  |  |  |  |  Branch (40:53): [True: 818, False: 164k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  340|   165k|                    pi2_tmp[k + 4] =
  341|   165k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   165k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   165k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 422, False: 165k]
  |  |  |  |  |  Branch (40:53): [True: 585, False: 164k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  342|   165k|                }
  343|  41.3k|            }
  344|  70.0k|            pi2_src++;
  345|  70.0k|            pi2_tmp += trans_size;
  346|  70.0k|            zero_cols = zero_cols >> 1;
  347|  70.0k|        }
  348|       |
  349|  12.8k|        pi2_tmp = pi2_tmp_orig;
  350|       |
  351|       |        /* Inverse Transform 2nd stage */
  352|  12.8k|        shift = 20 - bit_depth;
  353|  12.8k|        add = 1 << (shift - 1);
  354|  12.8k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (354:12): [True: 8.14k, False: 4.69k]
  ------------------
  355|  8.14k|        {
  356|  73.0k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (356:24): [True: 64.9k, False: 8.14k]
  ------------------
  357|  64.9k|            {
  358|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  359|   324k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (359:28): [True: 259k, False: 64.9k]
  ------------------
  360|   259k|                {
  361|   259k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  362|   259k|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  363|   259k|                }
  364|  64.9k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  365|  64.9k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  366|  64.9k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  367|  64.9k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  368|       |
  369|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  370|  64.9k|                e[0] = ee[0] + eo[0];
  371|  64.9k|                e[3] = ee[0] - eo[0];
  372|  64.9k|                e[1] = ee[1] + eo[1];
  373|  64.9k|                e[2] = ee[1] - eo[1];
  374|   324k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (374:28): [True: 259k, False: 64.9k]
  ------------------
  375|   259k|                {
  376|   259k|                    pi2_dst[k] =
  377|   259k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   259k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   259k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 259k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 259k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  378|       |
  379|   259k|                    pi2_dst[k + 4] =
  380|   259k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   259k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   259k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 259k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 259k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  381|   259k|                }
  382|  64.9k|                pi2_tmp++;
  383|  64.9k|                pi2_dst += dst_strd;
  384|  64.9k|            }
  385|  8.14k|        }
  386|  4.69k|        else /* All rows of output of 1st stage are non-zero */
  387|  4.69k|        {
  388|  42.3k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (388:24): [True: 37.7k, False: 4.69k]
  ------------------
  389|  37.7k|            {
  390|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  391|   188k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (391:28): [True: 150k, False: 37.7k]
  ------------------
  392|   150k|                {
  393|   150k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  394|   150k|                                    + g_ai2_ihevc_trans_8[3][k]
  395|   150k|                                                    * pi2_tmp[3 * trans_size]
  396|   150k|                                    + g_ai2_ihevc_trans_8[5][k]
  397|   150k|                                                    * pi2_tmp[5 * trans_size]
  398|   150k|                                    + g_ai2_ihevc_trans_8[7][k]
  399|   150k|                                                    * pi2_tmp[7 * trans_size];
  400|   150k|                }
  401|       |
  402|  37.7k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  403|  37.7k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  404|  37.7k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  405|  37.7k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  406|  37.7k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  407|  37.7k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  408|  37.7k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  409|  37.7k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  410|       |
  411|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  412|  37.7k|                e[0] = ee[0] + eo[0];
  413|  37.7k|                e[3] = ee[0] - eo[0];
  414|  37.7k|                e[1] = ee[1] + eo[1];
  415|  37.7k|                e[2] = ee[1] - eo[1];
  416|   188k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (416:28): [True: 150k, False: 37.7k]
  ------------------
  417|   150k|                {
  418|   150k|                    pi2_dst[k] =
  419|   150k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   150k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   150k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 150k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|       |
  421|   150k|                    pi2_dst[k + 4] =
  422|   150k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   150k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   150k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 150k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  423|   150k|                }
  424|  37.7k|                pi2_tmp++;
  425|  37.7k|                pi2_dst += dst_strd;
  426|  37.7k|            }
  427|  4.69k|        }
  428|       |        /************************************************************************************************/
  429|       |        /************************************END - IT_RECON_8x8******************************************/
  430|       |        /************************************************************************************************/
  431|  12.8k|    }
  432|  28.1k|    else /* All rows of input are non-zero */
  433|  28.1k|    {
  434|       |        /************************************************************************************************/
  435|       |        /**********************************START - IT_RECON_8x8******************************************/
  436|       |        /************************************************************************************************/
  437|       |
  438|       |        /* Inverse Transform 1st stage */
  439|  28.1k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  28.1k|#define IT_SHIFT_STAGE_1 7
  ------------------
  440|  28.1k|        add = 1 << (shift - 1);
  441|       |
  442|   221k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (442:20): [True: 192k, False: 28.1k]
  ------------------
  443|   192k|        {
  444|       |            /* Checking for Zero Cols */
  445|   192k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (445:16): [True: 64.6k, False: 128k]
  ------------------
  446|  64.6k|            {
  447|  64.6k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  448|  64.6k|            }
  449|   128k|            else
  450|   128k|            {
  451|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  452|   641k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (452:28): [True: 513k, False: 128k]
  ------------------
  453|   513k|                {
  454|   513k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  455|   513k|                                    + g_ai2_ihevc_trans_8[3][k]
  456|   513k|                                                    * pi2_src[3 * src_strd]
  457|   513k|                                    + g_ai2_ihevc_trans_8[5][k]
  458|   513k|                                                    * pi2_src[5 * src_strd]
  459|   513k|                                    + g_ai2_ihevc_trans_8[7][k]
  460|   513k|                                                    * pi2_src[7 * src_strd];
  461|   513k|                }
  462|       |
  463|   128k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  464|   128k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  465|   128k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  466|   128k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  467|   128k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  468|   128k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  469|   128k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  470|   128k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd];
  471|       |
  472|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  473|   128k|                e[0] = ee[0] + eo[0];
  474|   128k|                e[3] = ee[0] - eo[0];
  475|   128k|                e[1] = ee[1] + eo[1];
  476|   128k|                e[2] = ee[1] - eo[1];
  477|   641k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (477:28): [True: 513k, False: 128k]
  ------------------
  478|   513k|                {
  479|   513k|                    pi2_tmp[k] =
  480|   513k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   513k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   513k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.70k, False: 511k]
  |  |  |  |  |  Branch (40:53): [True: 1.45k, False: 509k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|   513k|                    pi2_tmp[k + 4] =
  482|   513k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   513k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   513k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.26k, False: 511k]
  |  |  |  |  |  Branch (40:53): [True: 1.63k, False: 510k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   513k|                }
  484|   128k|            }
  485|   192k|            pi2_src++;
  486|   192k|            pi2_tmp += trans_size;
  487|   192k|            zero_cols = zero_cols >> 1;
  488|   192k|        }
  489|       |
  490|  28.1k|        pi2_tmp = pi2_tmp_orig;
  491|       |
  492|       |        /* Inverse Transform 2nd stage */
  493|  28.1k|        shift = 20 - bit_depth;
  494|  28.1k|        add = 1 << (shift - 1);
  495|  28.1k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (495:12): [True: 8.04k, False: 20.0k]
  ------------------
  496|  8.04k|        {
  497|  72.1k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (497:24): [True: 64.1k, False: 8.04k]
  ------------------
  498|  64.1k|            {
  499|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  500|   320k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (500:28): [True: 256k, False: 64.1k]
  ------------------
  501|   256k|                {
  502|   256k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  503|   256k|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  504|   256k|                }
  505|  64.1k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  506|  64.1k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  507|  64.1k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  508|  64.1k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  509|       |
  510|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  511|  64.1k|                e[0] = ee[0] + eo[0];
  512|  64.1k|                e[3] = ee[0] - eo[0];
  513|  64.1k|                e[1] = ee[1] + eo[1];
  514|  64.1k|                e[2] = ee[1] - eo[1];
  515|   320k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (515:28): [True: 256k, False: 64.1k]
  ------------------
  516|   256k|                {
  517|   256k|                    pi2_dst[k] =
  518|   256k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   256k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   256k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 256k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  519|       |
  520|   256k|                    pi2_dst[k + 4] =
  521|   256k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   256k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   256k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 256k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 256k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  522|   256k|                }
  523|  64.1k|                pi2_tmp++;
  524|  64.1k|                pi2_dst += dst_strd;
  525|  64.1k|            }
  526|  8.04k|        }
  527|  20.0k|        else /* All rows of output of 1st stage are non-zero */
  528|  20.0k|        {
  529|   180k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (529:24): [True: 160k, False: 20.0k]
  ------------------
  530|   160k|            {
  531|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  532|   804k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (532:28): [True: 643k, False: 160k]
  ------------------
  533|   643k|                {
  534|   643k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  535|   643k|                                    + g_ai2_ihevc_trans_8[3][k]
  536|   643k|                                                    * pi2_tmp[3 * trans_size]
  537|   643k|                                    + g_ai2_ihevc_trans_8[5][k]
  538|   643k|                                                    * pi2_tmp[5 * trans_size]
  539|   643k|                                    + g_ai2_ihevc_trans_8[7][k]
  540|   643k|                                                    * pi2_tmp[7 * trans_size];
  541|   643k|                }
  542|       |
  543|   160k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  544|   160k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  545|   160k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  546|   160k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  547|   160k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  548|   160k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  549|   160k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  550|   160k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  551|       |
  552|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  553|   160k|                e[0] = ee[0] + eo[0];
  554|   160k|                e[3] = ee[0] - eo[0];
  555|   160k|                e[1] = ee[1] + eo[1];
  556|   160k|                e[2] = ee[1] - eo[1];
  557|   804k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (557:28): [True: 643k, False: 160k]
  ------------------
  558|   643k|                {
  559|   643k|                    pi2_dst[k] =
  560|   643k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   643k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   643k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 643k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 643k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  561|       |
  562|   643k|                    pi2_dst[k + 4] =
  563|   643k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   643k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   643k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 643k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 643k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  564|   643k|                }
  565|   160k|                pi2_tmp++;
  566|   160k|                pi2_dst += dst_strd;
  567|   160k|            }
  568|  20.0k|        }
  569|       |        /************************************************************************************************/
  570|       |        /************************************END - IT_RECON_8x8******************************************/
  571|       |        /************************************************************************************************/
  572|  28.1k|    }
  573|  40.9k|}
ihevc_itrans_res_16x16:
  584|  39.6k|{
  585|  39.6k|    WORD32 j, k;
  586|  39.6k|    WORD32 e[8], o[8];
  587|  39.6k|    WORD32 ee[4], eo[4];
  588|  39.6k|    WORD32 eee[2], eeo[2];
  589|  39.6k|    WORD32 add;
  590|  39.6k|    WORD32 shift;
  591|  39.6k|    WORD16 *pi2_tmp_orig;
  592|  39.6k|    WORD32 trans_size;
  593|  39.6k|    WORD32 zero_rows_2nd_stage = zero_cols;
  594|  39.6k|    WORD32 row_limit_2nd_stage;
  595|       |
  596|  39.6k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (596:8): [True: 12.8k, False: 26.8k]
  ------------------
  597|  12.8k|        row_limit_2nd_stage = 4;
  598|  26.8k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (598:13): [True: 9.29k, False: 17.5k]
  ------------------
  599|  9.29k|        row_limit_2nd_stage = 8;
  600|  17.5k|    else
  601|  17.5k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  431|  17.5k|#define TRANS_SIZE_16 16
  ------------------
  602|       |
  603|  39.6k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  39.6k|#define TRANS_SIZE_16 16
  ------------------
  604|  39.6k|    pi2_tmp_orig = pi2_tmp;
  605|  39.6k|    if((zero_rows & 0xFFF0) == 0xFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (605:8): [True: 19.6k, False: 20.0k]
  ------------------
  606|  19.6k|    {
  607|       |        /* Inverse Transform 1st stage */
  608|       |        /************************************************************************************************/
  609|       |        /**********************************START - IT_RECON_16x16****************************************/
  610|       |        /************************************************************************************************/
  611|       |
  612|  19.6k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  19.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  613|  19.6k|        add = 1 << (shift - 1);
  614|       |
  615|   208k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (615:20): [True: 188k, False: 19.6k]
  ------------------
  616|   188k|        {
  617|       |            /* Checking for Zero Cols */
  618|   188k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (618:16): [True: 71.3k, False: 117k]
  ------------------
  619|  71.3k|            {
  620|  71.3k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  621|  71.3k|            }
  622|   117k|            else
  623|   117k|            {
  624|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  625|  1.05M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (625:28): [True: 941k, False: 117k]
  ------------------
  626|   941k|                {
  627|   941k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  628|   941k|                                    + g_ai2_ihevc_trans_16[3][k]
  629|   941k|                                                    * pi2_src[3 * src_strd];
  630|   941k|                }
  631|   588k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (631:28): [True: 470k, False: 117k]
  ------------------
  632|   470k|                {
  633|   470k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  634|   470k|                }
  635|   117k|                eeo[0] = 0;
  636|   117k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  637|   117k|                eeo[1] = 0;
  638|   117k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  639|       |
  640|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  641|   352k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (641:28): [True: 235k, False: 117k]
  ------------------
  642|   235k|                {
  643|   235k|                    ee[k] = eee[k] + eeo[k];
  644|   235k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  645|   235k|                }
  646|   588k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (646:28): [True: 470k, False: 117k]
  ------------------
  647|   470k|                {
  648|   470k|                    e[k] = ee[k] + eo[k];
  649|   470k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  650|   470k|                }
  651|  1.05M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (651:28): [True: 941k, False: 117k]
  ------------------
  652|   941k|                {
  653|   941k|                    pi2_tmp[k] =
  654|   941k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   941k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   941k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 156, False: 941k]
  |  |  |  |  |  Branch (40:53): [True: 305, False: 941k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  655|   941k|                    pi2_tmp[k + 8] =
  656|   941k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   941k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   941k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 233, False: 941k]
  |  |  |  |  |  Branch (40:53): [True: 305, False: 941k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  657|   941k|                }
  658|   117k|            }
  659|   188k|            pi2_src++;
  660|   188k|            pi2_tmp += trans_size;
  661|   188k|            zero_cols = zero_cols >> 1;
  662|   188k|        }
  663|       |
  664|  19.6k|        pi2_tmp = pi2_tmp_orig;
  665|       |
  666|       |        /* Inverse Transform 2nd stage */
  667|  19.6k|        shift = 20 - bit_depth;
  668|  19.6k|        add = 1 << (shift - 1);
  669|       |
  670|  19.6k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (670:12): [True: 6.47k, False: 13.1k]
  ------------------
  671|  6.47k|        {
  672|   109k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (672:24): [True: 103k, False: 6.47k]
  ------------------
  673|   103k|            {
  674|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  675|   930k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (675:28): [True: 826k, False: 103k]
  ------------------
  676|   826k|                {
  677|   826k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  678|   826k|                                    + g_ai2_ihevc_trans_16[3][k]
  679|   826k|                                                    * pi2_tmp[3 * trans_size];
  680|   826k|                }
  681|   516k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (681:28): [True: 413k, False: 103k]
  ------------------
  682|   413k|                {
  683|   413k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  684|   413k|                }
  685|   103k|                eeo[0] = 0;
  686|   103k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  687|   103k|                eeo[1] = 0;
  688|   103k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  689|       |
  690|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  691|   310k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (691:28): [True: 206k, False: 103k]
  ------------------
  692|   206k|                {
  693|   206k|                    ee[k] = eee[k] + eeo[k];
  694|   206k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  695|   206k|                }
  696|   516k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (696:28): [True: 413k, False: 103k]
  ------------------
  697|   413k|                {
  698|   413k|                    e[k] = ee[k] + eo[k];
  699|   413k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  700|   413k|                }
  701|   929k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (701:28): [True: 826k, False: 103k]
  ------------------
  702|   826k|                {
  703|   826k|                    pi2_dst[k] =
  704|   826k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   826k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   826k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 826k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 826k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|       |
  706|   826k|                    pi2_dst[k + 8] =
  707|   826k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   826k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   826k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 826k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 826k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|   826k|                }
  709|   103k|                pi2_tmp++;
  710|   103k|                pi2_dst += dst_strd;
  711|   103k|            }
  712|  6.47k|        }
  713|  13.1k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (713:17): [True: 5.74k, False: 7.38k]
  ------------------
  714|  5.74k|        {
  715|  96.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (715:24): [True: 91.0k, False: 5.74k]
  ------------------
  716|  91.0k|            {
  717|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  718|   819k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (718:28): [True: 728k, False: 91.0k]
  ------------------
  719|   728k|                {
  720|   728k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  721|   728k|                                    + g_ai2_ihevc_trans_16[3][k]
  722|   728k|                                                    * pi2_tmp[3 * trans_size]
  723|   728k|                                    + g_ai2_ihevc_trans_16[5][k]
  724|   728k|                                                    * pi2_tmp[5 * trans_size]
  725|   728k|                                    + g_ai2_ihevc_trans_16[7][k]
  726|   728k|                                                    * pi2_tmp[7 * trans_size];
  727|   728k|                }
  728|   455k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (728:28): [True: 364k, False: 91.0k]
  ------------------
  729|   364k|                {
  730|   364k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  731|   364k|                                    + g_ai2_ihevc_trans_16[6][k]
  732|   364k|                                                    * pi2_tmp[6 * trans_size];
  733|   364k|                }
  734|  91.0k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  735|  91.0k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  736|  91.0k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  737|  91.0k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  738|       |
  739|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  740|   273k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (740:28): [True: 182k, False: 91.0k]
  ------------------
  741|   182k|                {
  742|   182k|                    ee[k] = eee[k] + eeo[k];
  743|   182k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  744|   182k|                }
  745|   455k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (745:28): [True: 364k, False: 91.0k]
  ------------------
  746|   364k|                {
  747|   364k|                    e[k] = ee[k] + eo[k];
  748|   364k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  749|   364k|                }
  750|   819k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (750:28): [True: 728k, False: 91.0k]
  ------------------
  751|   728k|                {
  752|   728k|                    pi2_dst[k] =
  753|   728k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   728k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   728k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 728k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 728k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|       |
  755|   728k|                    pi2_dst[k + 8] =
  756|   728k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   728k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   728k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 728k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 728k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|   728k|                }
  758|  91.0k|                pi2_tmp++;
  759|  91.0k|                pi2_dst += dst_strd;
  760|  91.0k|            }
  761|  5.74k|        }
  762|  7.38k|        else /* All rows of output of 1st stage are non-zero */
  763|  7.38k|        {
  764|   123k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (764:24): [True: 115k, False: 7.38k]
  ------------------
  765|   115k|            {
  766|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  767|  1.04M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (767:28): [True: 927k, False: 115k]
  ------------------
  768|   927k|                {
  769|   927k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  770|   927k|                                    + g_ai2_ihevc_trans_16[3][k]
  771|   927k|                                                    * pi2_tmp[3 * trans_size]
  772|   927k|                                    + g_ai2_ihevc_trans_16[5][k]
  773|   927k|                                                    * pi2_tmp[5 * trans_size]
  774|   927k|                                    + g_ai2_ihevc_trans_16[7][k]
  775|   927k|                                                    * pi2_tmp[7 * trans_size]
  776|   927k|                                    + g_ai2_ihevc_trans_16[9][k]
  777|   927k|                                                    * pi2_tmp[9 * trans_size]
  778|   927k|                                    + g_ai2_ihevc_trans_16[11][k]
  779|   927k|                                                    * pi2_tmp[11 * trans_size]
  780|   927k|                                    + g_ai2_ihevc_trans_16[13][k]
  781|   927k|                                                    * pi2_tmp[13 * trans_size]
  782|   927k|                                    + g_ai2_ihevc_trans_16[15][k]
  783|   927k|                                                    * pi2_tmp[15 * trans_size];
  784|   927k|                }
  785|   579k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (785:28): [True: 463k, False: 115k]
  ------------------
  786|   463k|                {
  787|   463k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  788|   463k|                                    + g_ai2_ihevc_trans_16[6][k]
  789|   463k|                                                    * pi2_tmp[6 * trans_size]
  790|   463k|                                    + g_ai2_ihevc_trans_16[10][k]
  791|   463k|                                                    * pi2_tmp[10 * trans_size]
  792|   463k|                                    + g_ai2_ihevc_trans_16[14][k]
  793|   463k|                                                    * pi2_tmp[14 * trans_size];
  794|   463k|                }
  795|   115k|                eeo[0] =
  796|   115k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  797|   115k|                                                + g_ai2_ihevc_trans_16[12][0]
  798|   115k|                                                                * pi2_tmp[12
  799|   115k|                                                                                * trans_size];
  800|   115k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  801|   115k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  802|   115k|                eeo[1] =
  803|   115k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  804|   115k|                                                + g_ai2_ihevc_trans_16[12][1]
  805|   115k|                                                                * pi2_tmp[12
  806|   115k|                                                                                * trans_size];
  807|   115k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  808|   115k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  809|       |
  810|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  811|   348k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (811:28): [True: 232k, False: 115k]
  ------------------
  812|   232k|                {
  813|   232k|                    ee[k] = eee[k] + eeo[k];
  814|   232k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  815|   232k|                }
  816|   579k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (816:28): [True: 463k, False: 115k]
  ------------------
  817|   463k|                {
  818|   463k|                    e[k] = ee[k] + eo[k];
  819|   463k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  820|   463k|                }
  821|  1.04M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (821:28): [True: 926k, False: 115k]
  ------------------
  822|   926k|                {
  823|   926k|                    pi2_dst[k] =
  824|   926k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   926k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   926k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 926k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 926k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  825|       |
  826|   926k|                    pi2_dst[k + 8] =
  827|   926k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   926k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   926k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 926k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 926k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|   926k|                }
  829|   115k|                pi2_tmp++;
  830|   115k|                pi2_dst += dst_strd;
  831|   115k|            }
  832|  7.38k|        }
  833|       |        /************************************************************************************************/
  834|       |        /************************************END - IT_RECON_16x16****************************************/
  835|       |        /************************************************************************************************/
  836|  19.6k|    }
  837|  20.0k|    else if((zero_rows & 0xFF00) == 0xFF00)  /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (837:13): [True: 8.67k, False: 11.3k]
  ------------------
  838|  8.67k|    {
  839|       |        /* Inverse Transform 1st stage */
  840|       |        /************************************************************************************************/
  841|       |        /**********************************START - IT_RECON_16x16****************************************/
  842|       |        /************************************************************************************************/
  843|       |
  844|  8.67k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  8.67k|#define IT_SHIFT_STAGE_1 7
  ------------------
  845|  8.67k|        add = 1 << (shift - 1);
  846|       |
  847|  89.6k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (847:20): [True: 80.9k, False: 8.67k]
  ------------------
  848|  80.9k|        {
  849|       |            /* Checking for Zero Cols */
  850|  80.9k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (850:16): [True: 45.2k, False: 35.6k]
  ------------------
  851|  45.2k|            {
  852|  45.2k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  853|  45.2k|            }
  854|  35.6k|            else
  855|  35.6k|            {
  856|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  857|   322k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (857:28): [True: 286k, False: 35.6k]
  ------------------
  858|   286k|                {
  859|   286k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  860|   286k|                                    + g_ai2_ihevc_trans_16[3][k]
  861|   286k|                                                    * pi2_src[3 * src_strd]
  862|   286k|                                    + g_ai2_ihevc_trans_16[5][k]
  863|   286k|                                                    * pi2_src[5 * src_strd]
  864|   286k|                                    + g_ai2_ihevc_trans_16[7][k]
  865|   286k|                                                    * pi2_src[7 * src_strd];
  866|   286k|                }
  867|   179k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (867:28): [True: 143k, False: 35.6k]
  ------------------
  868|   143k|                {
  869|   143k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  870|   143k|                                    + g_ai2_ihevc_trans_16[6][k]
  871|   143k|                                                    * pi2_src[6 * src_strd];
  872|   143k|                }
  873|  35.6k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  874|  35.6k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  875|  35.6k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  876|  35.6k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  877|       |
  878|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  879|   107k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (879:28): [True: 71.6k, False: 35.6k]
  ------------------
  880|  71.6k|                {
  881|  71.6k|                    ee[k] = eee[k] + eeo[k];
  882|  71.6k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  883|  71.6k|                }
  884|   178k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (884:28): [True: 143k, False: 35.6k]
  ------------------
  885|   143k|                {
  886|   143k|                    e[k] = ee[k] + eo[k];
  887|   143k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  888|   143k|                }
  889|   322k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (889:28): [True: 286k, False: 35.6k]
  ------------------
  890|   286k|                {
  891|   286k|                    pi2_tmp[k] =
  892|   286k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   286k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   286k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 302, False: 286k]
  |  |  |  |  |  Branch (40:53): [True: 422, False: 285k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  893|   286k|                    pi2_tmp[k + 8] =
  894|   286k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   286k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   286k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 379, False: 286k]
  |  |  |  |  |  Branch (40:53): [True: 699, False: 285k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  895|   286k|                }
  896|  35.6k|            }
  897|  80.9k|            pi2_src++;
  898|  80.9k|            pi2_tmp += trans_size;
  899|  80.9k|            zero_cols = zero_cols >> 1;
  900|  80.9k|        }
  901|       |
  902|  8.67k|        pi2_tmp = pi2_tmp_orig;
  903|       |
  904|       |        /* Inverse Transform 2nd stage */
  905|  8.67k|        shift = 20 - bit_depth;
  906|  8.67k|        add = 1 << (shift - 1);
  907|       |
  908|  8.67k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (908:12): [True: 3.69k, False: 4.97k]
  ------------------
  909|  3.69k|        {
  910|  61.5k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (910:24): [True: 57.8k, False: 3.69k]
  ------------------
  911|  57.8k|            {
  912|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  913|   519k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (913:28): [True: 462k, False: 57.8k]
  ------------------
  914|   462k|                {
  915|   462k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  916|   462k|                                    + g_ai2_ihevc_trans_16[3][k]
  917|   462k|                                                    * pi2_tmp[3 * trans_size];
  918|   462k|                }
  919|   289k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (919:28): [True: 231k, False: 57.8k]
  ------------------
  920|   231k|                {
  921|   231k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  922|   231k|                }
  923|  57.8k|                eeo[0] = 0;
  924|  57.8k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  925|  57.8k|                eeo[1] = 0;
  926|  57.8k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  927|       |
  928|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  929|   173k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (929:28): [True: 115k, False: 57.8k]
  ------------------
  930|   115k|                {
  931|   115k|                    ee[k] = eee[k] + eeo[k];
  932|   115k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  933|   115k|                }
  934|   288k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (934:28): [True: 230k, False: 57.8k]
  ------------------
  935|   230k|                {
  936|   230k|                    e[k] = ee[k] + eo[k];
  937|   230k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  938|   230k|                }
  939|   519k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (939:28): [True: 461k, False: 57.8k]
  ------------------
  940|   461k|                {
  941|   461k|                    pi2_dst[k] =
  942|   461k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   461k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   461k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 461k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 461k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  943|       |
  944|   461k|                    pi2_dst[k + 8] =
  945|   461k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   461k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   461k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 461k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 461k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  946|   461k|                }
  947|  57.8k|                pi2_tmp++;
  948|  57.8k|                pi2_dst += dst_strd;
  949|  57.8k|            }
  950|  3.69k|        }
  951|  4.97k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (951:17): [True: 1.67k, False: 3.30k]
  ------------------
  952|  1.67k|        {
  953|  28.3k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (953:24): [True: 26.7k, False: 1.67k]
  ------------------
  954|  26.7k|            {
  955|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  956|   240k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (956:28): [True: 213k, False: 26.7k]
  ------------------
  957|   213k|                {
  958|   213k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  959|   213k|                                    + g_ai2_ihevc_trans_16[3][k]
  960|   213k|                                                    * pi2_tmp[3 * trans_size]
  961|   213k|                                    + g_ai2_ihevc_trans_16[5][k]
  962|   213k|                                                    * pi2_tmp[5 * trans_size]
  963|   213k|                                    + g_ai2_ihevc_trans_16[7][k]
  964|   213k|                                                    * pi2_tmp[7 * trans_size];
  965|   213k|                }
  966|   133k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (966:28): [True: 106k, False: 26.7k]
  ------------------
  967|   106k|                {
  968|   106k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  969|   106k|                                    + g_ai2_ihevc_trans_16[6][k]
  970|   106k|                                                    * pi2_tmp[6 * trans_size];
  971|   106k|                }
  972|  26.7k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  973|  26.7k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  974|  26.7k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  975|  26.7k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  976|       |
  977|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  978|  80.1k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (978:28): [True: 53.4k, False: 26.7k]
  ------------------
  979|  53.4k|                {
  980|  53.4k|                    ee[k] = eee[k] + eeo[k];
  981|  53.4k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  982|  53.4k|                }
  983|   133k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (983:28): [True: 106k, False: 26.7k]
  ------------------
  984|   106k|                {
  985|   106k|                    e[k] = ee[k] + eo[k];
  986|   106k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  987|   106k|                }
  988|   239k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (988:28): [True: 213k, False: 26.7k]
  ------------------
  989|   213k|                {
  990|   213k|                    pi2_dst[k] =
  991|   213k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   213k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   213k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 213k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|       |
  993|   213k|                    pi2_dst[k + 8] =
  994|   213k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   213k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   213k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 213k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 213k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|   213k|                }
  996|  26.7k|                pi2_tmp++;
  997|  26.7k|                pi2_dst += dst_strd;
  998|  26.7k|            }
  999|  1.67k|        }
 1000|  3.30k|        else /* All rows of output of 1st stage are non-zero */
 1001|  3.30k|        {
 1002|  56.0k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1002:24): [True: 52.7k, False: 3.30k]
  ------------------
 1003|  52.7k|            {
 1004|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1005|   471k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1005:28): [True: 418k, False: 52.7k]
  ------------------
 1006|   418k|                {
 1007|   418k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
 1008|   418k|                                    + g_ai2_ihevc_trans_16[3][k]
 1009|   418k|                                                    * pi2_tmp[3 * trans_size]
 1010|   418k|                                    + g_ai2_ihevc_trans_16[5][k]
 1011|   418k|                                                    * pi2_tmp[5 * trans_size]
 1012|   418k|                                    + g_ai2_ihevc_trans_16[7][k]
 1013|   418k|                                                    * pi2_tmp[7 * trans_size]
 1014|   418k|                                    + g_ai2_ihevc_trans_16[9][k]
 1015|   418k|                                                    * pi2_tmp[9 * trans_size]
 1016|   418k|                                    + g_ai2_ihevc_trans_16[11][k]
 1017|   418k|                                                    * pi2_tmp[11 * trans_size]
 1018|   418k|                                    + g_ai2_ihevc_trans_16[13][k]
 1019|   418k|                                                    * pi2_tmp[13 * trans_size]
 1020|   418k|                                    + g_ai2_ihevc_trans_16[15][k]
 1021|   418k|                                                    * pi2_tmp[15 * trans_size];
 1022|   418k|                }
 1023|   263k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1023:28): [True: 210k, False: 52.7k]
  ------------------
 1024|   210k|                {
 1025|   210k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
 1026|   210k|                                    + g_ai2_ihevc_trans_16[6][k]
 1027|   210k|                                                    * pi2_tmp[6 * trans_size]
 1028|   210k|                                    + g_ai2_ihevc_trans_16[10][k]
 1029|   210k|                                                    * pi2_tmp[10 * trans_size]
 1030|   210k|                                    + g_ai2_ihevc_trans_16[14][k]
 1031|   210k|                                                    * pi2_tmp[14 * trans_size];
 1032|   210k|                }
 1033|  52.7k|                eeo[0] =
 1034|  52.7k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
 1035|  52.7k|                                                + g_ai2_ihevc_trans_16[12][0]
 1036|  52.7k|                                                                * pi2_tmp[12
 1037|  52.7k|                                                                                * trans_size];
 1038|  52.7k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
 1039|  52.7k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
 1040|  52.7k|                eeo[1] =
 1041|  52.7k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
 1042|  52.7k|                                                + g_ai2_ihevc_trans_16[12][1]
 1043|  52.7k|                                                                * pi2_tmp[12
 1044|  52.7k|                                                                                * trans_size];
 1045|  52.7k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
 1046|  52.7k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
 1047|       |
 1048|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1049|   157k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (1049:28): [True: 105k, False: 52.7k]
  ------------------
 1050|   105k|                {
 1051|   105k|                    ee[k] = eee[k] + eeo[k];
 1052|   105k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
 1053|   105k|                }
 1054|   262k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1054:28): [True: 209k, False: 52.7k]
  ------------------
 1055|   209k|                {
 1056|   209k|                    e[k] = ee[k] + eo[k];
 1057|   209k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
 1058|   209k|                }
 1059|   471k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1059:28): [True: 419k, False: 52.7k]
  ------------------
 1060|   419k|                {
 1061|   419k|                    pi2_dst[k] =
 1062|   419k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   419k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   419k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 419k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 419k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1063|       |
 1064|   419k|                    pi2_dst[k + 8] =
 1065|   419k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   419k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   419k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 419k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 419k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1066|   419k|                }
 1067|  52.7k|                pi2_tmp++;
 1068|  52.7k|                pi2_dst += dst_strd;
 1069|  52.7k|            }
 1070|  3.30k|        }
 1071|       |        /************************************************************************************************/
 1072|       |        /************************************END - IT_RECON_16x16****************************************/
 1073|       |        /************************************************************************************************/
 1074|  8.67k|    }
 1075|  11.3k|    else  /* All rows of input are non-zero */
 1076|  11.3k|    {
 1077|       |        /* Inverse Transform 1st stage */
 1078|       |        /************************************************************************************************/
 1079|       |        /**********************************START - IT_RECON_16x16****************************************/
 1080|       |        /************************************************************************************************/
 1081|       |
 1082|  11.3k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  11.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
 1083|  11.3k|        add = 1 << (shift - 1);
 1084|       |
 1085|   146k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (1085:20): [True: 135k, False: 11.3k]
  ------------------
 1086|   135k|        {
 1087|       |            /* Checking for Zero Cols */
 1088|   135k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (1088:16): [True: 56.3k, False: 79.0k]
  ------------------
 1089|  56.3k|            {
 1090|  56.3k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
 1091|  56.3k|            }
 1092|  79.0k|            else
 1093|  79.0k|            {
 1094|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1095|   711k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1095:28): [True: 632k, False: 79.0k]
  ------------------
 1096|   632k|                {
 1097|   632k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
 1098|   632k|                                    + g_ai2_ihevc_trans_16[3][k]
 1099|   632k|                                                    * pi2_src[3 * src_strd]
 1100|   632k|                                    + g_ai2_ihevc_trans_16[5][k]
 1101|   632k|                                                    * pi2_src[5 * src_strd]
 1102|   632k|                                    + g_ai2_ihevc_trans_16[7][k]
 1103|   632k|                                                    * pi2_src[7 * src_strd]
 1104|   632k|                                    + g_ai2_ihevc_trans_16[9][k]
 1105|   632k|                                                    * pi2_src[9 * src_strd]
 1106|   632k|                                    + g_ai2_ihevc_trans_16[11][k]
 1107|   632k|                                                    * pi2_src[11 * src_strd]
 1108|   632k|                                    + g_ai2_ihevc_trans_16[13][k]
 1109|   632k|                                                    * pi2_src[13 * src_strd]
 1110|   632k|                                    + g_ai2_ihevc_trans_16[15][k]
 1111|   632k|                                                    * pi2_src[15 * src_strd];
 1112|   632k|                }
 1113|   395k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1113:28): [True: 316k, False: 79.0k]
  ------------------
 1114|   316k|                {
 1115|   316k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
 1116|   316k|                                    + g_ai2_ihevc_trans_16[6][k]
 1117|   316k|                                                    * pi2_src[6 * src_strd]
 1118|   316k|                                    + g_ai2_ihevc_trans_16[10][k]
 1119|   316k|                                                    * pi2_src[10 * src_strd]
 1120|   316k|                                    + g_ai2_ihevc_trans_16[14][k]
 1121|   316k|                                                    * pi2_src[14 * src_strd];
 1122|   316k|                }
 1123|  79.0k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
 1124|  79.0k|                                + g_ai2_ihevc_trans_16[12][0]
 1125|  79.0k|                                                * pi2_src[12 * src_strd];
 1126|  79.0k|                eee[0] =
 1127|  79.0k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
 1128|  79.0k|                                                + g_ai2_ihevc_trans_16[8][0]
 1129|  79.0k|                                                                * pi2_src[8
 1130|  79.0k|                                                                                * src_strd];
 1131|  79.0k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
 1132|  79.0k|                                + g_ai2_ihevc_trans_16[12][1]
 1133|  79.0k|                                                * pi2_src[12 * src_strd];
 1134|  79.0k|                eee[1] =
 1135|  79.0k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
 1136|  79.0k|                                                + g_ai2_ihevc_trans_16[8][1]
 1137|  79.0k|                                                                * pi2_src[8
 1138|  79.0k|                                                                                * src_strd];
 1139|       |
 1140|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1141|   237k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (1141:28): [True: 158k, False: 79.0k]
  ------------------
 1142|   158k|                {
 1143|   158k|                    ee[k] = eee[k] + eeo[k];
 1144|   158k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
 1145|   158k|                }
 1146|   395k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1146:28): [True: 316k, False: 79.0k]
  ------------------
 1147|   316k|                {
 1148|   316k|                    e[k] = ee[k] + eo[k];
 1149|   316k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
 1150|   316k|                }
 1151|   711k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1151:28): [True: 632k, False: 79.0k]
  ------------------
 1152|   632k|                {
 1153|   632k|                    pi2_tmp[k] =
 1154|   632k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   632k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   632k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 424, False: 632k]
  |  |  |  |  |  Branch (40:53): [True: 541, False: 631k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1155|   632k|                    pi2_tmp[k + 8] =
 1156|   632k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   632k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   632k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 366, False: 632k]
  |  |  |  |  |  Branch (40:53): [True: 390, False: 631k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1157|   632k|                }
 1158|  79.0k|            }
 1159|   135k|            pi2_src++;
 1160|   135k|            pi2_tmp += trans_size;
 1161|   135k|            zero_cols = zero_cols >> 1;
 1162|   135k|        }
 1163|       |
 1164|  11.3k|        pi2_tmp = pi2_tmp_orig;
 1165|       |
 1166|       |        /* Inverse Transform 2nd stage */
 1167|  11.3k|        shift = 20 - bit_depth;
 1168|  11.3k|        add = 1 << (shift - 1);
 1169|       |
 1170|  11.3k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (1170:12): [True: 2.66k, False: 8.73k]
  ------------------
 1171|  2.66k|        {
 1172|  45.0k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1172:24): [True: 42.3k, False: 2.66k]
  ------------------
 1173|  42.3k|            {
 1174|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1175|   380k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1175:28): [True: 338k, False: 42.3k]
  ------------------
 1176|   338k|                {
 1177|   338k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
 1178|   338k|                                    + g_ai2_ihevc_trans_16[3][k]
 1179|   338k|                                                    * pi2_tmp[3 * trans_size];
 1180|   338k|                }
 1181|   211k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1181:28): [True: 169k, False: 42.3k]
  ------------------
 1182|   169k|                {
 1183|   169k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
 1184|   169k|                }
 1185|  42.3k|                eeo[0] = 0;
 1186|  42.3k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
 1187|  42.3k|                eeo[1] = 0;
 1188|  42.3k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
 1189|       |
 1190|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1191|   126k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (1191:28): [True: 84.5k, False: 42.3k]
  ------------------
 1192|  84.5k|                {
 1193|  84.5k|                    ee[k] = eee[k] + eeo[k];
 1194|  84.5k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
 1195|  84.5k|                }
 1196|   211k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1196:28): [True: 168k, False: 42.3k]
  ------------------
 1197|   168k|                {
 1198|   168k|                    e[k] = ee[k] + eo[k];
 1199|   168k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
 1200|   168k|                }
 1201|   379k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1201:28): [True: 337k, False: 42.3k]
  ------------------
 1202|   337k|                {
 1203|   337k|                    pi2_dst[k] =
 1204|   337k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   337k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   337k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 337k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 337k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1205|       |
 1206|   337k|                    pi2_dst[k + 8] =
 1207|   337k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   337k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   337k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 337k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 337k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1208|   337k|                }
 1209|  42.3k|                pi2_tmp++;
 1210|  42.3k|                pi2_dst += dst_strd;
 1211|  42.3k|            }
 1212|  2.66k|        }
 1213|  8.73k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (1213:17): [True: 1.86k, False: 6.86k]
  ------------------
 1214|  1.86k|        {
 1215|  31.1k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1215:24): [True: 29.2k, False: 1.86k]
  ------------------
 1216|  29.2k|            {
 1217|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1218|   263k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1218:28): [True: 234k, False: 29.2k]
  ------------------
 1219|   234k|                {
 1220|   234k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
 1221|   234k|                                    + g_ai2_ihevc_trans_16[3][k]
 1222|   234k|                                                    * pi2_tmp[3 * trans_size]
 1223|   234k|                                    + g_ai2_ihevc_trans_16[5][k]
 1224|   234k|                                                    * pi2_tmp[5 * trans_size]
 1225|   234k|                                    + g_ai2_ihevc_trans_16[7][k]
 1226|   234k|                                                    * pi2_tmp[7 * trans_size];
 1227|   234k|                }
 1228|   146k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1228:28): [True: 117k, False: 29.2k]
  ------------------
 1229|   117k|                {
 1230|   117k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
 1231|   117k|                                    + g_ai2_ihevc_trans_16[6][k]
 1232|   117k|                                                    * pi2_tmp[6 * trans_size];
 1233|   117k|                }
 1234|  29.2k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
 1235|  29.2k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
 1236|  29.2k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
 1237|  29.2k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
 1238|       |
 1239|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1240|  87.8k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (1240:28): [True: 58.6k, False: 29.2k]
  ------------------
 1241|  58.6k|                {
 1242|  58.6k|                    ee[k] = eee[k] + eeo[k];
 1243|  58.6k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
 1244|  58.6k|                }
 1245|   147k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1245:28): [True: 117k, False: 29.2k]
  ------------------
 1246|   117k|                {
 1247|   117k|                    e[k] = ee[k] + eo[k];
 1248|   117k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
 1249|   117k|                }
 1250|   263k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1250:28): [True: 234k, False: 29.2k]
  ------------------
 1251|   234k|                {
 1252|   234k|                    pi2_dst[k] =
 1253|   234k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   234k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   234k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 234k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 234k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1254|       |
 1255|   234k|                    pi2_dst[k + 8] =
 1256|   234k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   234k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   234k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 234k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 234k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1257|   234k|                }
 1258|  29.2k|                pi2_tmp++;
 1259|  29.2k|                pi2_dst += dst_strd;
 1260|  29.2k|            }
 1261|  1.86k|        }
 1262|  6.86k|        else /* All rows of output of 1st stage are non-zero */
 1263|  6.86k|        {
 1264|   116k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1264:24): [True: 109k, False: 6.86k]
  ------------------
 1265|   109k|            {
 1266|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1267|   988k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1267:28): [True: 878k, False: 109k]
  ------------------
 1268|   878k|                {
 1269|   878k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
 1270|   878k|                                    + g_ai2_ihevc_trans_16[3][k]
 1271|   878k|                                                    * pi2_tmp[3 * trans_size]
 1272|   878k|                                    + g_ai2_ihevc_trans_16[5][k]
 1273|   878k|                                                    * pi2_tmp[5 * trans_size]
 1274|   878k|                                    + g_ai2_ihevc_trans_16[7][k]
 1275|   878k|                                                    * pi2_tmp[7 * trans_size]
 1276|   878k|                                    + g_ai2_ihevc_trans_16[9][k]
 1277|   878k|                                                    * pi2_tmp[9 * trans_size]
 1278|   878k|                                    + g_ai2_ihevc_trans_16[11][k]
 1279|   878k|                                                    * pi2_tmp[11 * trans_size]
 1280|   878k|                                    + g_ai2_ihevc_trans_16[13][k]
 1281|   878k|                                                    * pi2_tmp[13 * trans_size]
 1282|   878k|                                    + g_ai2_ihevc_trans_16[15][k]
 1283|   878k|                                                    * pi2_tmp[15 * trans_size];
 1284|   878k|                }
 1285|   549k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1285:28): [True: 439k, False: 109k]
  ------------------
 1286|   439k|                {
 1287|   439k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
 1288|   439k|                                    + g_ai2_ihevc_trans_16[6][k]
 1289|   439k|                                                    * pi2_tmp[6 * trans_size]
 1290|   439k|                                    + g_ai2_ihevc_trans_16[10][k]
 1291|   439k|                                                    * pi2_tmp[10 * trans_size]
 1292|   439k|                                    + g_ai2_ihevc_trans_16[14][k]
 1293|   439k|                                                    * pi2_tmp[14 * trans_size];
 1294|   439k|                }
 1295|   109k|                eeo[0] =
 1296|   109k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
 1297|   109k|                                                + g_ai2_ihevc_trans_16[12][0]
 1298|   109k|                                                                * pi2_tmp[12
 1299|   109k|                                                                                * trans_size];
 1300|   109k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
 1301|   109k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
 1302|   109k|                eeo[1] =
 1303|   109k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
 1304|   109k|                                                + g_ai2_ihevc_trans_16[12][1]
 1305|   109k|                                                                * pi2_tmp[12
 1306|   109k|                                                                                * trans_size];
 1307|   109k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
 1308|   109k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
 1309|       |
 1310|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1311|   329k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (1311:28): [True: 219k, False: 109k]
  ------------------
 1312|   219k|                {
 1313|   219k|                    ee[k] = eee[k] + eeo[k];
 1314|   219k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
 1315|   219k|                }
 1316|   548k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1316:28): [True: 439k, False: 109k]
  ------------------
 1317|   439k|                {
 1318|   439k|                    e[k] = ee[k] + eo[k];
 1319|   439k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
 1320|   439k|                }
 1321|   988k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1321:28): [True: 878k, False: 109k]
  ------------------
 1322|   878k|                {
 1323|   878k|                    pi2_dst[k] =
 1324|   878k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   878k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   878k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 878k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 878k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1325|       |
 1326|   878k|                    pi2_dst[k + 8] =
 1327|   878k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   878k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   878k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 878k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 878k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1328|   878k|                }
 1329|   109k|                pi2_tmp++;
 1330|   109k|                pi2_dst += dst_strd;
 1331|   109k|            }
 1332|  6.86k|        }
 1333|       |        /************************************************************************************************/
 1334|       |        /************************************END - IT_RECON_16x16****************************************/
 1335|       |        /************************************************************************************************/
 1336|  11.3k|    }
 1337|       |
 1338|  39.6k|}
ihevc_itrans_res_32x32:
 1349|  15.4k|{
 1350|  15.4k|    WORD32 j, k;
 1351|  15.4k|    WORD32 e[16], o[16];
 1352|  15.4k|    WORD32 ee[8], eo[8];
 1353|  15.4k|    WORD32 eee[4], eeo[4];
 1354|  15.4k|    WORD32 eeee[2], eeeo[2];
 1355|  15.4k|    WORD32 add;
 1356|  15.4k|    WORD32 shift;
 1357|  15.4k|    WORD16 *pi2_tmp_orig;
 1358|  15.4k|    WORD32 trans_size;
 1359|  15.4k|    WORD32 zero_rows_2nd_stage = zero_cols;
 1360|  15.4k|    WORD32 row_limit_2nd_stage;
 1361|       |
 1362|  15.4k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|  15.4k|#define TRANS_SIZE_32 32
  ------------------
 1363|  15.4k|    pi2_tmp_orig = pi2_tmp;
 1364|       |
 1365|  15.4k|    if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0)
  ------------------
  |  Branch (1365:8): [True: 4.74k, False: 10.7k]
  ------------------
 1366|  4.74k|        row_limit_2nd_stage = 4;
 1367|  10.7k|    else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00)
  ------------------
  |  Branch (1367:13): [True: 1.38k, False: 9.36k]
  ------------------
 1368|  1.38k|        row_limit_2nd_stage = 8;
 1369|  9.36k|    else
 1370|  9.36k|        row_limit_2nd_stage = TRANS_SIZE_32;
  ------------------
  |  |  432|  9.36k|#define TRANS_SIZE_32 32
  ------------------
 1371|       |
 1372|  15.4k|    if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (1372:8): [True: 4.64k, False: 10.8k]
  ------------------
 1373|  4.64k|    {
 1374|       |        /************************************************************************************************/
 1375|       |        /**********************************START - IT_RECON_32x32****************************************/
 1376|       |        /************************************************************************************************/
 1377|       |        /* Inverse Transform 1st stage */
 1378|  4.64k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  4.64k|#define IT_SHIFT_STAGE_1 7
  ------------------
 1379|  4.64k|        add = 1 << (shift - 1);
 1380|       |
 1381|  65.2k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (1381:20): [True: 60.6k, False: 4.64k]
  ------------------
 1382|  60.6k|        {
 1383|       |            /* Checking for Zero Cols */
 1384|  60.6k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (1384:16): [True: 40.3k, False: 20.2k]
  ------------------
 1385|  40.3k|            {
 1386|  40.3k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
 1387|  40.3k|            }
 1388|  20.2k|            else
 1389|  20.2k|            {
 1390|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1391|   344k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1391:28): [True: 323k, False: 20.2k]
  ------------------
 1392|   323k|                {
 1393|   323k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
 1394|   323k|                                    + g_ai2_ihevc_trans_32[3][k]
 1395|   323k|                                                    * pi2_src[3 * src_strd];
 1396|   323k|                }
 1397|   182k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1397:28): [True: 161k, False: 20.2k]
  ------------------
 1398|   161k|                {
 1399|   161k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd];
 1400|   161k|                }
 1401|       |//                for(k = 0; k < 4; k++)
 1402|  20.2k|                {
 1403|  20.2k|                    eeo[0] = 0;
 1404|  20.2k|                    eeo[1] = 0;
 1405|  20.2k|                    eeo[2] = 0;
 1406|  20.2k|                    eeo[3] = 0;
 1407|  20.2k|                }
 1408|  20.2k|                eeeo[0] = 0;
 1409|  20.2k|                eeeo[1] = 0;
 1410|  20.2k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
 1411|  20.2k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
 1412|       |
 1413|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1414|  20.2k|                eee[0] = eeee[0] + eeeo[0];
 1415|  20.2k|                eee[3] = eeee[0] - eeeo[0];
 1416|  20.2k|                eee[1] = eeee[1] + eeeo[1];
 1417|  20.2k|                eee[2] = eeee[1] - eeeo[1];
 1418|   101k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1418:28): [True: 80.9k, False: 20.2k]
  ------------------
 1419|  80.9k|                {
 1420|  80.9k|                    ee[k] = eee[k] + eeo[k];
 1421|  80.9k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1422|  80.9k|                }
 1423|   182k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1423:28): [True: 161k, False: 20.2k]
  ------------------
 1424|   161k|                {
 1425|   161k|                    e[k] = ee[k] + eo[k];
 1426|   161k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1427|   161k|                }
 1428|   344k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1428:28): [True: 323k, False: 20.2k]
  ------------------
 1429|   323k|                {
 1430|   323k|                    pi2_tmp[k] =
 1431|   323k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   323k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   323k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 595, False: 323k]
  |  |  |  |  |  Branch (40:53): [True: 869, False: 322k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1432|   323k|                    pi2_tmp[k + 16] =
 1433|   323k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   323k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   323k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 316, False: 323k]
  |  |  |  |  |  Branch (40:53): [True: 229, False: 323k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1434|   323k|                }
 1435|  20.2k|            }
 1436|  60.6k|            pi2_src++;
 1437|  60.6k|            pi2_tmp += trans_size;
 1438|  60.6k|            zero_cols = zero_cols >> 1;
 1439|  60.6k|        }
 1440|       |
 1441|  4.64k|        pi2_tmp = pi2_tmp_orig;
 1442|       |
 1443|       |        /* Inverse Transform 2nd stage */
 1444|  4.64k|        shift = 20 - bit_depth;
 1445|  4.64k|        add = 1 << (shift - 1);
 1446|  4.64k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (1446:12): [True: 2.63k, False: 2.01k]
  ------------------
 1447|  2.63k|        {
 1448|  86.7k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1448:24): [True: 84.1k, False: 2.63k]
  ------------------
 1449|  84.1k|            {
 1450|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1451|  1.42M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1451:28): [True: 1.34M, False: 84.1k]
  ------------------
 1452|  1.34M|                {
 1453|  1.34M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1454|  1.34M|                                    + g_ai2_ihevc_trans_32[3][k]
 1455|  1.34M|                                                    * pi2_tmp[3 * trans_size];
 1456|  1.34M|                }
 1457|   757k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1457:28): [True: 672k, False: 84.1k]
  ------------------
 1458|   672k|                {
 1459|   672k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
 1460|   672k|                }
 1461|       |//                for(k = 0; k < 4; k++)
 1462|  84.1k|                {
 1463|  84.1k|                    eeo[0] = 0;
 1464|  84.1k|                    eeo[1] = 0;
 1465|  84.1k|                    eeo[2] = 0;
 1466|  84.1k|                    eeo[3] = 0;
 1467|  84.1k|                }
 1468|  84.1k|                eeeo[0] = 0;
 1469|  84.1k|                eeeo[1] = 0;
 1470|  84.1k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
 1471|  84.1k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
 1472|       |
 1473|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1474|  84.1k|                eee[0] = eeee[0] + eeeo[0];
 1475|  84.1k|                eee[3] = eeee[0] - eeeo[0];
 1476|  84.1k|                eee[1] = eeee[1] + eeeo[1];
 1477|  84.1k|                eee[2] = eeee[1] - eeeo[1];
 1478|   420k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1478:28): [True: 336k, False: 84.1k]
  ------------------
 1479|   336k|                {
 1480|   336k|                    ee[k] = eee[k] + eeo[k];
 1481|   336k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1482|   336k|                }
 1483|   757k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1483:28): [True: 673k, False: 84.1k]
  ------------------
 1484|   673k|                {
 1485|   673k|                    e[k] = ee[k] + eo[k];
 1486|   673k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1487|   673k|                }
 1488|  1.43M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1488:28): [True: 1.34M, False: 84.1k]
  ------------------
 1489|  1.34M|                {
 1490|  1.34M|                    pi2_dst[k] =
 1491|  1.34M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.34M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1492|       |
 1493|  1.34M|                    pi2_dst[k + 16] =
 1494|  1.34M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  1.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.34M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1495|  1.34M|                }
 1496|  84.1k|                pi2_tmp++;
 1497|  84.1k|                pi2_dst += dst_strd;
 1498|  84.1k|            }
 1499|  2.63k|        }
 1500|  2.01k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (1500:17): [True: 596, False: 1.41k]
  ------------------
 1501|    596|        {
 1502|  19.6k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1502:24): [True: 19.0k, False: 596]
  ------------------
 1503|  19.0k|            {
 1504|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1505|   324k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1505:28): [True: 305k, False: 19.0k]
  ------------------
 1506|   305k|                {
 1507|   305k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1508|   305k|                                    + g_ai2_ihevc_trans_32[3][k]
 1509|   305k|                                                    * pi2_tmp[3 * trans_size]
 1510|   305k|                                    + g_ai2_ihevc_trans_32[5][k]
 1511|   305k|                                                    * pi2_tmp[5 * trans_size]
 1512|   305k|                                    + g_ai2_ihevc_trans_32[7][k]
 1513|   305k|                                                    * pi2_tmp[7 * trans_size];
 1514|   305k|                }
 1515|   171k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1515:28): [True: 152k, False: 19.0k]
  ------------------
 1516|   152k|                {
 1517|   152k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1518|   152k|                                    + g_ai2_ihevc_trans_32[6][k]
 1519|   152k|                                                    * pi2_tmp[6 * trans_size];
 1520|   152k|                }
 1521|  95.3k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1521:28): [True: 76.2k, False: 19.0k]
  ------------------
 1522|  76.2k|                {
 1523|  76.2k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
 1524|  76.2k|                }
 1525|  19.0k|                eeeo[0] = 0;
 1526|  19.0k|                eeeo[1] = 0;
 1527|  19.0k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
 1528|  19.0k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
 1529|       |
 1530|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1531|  19.0k|                eee[0] = eeee[0] + eeeo[0];
 1532|  19.0k|                eee[3] = eeee[0] - eeeo[0];
 1533|  19.0k|                eee[1] = eeee[1] + eeeo[1];
 1534|  19.0k|                eee[2] = eeee[1] - eeeo[1];
 1535|  95.3k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1535:28): [True: 76.2k, False: 19.0k]
  ------------------
 1536|  76.2k|                {
 1537|  76.2k|                    ee[k] = eee[k] + eeo[k];
 1538|  76.2k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1539|  76.2k|                }
 1540|   171k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1540:28): [True: 152k, False: 19.0k]
  ------------------
 1541|   152k|                {
 1542|   152k|                    e[k] = ee[k] + eo[k];
 1543|   152k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1544|   152k|                }
 1545|   324k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1545:28): [True: 305k, False: 19.0k]
  ------------------
 1546|   305k|                {
 1547|   305k|                    pi2_dst[k] =
 1548|   305k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   305k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   305k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 305k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 305k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1549|       |
 1550|   305k|                    pi2_dst[k + 16] =
 1551|   305k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   305k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   305k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 305k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 305k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1552|   305k|                }
 1553|  19.0k|                pi2_tmp++;
 1554|  19.0k|                pi2_dst += dst_strd;
 1555|  19.0k|            }
 1556|    596|        }
 1557|  1.41k|        else /* All rows of output of 1st stage are non-zero */
 1558|  1.41k|        {
 1559|  46.3k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1559:24): [True: 44.9k, False: 1.41k]
  ------------------
 1560|  44.9k|            {
 1561|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1562|   761k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1562:28): [True: 716k, False: 44.9k]
  ------------------
 1563|   716k|                {
 1564|   716k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1565|   716k|                                    + g_ai2_ihevc_trans_32[3][k]
 1566|   716k|                                                    * pi2_tmp[3 * trans_size]
 1567|   716k|                                    + g_ai2_ihevc_trans_32[5][k]
 1568|   716k|                                                    * pi2_tmp[5 * trans_size]
 1569|   716k|                                    + g_ai2_ihevc_trans_32[7][k]
 1570|   716k|                                                    * pi2_tmp[7 * trans_size]
 1571|   716k|                                    + g_ai2_ihevc_trans_32[9][k]
 1572|   716k|                                                    * pi2_tmp[9 * trans_size]
 1573|   716k|                                    + g_ai2_ihevc_trans_32[11][k]
 1574|   716k|                                                    * pi2_tmp[11 * trans_size]
 1575|   716k|                                    + g_ai2_ihevc_trans_32[13][k]
 1576|   716k|                                                    * pi2_tmp[13 * trans_size]
 1577|   716k|                                    + g_ai2_ihevc_trans_32[15][k]
 1578|   716k|                                                    * pi2_tmp[15 * trans_size]
 1579|   716k|                                    + g_ai2_ihevc_trans_32[17][k]
 1580|   716k|                                                    * pi2_tmp[17 * trans_size]
 1581|   716k|                                    + g_ai2_ihevc_trans_32[19][k]
 1582|   716k|                                                    * pi2_tmp[19 * trans_size]
 1583|   716k|                                    + g_ai2_ihevc_trans_32[21][k]
 1584|   716k|                                                    * pi2_tmp[21 * trans_size]
 1585|   716k|                                    + g_ai2_ihevc_trans_32[23][k]
 1586|   716k|                                                    * pi2_tmp[23 * trans_size]
 1587|   716k|                                    + g_ai2_ihevc_trans_32[25][k]
 1588|   716k|                                                    * pi2_tmp[25 * trans_size]
 1589|   716k|                                    + g_ai2_ihevc_trans_32[27][k]
 1590|   716k|                                                    * pi2_tmp[27 * trans_size]
 1591|   716k|                                    + g_ai2_ihevc_trans_32[29][k]
 1592|   716k|                                                    * pi2_tmp[29 * trans_size]
 1593|   716k|                                    + g_ai2_ihevc_trans_32[31][k]
 1594|   716k|                                                    * pi2_tmp[31 * trans_size];
 1595|   716k|                }
 1596|   404k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1596:28): [True: 359k, False: 44.9k]
  ------------------
 1597|   359k|                {
 1598|   359k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1599|   359k|                                    + g_ai2_ihevc_trans_32[6][k]
 1600|   359k|                                                    * pi2_tmp[6 * trans_size]
 1601|   359k|                                    + g_ai2_ihevc_trans_32[10][k]
 1602|   359k|                                                    * pi2_tmp[10 * trans_size]
 1603|   359k|                                    + g_ai2_ihevc_trans_32[14][k]
 1604|   359k|                                                    * pi2_tmp[14 * trans_size]
 1605|   359k|                                    + g_ai2_ihevc_trans_32[18][k]
 1606|   359k|                                                    * pi2_tmp[18 * trans_size]
 1607|   359k|                                    + g_ai2_ihevc_trans_32[22][k]
 1608|   359k|                                                    * pi2_tmp[22 * trans_size]
 1609|   359k|                                    + g_ai2_ihevc_trans_32[26][k]
 1610|   359k|                                                    * pi2_tmp[26 * trans_size]
 1611|   359k|                                    + g_ai2_ihevc_trans_32[30][k]
 1612|   359k|                                                    * pi2_tmp[30 * trans_size];
 1613|   359k|                }
 1614|   224k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1614:28): [True: 180k, False: 44.9k]
  ------------------
 1615|   180k|                {
 1616|   180k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1617|   180k|                                    + g_ai2_ihevc_trans_32[12][k]
 1618|   180k|                                                    * pi2_tmp[12 * trans_size]
 1619|   180k|                                    + g_ai2_ihevc_trans_32[20][k]
 1620|   180k|                                                    * pi2_tmp[20 * trans_size]
 1621|   180k|                                    + g_ai2_ihevc_trans_32[28][k]
 1622|   180k|                                                    * pi2_tmp[28 * trans_size];
 1623|   180k|                }
 1624|  44.9k|                eeeo[0] =
 1625|  44.9k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1626|  44.9k|                                                + g_ai2_ihevc_trans_32[24][0]
 1627|  44.9k|                                                                * pi2_tmp[24
 1628|  44.9k|                                                                                * trans_size];
 1629|  44.9k|                eeeo[1] =
 1630|  44.9k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1631|  44.9k|                                                + g_ai2_ihevc_trans_32[24][1]
 1632|  44.9k|                                                                * pi2_tmp[24
 1633|  44.9k|                                                                                * trans_size];
 1634|  44.9k|                eeee[0] =
 1635|  44.9k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1636|  44.9k|                                                + g_ai2_ihevc_trans_32[16][0]
 1637|  44.9k|                                                                * pi2_tmp[16
 1638|  44.9k|                                                                                * trans_size];
 1639|  44.9k|                eeee[1] =
 1640|  44.9k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1641|  44.9k|                                                + g_ai2_ihevc_trans_32[16][1]
 1642|  44.9k|                                                                * pi2_tmp[16
 1643|  44.9k|                                                                                * trans_size];
 1644|       |
 1645|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1646|  44.9k|                eee[0] = eeee[0] + eeeo[0];
 1647|  44.9k|                eee[3] = eeee[0] - eeeo[0];
 1648|  44.9k|                eee[1] = eeee[1] + eeeo[1];
 1649|  44.9k|                eee[2] = eeee[1] - eeeo[1];
 1650|   224k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1650:28): [True: 179k, False: 44.9k]
  ------------------
 1651|   179k|                {
 1652|   179k|                    ee[k] = eee[k] + eeo[k];
 1653|   179k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1654|   179k|                }
 1655|   404k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1655:28): [True: 359k, False: 44.9k]
  ------------------
 1656|   359k|                {
 1657|   359k|                    e[k] = ee[k] + eo[k];
 1658|   359k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1659|   359k|                }
 1660|   762k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1660:28): [True: 717k, False: 44.9k]
  ------------------
 1661|   717k|                {
 1662|   717k|                    pi2_dst[k] =
 1663|   717k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   717k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   717k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 717k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 717k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1664|       |
 1665|   717k|                    pi2_dst[k + 16] =
 1666|   717k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   717k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   717k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 717k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 717k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1667|   717k|                }
 1668|  44.9k|                pi2_tmp++;
 1669|  44.9k|                pi2_dst += dst_strd;
 1670|  44.9k|            }
 1671|  1.41k|        }
 1672|       |        /************************************************************************************************/
 1673|       |        /************************************END - IT_RECON_32x32****************************************/
 1674|       |        /************************************************************************************************/
 1675|  4.64k|    }
 1676|  10.8k|    else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (1676:13): [True: 2.62k, False: 8.22k]
  ------------------
 1677|  2.62k|    {
 1678|       |        /************************************************************************************************/
 1679|       |        /**********************************START - IT_RECON_32x32****************************************/
 1680|       |        /************************************************************************************************/
 1681|       |        /* Inverse Transform 1st stage */
 1682|  2.62k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  2.62k|#define IT_SHIFT_STAGE_1 7
  ------------------
 1683|  2.62k|        add = 1 << (shift - 1);
 1684|       |
 1685|  48.9k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (1685:20): [True: 46.3k, False: 2.62k]
  ------------------
 1686|  46.3k|        {
 1687|       |            /* Checking for Zero Cols */
 1688|  46.3k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (1688:16): [True: 28.0k, False: 18.2k]
  ------------------
 1689|  28.0k|            {
 1690|  28.0k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
 1691|  28.0k|            }
 1692|  18.2k|            else
 1693|  18.2k|            {
 1694|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1695|   310k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1695:28): [True: 292k, False: 18.2k]
  ------------------
 1696|   292k|                {
 1697|   292k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
 1698|   292k|                                    + g_ai2_ihevc_trans_32[3][k]
 1699|   292k|                                                    * pi2_src[3 * src_strd]
 1700|   292k|                                    + g_ai2_ihevc_trans_32[5][k]
 1701|   292k|                                                    * pi2_src[5 * src_strd]
 1702|   292k|                                    + g_ai2_ihevc_trans_32[7][k]
 1703|   292k|                                                    * pi2_src[7 * src_strd];
 1704|   292k|                }
 1705|   164k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1705:28): [True: 146k, False: 18.2k]
  ------------------
 1706|   146k|                {
 1707|   146k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
 1708|   146k|                                    + g_ai2_ihevc_trans_32[6][k]
 1709|   146k|                                                    * pi2_src[6 * src_strd];
 1710|   146k|                }
 1711|  91.2k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1711:28): [True: 73.0k, False: 18.2k]
  ------------------
 1712|  73.0k|                {
 1713|  73.0k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd];
 1714|  73.0k|                }
 1715|  18.2k|                eeeo[0] = 0;
 1716|  18.2k|                eeeo[1] = 0;
 1717|  18.2k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
 1718|  18.2k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
 1719|       |
 1720|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1721|  18.2k|                eee[0] = eeee[0] + eeeo[0];
 1722|  18.2k|                eee[3] = eeee[0] - eeeo[0];
 1723|  18.2k|                eee[1] = eeee[1] + eeeo[1];
 1724|  18.2k|                eee[2] = eeee[1] - eeeo[1];
 1725|  91.2k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1725:28): [True: 73.0k, False: 18.2k]
  ------------------
 1726|  73.0k|                {
 1727|  73.0k|                    ee[k] = eee[k] + eeo[k];
 1728|  73.0k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1729|  73.0k|                }
 1730|   164k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1730:28): [True: 146k, False: 18.2k]
  ------------------
 1731|   146k|                {
 1732|   146k|                    e[k] = ee[k] + eo[k];
 1733|   146k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1734|   146k|                }
 1735|   310k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1735:28): [True: 292k, False: 18.2k]
  ------------------
 1736|   292k|                {
 1737|   292k|                    pi2_tmp[k] =
 1738|   292k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   292k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   292k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.99k, False: 290k]
  |  |  |  |  |  Branch (40:53): [True: 1.88k, False: 288k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1739|   292k|                    pi2_tmp[k + 16] =
 1740|   292k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   292k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   292k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 480, False: 291k]
  |  |  |  |  |  Branch (40:53): [True: 543, False: 290k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1741|   292k|                }
 1742|  18.2k|            }
 1743|  46.3k|            pi2_src++;
 1744|  46.3k|            pi2_tmp += trans_size;
 1745|  46.3k|            zero_cols = zero_cols >> 1;
 1746|  46.3k|        }
 1747|       |
 1748|  2.62k|        pi2_tmp = pi2_tmp_orig;
 1749|       |
 1750|       |        /* Inverse Transform 2nd stage */
 1751|  2.62k|        shift = 20 - bit_depth;
 1752|  2.62k|        add = 1 << (shift - 1);
 1753|  2.62k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (1753:12): [True: 999, False: 1.62k]
  ------------------
 1754|    999|        {
 1755|  32.9k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1755:24): [True: 31.9k, False: 999]
  ------------------
 1756|  31.9k|            {
 1757|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1758|   543k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1758:28): [True: 511k, False: 31.9k]
  ------------------
 1759|   511k|                {
 1760|   511k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1761|   511k|                                    + g_ai2_ihevc_trans_32[3][k]
 1762|   511k|                                                    * pi2_tmp[3 * trans_size];
 1763|   511k|                }
 1764|   287k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1764:28): [True: 255k, False: 31.9k]
  ------------------
 1765|   255k|                {
 1766|   255k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
 1767|   255k|                }
 1768|       |//                for(k = 0; k < 4; k++)
 1769|  31.9k|                {
 1770|  31.9k|                    eeo[0] = 0;
 1771|  31.9k|                    eeo[1] = 0;
 1772|  31.9k|                    eeo[2] = 0;
 1773|  31.9k|                    eeo[3] = 0;
 1774|  31.9k|                }
 1775|  31.9k|                eeeo[0] = 0;
 1776|  31.9k|                eeeo[1] = 0;
 1777|  31.9k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
 1778|  31.9k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
 1779|       |
 1780|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1781|  31.9k|                eee[0] = eeee[0] + eeeo[0];
 1782|  31.9k|                eee[3] = eeee[0] - eeeo[0];
 1783|  31.9k|                eee[1] = eeee[1] + eeeo[1];
 1784|  31.9k|                eee[2] = eeee[1] - eeeo[1];
 1785|   159k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1785:28): [True: 127k, False: 31.9k]
  ------------------
 1786|   127k|                {
 1787|   127k|                    ee[k] = eee[k] + eeo[k];
 1788|   127k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1789|   127k|                }
 1790|   287k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1790:28): [True: 255k, False: 31.9k]
  ------------------
 1791|   255k|                {
 1792|   255k|                    e[k] = ee[k] + eo[k];
 1793|   255k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1794|   255k|                }
 1795|   543k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1795:28): [True: 511k, False: 31.9k]
  ------------------
 1796|   511k|                {
 1797|   511k|                    pi2_dst[k] =
 1798|   511k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   511k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   511k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 511k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 511k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1799|       |
 1800|   511k|                    pi2_dst[k + 16] =
 1801|   511k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   511k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   511k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 511k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 511k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1802|   511k|                }
 1803|  31.9k|                pi2_tmp++;
 1804|  31.9k|                pi2_dst += dst_strd;
 1805|  31.9k|            }
 1806|    999|        }
 1807|  1.62k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (1807:17): [True: 400, False: 1.22k]
  ------------------
 1808|    400|        {
 1809|  13.2k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1809:24): [True: 12.8k, False: 400]
  ------------------
 1810|  12.8k|            {
 1811|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1812|   217k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1812:28): [True: 204k, False: 12.8k]
  ------------------
 1813|   204k|                {
 1814|   204k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1815|   204k|                                    + g_ai2_ihevc_trans_32[3][k]
 1816|   204k|                                                    * pi2_tmp[3 * trans_size]
 1817|   204k|                                    + g_ai2_ihevc_trans_32[5][k]
 1818|   204k|                                                    * pi2_tmp[5 * trans_size]
 1819|   204k|                                    + g_ai2_ihevc_trans_32[7][k]
 1820|   204k|                                                    * pi2_tmp[7 * trans_size];
 1821|   204k|                }
 1822|   115k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1822:28): [True: 102k, False: 12.8k]
  ------------------
 1823|   102k|                {
 1824|   102k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1825|   102k|                                    + g_ai2_ihevc_trans_32[6][k]
 1826|   102k|                                                    * pi2_tmp[6 * trans_size];
 1827|   102k|                }
 1828|  64.0k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1828:28): [True: 51.2k, False: 12.8k]
  ------------------
 1829|  51.2k|                {
 1830|  51.2k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
 1831|  51.2k|                }
 1832|  12.8k|                eeeo[0] = 0;
 1833|  12.8k|                eeeo[1] = 0;
 1834|  12.8k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
 1835|  12.8k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
 1836|       |
 1837|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1838|  12.8k|                eee[0] = eeee[0] + eeeo[0];
 1839|  12.8k|                eee[3] = eeee[0] - eeeo[0];
 1840|  12.8k|                eee[1] = eeee[1] + eeeo[1];
 1841|  12.8k|                eee[2] = eeee[1] - eeeo[1];
 1842|  64.0k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1842:28): [True: 51.2k, False: 12.8k]
  ------------------
 1843|  51.2k|                {
 1844|  51.2k|                    ee[k] = eee[k] + eeo[k];
 1845|  51.2k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1846|  51.2k|                }
 1847|   115k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1847:28): [True: 102k, False: 12.8k]
  ------------------
 1848|   102k|                {
 1849|   102k|                    e[k] = ee[k] + eo[k];
 1850|   102k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1851|   102k|                }
 1852|   217k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1852:28): [True: 204k, False: 12.8k]
  ------------------
 1853|   204k|                {
 1854|   204k|                    pi2_dst[k] =
 1855|   204k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   204k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   204k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 204k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1856|       |
 1857|   204k|                    pi2_dst[k + 16] =
 1858|   204k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   204k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   204k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 204k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 204k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1859|   204k|                }
 1860|  12.8k|                pi2_tmp++;
 1861|  12.8k|                pi2_dst += dst_strd;
 1862|  12.8k|            }
 1863|    400|        }
 1864|  1.22k|        else /* All rows of output of 1st stage are non-zero */
 1865|  1.22k|        {
 1866|  40.3k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1866:24): [True: 39.1k, False: 1.22k]
  ------------------
 1867|  39.1k|            {
 1868|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1869|   665k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1869:28): [True: 626k, False: 39.1k]
  ------------------
 1870|   626k|                {
 1871|   626k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1872|   626k|                                    + g_ai2_ihevc_trans_32[3][k]
 1873|   626k|                                                    * pi2_tmp[3 * trans_size]
 1874|   626k|                                    + g_ai2_ihevc_trans_32[5][k]
 1875|   626k|                                                    * pi2_tmp[5 * trans_size]
 1876|   626k|                                    + g_ai2_ihevc_trans_32[7][k]
 1877|   626k|                                                    * pi2_tmp[7 * trans_size]
 1878|   626k|                                    + g_ai2_ihevc_trans_32[9][k]
 1879|   626k|                                                    * pi2_tmp[9 * trans_size]
 1880|   626k|                                    + g_ai2_ihevc_trans_32[11][k]
 1881|   626k|                                                    * pi2_tmp[11 * trans_size]
 1882|   626k|                                    + g_ai2_ihevc_trans_32[13][k]
 1883|   626k|                                                    * pi2_tmp[13 * trans_size]
 1884|   626k|                                    + g_ai2_ihevc_trans_32[15][k]
 1885|   626k|                                                    * pi2_tmp[15 * trans_size]
 1886|   626k|                                    + g_ai2_ihevc_trans_32[17][k]
 1887|   626k|                                                    * pi2_tmp[17 * trans_size]
 1888|   626k|                                    + g_ai2_ihevc_trans_32[19][k]
 1889|   626k|                                                    * pi2_tmp[19 * trans_size]
 1890|   626k|                                    + g_ai2_ihevc_trans_32[21][k]
 1891|   626k|                                                    * pi2_tmp[21 * trans_size]
 1892|   626k|                                    + g_ai2_ihevc_trans_32[23][k]
 1893|   626k|                                                    * pi2_tmp[23 * trans_size]
 1894|   626k|                                    + g_ai2_ihevc_trans_32[25][k]
 1895|   626k|                                                    * pi2_tmp[25 * trans_size]
 1896|   626k|                                    + g_ai2_ihevc_trans_32[27][k]
 1897|   626k|                                                    * pi2_tmp[27 * trans_size]
 1898|   626k|                                    + g_ai2_ihevc_trans_32[29][k]
 1899|   626k|                                                    * pi2_tmp[29 * trans_size]
 1900|   626k|                                    + g_ai2_ihevc_trans_32[31][k]
 1901|   626k|                                                    * pi2_tmp[31 * trans_size];
 1902|   626k|                }
 1903|   352k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1903:28): [True: 313k, False: 39.1k]
  ------------------
 1904|   313k|                {
 1905|   313k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1906|   313k|                                    + g_ai2_ihevc_trans_32[6][k]
 1907|   313k|                                                    * pi2_tmp[6 * trans_size]
 1908|   313k|                                    + g_ai2_ihevc_trans_32[10][k]
 1909|   313k|                                                    * pi2_tmp[10 * trans_size]
 1910|   313k|                                    + g_ai2_ihevc_trans_32[14][k]
 1911|   313k|                                                    * pi2_tmp[14 * trans_size]
 1912|   313k|                                    + g_ai2_ihevc_trans_32[18][k]
 1913|   313k|                                                    * pi2_tmp[18 * trans_size]
 1914|   313k|                                    + g_ai2_ihevc_trans_32[22][k]
 1915|   313k|                                                    * pi2_tmp[22 * trans_size]
 1916|   313k|                                    + g_ai2_ihevc_trans_32[26][k]
 1917|   313k|                                                    * pi2_tmp[26 * trans_size]
 1918|   313k|                                    + g_ai2_ihevc_trans_32[30][k]
 1919|   313k|                                                    * pi2_tmp[30 * trans_size];
 1920|   313k|                }
 1921|   195k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1921:28): [True: 156k, False: 39.1k]
  ------------------
 1922|   156k|                {
 1923|   156k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1924|   156k|                                    + g_ai2_ihevc_trans_32[12][k]
 1925|   156k|                                                    * pi2_tmp[12 * trans_size]
 1926|   156k|                                    + g_ai2_ihevc_trans_32[20][k]
 1927|   156k|                                                    * pi2_tmp[20 * trans_size]
 1928|   156k|                                    + g_ai2_ihevc_trans_32[28][k]
 1929|   156k|                                                    * pi2_tmp[28 * trans_size];
 1930|   156k|                }
 1931|  39.1k|                eeeo[0] =
 1932|  39.1k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1933|  39.1k|                                                + g_ai2_ihevc_trans_32[24][0]
 1934|  39.1k|                                                                * pi2_tmp[24
 1935|  39.1k|                                                                                * trans_size];
 1936|  39.1k|                eeeo[1] =
 1937|  39.1k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1938|  39.1k|                                                + g_ai2_ihevc_trans_32[24][1]
 1939|  39.1k|                                                                * pi2_tmp[24
 1940|  39.1k|                                                                                * trans_size];
 1941|  39.1k|                eeee[0] =
 1942|  39.1k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1943|  39.1k|                                                + g_ai2_ihevc_trans_32[16][0]
 1944|  39.1k|                                                                * pi2_tmp[16
 1945|  39.1k|                                                                                * trans_size];
 1946|  39.1k|                eeee[1] =
 1947|  39.1k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1948|  39.1k|                                                + g_ai2_ihevc_trans_32[16][1]
 1949|  39.1k|                                                                * pi2_tmp[16
 1950|  39.1k|                                                                                * trans_size];
 1951|       |
 1952|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1953|  39.1k|                eee[0] = eeee[0] + eeeo[0];
 1954|  39.1k|                eee[3] = eeee[0] - eeeo[0];
 1955|  39.1k|                eee[1] = eeee[1] + eeeo[1];
 1956|  39.1k|                eee[2] = eeee[1] - eeeo[1];
 1957|   195k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1957:28): [True: 156k, False: 39.1k]
  ------------------
 1958|   156k|                {
 1959|   156k|                    ee[k] = eee[k] + eeo[k];
 1960|   156k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1961|   156k|                }
 1962|   352k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1962:28): [True: 313k, False: 39.1k]
  ------------------
 1963|   313k|                {
 1964|   313k|                    e[k] = ee[k] + eo[k];
 1965|   313k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1966|   313k|                }
 1967|   665k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1967:28): [True: 626k, False: 39.1k]
  ------------------
 1968|   626k|                {
 1969|   626k|                    pi2_dst[k] =
 1970|   626k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   626k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   626k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 626k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 626k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1971|       |
 1972|   626k|                    pi2_dst[k + 16] =
 1973|   626k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   626k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   626k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 626k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 626k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1974|   626k|                }
 1975|  39.1k|                pi2_tmp++;
 1976|  39.1k|                pi2_dst += dst_strd;
 1977|  39.1k|            }
 1978|  1.22k|        }
 1979|       |        /************************************************************************************************/
 1980|       |        /************************************END - IT_RECON_32x32****************************************/
 1981|       |        /************************************************************************************************/
 1982|  2.62k|    }
 1983|  8.22k|    else  /* All rows of input are non-zero */
 1984|  8.22k|    {
 1985|       |        /************************************************************************************************/
 1986|       |        /**********************************START - IT_RECON_32x32****************************************/
 1987|       |        /************************************************************************************************/
 1988|       |        /* Inverse Transform 1st stage */
 1989|  8.22k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  8.22k|#define IT_SHIFT_STAGE_1 7
  ------------------
 1990|  8.22k|        add = 1 << (shift - 1);
 1991|       |
 1992|   230k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (1992:20): [True: 222k, False: 8.22k]
  ------------------
 1993|   222k|        {
 1994|       |            /* Checking for Zero Cols */
 1995|   222k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (1995:16): [True: 103k, False: 119k]
  ------------------
 1996|   103k|            {
 1997|   103k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
 1998|   103k|            }
 1999|   119k|            else
 2000|   119k|            {
 2001|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 2002|  2.02M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2002:28): [True: 1.90M, False: 119k]
  ------------------
 2003|  1.90M|                {
 2004|  1.90M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
 2005|  1.90M|                                    + g_ai2_ihevc_trans_32[3][k]
 2006|  1.90M|                                                    * pi2_src[3 * src_strd]
 2007|  1.90M|                                    + g_ai2_ihevc_trans_32[5][k]
 2008|  1.90M|                                                    * pi2_src[5 * src_strd]
 2009|  1.90M|                                    + g_ai2_ihevc_trans_32[7][k]
 2010|  1.90M|                                                    * pi2_src[7 * src_strd]
 2011|  1.90M|                                    + g_ai2_ihevc_trans_32[9][k]
 2012|  1.90M|                                                    * pi2_src[9 * src_strd]
 2013|  1.90M|                                    + g_ai2_ihevc_trans_32[11][k]
 2014|  1.90M|                                                    * pi2_src[11 * src_strd]
 2015|  1.90M|                                    + g_ai2_ihevc_trans_32[13][k]
 2016|  1.90M|                                                    * pi2_src[13 * src_strd]
 2017|  1.90M|                                    + g_ai2_ihevc_trans_32[15][k]
 2018|  1.90M|                                                    * pi2_src[15 * src_strd]
 2019|  1.90M|                                    + g_ai2_ihevc_trans_32[17][k]
 2020|  1.90M|                                                    * pi2_src[17 * src_strd]
 2021|  1.90M|                                    + g_ai2_ihevc_trans_32[19][k]
 2022|  1.90M|                                                    * pi2_src[19 * src_strd]
 2023|  1.90M|                                    + g_ai2_ihevc_trans_32[21][k]
 2024|  1.90M|                                                    * pi2_src[21 * src_strd]
 2025|  1.90M|                                    + g_ai2_ihevc_trans_32[23][k]
 2026|  1.90M|                                                    * pi2_src[23 * src_strd]
 2027|  1.90M|                                    + g_ai2_ihevc_trans_32[25][k]
 2028|  1.90M|                                                    * pi2_src[25 * src_strd]
 2029|  1.90M|                                    + g_ai2_ihevc_trans_32[27][k]
 2030|  1.90M|                                                    * pi2_src[27 * src_strd]
 2031|  1.90M|                                    + g_ai2_ihevc_trans_32[29][k]
 2032|  1.90M|                                                    * pi2_src[29 * src_strd]
 2033|  1.90M|                                    + g_ai2_ihevc_trans_32[31][k]
 2034|  1.90M|                                                    * pi2_src[31 * src_strd];
 2035|  1.90M|                }
 2036|  1.07M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2036:28): [True: 954k, False: 119k]
  ------------------
 2037|   954k|                {
 2038|   954k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
 2039|   954k|                                    + g_ai2_ihevc_trans_32[6][k]
 2040|   954k|                                                    * pi2_src[6 * src_strd]
 2041|   954k|                                    + g_ai2_ihevc_trans_32[10][k]
 2042|   954k|                                                    * pi2_src[10 * src_strd]
 2043|   954k|                                    + g_ai2_ihevc_trans_32[14][k]
 2044|   954k|                                                    * pi2_src[14 * src_strd]
 2045|   954k|                                    + g_ai2_ihevc_trans_32[18][k]
 2046|   954k|                                                    * pi2_src[18 * src_strd]
 2047|   954k|                                    + g_ai2_ihevc_trans_32[22][k]
 2048|   954k|                                                    * pi2_src[22 * src_strd]
 2049|   954k|                                    + g_ai2_ihevc_trans_32[26][k]
 2050|   954k|                                                    * pi2_src[26 * src_strd]
 2051|   954k|                                    + g_ai2_ihevc_trans_32[30][k]
 2052|   954k|                                                    * pi2_src[30 * src_strd];
 2053|   954k|                }
 2054|   596k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2054:28): [True: 477k, False: 119k]
  ------------------
 2055|   477k|                {
 2056|   477k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]
 2057|   477k|                                    + g_ai2_ihevc_trans_32[12][k]
 2058|   477k|                                                    * pi2_src[12 * src_strd]
 2059|   477k|                                    + g_ai2_ihevc_trans_32[20][k]
 2060|   477k|                                                    * pi2_src[20 * src_strd]
 2061|   477k|                                    + g_ai2_ihevc_trans_32[28][k]
 2062|   477k|                                                    * pi2_src[28 * src_strd];
 2063|   477k|                }
 2064|   119k|                eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd]
 2065|   119k|                                + g_ai2_ihevc_trans_32[24][0]
 2066|   119k|                                                * pi2_src[24 * src_strd];
 2067|   119k|                eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd]
 2068|   119k|                                + g_ai2_ihevc_trans_32[24][1]
 2069|   119k|                                                * pi2_src[24 * src_strd];
 2070|   119k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]
 2071|   119k|                                + g_ai2_ihevc_trans_32[16][0]
 2072|   119k|                                                * pi2_src[16 * src_strd];
 2073|   119k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]
 2074|   119k|                                + g_ai2_ihevc_trans_32[16][1]
 2075|   119k|                                                * pi2_src[16 * src_strd];
 2076|       |
 2077|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 2078|   119k|                eee[0] = eeee[0] + eeeo[0];
 2079|   119k|                eee[3] = eeee[0] - eeeo[0];
 2080|   119k|                eee[1] = eeee[1] + eeeo[1];
 2081|   119k|                eee[2] = eeee[1] - eeeo[1];
 2082|   596k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2082:28): [True: 477k, False: 119k]
  ------------------
 2083|   477k|                {
 2084|   477k|                    ee[k] = eee[k] + eeo[k];
 2085|   477k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 2086|   477k|                }
 2087|  1.07M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2087:28): [True: 954k, False: 119k]
  ------------------
 2088|   954k|                {
 2089|   954k|                    e[k] = ee[k] + eo[k];
 2090|   954k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 2091|   954k|                }
 2092|  2.02M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2092:28): [True: 1.90M, False: 119k]
  ------------------
 2093|  1.90M|                {
 2094|  1.90M|                    pi2_tmp[k] =
 2095|  1.90M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.90M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.90M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 593, False: 1.90M]
  |  |  |  |  |  Branch (40:53): [True: 672, False: 1.90M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2096|  1.90M|                    pi2_tmp[k + 16] =
 2097|  1.90M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  1.90M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.90M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 451, False: 1.90M]
  |  |  |  |  |  Branch (40:53): [True: 481, False: 1.90M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|  1.90M|                }
 2099|   119k|            }
 2100|   222k|            pi2_src++;
 2101|   222k|            pi2_tmp += trans_size;
 2102|   222k|            zero_cols = zero_cols >> 1;
 2103|   222k|        }
 2104|       |
 2105|  8.22k|        pi2_tmp = pi2_tmp_orig;
 2106|       |
 2107|       |        /* Inverse Transform 2nd stage */
 2108|  8.22k|        shift = 20 - bit_depth;
 2109|  8.22k|        add = 1 << (shift - 1);
 2110|  8.22k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (2110:12): [True: 1.11k, False: 7.11k]
  ------------------
 2111|  1.11k|        {
 2112|  36.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2112:24): [True: 35.6k, False: 1.11k]
  ------------------
 2113|  35.6k|            {
 2114|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 2115|   606k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2115:28): [True: 571k, False: 35.6k]
  ------------------
 2116|   571k|                {
 2117|   571k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 2118|   571k|                                    + g_ai2_ihevc_trans_32[3][k]
 2119|   571k|                                                    * pi2_tmp[3 * trans_size];
 2120|   571k|                }
 2121|   321k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2121:28): [True: 285k, False: 35.6k]
  ------------------
 2122|   285k|                {
 2123|   285k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
 2124|   285k|                }
 2125|       |//                for(k = 0; k < 4; k++)
 2126|  35.6k|                {
 2127|  35.6k|                    eeo[0] = 0;
 2128|  35.6k|                    eeo[1] = 0;
 2129|  35.6k|                    eeo[2] = 0;
 2130|  35.6k|                    eeo[3] = 0;
 2131|  35.6k|                }
 2132|  35.6k|                eeeo[0] = 0;
 2133|  35.6k|                eeeo[1] = 0;
 2134|  35.6k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
 2135|  35.6k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
 2136|       |
 2137|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 2138|  35.6k|                eee[0] = eeee[0] + eeeo[0];
 2139|  35.6k|                eee[3] = eeee[0] - eeeo[0];
 2140|  35.6k|                eee[1] = eeee[1] + eeeo[1];
 2141|  35.6k|                eee[2] = eeee[1] - eeeo[1];
 2142|   178k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2142:28): [True: 142k, False: 35.6k]
  ------------------
 2143|   142k|                {
 2144|   142k|                    ee[k] = eee[k] + eeo[k];
 2145|   142k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 2146|   142k|                }
 2147|   321k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2147:28): [True: 285k, False: 35.6k]
  ------------------
 2148|   285k|                {
 2149|   285k|                    e[k] = ee[k] + eo[k];
 2150|   285k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 2151|   285k|                }
 2152|   606k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2152:28): [True: 571k, False: 35.6k]
  ------------------
 2153|   571k|                {
 2154|   571k|                    pi2_dst[k] =
 2155|   571k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   571k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   571k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 571k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 571k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2156|       |
 2157|   571k|                    pi2_dst[k + 16] =
 2158|   571k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   571k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   571k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 571k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 571k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2159|   571k|                }
 2160|  35.6k|                pi2_tmp++;
 2161|  35.6k|                pi2_dst += dst_strd;
 2162|  35.6k|            }
 2163|  1.11k|        }
 2164|  7.11k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (2164:17): [True: 387, False: 6.72k]
  ------------------
 2165|    387|        {
 2166|  12.7k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2166:24): [True: 12.3k, False: 387]
  ------------------
 2167|  12.3k|            {
 2168|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 2169|   210k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2169:28): [True: 198k, False: 12.3k]
  ------------------
 2170|   198k|                {
 2171|   198k|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 2172|   198k|                                    + g_ai2_ihevc_trans_32[3][k]
 2173|   198k|                                                    * pi2_tmp[3 * trans_size]
 2174|   198k|                                    + g_ai2_ihevc_trans_32[5][k]
 2175|   198k|                                                    * pi2_tmp[5 * trans_size]
 2176|   198k|                                    + g_ai2_ihevc_trans_32[7][k]
 2177|   198k|                                                    * pi2_tmp[7 * trans_size];
 2178|   198k|                }
 2179|   111k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2179:28): [True: 99.0k, False: 12.3k]
  ------------------
 2180|  99.0k|                {
 2181|  99.0k|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 2182|  99.0k|                                    + g_ai2_ihevc_trans_32[6][k]
 2183|  99.0k|                                                    * pi2_tmp[6 * trans_size];
 2184|  99.0k|                }
 2185|  61.9k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2185:28): [True: 49.5k, False: 12.3k]
  ------------------
 2186|  49.5k|                {
 2187|  49.5k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
 2188|  49.5k|                }
 2189|  12.3k|                eeeo[0] = 0;
 2190|  12.3k|                eeeo[1] = 0;
 2191|  12.3k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
 2192|  12.3k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
 2193|       |
 2194|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 2195|  12.3k|                eee[0] = eeee[0] + eeeo[0];
 2196|  12.3k|                eee[3] = eeee[0] - eeeo[0];
 2197|  12.3k|                eee[1] = eeee[1] + eeeo[1];
 2198|  12.3k|                eee[2] = eeee[1] - eeeo[1];
 2199|  61.9k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2199:28): [True: 49.5k, False: 12.3k]
  ------------------
 2200|  49.5k|                {
 2201|  49.5k|                    ee[k] = eee[k] + eeo[k];
 2202|  49.5k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 2203|  49.5k|                }
 2204|   111k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2204:28): [True: 99.0k, False: 12.3k]
  ------------------
 2205|  99.0k|                {
 2206|  99.0k|                    e[k] = ee[k] + eo[k];
 2207|  99.0k|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 2208|  99.0k|                }
 2209|   210k|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2209:28): [True: 198k, False: 12.3k]
  ------------------
 2210|   198k|                {
 2211|   198k|                    pi2_dst[k] =
 2212|   198k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   198k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   198k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 198k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 198k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2213|       |
 2214|   198k|                    pi2_dst[k + 16] =
 2215|   198k|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   198k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   198k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 198k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 198k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2216|   198k|                }
 2217|  12.3k|                pi2_tmp++;
 2218|  12.3k|                pi2_dst += dst_strd;
 2219|  12.3k|            }
 2220|    387|        }
 2221|  6.72k|        else /* All rows of output of 1st stage are non-zero */
 2222|  6.72k|        {
 2223|   220k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2223:24): [True: 214k, False: 6.72k]
  ------------------
 2224|   214k|            {
 2225|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 2226|  3.63M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2226:28): [True: 3.42M, False: 214k]
  ------------------
 2227|  3.42M|                {
 2228|  3.42M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 2229|  3.42M|                                    + g_ai2_ihevc_trans_32[3][k]
 2230|  3.42M|                                                    * pi2_tmp[3 * trans_size]
 2231|  3.42M|                                    + g_ai2_ihevc_trans_32[5][k]
 2232|  3.42M|                                                    * pi2_tmp[5 * trans_size]
 2233|  3.42M|                                    + g_ai2_ihevc_trans_32[7][k]
 2234|  3.42M|                                                    * pi2_tmp[7 * trans_size]
 2235|  3.42M|                                    + g_ai2_ihevc_trans_32[9][k]
 2236|  3.42M|                                                    * pi2_tmp[9 * trans_size]
 2237|  3.42M|                                    + g_ai2_ihevc_trans_32[11][k]
 2238|  3.42M|                                                    * pi2_tmp[11 * trans_size]
 2239|  3.42M|                                    + g_ai2_ihevc_trans_32[13][k]
 2240|  3.42M|                                                    * pi2_tmp[13 * trans_size]
 2241|  3.42M|                                    + g_ai2_ihevc_trans_32[15][k]
 2242|  3.42M|                                                    * pi2_tmp[15 * trans_size]
 2243|  3.42M|                                    + g_ai2_ihevc_trans_32[17][k]
 2244|  3.42M|                                                    * pi2_tmp[17 * trans_size]
 2245|  3.42M|                                    + g_ai2_ihevc_trans_32[19][k]
 2246|  3.42M|                                                    * pi2_tmp[19 * trans_size]
 2247|  3.42M|                                    + g_ai2_ihevc_trans_32[21][k]
 2248|  3.42M|                                                    * pi2_tmp[21 * trans_size]
 2249|  3.42M|                                    + g_ai2_ihevc_trans_32[23][k]
 2250|  3.42M|                                                    * pi2_tmp[23 * trans_size]
 2251|  3.42M|                                    + g_ai2_ihevc_trans_32[25][k]
 2252|  3.42M|                                                    * pi2_tmp[25 * trans_size]
 2253|  3.42M|                                    + g_ai2_ihevc_trans_32[27][k]
 2254|  3.42M|                                                    * pi2_tmp[27 * trans_size]
 2255|  3.42M|                                    + g_ai2_ihevc_trans_32[29][k]
 2256|  3.42M|                                                    * pi2_tmp[29 * trans_size]
 2257|  3.42M|                                    + g_ai2_ihevc_trans_32[31][k]
 2258|  3.42M|                                                    * pi2_tmp[31 * trans_size];
 2259|  3.42M|                }
 2260|  1.93M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2260:28): [True: 1.71M, False: 214k]
  ------------------
 2261|  1.71M|                {
 2262|  1.71M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 2263|  1.71M|                                    + g_ai2_ihevc_trans_32[6][k]
 2264|  1.71M|                                                    * pi2_tmp[6 * trans_size]
 2265|  1.71M|                                    + g_ai2_ihevc_trans_32[10][k]
 2266|  1.71M|                                                    * pi2_tmp[10 * trans_size]
 2267|  1.71M|                                    + g_ai2_ihevc_trans_32[14][k]
 2268|  1.71M|                                                    * pi2_tmp[14 * trans_size]
 2269|  1.71M|                                    + g_ai2_ihevc_trans_32[18][k]
 2270|  1.71M|                                                    * pi2_tmp[18 * trans_size]
 2271|  1.71M|                                    + g_ai2_ihevc_trans_32[22][k]
 2272|  1.71M|                                                    * pi2_tmp[22 * trans_size]
 2273|  1.71M|                                    + g_ai2_ihevc_trans_32[26][k]
 2274|  1.71M|                                                    * pi2_tmp[26 * trans_size]
 2275|  1.71M|                                    + g_ai2_ihevc_trans_32[30][k]
 2276|  1.71M|                                                    * pi2_tmp[30 * trans_size];
 2277|  1.71M|                }
 2278|  1.07M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2278:28): [True: 859k, False: 214k]
  ------------------
 2279|   859k|                {
 2280|   859k|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 2281|   859k|                                    + g_ai2_ihevc_trans_32[12][k]
 2282|   859k|                                                    * pi2_tmp[12 * trans_size]
 2283|   859k|                                    + g_ai2_ihevc_trans_32[20][k]
 2284|   859k|                                                    * pi2_tmp[20 * trans_size]
 2285|   859k|                                    + g_ai2_ihevc_trans_32[28][k]
 2286|   859k|                                                    * pi2_tmp[28 * trans_size];
 2287|   859k|                }
 2288|   214k|                eeeo[0] =
 2289|   214k|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 2290|   214k|                                                + g_ai2_ihevc_trans_32[24][0]
 2291|   214k|                                                                * pi2_tmp[24
 2292|   214k|                                                                                * trans_size];
 2293|   214k|                eeeo[1] =
 2294|   214k|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 2295|   214k|                                                + g_ai2_ihevc_trans_32[24][1]
 2296|   214k|                                                                * pi2_tmp[24
 2297|   214k|                                                                                * trans_size];
 2298|   214k|                eeee[0] =
 2299|   214k|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 2300|   214k|                                                + g_ai2_ihevc_trans_32[16][0]
 2301|   214k|                                                                * pi2_tmp[16
 2302|   214k|                                                                                * trans_size];
 2303|   214k|                eeee[1] =
 2304|   214k|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 2305|   214k|                                                + g_ai2_ihevc_trans_32[16][1]
 2306|   214k|                                                                * pi2_tmp[16
 2307|   214k|                                                                                * trans_size];
 2308|       |
 2309|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 2310|   214k|                eee[0] = eeee[0] + eeeo[0];
 2311|   214k|                eee[3] = eeee[0] - eeeo[0];
 2312|   214k|                eee[1] = eeee[1] + eeeo[1];
 2313|   214k|                eee[2] = eeee[1] - eeeo[1];
 2314|  1.07M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (2314:28): [True: 858k, False: 214k]
  ------------------
 2315|   858k|                {
 2316|   858k|                    ee[k] = eee[k] + eeo[k];
 2317|   858k|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 2318|   858k|                }
 2319|  1.93M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (2319:28): [True: 1.71M, False: 214k]
  ------------------
 2320|  1.71M|                {
 2321|  1.71M|                    e[k] = ee[k] + eo[k];
 2322|  1.71M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 2323|  1.71M|                }
 2324|  3.64M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (2324:28): [True: 3.42M, False: 214k]
  ------------------
 2325|  3.42M|                {
 2326|  3.42M|                    pi2_dst[k] =
 2327|  3.42M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.42M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.42M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.42M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.42M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2328|       |
 2329|  3.42M|                    pi2_dst[k + 16] =
 2330|  3.42M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  3.42M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.42M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 3.42M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 3.42M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2331|  3.42M|                }
 2332|   214k|                pi2_tmp++;
 2333|   214k|                pi2_dst += dst_strd;
 2334|   214k|            }
 2335|  6.72k|        }
 2336|       |        /************************************************************************************************/
 2337|       |        /************************************END - IT_RECON_32x32****************************************/
 2338|       |        /************************************************************************************************/
 2339|  8.22k|    }
 2340|  15.4k|}
ihevc_res_4x4_rotate:
 2348|  60.5k|{
 2349|  60.5k|    WORD32 i, j;
 2350|  60.5k|    WORD32 trans_size;
 2351|       |
 2352|  60.5k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  60.5k|#define TRANS_SIZE_4   4
  ------------------
 2353|       |
 2354|  60.5k|    WORD32 offset = trans_size * src_strd - 1;
 2355|       |
 2356|  60.5k|    zero_cols = gau4_ihevcd_4_bit_reverse[zero_cols & 0xF];
 2357|       |
 2358|   302k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (2358:16): [True: 241k, False: 60.5k]
  ------------------
 2359|   241k|    {
 2360|       |        /* Checking for Zero Cols */
 2361|   241k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (2361:12): [True: 98.9k, False: 142k]
  ------------------
 2362|  98.9k|        {
 2363|   494k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2363:24): [True: 395k, False: 98.9k]
  ------------------
 2364|   395k|            {
 2365|   395k|                pi2_dst[j * dst_strd] = 0;
 2366|   395k|            }
 2367|  98.9k|        }
 2368|   142k|        else
 2369|   142k|        {
 2370|   715k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2370:24): [True: 572k, False: 142k]
  ------------------
 2371|   572k|            {
 2372|   572k|                pi2_dst[j * dst_strd] = pi2_src[offset - (j * src_strd + i)];
 2373|   572k|            }
 2374|   142k|        }
 2375|   241k|        pi2_dst++;
 2376|   241k|        zero_cols = zero_cols >> 1;
 2377|   241k|    }
 2378|  60.5k|}
ihevc_res_nxn_copy:
 2387|  3.91k|{
 2388|       |
 2389|  3.91k|    WORD32 i, j;
 2390|       |
 2391|  25.0k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (2391:16): [True: 21.1k, False: 3.91k]
  ------------------
 2392|  21.1k|    {
 2393|       |        /* Checking for Zero Cols */
 2394|  21.1k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (2394:12): [True: 13.5k, False: 7.58k]
  ------------------
 2395|  13.5k|        {
 2396|   144k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2396:24): [True: 131k, False: 13.5k]
  ------------------
 2397|   131k|            {
 2398|   131k|                pi2_dst[j * dst_strd] = 0;
 2399|   131k|            }
 2400|  13.5k|        }
 2401|  7.58k|        else
 2402|  7.58k|        {
 2403|  83.6k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2403:24): [True: 76.0k, False: 7.58k]
  ------------------
 2404|  76.0k|            {
 2405|  76.0k|                pi2_dst[j * dst_strd] = pi2_src[(j * src_strd + i)];
 2406|  76.0k|            }
 2407|  7.58k|        }
 2408|  21.1k|        pi2_dst++;
 2409|  21.1k|        zero_cols = zero_cols >> 1;
 2410|  21.1k|    }
 2411|  3.91k|}
ihevc_res_nxn_rdpcm_horz:
 2420|  8.07k|{
 2421|  8.07k|    WORD32 i, j;
 2422|       |
 2423|       |    /* Checking for Zero Cols */
 2424|  8.07k|    if((zero_cols & 1) == 1)
  ------------------
  |  Branch (2424:8): [True: 1.87k, False: 6.19k]
  ------------------
 2425|  1.87k|    {
 2426|  9.50k|        for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2426:20): [True: 7.62k, False: 1.87k]
  ------------------
 2427|  7.62k|        {
 2428|  7.62k|            pi2_dst[j * dst_strd] = 0;
 2429|  7.62k|        }
 2430|  1.87k|    }
 2431|  6.19k|    else
 2432|  6.19k|    {
 2433|  36.4k|        for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2433:20): [True: 30.2k, False: 6.19k]
  ------------------
 2434|  30.2k|        {
 2435|  30.2k|            pi2_dst[j * dst_strd] = pi2_src[j * src_strd];
 2436|  30.2k|        }
 2437|  6.19k|    }
 2438|  8.07k|    pi2_dst++;
 2439|  8.07k|    zero_cols >>= 1;
 2440|       |
 2441|  37.8k|    for(i = 1; i < trans_size; i++)
  ------------------
  |  Branch (2441:16): [True: 29.8k, False: 8.07k]
  ------------------
 2442|  29.8k|    {
 2443|       |        /* Checking for Zero Cols */
 2444|  29.8k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (2444:12): [True: 12.5k, False: 17.3k]
  ------------------
 2445|  12.5k|        {
 2446|   132k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2446:24): [True: 119k, False: 12.5k]
  ------------------
 2447|   119k|            {
 2448|   119k|                pi2_dst[j * dst_strd] = pi2_dst[j * dst_strd - 1];
 2449|   119k|            }
 2450|  12.5k|        }
 2451|  17.3k|        else
 2452|  17.3k|        {
 2453|   111k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2453:24): [True: 94.0k, False: 17.3k]
  ------------------
 2454|  94.0k|            {
 2455|  94.0k|                pi2_dst[j * dst_strd] = pi2_src[j * src_strd + i] + pi2_dst[j * dst_strd - 1];
 2456|  94.0k|            }
 2457|  17.3k|        }
 2458|  29.8k|        pi2_dst++;
 2459|  29.8k|        zero_cols >>= 1;
 2460|  29.8k|    }
 2461|  8.07k|}
ihevc_res_nxn_rdpcm_vert:
 2470|  7.29k|{
 2471|  7.29k|    WORD32 i, j;
 2472|       |
 2473|  41.6k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (2473:16): [True: 34.3k, False: 7.29k]
  ------------------
 2474|  34.3k|    {
 2475|       |        /* Checking for Zero Cols */
 2476|  34.3k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (2476:12): [True: 16.1k, False: 18.2k]
  ------------------
 2477|  16.1k|        {
 2478|   135k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (2478:24): [True: 118k, False: 16.1k]
  ------------------
 2479|   118k|            {
 2480|   118k|                pi2_dst[j * dst_strd] = 0;
 2481|   118k|            }
 2482|  16.1k|        }
 2483|  18.2k|        else
 2484|  18.2k|        {
 2485|  18.2k|            WORD16 acc = pi2_src[i];
 2486|       |
 2487|  18.2k|            pi2_dst[0] = acc;
 2488|  88.8k|            for(j = 1; j < trans_size; j++)
  ------------------
  |  Branch (2488:24): [True: 70.6k, False: 18.2k]
  ------------------
 2489|  70.6k|            {
 2490|  70.6k|                acc += pi2_src[j * src_strd + i];
 2491|  70.6k|                pi2_dst[j * dst_strd] = acc;
 2492|  70.6k|            }
 2493|  18.2k|        }
 2494|  34.3k|        pi2_dst++;
 2495|  34.3k|        zero_cols = zero_cols >> 1;
 2496|  34.3k|    }
 2497|  7.29k|}

ihevc_memset_16bit:
   75|  5.05M|{
   76|  5.05M|    UWORD32 i;
   77|  1.36G|    for(i = 0; i < num_words; i++)
  ------------------
  |  Branch (77:16): [True: 1.36G, False: 5.05M]
  ------------------
   78|  1.36G|    {
   79|  1.36G|        *pu2_dst++ = value;
   80|  1.36G|    }
   81|  5.05M|}

ihevc_pad_top:
  271|  90.8k|{
  272|  90.8k|    WORD32 row;
  273|       |
  274|  5.65M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (274:18): [True: 5.56M, False: 90.8k]
  ------------------
  275|  5.56M|    {
  276|  5.56M|        memcpy(pu1_src - row * src_strd, pu1_src, wd);
  277|  5.56M|    }
  278|  90.8k|}
ihevc_pad_bottom:
  325|  90.8k|{
  326|  90.8k|    WORD32 row;
  327|       |
  328|  5.65M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (328:18): [True: 5.56M, False: 90.8k]
  ------------------
  329|  5.56M|    {
  330|  5.56M|        memcpy(pu1_src + (row - 1) * src_strd,
  331|  5.56M|               pu1_src - 1 * src_strd, wd);
  332|  5.56M|    }
  333|  90.8k|}
ihevc_pad_left_luma:
  380|   884k|{
  381|   884k|    WORD32 row;
  382|       |
  383|  29.6M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (383:18): [True: 28.7M, False: 884k]
  ------------------
  384|  28.7M|    {
  385|  28.7M|        memset(pu1_src - pad_size, *pu1_src, pad_size);
  386|       |
  387|  28.7M|        pu1_src += src_strd;
  388|  28.7M|    }
  389|   884k|}
ihevc_pad_left_chroma:
  436|   925k|{
  437|   925k|    WORD32 row;
  438|   925k|    WORD32 col;
  439|   925k|    UWORD16 *pu2_src = (UWORD16 *)pu1_src;
  440|       |
  441|   925k|    src_strd >>= 1;
  442|   925k|    pad_size >>= 1;
  443|       |
  444|  16.2M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (444:18): [True: 15.3M, False: 925k]
  ------------------
  445|  15.3M|    {
  446|  15.3M|        UWORD16 u2_uv_val;
  447|       |
  448|  15.3M|        u2_uv_val = pu2_src[0];
  449|   629M|        for(col = -pad_size; col < 0; col++)
  ------------------
  |  Branch (449:30): [True: 614M, False: 15.3M]
  ------------------
  450|   614M|            pu2_src[col] = u2_uv_val;
  451|       |
  452|  15.3M|        pu2_src += src_strd;
  453|  15.3M|    }
  454|   925k|}
ihevc_pad_right_luma:
  501|   884k|{
  502|   884k|    WORD32 row;
  503|       |
  504|  29.6M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (504:18): [True: 28.7M, False: 884k]
  ------------------
  505|  28.7M|    {
  506|  28.7M|        memset(pu1_src, *(pu1_src - 1), pad_size);
  507|       |
  508|  28.7M|        pu1_src += src_strd;
  509|  28.7M|    }
  510|   884k|}
ihevc_pad_right_chroma:
  557|   880k|{
  558|   880k|    WORD32 row;
  559|   880k|    WORD32 col;
  560|   880k|    UWORD16 *pu2_src = (UWORD16 *)pu1_src;
  561|       |
  562|   880k|    src_strd >>= 1;
  563|   880k|    pad_size >>= 1;
  564|       |
  565|  16.2M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (565:18): [True: 15.3M, False: 880k]
  ------------------
  566|  15.3M|    {
  567|  15.3M|        UWORD16 u2_uv_val;
  568|       |
  569|  15.3M|        u2_uv_val = pu2_src[-1];
  570|   629M|        for(col = 0; col < pad_size; col++)
  ------------------
  |  Branch (570:22): [True: 614M, False: 15.3M]
  ------------------
  571|   614M|            pu2_src[col] = u2_uv_val;
  572|       |
  573|  15.3M|        pu2_src += src_strd;
  574|  15.3M|    }
  575|   880k|}

ihevc_recon_4x4_ttype1:
  100|   639k|{
  101|   639k|    WORD32 i, j;
  102|   639k|    WORD32 trans_size;
  103|       |
  104|   639k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|   639k|#define TRANS_SIZE_4   4
  ------------------
  105|       |
  106|       |    /* Reconstruction */
  107|       |
  108|  3.19M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (108:16): [True: 2.55M, False: 639k]
  ------------------
  109|  2.55M|    {
  110|       |        /* Checking for Zero Cols */
  111|  2.55M|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (111:12): [True: 562k, False: 1.99M]
  ------------------
  112|   562k|        {
  113|  2.81M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (113:24): [True: 2.24M, False: 562k]
  ------------------
  114|  2.24M|            {
  115|  2.24M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  116|  2.24M|            }
  117|   562k|        }
  118|  1.99M|        else
  119|  1.99M|        {
  120|  9.97M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (120:24): [True: 7.97M, False: 1.99M]
  ------------------
  121|  7.97M|            {
  122|  7.97M|                pu1_dst[j * dst_strd] =
  123|  7.97M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  7.97M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.97M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.16M, False: 6.81M]
  |  |  |  |  |  Branch (40:53): [True: 217k, False: 6.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  7.97M|            }
  125|  1.99M|        }
  126|  2.55M|        pi2_src++;
  127|  2.55M|        pu1_dst++;
  128|  2.55M|        pu1_pred++;
  129|  2.55M|        zero_cols = zero_cols >> 1;
  130|  2.55M|    }
  131|   639k|}
ihevc_recon_4x4:
  182|  41.9k|{
  183|  41.9k|    WORD32 i, j;
  184|  41.9k|    WORD32 trans_size;
  185|       |
  186|  41.9k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  429|  41.9k|#define TRANS_SIZE_4   4
  ------------------
  187|       |
  188|       |    /* Reconstruction */
  189|       |
  190|   209k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (190:16): [True: 167k, False: 41.9k]
  ------------------
  191|   167k|    {
  192|       |        /* Checking for Zero Cols */
  193|   167k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (193:12): [True: 70.7k, False: 97.0k]
  ------------------
  194|  70.7k|        {
  195|   353k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (195:24): [True: 282k, False: 70.7k]
  ------------------
  196|   282k|            {
  197|   282k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  198|   282k|            }
  199|  70.7k|        }
  200|  97.0k|        else
  201|  97.0k|        {
  202|   485k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (202:24): [True: 388k, False: 97.0k]
  ------------------
  203|   388k|            {
  204|   388k|                pu1_dst[j * dst_strd] =
  205|   388k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|   388k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   388k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.0k, False: 374k]
  |  |  |  |  |  Branch (40:53): [True: 26.6k, False: 347k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|   388k|            }
  207|  97.0k|        }
  208|   167k|        pi2_src++;
  209|   167k|        pu1_dst++;
  210|   167k|        pu1_pred++;
  211|   167k|        zero_cols = zero_cols >> 1;
  212|   167k|    }
  213|  41.9k|}
ihevc_recon_8x8:
  264|  48.5k|{
  265|  48.5k|    WORD32 i, j;
  266|  48.5k|    WORD32 trans_size;
  267|       |
  268|  48.5k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  430|  48.5k|#define TRANS_SIZE_8   8
  ------------------
  269|       |
  270|       |    /* Reconstruction */
  271|       |
  272|   435k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (272:16): [True: 387k, False: 48.5k]
  ------------------
  273|   387k|    {
  274|       |        /* Checking for Zero Cols */
  275|   387k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (275:12): [True: 59.8k, False: 327k]
  ------------------
  276|  59.8k|        {
  277|   538k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (277:24): [True: 478k, False: 59.8k]
  ------------------
  278|   478k|            {
  279|   478k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  280|   478k|            }
  281|  59.8k|        }
  282|   327k|        else
  283|   327k|        {
  284|  2.94M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (284:24): [True: 2.61M, False: 327k]
  ------------------
  285|  2.61M|            {
  286|  2.61M|                pu1_dst[j * dst_strd] =
  287|  2.61M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  2.61M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.61M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 146k, False: 2.47M]
  |  |  |  |  |  Branch (40:53): [True: 194k, False: 2.27M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  2.61M|            }
  289|   327k|        }
  290|   387k|        pi2_src++;
  291|   387k|        pu1_dst++;
  292|   387k|        pu1_pred++;
  293|   387k|        zero_cols = zero_cols >> 1;
  294|   387k|    }
  295|  48.5k|}
ihevc_recon_16x16:
  346|  48.4k|{
  347|  48.4k|    WORD32 i, j;
  348|  48.4k|    WORD32 trans_size;
  349|       |
  350|  48.4k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|  48.4k|#define TRANS_SIZE_16 16
  ------------------
  351|       |
  352|       |    /* Reconstruction */
  353|       |
  354|   818k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (354:16): [True: 770k, False: 48.4k]
  ------------------
  355|   770k|    {
  356|       |        /* Checking for Zero Cols */
  357|   770k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (357:12): [True: 94.6k, False: 675k]
  ------------------
  358|  94.6k|        {
  359|  1.60M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (359:24): [True: 1.51M, False: 94.6k]
  ------------------
  360|  1.51M|            {
  361|  1.51M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  362|  1.51M|            }
  363|  94.6k|        }
  364|   675k|        else
  365|   675k|        {
  366|  11.4M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (366:24): [True: 10.7M, False: 675k]
  ------------------
  367|  10.7M|            {
  368|  10.7M|                pu1_dst[j * dst_strd] =
  369|  10.7M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  10.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  10.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 534k, False: 10.2M]
  |  |  |  |  |  Branch (40:53): [True: 199k, False: 10.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|  10.7M|            }
  371|   675k|        }
  372|   770k|        pi2_src++;
  373|   770k|        pu1_dst++;
  374|   770k|        pu1_pred++;
  375|   770k|        zero_cols = zero_cols >> 1;
  376|   770k|    }
  377|  48.4k|}
ihevc_recon_32x32:
  428|  21.1k|{
  429|  21.1k|    WORD32 i, j;
  430|  21.1k|    WORD32 trans_size;
  431|       |
  432|  21.1k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|  21.1k|#define TRANS_SIZE_32 32
  ------------------
  433|       |
  434|       |    /* Reconstruction */
  435|       |
  436|   693k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (436:16): [True: 672k, False: 21.1k]
  ------------------
  437|   672k|    {
  438|       |        /* Checking for Zero Cols */
  439|   672k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (439:12): [True: 167k, False: 505k]
  ------------------
  440|   167k|        {
  441|  5.51M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (441:24): [True: 5.34M, False: 167k]
  ------------------
  442|  5.34M|            {
  443|  5.34M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  444|  5.34M|            }
  445|   167k|        }
  446|   505k|        else
  447|   505k|        {
  448|  16.6M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (448:24): [True: 16.1M, False: 505k]
  ------------------
  449|  16.1M|            {
  450|  16.1M|                pu1_dst[j * dst_strd] =
  451|  16.1M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  16.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  16.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.21M, False: 14.9M]
  |  |  |  |  |  Branch (40:53): [True: 1.47M, False: 13.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  452|  16.1M|            }
  453|   505k|        }
  454|   672k|        pi2_src++;
  455|   672k|        pu1_dst++;
  456|   672k|        pu1_pred++;
  457|   672k|        zero_cols = zero_cols >> 1;
  458|   672k|    }
  459|  21.1k|}

ihevc_sao_band_offset_luma:
   80|   105k|{
   81|   105k|    WORD32 band_shift;
   82|   105k|    WORD32 band_table[NUM_BAND_TABLE];
   83|   105k|    WORD32 i;
   84|   105k|    WORD32 row, col;
   85|       |
   86|       |    /* Updating left and top and top-left */
   87|  2.98M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (87:18): [True: 2.87M, False: 105k]
  ------------------
   88|  2.87M|    {
   89|  2.87M|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
   90|  2.87M|    }
   91|   105k|    pu1_src_top_left[0] = pu1_src_top[wd - 1];
   92|  3.03M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (92:18): [True: 2.93M, False: 105k]
  ------------------
   93|  2.93M|    {
   94|  2.93M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
   95|  2.93M|    }
   96|       |
   97|   105k|    band_shift = BIT_DEPTH_LUMA - 5;
  ------------------
  |  |  273|   105k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|   105k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
   98|  3.47M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   55|  3.47M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (98:16): [True: 3.36M, False: 105k]
  ------------------
   99|  3.36M|    {
  100|  3.36M|        band_table[i] = 0;
  101|  3.36M|    }
  102|   525k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (102:16): [True: 420k, False: 105k]
  ------------------
  103|   420k|    {
  104|   420k|        band_table[(i + sao_band_pos) & 31] = i + 1;
  105|   420k|    }
  106|       |
  107|  2.93M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (107:18): [True: 2.83M, False: 105k]
  ------------------
  108|  2.83M|    {
  109|  88.0M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (109:22): [True: 85.2M, False: 2.83M]
  ------------------
  110|  85.2M|        {
  111|  85.2M|            WORD32 band_idx;
  112|       |
  113|  85.2M|            band_idx = band_table[pu1_src[col] >> band_shift];
  114|  85.2M|            pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|  85.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 261k, False: 84.9M]
  |  |  |  Branch (40:53): [True: 657k, False: 84.2M]
  |  |  ------------------
  ------------------
  115|  85.2M|        }
  116|  2.83M|        pu1_src += src_strd;
  117|  2.83M|    }
  118|   105k|}
ihevc_sao_band_offset_chroma:
  134|  82.9k|{
  135|  82.9k|    WORD32 band_shift;
  136|  82.9k|    WORD32 band_table_u[NUM_BAND_TABLE];
  137|  82.9k|    WORD32 band_table_v[NUM_BAND_TABLE];
  138|  82.9k|    WORD32 i;
  139|  82.9k|    WORD32 row, col;
  140|       |
  141|       |    /* Updating left and top and top-left */
  142|  1.24M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (142:18): [True: 1.16M, False: 82.9k]
  ------------------
  143|  1.16M|    {
  144|  1.16M|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
  145|  1.16M|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
  146|  1.16M|    }
  147|  82.9k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  148|  82.9k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  149|  2.45M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (149:18): [True: 2.37M, False: 82.9k]
  ------------------
  150|  2.37M|    {
  151|  2.37M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  152|  2.37M|    }
  153|       |
  154|       |
  155|  82.9k|    band_shift = BIT_DEPTH_CHROMA - 5;
  ------------------
  |  |  274|  82.9k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  82.9k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  156|  2.73M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   55|  2.73M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (156:16): [True: 2.65M, False: 82.9k]
  ------------------
  157|  2.65M|    {
  158|  2.65M|        band_table_u[i] = 0;
  159|  2.65M|        band_table_v[i] = 0;
  160|  2.65M|    }
  161|   414k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (161:16): [True: 331k, False: 82.9k]
  ------------------
  162|   331k|    {
  163|   331k|        band_table_u[(i + sao_band_pos_u) & 31] = i + 1;
  164|   331k|        band_table_v[(i + sao_band_pos_v) & 31] = i + 1;
  165|   331k|    }
  166|       |
  167|  1.24M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (167:18): [True: 1.15M, False: 82.9k]
  ------------------
  168|  1.15M|    {
  169|  36.3M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (169:22): [True: 35.1M, False: 1.15M]
  ------------------
  170|  35.1M|        {
  171|  35.1M|            WORD32 band_idx;
  172|  35.1M|            WORD8 *pi1_sao_offset;
  173|       |
  174|  35.1M|            pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (174:30): [True: 17.5M, False: 17.5M]
  ------------------
  175|  35.1M|            band_idx = (0 == col % 2) ? band_table_u[pu1_src[col] >> band_shift] : band_table_v[pu1_src[col] >> band_shift];
  ------------------
  |  Branch (175:24): [True: 17.5M, False: 17.5M]
  ------------------
  176|  35.1M|            pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|  35.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 32.8k, False: 35.1M]
  |  |  |  Branch (40:53): [True: 193k, False: 34.9M]
  |  |  ------------------
  ------------------
  177|  35.1M|        }
  178|  1.15M|        pu1_src += src_strd;
  179|  1.15M|    }
  180|  82.9k|}
ihevc_sao_edge_offset_class0:
  196|  27.0k|{
  197|  27.0k|    WORD32 row, col;
  198|  27.0k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  199|  27.0k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE];
  200|  27.0k|    WORD8 u1_sign_left, u1_sign_right;
  201|  27.0k|    WORD32 bit_depth;
  202|  27.0k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  27.0k|#define UNUSED(x) ((void)(x))
  ------------------
  203|  27.0k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  27.0k|#define UNUSED(x) ((void)(x))
  ------------------
  204|  27.0k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  27.0k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  27.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  205|       |
  206|       |    /* Initialize the mask values */
  207|  27.0k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  27.0k|#define MAX_CTB_SIZE        64
  ------------------
  208|       |
  209|       |    /* Update top and top-left arrays */
  210|  27.0k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  211|   718k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (211:18): [True: 691k, False: 27.0k]
  ------------------
  212|   691k|    {
  213|   691k|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
  214|   691k|    }
  215|   725k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (215:18): [True: 698k, False: 27.0k]
  ------------------
  216|   698k|    {
  217|   698k|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  218|   698k|    }
  219|       |
  220|       |    /* Update masks based on the availability flags */
  221|  27.0k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (221:8): [True: 2.59k, False: 24.4k]
  ------------------
  222|  2.59k|    {
  223|  2.59k|        au1_mask[0] = 0;
  224|  2.59k|    }
  225|  27.0k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (225:8): [True: 2.24k, False: 24.8k]
  ------------------
  226|  2.24k|    {
  227|  2.24k|        au1_mask[wd - 1] = 0;
  228|  2.24k|    }
  229|       |
  230|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  231|  27.0k|    {
  232|   705k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (232:22): [True: 678k, False: 27.0k]
  ------------------
  233|   678k|        {
  234|   678k|            u1_sign_left = SIGN(pu1_src[0] - pu1_src_left[row]);
  ------------------
  |  |   44|   678k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 528k, False: 149k]
  |  |  |  Branch (44:34): [True: 193k, False: 335k]
  |  |  ------------------
  ------------------
  235|  19.9M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (235:26): [True: 19.2M, False: 678k]
  ------------------
  236|  19.2M|            {
  237|  19.2M|                WORD32 edge_idx;
  238|       |
  239|  19.2M|                u1_sign_right = SIGN(pu1_src[col] - pu1_src[col + 1]);
  ------------------
  |  |   44|  19.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 15.0M, False: 4.18M]
  |  |  |  Branch (44:34): [True: 4.11M, False: 10.9M]
  |  |  ------------------
  ------------------
  240|  19.2M|                edge_idx = 2 + u1_sign_left + u1_sign_right;
  241|  19.2M|                u1_sign_left = -u1_sign_right;
  242|       |
  243|  19.2M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  244|       |
  245|  19.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (245:20): [True: 4.34M, False: 14.9M]
  ------------------
  246|  4.34M|                {
  247|  4.34M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  4.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.67k, False: 4.33M]
  |  |  |  Branch (40:53): [True: 7.44k, False: 4.33M]
  |  |  ------------------
  ------------------
  248|  4.34M|                }
  249|  19.2M|            }
  250|       |
  251|   678k|            pu1_src += src_strd;
  252|   678k|        }
  253|  27.0k|    }
  254|       |
  255|       |    /* Update left array */
  256|   717k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (256:18): [True: 690k, False: 27.0k]
  ------------------
  257|   690k|    {
  258|   690k|        pu1_src_left[row] = au1_src_left_tmp[row];
  259|   690k|    }
  260|       |
  261|  27.0k|}
ihevc_sao_edge_offset_class0_chroma:
  279|  20.3k|{
  280|  20.3k|    WORD32 row, col;
  281|  20.3k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  282|  20.3k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE];
  283|  20.3k|    WORD8 u1_sign_left_u, u1_sign_right_u;
  284|  20.3k|    WORD8 u1_sign_left_v, u1_sign_right_v;
  285|  20.3k|    WORD32 bit_depth;
  286|  20.3k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  20.3k|#define UNUSED(x) ((void)(x))
  ------------------
  287|  20.3k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  20.3k|#define UNUSED(x) ((void)(x))
  ------------------
  288|  20.3k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  20.3k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  20.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  289|       |
  290|       |    /* Initialize the mask values */
  291|  20.3k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  20.3k|#define MAX_CTB_SIZE        64
  ------------------
  292|       |
  293|       |    /* Update left, top and top-left arrays */
  294|  20.3k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  295|  20.3k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  296|   304k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (296:18): [True: 283k, False: 20.3k]
  ------------------
  297|   283k|    {
  298|   283k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
  299|   283k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  300|   283k|    }
  301|   603k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (301:18): [True: 583k, False: 20.3k]
  ------------------
  302|   583k|    {
  303|   583k|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  304|   583k|    }
  305|       |
  306|       |    /* Update masks based on the availability flags */
  307|  20.3k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (307:8): [True: 1.91k, False: 18.4k]
  ------------------
  308|  1.91k|    {
  309|  1.91k|        au1_mask[0] = 0;
  310|  1.91k|    }
  311|  20.3k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (311:8): [True: 1.71k, False: 18.6k]
  ------------------
  312|  1.71k|    {
  313|  1.71k|        au1_mask[(wd - 1) >> 1] = 0;
  314|  1.71k|    }
  315|       |
  316|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  317|  20.3k|    {
  318|   302k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (318:22): [True: 282k, False: 20.3k]
  ------------------
  319|   282k|        {
  320|   282k|            u1_sign_left_u = SIGN(pu1_src[0] - pu1_src_left[2 * row]);
  ------------------
  |  |   44|   282k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 225k, False: 56.4k]
  |  |  |  Branch (44:34): [True: 65.6k, False: 160k]
  |  |  ------------------
  ------------------
  321|   282k|            u1_sign_left_v = SIGN(pu1_src[1] - pu1_src_left[2 * row + 1]);
  ------------------
  |  |   44|   282k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 235k, False: 47.1k]
  |  |  |  Branch (44:34): [True: 60.1k, False: 175k]
  |  |  ------------------
  ------------------
  322|  8.88M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (322:26): [True: 8.60M, False: 282k]
  ------------------
  323|  8.60M|            {
  324|  8.60M|                WORD32 edge_idx;
  325|  8.60M|                WORD8 *pi1_sao_offset;
  326|       |
  327|  8.60M|                if(0 == col % 2)
  ------------------
  |  Branch (327:20): [True: 4.30M, False: 4.30M]
  ------------------
  328|  4.30M|                {
  329|  4.30M|                    pi1_sao_offset = pi1_sao_offset_u;
  330|  4.30M|                    u1_sign_right_u = SIGN(pu1_src[col] - pu1_src[col + 2]);
  ------------------
  |  |   44|  4.30M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 3.69M, False: 608k]
  |  |  |  Branch (44:34): [True: 629k, False: 3.06M]
  |  |  ------------------
  ------------------
  331|  4.30M|                    edge_idx = 2 + u1_sign_left_u + u1_sign_right_u;
  332|  4.30M|                    u1_sign_left_u = -u1_sign_right_u;
  333|  4.30M|                }
  334|  4.30M|                else
  335|  4.30M|                {
  336|  4.30M|                    pi1_sao_offset = pi1_sao_offset_v;
  337|  4.30M|                    u1_sign_right_v = SIGN(pu1_src[col] - pu1_src[col + 2]);
  ------------------
  |  |   44|  4.30M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 3.78M, False: 514k]
  |  |  |  Branch (44:34): [True: 555k, False: 3.23M]
  |  |  ------------------
  ------------------
  338|  4.30M|                    edge_idx = 2 + u1_sign_left_v + u1_sign_right_v;
  339|  4.30M|                    u1_sign_left_v = -u1_sign_right_v;
  340|  4.30M|                }
  341|       |
  342|  8.60M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  343|       |
  344|  8.60M|                if(0 != edge_idx)
  ------------------
  |  Branch (344:20): [True: 1.26M, False: 7.34M]
  ------------------
  345|  1.26M|                {
  346|  1.26M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  1.26M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.45k, False: 1.25M]
  |  |  |  Branch (40:53): [True: 2.04k, False: 1.25M]
  |  |  ------------------
  ------------------
  347|  1.26M|                }
  348|  8.60M|            }
  349|       |
  350|   282k|            pu1_src += src_strd;
  351|   282k|        }
  352|  20.3k|    }
  353|       |
  354|   587k|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (354:18): [True: 567k, False: 20.3k]
  ------------------
  355|   567k|    {
  356|   567k|        pu1_src_left[row] = au1_src_left_tmp[row];
  357|   567k|    }
  358|       |
  359|  20.3k|}
ihevc_sao_edge_offset_class1:
  375|  20.7k|{
  376|  20.7k|    WORD32 row, col;
  377|  20.7k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  378|  20.7k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  379|  20.7k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  380|  20.7k|    WORD8 u1_sign_down;
  381|  20.7k|    WORD32 bit_depth;
  382|  20.7k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  20.7k|#define UNUSED(x) ((void)(x))
  ------------------
  383|  20.7k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  20.7k|#define UNUSED(x) ((void)(x))
  ------------------
  384|       |
  385|  20.7k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  20.7k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  20.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  386|       |
  387|       |    /* Initialize the mask values */
  388|  20.7k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  20.7k|#define MAX_CTB_SIZE        64
  ------------------
  389|       |
  390|       |    /* Update left, top and top-left arrays */
  391|  20.7k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  392|   523k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (392:18): [True: 503k, False: 20.7k]
  ------------------
  393|   503k|    {
  394|   503k|        pu1_src_left[row] = pu1_src[row * src_strd + wd - 1];
  395|   503k|    }
  396|   533k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (396:18): [True: 512k, False: 20.7k]
  ------------------
  397|   512k|    {
  398|   512k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  399|   512k|    }
  400|       |
  401|       |    /* Update height and source pointers based on the availability flags */
  402|  20.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (402:8): [True: 4.30k, False: 16.4k]
  ------------------
  403|  4.30k|    {
  404|  4.30k|        pu1_src += src_strd;
  405|  4.30k|        ht--;
  406|  81.3k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (406:22): [True: 77.0k, False: 4.30k]
  ------------------
  407|  77.0k|        {
  408|  77.0k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - src_strd]);
  ------------------
  |  |   44|  77.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 55.1k, False: 21.9k]
  |  |  |  Branch (44:34): [True: 10.2k, False: 44.8k]
  |  |  ------------------
  ------------------
  409|  77.0k|        }
  410|  4.30k|    }
  411|  16.4k|    else
  412|  16.4k|    {
  413|   451k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (413:22): [True: 435k, False: 16.4k]
  ------------------
  414|   435k|        {
  415|   435k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col]);
  ------------------
  |  |   44|   435k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 325k, False: 109k]
  |  |  |  Branch (44:34): [True: 103k, False: 221k]
  |  |  ------------------
  ------------------
  416|   435k|        }
  417|  16.4k|    }
  418|  20.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (418:8): [True: 3.71k, False: 17.0k]
  ------------------
  419|  3.71k|    {
  420|  3.71k|        ht--;
  421|  3.71k|    }
  422|       |
  423|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  424|  20.7k|    {
  425|   511k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (425:22): [True: 491k, False: 20.7k]
  ------------------
  426|   491k|        {
  427|  14.8M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (427:26): [True: 14.3M, False: 491k]
  ------------------
  428|  14.3M|            {
  429|  14.3M|                WORD32 edge_idx;
  430|       |
  431|  14.3M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + src_strd]);
  ------------------
  |  |   44|  14.3M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 11.4M, False: 2.95M]
  |  |  |  Branch (44:34): [True: 3.00M, False: 8.41M]
  |  |  ------------------
  ------------------
  432|  14.3M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  433|  14.3M|                au1_sign_up[col] = -u1_sign_down;
  434|       |
  435|  14.3M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  436|       |
  437|  14.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (437:20): [True: 3.52M, False: 10.8M]
  ------------------
  438|  3.52M|                {
  439|  3.52M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  3.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.50k, False: 3.52M]
  |  |  |  Branch (40:53): [True: 7.95k, False: 3.51M]
  |  |  ------------------
  ------------------
  440|  3.52M|                }
  441|  14.3M|            }
  442|       |
  443|   491k|            pu1_src += src_strd;
  444|   491k|        }
  445|  20.7k|    }
  446|       |
  447|   533k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (447:18): [True: 512k, False: 20.7k]
  ------------------
  448|   512k|    {
  449|   512k|        pu1_src_top[col] = au1_src_top_tmp[col];
  450|   512k|    }
  451|       |
  452|  20.7k|}
ihevc_sao_edge_offset_class1_chroma:
  469|  20.1k|{
  470|  20.1k|    WORD32 row, col;
  471|  20.1k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  472|  20.1k|    UWORD8 au1_src_top_tmp[2 * MAX_CTB_SIZE];
  473|  20.1k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
  474|  20.1k|    WORD8 u1_sign_down;
  475|  20.1k|    WORD32 bit_depth;
  476|  20.1k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  20.1k|#define UNUSED(x) ((void)(x))
  ------------------
  477|  20.1k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  20.1k|#define UNUSED(x) ((void)(x))
  ------------------
  478|       |
  479|  20.1k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  20.1k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  20.1k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  480|       |
  481|       |    /* Initialize the mask values */
  482|  20.1k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  20.1k|#define MAX_CTB_SIZE        64
  ------------------
  483|       |
  484|       |    /* Update left, top and top-left arrays */
  485|  20.1k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  486|  20.1k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  487|   294k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (487:18): [True: 274k, False: 20.1k]
  ------------------
  488|   274k|    {
  489|   274k|        pu1_src_left[2 * row] = pu1_src[row * src_strd + wd - 2];
  490|   274k|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  491|   274k|    }
  492|   578k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (492:18): [True: 558k, False: 20.1k]
  ------------------
  493|   558k|    {
  494|   558k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  495|   558k|    }
  496|       |
  497|       |    /* Update height and source pointers based on the availability flags */
  498|  20.1k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (498:8): [True: 3.82k, False: 16.3k]
  ------------------
  499|  3.82k|    {
  500|  3.82k|        pu1_src += src_strd;
  501|  3.82k|        ht--;
  502|  92.5k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (502:22): [True: 88.7k, False: 3.82k]
  ------------------
  503|  88.7k|        {
  504|  88.7k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - src_strd]);
  ------------------
  |  |   44|  88.7k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 68.1k, False: 20.5k]
  |  |  |  Branch (44:34): [True: 6.00k, False: 62.1k]
  |  |  ------------------
  ------------------
  505|  88.7k|        }
  506|  3.82k|    }
  507|  16.3k|    else
  508|  16.3k|    {
  509|   486k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (509:22): [True: 469k, False: 16.3k]
  ------------------
  510|   469k|        {
  511|   469k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col]);
  ------------------
  |  |   44|   469k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 398k, False: 71.4k]
  |  |  |  Branch (44:34): [True: 70.1k, False: 328k]
  |  |  ------------------
  ------------------
  512|   469k|        }
  513|  16.3k|    }
  514|  20.1k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (514:8): [True: 2.66k, False: 17.5k]
  ------------------
  515|  2.66k|    {
  516|  2.66k|        ht--;
  517|  2.66k|    }
  518|       |
  519|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  520|  20.1k|    {
  521|   284k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (521:22): [True: 264k, False: 20.1k]
  ------------------
  522|   264k|        {
  523|  8.12M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (523:26): [True: 7.85M, False: 264k]
  ------------------
  524|  7.85M|            {
  525|  7.85M|                WORD32 edge_idx;
  526|  7.85M|                WORD8 *pi1_sao_offset;
  527|       |
  528|  7.85M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (528:34): [True: 3.92M, False: 3.92M]
  ------------------
  529|       |
  530|  7.85M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + src_strd]);
  ------------------
  |  |   44|  7.85M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 6.97M, False: 884k]
  |  |  |  Branch (44:34): [True: 871k, False: 6.10M]
  |  |  ------------------
  ------------------
  531|  7.85M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  532|  7.85M|                au1_sign_up[col] = -u1_sign_down;
  533|       |
  534|  7.85M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  535|       |
  536|  7.85M|                if(0 != edge_idx)
  ------------------
  |  Branch (536:20): [True: 1.16M, False: 6.68M]
  ------------------
  537|  1.16M|                {
  538|  1.16M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  1.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 871, False: 1.16M]
  |  |  |  Branch (40:53): [True: 2.08k, False: 1.16M]
  |  |  ------------------
  ------------------
  539|  1.16M|                }
  540|  7.85M|            }
  541|       |
  542|   264k|            pu1_src += src_strd;
  543|   264k|        }
  544|  20.1k|    }
  545|       |
  546|   578k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (546:18): [True: 558k, False: 20.1k]
  ------------------
  547|   558k|    {
  548|   558k|        pu1_src_top[col] = au1_src_top_tmp[col];
  549|   558k|    }
  550|       |
  551|  20.1k|}
ihevc_sao_edge_offset_class2:
  567|  35.1k|{
  568|  35.1k|    WORD32 row, col;
  569|  35.1k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  570|  35.1k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE], au1_src_top_tmp[MAX_CTB_SIZE];
  571|  35.1k|    UWORD8 u1_src_top_left_tmp;
  572|  35.1k|    WORD8 au1_sign_up[MAX_CTB_SIZE + 1], au1_sign_up_tmp[MAX_CTB_SIZE + 1];
  573|  35.1k|    WORD8 u1_sign_down;
  574|  35.1k|    WORD8 *pu1_sign_up;
  575|  35.1k|    WORD8 *pu1_sign_up_tmp;
  576|  35.1k|    UWORD8 *pu1_src_left_cpy;
  577|       |
  578|  35.1k|    WORD32 bit_depth;
  579|  35.1k|    UWORD8 u1_pos_0_0_tmp;
  580|  35.1k|    UWORD8 u1_pos_wd_ht_tmp;
  581|  35.1k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  35.1k|#define UNUSED(x) ((void)(x))
  ------------------
  582|  35.1k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  35.1k|#define UNUSED(x) ((void)(x))
  ------------------
  583|       |
  584|  35.1k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  35.1k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  35.1k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  585|  35.1k|    pu1_sign_up = au1_sign_up;
  586|  35.1k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  587|  35.1k|    pu1_src_left_cpy = pu1_src_left;
  588|       |
  589|       |    /* Initialize the mask values */
  590|  35.1k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  35.1k|#define MAX_CTB_SIZE        64
  ------------------
  591|       |
  592|       |    /* Update left, top and top-left arrays */
  593|  35.1k|    u1_src_top_left_tmp = pu1_src_top[wd - 1];
  594|   849k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (594:18): [True: 814k, False: 35.1k]
  ------------------
  595|   814k|    {
  596|   814k|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
  597|   814k|    }
  598|   858k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (598:18): [True: 823k, False: 35.1k]
  ------------------
  599|   823k|    {
  600|   823k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  601|   823k|    }
  602|       |
  603|       |
  604|       |    /* If top-left is available, process separately */
  605|  35.1k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (605:8): [True: 27.4k, False: 7.76k]
  ------------------
  606|  27.4k|    {
  607|  27.4k|        WORD32 edge_idx;
  608|       |
  609|  27.4k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  27.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.7k, False: 5.60k]
  |  |  |  Branch (44:34): [True: 5.87k, False: 15.9k]
  |  |  ------------------
  ------------------
  610|  27.4k|                        SIGN(pu1_src[0] - pu1_src[1 + src_strd]);
  ------------------
  |  |   44|  27.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.6k, False: 5.79k]
  |  |  |  Branch (44:34): [True: 4.91k, False: 16.6k]
  |  |  ------------------
  ------------------
  611|       |
  612|  27.4k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  613|       |
  614|  27.4k|        if(0 != edge_idx)
  ------------------
  |  Branch (614:12): [True: 7.89k, False: 19.5k]
  ------------------
  615|  7.89k|        {
  616|  7.89k|            u1_pos_0_0_tmp = CLIP3(pu1_src[0] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.89k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 368, False: 7.53k]
  |  |  |  Branch (40:53): [True: 344, False: 7.18k]
  |  |  ------------------
  ------------------
  617|  7.89k|        }
  618|  19.5k|        else
  619|  19.5k|        {
  620|  19.5k|            u1_pos_0_0_tmp = pu1_src[0];
  621|  19.5k|        }
  622|  27.4k|    }
  623|  7.76k|    else
  624|  7.76k|    {
  625|  7.76k|        u1_pos_0_0_tmp = pu1_src[0];
  626|  7.76k|    }
  627|       |
  628|       |    /* If bottom-right is available, process separately */
  629|  35.1k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (629:8): [True: 30.0k, False: 5.09k]
  ------------------
  630|  30.0k|    {
  631|  30.0k|        WORD32 edge_idx;
  632|       |
  633|  30.0k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 1 - src_strd]) +
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 25.3k, False: 4.77k]
  |  |  |  Branch (44:34): [True: 4.64k, False: 20.6k]
  |  |  ------------------
  ------------------
  634|  30.0k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 23.8k, False: 6.18k]
  |  |  |  Branch (44:34): [True: 6.46k, False: 17.4k]
  |  |  ------------------
  ------------------
  635|       |
  636|  30.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  637|       |
  638|  30.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (638:12): [True: 9.95k, False: 20.1k]
  ------------------
  639|  9.95k|        {
  640|  9.95k|            u1_pos_wd_ht_tmp = CLIP3(pu1_src[wd - 1 + (ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.95k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 444, False: 9.51k]
  |  |  |  Branch (40:53): [True: 177, False: 9.33k]
  |  |  ------------------
  ------------------
  641|  9.95k|        }
  642|  20.1k|        else
  643|  20.1k|        {
  644|  20.1k|            u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
  645|  20.1k|        }
  646|  30.0k|    }
  647|  5.09k|    else
  648|  5.09k|    {
  649|  5.09k|        u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
  650|  5.09k|    }
  651|       |
  652|       |    /* If Left is not available */
  653|  35.1k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (653:8): [True: 3.47k, False: 31.6k]
  ------------------
  654|  3.47k|    {
  655|  3.47k|        au1_mask[0] = 0;
  656|  3.47k|    }
  657|       |
  658|       |    /* If Top is not available */
  659|  35.1k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (659:8): [True: 4.89k, False: 30.2k]
  ------------------
  660|  4.89k|    {
  661|  4.89k|        pu1_src += src_strd;
  662|  4.89k|        ht--;
  663|  4.89k|        pu1_src_left_cpy += 1;
  664|   116k|        for(col = 1; col < wd; col++)
  ------------------
  |  Branch (664:22): [True: 111k, False: 4.89k]
  ------------------
  665|   111k|        {
  666|   111k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - 1 - src_strd]);
  ------------------
  |  |   44|   111k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 92.3k, False: 19.2k]
  |  |  |  Branch (44:34): [True: 25.9k, False: 66.3k]
  |  |  ------------------
  ------------------
  667|   111k|        }
  668|  4.89k|    }
  669|  30.2k|    else
  670|  30.2k|    {
  671|   707k|        for(col = 1; col < wd; col++)
  ------------------
  |  Branch (671:22): [True: 677k, False: 30.2k]
  ------------------
  672|   677k|        {
  673|   677k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col - 1]);
  ------------------
  |  |   44|   677k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 527k, False: 149k]
  |  |  |  Branch (44:34): [True: 141k, False: 385k]
  |  |  ------------------
  ------------------
  674|   677k|        }
  675|  30.2k|    }
  676|       |
  677|       |    /* If Right is not available */
  678|  35.1k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (678:8): [True: 2.88k, False: 32.2k]
  ------------------
  679|  2.88k|    {
  680|  2.88k|        au1_mask[wd - 1] = 0;
  681|  2.88k|    }
  682|       |
  683|       |    /* If Bottom is not available */
  684|  35.1k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (684:8): [True: 2.61k, False: 32.5k]
  ------------------
  685|  2.61k|    {
  686|  2.61k|        ht--;
  687|  2.61k|    }
  688|       |
  689|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  690|  35.1k|    {
  691|   824k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (691:22): [True: 789k, False: 35.1k]
  ------------------
  692|   789k|        {
  693|   789k|            pu1_sign_up[0] = SIGN(pu1_src[0] - pu1_src_left_cpy[row - 1]);
  ------------------
  |  |   44|   789k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 622k, False: 166k]
  |  |  |  Branch (44:34): [True: 214k, False: 408k]
  |  |  ------------------
  ------------------
  694|  22.0M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (694:26): [True: 21.2M, False: 789k]
  ------------------
  695|  21.2M|            {
  696|  21.2M|                WORD32 edge_idx;
  697|       |
  698|  21.2M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + 1 + src_strd]);
  ------------------
  |  |   44|  21.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 16.6M, False: 4.55M]
  |  |  |  Branch (44:34): [True: 4.52M, False: 12.1M]
  |  |  ------------------
  ------------------
  699|  21.2M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  700|  21.2M|                pu1_sign_up_tmp[col + 1] = -u1_sign_down;
  701|       |
  702|  21.2M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  703|       |
  704|  21.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (704:20): [True: 5.84M, False: 15.3M]
  ------------------
  705|  5.84M|                {
  706|  5.84M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  5.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.6k, False: 5.82M]
  |  |  |  Branch (40:53): [True: 17.2k, False: 5.81M]
  |  |  ------------------
  ------------------
  707|  5.84M|                }
  708|  21.2M|            }
  709|       |
  710|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  711|   789k|            {
  712|   789k|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  713|   789k|                pu1_sign_up = pu1_sign_up_tmp;
  714|   789k|                pu1_sign_up_tmp = pu1_swap_tmp;
  715|   789k|            }
  716|       |
  717|   789k|            pu1_src += src_strd;
  718|   789k|        }
  719|       |
  720|  35.1k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd] = u1_pos_0_0_tmp;
  ------------------
  |  Branch (720:19): [True: 30.3k, False: 4.85k]
  ------------------
  721|  35.1k|        pu1_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u1_pos_wd_ht_tmp;
  ------------------
  |  Branch (721:18): [True: 32.5k, False: 2.57k]
  ------------------
  722|  35.1k|    }
  723|       |
  724|  35.1k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (724:8): [True: 4.89k, False: 30.2k]
  ------------------
  725|  4.89k|        ht++;
  726|  35.1k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (726:8): [True: 2.61k, False: 32.5k]
  ------------------
  727|  2.61k|        ht++;
  728|  35.1k|    *pu1_src_top_left = u1_src_top_left_tmp;
  729|   849k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (729:18): [True: 813k, False: 35.1k]
  ------------------
  730|   813k|    {
  731|   813k|        pu1_src_left[row] = au1_src_left_tmp[row];
  732|   813k|    }
  733|   858k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (733:18): [True: 823k, False: 35.1k]
  ------------------
  734|   823k|    {
  735|   823k|        pu1_src_top[col] = au1_src_top_tmp[col];
  736|   823k|    }
  737|       |
  738|  35.1k|}
ihevc_sao_edge_offset_class2_chroma:
  756|  34.5k|{
  757|  34.5k|    WORD32 row, col;
  758|  34.5k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  759|  34.5k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE], au1_src_top_tmp[2 * MAX_CTB_SIZE];
  760|  34.5k|    UWORD8 au1_src_top_left_tmp[2];
  761|  34.5k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE + 2], au1_sign_up_tmp[2 * MAX_CTB_SIZE + 2];
  762|  34.5k|    WORD8 u1_sign_down;
  763|  34.5k|    WORD8 *pu1_sign_up;
  764|  34.5k|    WORD8 *pu1_sign_up_tmp;
  765|  34.5k|    UWORD8 *pu1_src_left_cpy;
  766|       |
  767|  34.5k|    WORD32 bit_depth;
  768|       |
  769|  34.5k|    UWORD8 u1_pos_0_0_tmp_u;
  770|  34.5k|    UWORD8 u1_pos_0_0_tmp_v;
  771|  34.5k|    UWORD8 u1_pos_wd_ht_tmp_u;
  772|  34.5k|    UWORD8 u1_pos_wd_ht_tmp_v;
  773|  34.5k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  34.5k|#define UNUSED(x) ((void)(x))
  ------------------
  774|  34.5k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  34.5k|#define UNUSED(x) ((void)(x))
  ------------------
  775|       |
  776|       |
  777|  34.5k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  34.5k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  34.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  778|  34.5k|    pu1_sign_up = au1_sign_up;
  779|  34.5k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  780|  34.5k|    pu1_src_left_cpy = pu1_src_left;
  781|       |
  782|       |    /* Initialize the mask values */
  783|  34.5k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  34.5k|#define MAX_CTB_SIZE        64
  ------------------
  784|       |
  785|       |    /* Update left, top and top-left arrays */
  786|  34.5k|    au1_src_top_left_tmp[0] = pu1_src_top[wd - 2];
  787|  34.5k|    au1_src_top_left_tmp[1] = pu1_src_top[wd - 1];
  788|   456k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (788:18): [True: 421k, False: 34.5k]
  ------------------
  789|   421k|    {
  790|   421k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
  791|   421k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  792|   421k|    }
  793|   885k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (793:18): [True: 850k, False: 34.5k]
  ------------------
  794|   850k|    {
  795|   850k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  796|   850k|    }
  797|       |
  798|       |
  799|       |    /* If top-left is available, process separately */
  800|  34.5k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (800:8): [True: 26.6k, False: 7.88k]
  ------------------
  801|  26.6k|    {
  802|  26.6k|        WORD32 edge_idx;
  803|       |
  804|       |        /* U */
  805|  26.6k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  26.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.1k, False: 5.51k]
  |  |  |  Branch (44:34): [True: 5.75k, False: 15.3k]
  |  |  ------------------
  ------------------
  806|  26.6k|                        SIGN(pu1_src[0] - pu1_src[2 + src_strd]);
  ------------------
  |  |   44|  26.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.6k, False: 4.94k]
  |  |  |  Branch (44:34): [True: 5.12k, False: 16.5k]
  |  |  ------------------
  ------------------
  807|       |
  808|  26.6k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  809|       |
  810|  26.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (810:12): [True: 8.38k, False: 18.2k]
  ------------------
  811|  8.38k|        {
  812|  8.38k|            u1_pos_0_0_tmp_u = CLIP3(pu1_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.38k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 372, False: 8.00k]
  |  |  |  Branch (40:53): [True: 245, False: 7.76k]
  |  |  ------------------
  ------------------
  813|  8.38k|        }
  814|  18.2k|        else
  815|  18.2k|        {
  816|  18.2k|            u1_pos_0_0_tmp_u = pu1_src[0];
  817|  18.2k|        }
  818|       |
  819|       |        /* V */
  820|  26.6k|        edge_idx = 2 + SIGN(pu1_src[1] - pu1_src_top_left[1]) +
  ------------------
  |  |   44|  26.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.8k, False: 4.79k]
  |  |  |  Branch (44:34): [True: 6.02k, False: 15.8k]
  |  |  ------------------
  ------------------
  821|  26.6k|                        SIGN(pu1_src[1] - pu1_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  26.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.6k, False: 5.00k]
  |  |  |  Branch (44:34): [True: 4.62k, False: 17.0k]
  |  |  ------------------
  ------------------
  822|       |
  823|  26.6k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  824|       |
  825|  26.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (825:12): [True: 8.11k, False: 18.5k]
  ------------------
  826|  8.11k|        {
  827|  8.11k|            u1_pos_0_0_tmp_v = CLIP3(pu1_src[1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.11k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 491, False: 7.62k]
  |  |  |  Branch (40:53): [True: 367, False: 7.25k]
  |  |  ------------------
  ------------------
  828|  8.11k|        }
  829|  18.5k|        else
  830|  18.5k|        {
  831|  18.5k|            u1_pos_0_0_tmp_v = pu1_src[1];
  832|  18.5k|        }
  833|  26.6k|    }
  834|  7.88k|    else
  835|  7.88k|    {
  836|  7.88k|        u1_pos_0_0_tmp_u = pu1_src[0];
  837|  7.88k|        u1_pos_0_0_tmp_v = pu1_src[1];
  838|  7.88k|    }
  839|       |
  840|       |    /* If bottom-right is available, process separately */
  841|  34.5k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (841:8): [True: 30.0k, False: 4.42k]
  ------------------
  842|  30.0k|    {
  843|  30.0k|        WORD32 edge_idx;
  844|       |
  845|       |        /* U */
  846|  30.0k|        edge_idx = 2 + SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.2k, False: 3.85k]
  |  |  |  Branch (44:34): [True: 4.34k, False: 21.8k]
  |  |  ------------------
  ------------------
  847|  30.0k|                        SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 23.6k, False: 6.42k]
  |  |  |  Branch (44:34): [True: 6.02k, False: 17.6k]
  |  |  ------------------
  ------------------
  848|       |
  849|  30.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  850|       |
  851|  30.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (851:12): [True: 8.93k, False: 21.1k]
  ------------------
  852|  8.93k|        {
  853|  8.93k|            u1_pos_wd_ht_tmp_u = CLIP3(pu1_src[wd - 2 + (ht - 1) * src_strd] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.93k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 405, False: 8.52k]
  |  |  |  Branch (40:53): [True: 271, False: 8.25k]
  |  |  ------------------
  ------------------
  854|  8.93k|        }
  855|  21.1k|        else
  856|  21.1k|        {
  857|  21.1k|            u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
  858|  21.1k|        }
  859|       |
  860|       |        /* V */
  861|  30.0k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.4k, False: 3.59k]
  |  |  |  Branch (44:34): [True: 4.37k, False: 22.1k]
  |  |  ------------------
  ------------------
  862|  30.0k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  30.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 24.0k, False: 6.09k]
  |  |  |  Branch (44:34): [True: 6.04k, False: 17.9k]
  |  |  ------------------
  ------------------
  863|       |
  864|  30.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  865|       |
  866|  30.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (866:12): [True: 8.52k, False: 21.5k]
  ------------------
  867|  8.52k|        {
  868|  8.52k|            u1_pos_wd_ht_tmp_v = CLIP3(pu1_src[wd - 1 + (ht - 1) * src_strd] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.52k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 272, False: 8.25k]
  |  |  |  Branch (40:53): [True: 230, False: 8.02k]
  |  |  ------------------
  ------------------
  869|  8.52k|        }
  870|  21.5k|        else
  871|  21.5k|        {
  872|  21.5k|            u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
  873|  21.5k|        }
  874|  30.0k|    }
  875|  4.42k|    else
  876|  4.42k|    {
  877|  4.42k|        u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
  878|  4.42k|        u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
  879|  4.42k|    }
  880|       |
  881|       |    /* If Left is not available */
  882|  34.5k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (882:8): [True: 3.36k, False: 31.1k]
  ------------------
  883|  3.36k|    {
  884|  3.36k|        au1_mask[0] = 0;
  885|  3.36k|    }
  886|       |
  887|       |    /* If Top is not available */
  888|  34.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (888:8): [True: 4.99k, False: 29.5k]
  ------------------
  889|  4.99k|    {
  890|  4.99k|        pu1_src += src_strd;
  891|  4.99k|        pu1_src_left_cpy += 2;
  892|  4.99k|        ht--;
  893|   125k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (893:22): [True: 120k, False: 4.99k]
  ------------------
  894|   120k|        {
  895|   120k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - 2 - src_strd]);
  ------------------
  |  |   44|   120k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 104k, False: 16.3k]
  |  |  |  Branch (44:34): [True: 13.2k, False: 90.8k]
  |  |  ------------------
  ------------------
  896|   120k|        }
  897|  4.99k|    }
  898|  29.5k|    else
  899|  29.5k|    {
  900|   690k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (900:22): [True: 661k, False: 29.5k]
  ------------------
  901|   661k|        {
  902|   661k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col - 2]);
  ------------------
  |  |   44|   661k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 540k, False: 120k]
  |  |  |  Branch (44:34): [True: 122k, False: 417k]
  |  |  ------------------
  ------------------
  903|   661k|        }
  904|  29.5k|    }
  905|       |
  906|       |    /* If Right is not available */
  907|  34.5k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (907:8): [True: 2.80k, False: 31.7k]
  ------------------
  908|  2.80k|    {
  909|  2.80k|        au1_mask[(wd - 1) >> 1] = 0;
  910|  2.80k|    }
  911|       |
  912|       |    /* If Bottom is not available */
  913|  34.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (913:8): [True: 1.78k, False: 32.7k]
  ------------------
  914|  1.78k|    {
  915|  1.78k|        ht--;
  916|  1.78k|    }
  917|       |
  918|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  919|  34.5k|    {
  920|   447k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (920:22): [True: 413k, False: 34.5k]
  ------------------
  921|   413k|        {
  922|   413k|            pu1_sign_up[0] = SIGN(pu1_src[0] - pu1_src_left_cpy[2 * (row - 1)]);
  ------------------
  |  |   44|   413k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 335k, False: 77.5k]
  |  |  |  Branch (44:34): [True: 93.1k, False: 242k]
  |  |  ------------------
  ------------------
  923|   413k|            pu1_sign_up[1] = SIGN(pu1_src[1] - pu1_src_left_cpy[2 * (row - 1) + 1]);
  ------------------
  |  |   44|   413k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 340k, False: 72.6k]
  |  |  |  Branch (44:34): [True: 102k, False: 238k]
  |  |  ------------------
  ------------------
  924|  11.7M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (924:26): [True: 11.3M, False: 413k]
  ------------------
  925|  11.3M|            {
  926|  11.3M|                WORD32 edge_idx;
  927|  11.3M|                WORD8 *pi1_sao_offset;
  928|       |
  929|  11.3M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (929:34): [True: 5.65M, False: 5.65M]
  ------------------
  930|       |
  931|  11.3M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + 2 + src_strd]);
  ------------------
  |  |   44|  11.3M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 9.58M, False: 1.71M]
  |  |  |  Branch (44:34): [True: 1.75M, False: 7.82M]
  |  |  ------------------
  ------------------
  932|  11.3M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  933|  11.3M|                pu1_sign_up_tmp[col + 2] = -u1_sign_down;
  934|       |
  935|  11.3M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  936|       |
  937|  11.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (937:20): [True: 2.39M, False: 8.90M]
  ------------------
  938|  2.39M|                {
  939|  2.39M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  2.39M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 15.3k, False: 2.37M]
  |  |  |  Branch (40:53): [True: 17.2k, False: 2.36M]
  |  |  ------------------
  ------------------
  940|  2.39M|                }
  941|  11.3M|            }
  942|       |
  943|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  944|   413k|            {
  945|   413k|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  946|   413k|                pu1_sign_up = pu1_sign_up_tmp;
  947|   413k|                pu1_sign_up_tmp = pu1_swap_tmp;
  948|   413k|            }
  949|       |
  950|   413k|            pu1_src += src_strd;
  951|   413k|        }
  952|       |
  953|  34.5k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd] = u1_pos_0_0_tmp_u;
  ------------------
  |  Branch (953:19): [True: 29.5k, False: 4.97k]
  ------------------
  954|  34.5k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + 1] = u1_pos_0_0_tmp_v;
  ------------------
  |  Branch (954:19): [True: 29.5k, False: 4.97k]
  ------------------
  955|  34.5k|        pu1_src[(pu1_avail[3] ? wd - 2 - src_strd : wd - 2)] = u1_pos_wd_ht_tmp_u;
  ------------------
  |  Branch (955:18): [True: 32.7k, False: 1.76k]
  ------------------
  956|  34.5k|        pu1_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u1_pos_wd_ht_tmp_v;
  ------------------
  |  Branch (956:18): [True: 32.7k, False: 1.76k]
  ------------------
  957|  34.5k|    }
  958|       |
  959|  34.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (959:8): [True: 4.99k, False: 29.5k]
  ------------------
  960|  4.99k|        ht++;
  961|  34.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (961:8): [True: 1.78k, False: 32.7k]
  ------------------
  962|  1.78k|        ht++;
  963|  34.5k|    pu1_src_top_left[0] = au1_src_top_left_tmp[0];
  964|  34.5k|    pu1_src_top_left[1] = au1_src_top_left_tmp[1];
  965|   878k|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (965:18): [True: 843k, False: 34.5k]
  ------------------
  966|   843k|    {
  967|   843k|        pu1_src_left[row] = au1_src_left_tmp[row];
  968|   843k|    }
  969|   885k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (969:18): [True: 850k, False: 34.5k]
  ------------------
  970|   850k|    {
  971|   850k|        pu1_src_top[col] = au1_src_top_tmp[col];
  972|   850k|    }
  973|       |
  974|  34.5k|}
ihevc_sao_edge_offset_class3:
  991|  45.7k|{
  992|  45.7k|    WORD32 row, col;
  993|  45.7k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  994|  45.7k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  995|  45.7k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE];
  996|  45.7k|    UWORD8 u1_src_top_left_tmp;
  997|  45.7k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  998|  45.7k|    UWORD8 *pu1_src_left_cpy;
  999|  45.7k|    WORD8 u1_sign_down;
 1000|  45.7k|    WORD32 bit_depth;
 1001|       |
 1002|  45.7k|    UWORD8 u1_pos_0_ht_tmp;
 1003|  45.7k|    UWORD8 u1_pos_wd_0_tmp;
 1004|       |
 1005|  45.7k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  45.7k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  45.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1006|  45.7k|    pu1_src_left_cpy = pu1_src_left;
 1007|       |
 1008|       |    /* Initialize the mask values */
 1009|  45.7k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  45.7k|#define MAX_CTB_SIZE        64
  ------------------
 1010|       |
 1011|       |    /* Update left, top and top-left arrays */
 1012|  45.7k|    u1_src_top_left_tmp = pu1_src_top[wd - 1];
 1013|   905k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1013:18): [True: 859k, False: 45.7k]
  ------------------
 1014|   859k|    {
 1015|   859k|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
 1016|   859k|    }
 1017|   911k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1017:18): [True: 865k, False: 45.7k]
  ------------------
 1018|   865k|    {
 1019|   865k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
 1020|   865k|    }
 1021|       |
 1022|       |    /* If top-right is available, process separately */
 1023|  45.7k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1023:8): [True: 35.8k, False: 9.93k]
  ------------------
 1024|  35.8k|    {
 1025|  35.8k|        WORD32 edge_idx;
 1026|       |
 1027|  35.8k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  35.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.3k, False: 8.56k]
  |  |  |  Branch (44:34): [True: 5.48k, False: 21.8k]
  |  |  ------------------
  ------------------
 1028|  35.8k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  35.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.3k, False: 6.50k]
  |  |  |  Branch (44:34): [True: 5.71k, False: 23.6k]
  |  |  ------------------
  ------------------
 1029|       |
 1030|  35.8k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1031|       |
 1032|  35.8k|        if(0 != edge_idx)
  ------------------
  |  Branch (1032:12): [True: 10.2k, False: 25.6k]
  ------------------
 1033|  10.2k|        {
 1034|  10.2k|            u1_pos_wd_0_tmp = CLIP3(pu1_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  10.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 356, False: 9.88k]
  |  |  |  Branch (40:53): [True: 191, False: 9.69k]
  |  |  ------------------
  ------------------
 1035|  10.2k|        }
 1036|  25.6k|        else
 1037|  25.6k|        {
 1038|  25.6k|            u1_pos_wd_0_tmp = pu1_src[wd - 1];
 1039|  25.6k|        }
 1040|  35.8k|    }
 1041|  9.93k|    else
 1042|  9.93k|    {
 1043|  9.93k|        u1_pos_wd_0_tmp = pu1_src[wd - 1];
 1044|  9.93k|    }
 1045|       |
 1046|       |    /* If bottom-left is available, process separately */
 1047|  45.7k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1047:8): [True: 40.6k, False: 5.13k]
  ------------------
 1048|  40.6k|    {
 1049|  40.6k|        WORD32 edge_idx;
 1050|       |
 1051|  40.6k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  40.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.9k, False: 5.68k]
  |  |  |  Branch (44:34): [True: 7.57k, False: 27.4k]
  |  |  ------------------
  ------------------
 1052|  40.6k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  40.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.9k, False: 5.74k]
  |  |  |  Branch (44:34): [True: 9.87k, False: 25.0k]
  |  |  ------------------
  ------------------
 1053|       |
 1054|  40.6k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1055|       |
 1056|  40.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (1056:12): [True: 11.7k, False: 28.8k]
  ------------------
 1057|  11.7k|        {
 1058|  11.7k|            u1_pos_0_ht_tmp = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  11.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 431, False: 11.3k]
  |  |  |  Branch (40:53): [True: 146, False: 11.1k]
  |  |  ------------------
  ------------------
 1059|  11.7k|        }
 1060|  28.8k|        else
 1061|  28.8k|        {
 1062|  28.8k|            u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 1063|  28.8k|        }
 1064|  40.6k|    }
 1065|  5.13k|    else
 1066|  5.13k|    {
 1067|  5.13k|        u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 1068|  5.13k|    }
 1069|       |
 1070|       |    /* If Left is not available */
 1071|  45.7k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1071:8): [True: 2.99k, False: 42.8k]
  ------------------
 1072|  2.99k|    {
 1073|  2.99k|        au1_mask[0] = 0;
 1074|  2.99k|    }
 1075|       |
 1076|       |    /* If Top is not available */
 1077|  45.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1077:8): [True: 7.62k, False: 38.1k]
  ------------------
 1078|  7.62k|    {
 1079|  7.62k|        pu1_src += src_strd;
 1080|  7.62k|        ht--;
 1081|  7.62k|        pu1_src_left_cpy += 1;
 1082|   131k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1082:22): [True: 123k, False: 7.62k]
  ------------------
 1083|   123k|        {
 1084|   123k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col + 1 - src_strd]);
  ------------------
  |  |   44|   123k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 101k, False: 21.8k]
  |  |  |  Branch (44:34): [True: 20.2k, False: 81.5k]
  |  |  ------------------
  ------------------
 1085|   123k|        }
 1086|  7.62k|    }
 1087|  38.1k|    else
 1088|  38.1k|    {
 1089|   734k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1089:22): [True: 696k, False: 38.1k]
  ------------------
 1090|   696k|        {
 1091|   696k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col + 1]);
  ------------------
  |  |   44|   696k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 528k, False: 168k]
  |  |  |  Branch (44:34): [True: 134k, False: 394k]
  |  |  ------------------
  ------------------
 1092|   696k|        }
 1093|  38.1k|    }
 1094|       |
 1095|       |    /* If Right is not available */
 1096|  45.7k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1096:8): [True: 2.68k, False: 43.1k]
  ------------------
 1097|  2.68k|    {
 1098|  2.68k|        au1_mask[wd - 1] = 0;
 1099|  2.68k|    }
 1100|       |
 1101|       |    /* If Bottom is not available */
 1102|  45.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1102:8): [True: 2.38k, False: 43.4k]
  ------------------
 1103|  2.38k|    {
 1104|  2.38k|        ht--;
 1105|  2.38k|    }
 1106|       |
 1107|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1108|  45.7k|    {
 1109|   886k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1109:22): [True: 840k, False: 45.7k]
  ------------------
 1110|   840k|        {
 1111|   840k|            au1_sign_up[wd - 1] = SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 + 1 - src_strd]);
  ------------------
  |  |   44|   840k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 639k, False: 200k]
  |  |  |  Branch (44:34): [True: 176k, False: 463k]
  |  |  ------------------
  ------------------
 1112|  20.8M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1112:26): [True: 19.9M, False: 840k]
  ------------------
 1113|  19.9M|            {
 1114|  19.9M|                WORD32 edge_idx;
 1115|       |
 1116|  19.9M|                u1_sign_down = SIGN(pu1_src[col] - ((col == 0) ? pu1_src_left_cpy[row + 1] :
  ------------------
  |  |   44|  39.9M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 15.6M, False: 4.32M]
  |  |  |  Branch (44:23): [True: 840k, False: 19.1M]
  |  |  |  Branch (44:34): [True: 4.43M, False: 11.2M]
  |  |  |  Branch (44:35): [True: 682k, False: 14.9M]
  |  |  ------------------
  ------------------
 1117|  19.9M|                                                                 pu1_src[col - 1 + src_strd]));
 1118|  19.9M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1119|  19.9M|                if(col > 0)
  ------------------
  |  Branch (1119:20): [True: 19.1M, False: 831k]
  ------------------
 1120|  19.1M|                    au1_sign_up[col - 1] = -u1_sign_down;
 1121|       |
 1122|  19.9M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
 1123|       |
 1124|  19.9M|                if(0 != edge_idx)
  ------------------
  |  Branch (1124:20): [True: 5.77M, False: 14.2M]
  ------------------
 1125|  5.77M|                {
 1126|  5.77M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  5.77M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.6k, False: 5.76M]
  |  |  |  Branch (40:53): [True: 27.4k, False: 5.73M]
  |  |  ------------------
  ------------------
 1127|  5.77M|                }
 1128|  19.9M|            }
 1129|       |
 1130|   840k|            pu1_src += src_strd;
 1131|   840k|        }
 1132|       |
 1133|  45.7k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u1_pos_wd_0_tmp;
  ------------------
  |  Branch (1133:19): [True: 38.2k, False: 7.58k]
  ------------------
 1134|  45.7k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u1_pos_0_ht_tmp;
  ------------------
  |  Branch (1134:18): [True: 43.3k, False: 2.46k]
  ------------------
 1135|  45.7k|    }
 1136|       |
 1137|  45.7k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1137:8): [True: 7.62k, False: 38.1k]
  ------------------
 1138|  7.62k|        ht++;
 1139|  45.7k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1139:8): [True: 2.38k, False: 43.4k]
  ------------------
 1140|  2.38k|        ht++;
 1141|  45.7k|    *pu1_src_top_left = u1_src_top_left_tmp;
 1142|   903k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1142:18): [True: 857k, False: 45.7k]
  ------------------
 1143|   857k|    {
 1144|   857k|        pu1_src_left[row] = au1_src_left_tmp[row];
 1145|   857k|    }
 1146|   909k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1146:18): [True: 863k, False: 45.7k]
  ------------------
 1147|   863k|    {
 1148|   863k|        pu1_src_top[col] = au1_src_top_tmp[col];
 1149|   863k|    }
 1150|       |
 1151|  45.7k|}
ihevc_sao_edge_offset_class3_chroma:
 1168|  44.8k|{
 1169|  44.8k|    WORD32 row, col;
 1170|  44.8k|    UWORD8 au1_mask[MAX_CTB_SIZE];
 1171|  44.8k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE], au1_src_top_tmp[2 * MAX_CTB_SIZE];
 1172|  44.8k|    UWORD8 au1_src_top_left_tmp[2];
 1173|  44.8k|    WORD8 au1_sign_up[2 * MAX_CTB_SIZE];
 1174|  44.8k|    UWORD8 *pu1_src_left_cpy;
 1175|  44.8k|    WORD8 u1_sign_down;
 1176|  44.8k|    WORD32 bit_depth;
 1177|       |
 1178|  44.8k|    UWORD8 u1_pos_wd_0_tmp_u;
 1179|  44.8k|    UWORD8 u1_pos_wd_0_tmp_v;
 1180|  44.8k|    UWORD8 u1_pos_0_ht_tmp_u;
 1181|  44.8k|    UWORD8 u1_pos_0_ht_tmp_v;
 1182|       |
 1183|  44.8k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  274|  44.8k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  44.8k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1184|  44.8k|    pu1_src_left_cpy = pu1_src_left;
 1185|       |
 1186|       |    /* Initialize the mask values */
 1187|  44.8k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  351|  44.8k|#define MAX_CTB_SIZE        64
  ------------------
 1188|       |
 1189|       |    /* Update left, top and top-left arrays */
 1190|  44.8k|    au1_src_top_left_tmp[0] = pu1_src_top[wd - 2];
 1191|  44.8k|    au1_src_top_left_tmp[1] = pu1_src_top[wd - 1];
 1192|   498k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1192:18): [True: 453k, False: 44.8k]
  ------------------
 1193|   453k|    {
 1194|   453k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
 1195|   453k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
 1196|   453k|    }
 1197|   963k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1197:18): [True: 918k, False: 44.8k]
  ------------------
 1198|   918k|    {
 1199|   918k|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
 1200|   918k|    }
 1201|       |
 1202|       |
 1203|       |    /* If top-right is available, process separately */
 1204|  44.8k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1204:8): [True: 34.0k, False: 10.8k]
  ------------------
 1205|  34.0k|    {
 1206|  34.0k|        WORD32 edge_idx;
 1207|       |
 1208|       |        /* U */
 1209|  34.0k|        edge_idx = 2 + SIGN(pu1_src[wd - 2] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  34.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 28.2k, False: 5.76k]
  |  |  |  Branch (44:34): [True: 6.11k, False: 22.1k]
  |  |  ------------------
  ------------------
 1210|  34.0k|                        SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|  34.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.5k, False: 4.50k]
  |  |  |  Branch (44:34): [True: 5.23k, False: 24.2k]
  |  |  ------------------
  ------------------
 1211|       |
 1212|  34.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1213|       |
 1214|  34.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (1214:12): [True: 9.48k, False: 24.5k]
  ------------------
 1215|  9.48k|        {
 1216|  9.48k|            u1_pos_wd_0_tmp_u = CLIP3(pu1_src[wd - 2] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.48k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 563, False: 8.92k]
  |  |  |  Branch (40:53): [True: 595, False: 8.32k]
  |  |  ------------------
  ------------------
 1217|  9.48k|        }
 1218|  24.5k|        else
 1219|  24.5k|        {
 1220|  24.5k|            u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 1221|  24.5k|        }
 1222|       |
 1223|       |        /* V */
 1224|  34.0k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[1]) +
  ------------------
  |  |   44|  34.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.2k, False: 4.82k]
  |  |  |  Branch (44:34): [True: 5.65k, False: 23.5k]
  |  |  ------------------
  ------------------
 1225|  34.0k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|  34.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 30.0k, False: 3.98k]
  |  |  |  Branch (44:34): [True: 5.19k, False: 24.8k]
  |  |  ------------------
  ------------------
 1226|       |
 1227|  34.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1228|       |
 1229|  34.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (1229:12): [True: 8.34k, False: 25.6k]
  ------------------
 1230|  8.34k|        {
 1231|  8.34k|            u1_pos_wd_0_tmp_v = CLIP3(pu1_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.34k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 446, False: 7.90k]
  |  |  |  Branch (40:53): [True: 711, False: 7.19k]
  |  |  ------------------
  ------------------
 1232|  8.34k|        }
 1233|  25.6k|        else
 1234|  25.6k|        {
 1235|  25.6k|            u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 1236|  25.6k|        }
 1237|  34.0k|    }
 1238|  10.8k|    else
 1239|  10.8k|    {
 1240|  10.8k|        u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 1241|  10.8k|        u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 1242|  10.8k|    }
 1243|       |
 1244|       |    /* If bottom-left is available, process separately */
 1245|  44.8k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1245:8): [True: 37.3k, False: 7.52k]
  ------------------
 1246|  37.3k|    {
 1247|  37.3k|        WORD32 edge_idx;
 1248|       |
 1249|       |        /* U */
 1250|  37.3k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|  37.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.8k, False: 4.48k]
  |  |  |  Branch (44:34): [True: 4.87k, False: 28.0k]
  |  |  ------------------
  ------------------
 1251|  37.3k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  37.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 30.7k, False: 6.65k]
  |  |  |  Branch (44:34): [True: 6.16k, False: 24.5k]
  |  |  ------------------
  ------------------
 1252|       |
 1253|  37.3k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1254|       |
 1255|  37.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (1255:12): [True: 9.53k, False: 27.8k]
  ------------------
 1256|  9.53k|        {
 1257|  9.53k|            u1_pos_0_ht_tmp_u = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.53k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 508, False: 9.02k]
  |  |  |  Branch (40:53): [True: 659, False: 8.36k]
  |  |  ------------------
  ------------------
 1258|  9.53k|        }
 1259|  27.8k|        else
 1260|  27.8k|        {
 1261|  27.8k|            u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 1262|  27.8k|        }
 1263|       |
 1264|       |        /* V */
 1265|  37.3k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|  37.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 33.4k, False: 3.90k]
  |  |  |  Branch (44:34): [True: 4.63k, False: 28.8k]
  |  |  ------------------
  ------------------
 1266|  37.3k|                        SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src_bot_left[1]);
  ------------------
  |  |   44|  37.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 31.6k, False: 5.69k]
  |  |  |  Branch (44:34): [True: 5.50k, False: 26.1k]
  |  |  ------------------
  ------------------
 1267|       |
 1268|  37.3k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1269|       |
 1270|  37.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (1270:12): [True: 8.36k, False: 28.9k]
  ------------------
 1271|  8.36k|        {
 1272|  8.36k|            u1_pos_0_ht_tmp_v = CLIP3(pu1_src[(ht - 1) * src_strd + 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.36k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 521, False: 7.84k]
  |  |  |  Branch (40:53): [True: 729, False: 7.11k]
  |  |  ------------------
  ------------------
 1273|  8.36k|        }
 1274|  28.9k|        else
 1275|  28.9k|        {
 1276|  28.9k|            u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 1277|  28.9k|        }
 1278|  37.3k|    }
 1279|  7.52k|    else
 1280|  7.52k|    {
 1281|  7.52k|        u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 1282|  7.52k|        u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 1283|  7.52k|    }
 1284|       |
 1285|       |    /* If Left is not available */
 1286|  44.8k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1286:8): [True: 4.30k, False: 40.5k]
  ------------------
 1287|  4.30k|    {
 1288|  4.30k|        au1_mask[0] = 0;
 1289|  4.30k|    }
 1290|       |
 1291|       |    /* If Top is not available */
 1292|  44.8k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1292:8): [True: 7.40k, False: 37.4k]
  ------------------
 1293|  7.40k|    {
 1294|  7.40k|        pu1_src += src_strd;
 1295|  7.40k|        ht--;
 1296|  7.40k|        pu1_src_left_cpy += 2;
 1297|   139k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1297:22): [True: 131k, False: 7.40k]
  ------------------
 1298|   131k|        {
 1299|   131k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col + 2 - src_strd]);
  ------------------
  |  |   44|   131k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 120k, False: 11.0k]
  |  |  |  Branch (44:34): [True: 6.69k, False: 113k]
  |  |  ------------------
  ------------------
 1300|   131k|        }
 1301|  7.40k|    }
 1302|  37.4k|    else
 1303|  37.4k|    {
 1304|   734k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1304:22): [True: 697k, False: 37.4k]
  ------------------
 1305|   697k|        {
 1306|   697k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col + 2]);
  ------------------
  |  |   44|   697k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 589k, False: 107k]
  |  |  |  Branch (44:34): [True: 116k, False: 472k]
  |  |  ------------------
  ------------------
 1307|   697k|        }
 1308|  37.4k|    }
 1309|       |
 1310|       |    /* If Right is not available */
 1311|  44.8k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1311:8): [True: 4.03k, False: 40.8k]
  ------------------
 1312|  4.03k|    {
 1313|  4.03k|        au1_mask[(wd - 1) >> 1] = 0;
 1314|  4.03k|    }
 1315|       |
 1316|       |    /* If Bottom is not available */
 1317|  44.8k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1317:8): [True: 3.61k, False: 41.2k]
  ------------------
 1318|  3.61k|    {
 1319|  3.61k|        ht--;
 1320|  3.61k|    }
 1321|       |
 1322|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1323|  44.8k|    {
 1324|   484k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1324:22): [True: 439k, False: 44.8k]
  ------------------
 1325|   439k|        {
 1326|   439k|            au1_sign_up[wd - 2] = SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 + 2 - src_strd]);
  ------------------
  |  |   44|   439k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 368k, False: 71.3k]
  |  |  |  Branch (44:34): [True: 71.2k, False: 297k]
  |  |  ------------------
  ------------------
 1327|   439k|            au1_sign_up[wd - 1] = SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 + 2 - src_strd]);
  ------------------
  |  |   44|   439k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 375k, False: 64.3k]
  |  |  |  Branch (44:34): [True: 65.2k, False: 310k]
  |  |  ------------------
  ------------------
 1328|  10.6M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1328:26): [True: 10.2M, False: 439k]
  ------------------
 1329|  10.2M|            {
 1330|  10.2M|                WORD32 edge_idx;
 1331|  10.2M|                WORD8 *pi1_sao_offset;
 1332|       |
 1333|  10.2M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (1333:34): [True: 5.12M, False: 5.12M]
  ------------------
 1334|       |
 1335|  10.2M|                u1_sign_down = SIGN(pu1_src[col] - ((col < 2) ? pu1_src_left_cpy[2 * (row + 1) + col] :
  ------------------
  |  |   44|  20.4M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 8.95M, False: 1.29M]
  |  |  |  Branch (44:23): [True: 879k, False: 9.36M]
  |  |  |  Branch (44:34): [True: 1.37M, False: 7.57M]
  |  |  |  Branch (44:35): [True: 763k, False: 8.18M]
  |  |  ------------------
  ------------------
 1336|  10.2M|                                                                pu1_src[col - 2 + src_strd]));
 1337|  10.2M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1338|  10.2M|                if(col > 1)
  ------------------
  |  Branch (1338:20): [True: 9.36M, False: 875k]
  ------------------
 1339|  9.36M|                    au1_sign_up[col - 2] = -u1_sign_down;
 1340|       |
 1341|  10.2M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
 1342|       |
 1343|  10.2M|                if(0 != edge_idx)
  ------------------
  |  Branch (1343:20): [True: 1.82M, False: 8.41M]
  ------------------
 1344|  1.82M|                {
 1345|  1.82M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  1.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 24.0k, False: 1.80M]
  |  |  |  Branch (40:53): [True: 25.0k, False: 1.77M]
  |  |  ------------------
  ------------------
 1346|  1.82M|                }
 1347|  10.2M|            }
 1348|       |
 1349|   439k|            pu1_src += src_strd;
 1350|   439k|        }
 1351|       |
 1352|  44.8k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 2] = u1_pos_wd_0_tmp_u;
  ------------------
  |  Branch (1352:19): [True: 37.4k, False: 7.42k]
  ------------------
 1353|  44.8k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u1_pos_wd_0_tmp_v;
  ------------------
  |  Branch (1353:19): [True: 37.4k, False: 7.42k]
  ------------------
 1354|  44.8k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u1_pos_0_ht_tmp_u;
  ------------------
  |  Branch (1354:18): [True: 41.2k, False: 3.63k]
  ------------------
 1355|  44.8k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0) + 1] = u1_pos_0_ht_tmp_v;
  ------------------
  |  Branch (1355:18): [True: 41.2k, False: 3.62k]
  ------------------
 1356|  44.8k|    }
 1357|       |
 1358|  44.8k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1358:8): [True: 7.40k, False: 37.4k]
  ------------------
 1359|  7.40k|        ht++;
 1360|  44.8k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1360:8): [True: 3.60k, False: 41.2k]
  ------------------
 1361|  3.60k|        ht++;
 1362|  44.8k|    pu1_src_top_left[0] = au1_src_top_left_tmp[0];
 1363|  44.8k|    pu1_src_top_left[1] = au1_src_top_left_tmp[1];
 1364|   951k|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1364:18): [True: 906k, False: 44.8k]
  ------------------
 1365|   906k|    {
 1366|   906k|        pu1_src_left[row] = au1_src_left_tmp[row];
 1367|   906k|    }
 1368|   962k|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1368:18): [True: 917k, False: 44.8k]
  ------------------
 1369|   917k|    {
 1370|   917k|        pu1_src_top[col] = au1_src_top_tmp[col];
 1371|   917k|    }
 1372|       |
 1373|  44.8k|}

ihevc_weighted_pred_uni:
  114|   461k|{
  115|   461k|    WORD32 row, col;
  116|   461k|    WORD32 i4_tmp;
  117|       |
  118|  4.35M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (118:18): [True: 3.89M, False: 461k]
  ------------------
  119|  3.89M|    {
  120|  48.9M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (120:22): [True: 45.0M, False: 3.89M]
  ------------------
  121|  45.0M|        {
  122|  45.0M|            i4_tmp = (pi2_src[col] + lvl_shift) * wgt0;
  123|  45.0M|            i4_tmp += 1 << (shift - 1);
  124|  45.0M|            i4_tmp = (i4_tmp >> shift) + off0;
  125|       |
  126|  45.0M|            pu1_dst[col] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  45.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  45.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.98M, False: 43.0M]
  |  |  |  |  |  Branch (40:53): [True: 3.57M, False: 39.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|  45.0M|        }
  128|       |
  129|  3.89M|        pi2_src += src_strd;
  130|  3.89M|        pu1_dst += dst_strd;
  131|  3.89M|    }
  132|   461k|}
ihevc_weighted_pred_chroma_uni:
  199|   464k|{
  200|   464k|    WORD32 row, col;
  201|   464k|    WORD32 i4_tmp;
  202|       |
  203|  2.43M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (203:18): [True: 1.97M, False: 464k]
  ------------------
  204|  1.97M|    {
  205|  13.4M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (205:22): [True: 11.4M, False: 1.97M]
  ------------------
  206|  11.4M|        {
  207|  11.4M|            i4_tmp = (pi2_src[col] + lvl_shift) * wgt0_cb;
  208|  11.4M|            i4_tmp += 1 << (shift - 1);
  209|  11.4M|            i4_tmp = (i4_tmp >> shift) + off0_cb;
  210|       |
  211|  11.4M|            pu1_dst[col] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  11.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 47.9k, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 690k, False: 10.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|  11.4M|            i4_tmp = (pi2_src[col + 1] + lvl_shift) * wgt0_cr;
  214|  11.4M|            i4_tmp += 1 << (shift - 1);
  215|  11.4M|            i4_tmp = (i4_tmp >> shift) + off0_cr;
  216|       |
  217|  11.4M|            pu1_dst[col + 1] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  11.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 258k, False: 11.2M]
  |  |  |  |  |  Branch (40:53): [True: 717k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  11.4M|        }
  219|       |
  220|  1.97M|        pi2_src += src_strd;
  221|  1.97M|        pu1_dst += dst_strd;
  222|  1.97M|    }
  223|   464k|}
ihevc_weighted_pred_bi:
  305|  15.7M|{
  306|  15.7M|    WORD32 row, col;
  307|  15.7M|    WORD32 i4_tmp;
  308|       |
  309|   136M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (309:18): [True: 120M, False: 15.7M]
  ------------------
  310|   120M|    {
  311|  1.12G|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (311:22): [True: 1.00G, False: 120M]
  ------------------
  312|  1.00G|        {
  313|  1.00G|            i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0;
  314|  1.00G|            i4_tmp += (pi2_src2[col] + lvl_shift2) * wgt1;
  315|  1.00G|            i4_tmp += (off0 + off1 + 1) << (shift - 1);
  316|       |
  317|  1.00G|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|  1.00G|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.00G|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 38.3M, False: 969M]
  |  |  |  |  |  Branch (40:53): [True: 50.2M, False: 918M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  1.00G|        }
  319|       |
  320|   120M|        pi2_src1 += src_strd1;
  321|   120M|        pi2_src2 += src_strd2;
  322|   120M|        pu1_dst += dst_strd;
  323|   120M|    }
  324|  15.7M|}
ihevc_weighted_pred_chroma_bi:
  410|  15.8M|{
  411|  15.8M|    WORD32 row, col;
  412|  15.8M|    WORD32 i4_tmp;
  413|       |
  414|  79.0M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (414:18): [True: 63.2M, False: 15.8M]
  ------------------
  415|  63.2M|    {
  416|   328M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (416:22): [True: 264M, False: 63.2M]
  ------------------
  417|   264M|        {
  418|   264M|            i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0_cb;
  419|   264M|            i4_tmp += (pi2_src2[col] + lvl_shift2) * wgt1_cb;
  420|   264M|            i4_tmp += (off0_cb + off1_cb + 1) << (shift - 1);
  421|       |
  422|   264M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|   264M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   264M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.07M, False: 263M]
  |  |  |  |  |  Branch (40:53): [True: 2.32M, False: 261M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  423|       |
  424|   264M|            i4_tmp = (pi2_src1[col + 1] + lvl_shift1) * wgt0_cr;
  425|   264M|            i4_tmp += (pi2_src2[col + 1] + lvl_shift2) * wgt1_cr;
  426|   264M|            i4_tmp += (off0_cr + off1_cr + 1) << (shift - 1);
  427|       |
  428|   264M|            pu1_dst[col + 1] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|   264M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   264M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.28M, False: 260M]
  |  |  |  |  |  Branch (40:53): [True: 3.58M, False: 256M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  429|   264M|        }
  430|       |
  431|  63.2M|        pi2_src1 += src_strd1;
  432|  63.2M|        pi2_src2 += src_strd2;
  433|  63.2M|        pu1_dst += dst_strd;
  434|  63.2M|    }
  435|  15.8M|}
ihevc_weighted_pred_bi_default:
  497|  13.9M|{
  498|  13.9M|    WORD32 row, col;
  499|  13.9M|    WORD32 i4_tmp;
  500|  13.9M|    WORD32 shift;
  501|       |
  502|  13.9M|    shift = SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|  13.9M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.9M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  503|  95.4M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (503:18): [True: 81.5M, False: 13.9M]
  ------------------
  504|  81.5M|    {
  505|   762M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (505:22): [True: 681M, False: 81.5M]
  ------------------
  506|   681M|        {
  507|   681M|            i4_tmp = pi2_src1[col] + lvl_shift1;
  508|   681M|            i4_tmp += pi2_src2[col] + lvl_shift2;
  509|   681M|            i4_tmp += 1 << (shift - 1);
  510|       |
  511|   681M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|   681M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   681M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 413k, False: 680M]
  |  |  |  |  |  Branch (40:53): [True: 507k, False: 680M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|   681M|        }
  513|       |
  514|  81.5M|        pi2_src1 += src_strd1;
  515|  81.5M|        pi2_src2 += src_strd2;
  516|  81.5M|        pu1_dst += dst_strd;
  517|  81.5M|    }
  518|  13.9M|}

ithread_get_handle_size:
   55|   220k|{
   56|   220k|    return sizeof(pthread_t);
   57|   220k|}
ithread_get_mutex_lock_size:
   60|   294k|{
   61|   294k|    return sizeof(pthread_mutex_t);
   62|   294k|}
ithread_create:
   65|  26.3k|{
   66|  26.3k|    return pthread_create((pthread_t *)thread_handle, attribute, (void * (*)(void *))strt, argument);
   67|  26.3k|}
ithread_join:
   70|  26.3k|{
   71|  26.3k|    pthread_t *pthread_handle   = (pthread_t *)thread_handle;
   72|  26.3k|    return pthread_join(*pthread_handle, val_ptr);
   73|  26.3k|}
ithread_mutex_init:
   85|   415k|{
   86|       |    return pthread_mutex_init((pthread_mutex_t *)mutex, NULL);
   87|   415k|}
ithread_mutex_destroy:
   90|   415k|{
   91|   415k|    return pthread_mutex_destroy((pthread_mutex_t *)mutex);
   92|   415k|}
ithread_mutex_lock:
   95|  5.80M|{
   96|  5.80M|    return pthread_mutex_lock((pthread_mutex_t *)mutex);
   97|  5.80M|}
ithread_mutex_unlock:
  100|  5.85M|{
  101|  5.85M|    return pthread_mutex_unlock((pthread_mutex_t *)mutex);
  102|  5.85M|}
ithread_yield:
  105|  25.3M|{
  106|  25.3M|    sched_yield();
  107|  25.3M|}
ithread_set_affinity:
  150|   215k|{
  151|       |
  152|       |#ifdef PTHREAD_AFFINITY
  153|       |    cpu_set_t cpuset;
  154|       |    int num_cores = sysconf(_SC_NPROCESSORS_ONLN);
  155|       |    pthread_t cur_thread = pthread_self();
  156|       |
  157|       |    if(core_id >= num_cores)
  158|       |        return -1;
  159|       |
  160|       |    CPU_ZERO(&cpuset);
  161|       |    CPU_SET(core_id, &cpuset);
  162|       |
  163|       |    return pthread_setaffinity_np(cur_thread, sizeof(cpu_set_t), &cpuset);
  164|       |
  165|       |#elif SYSCALL_AFFINITY
  166|       |    WORD32 i4_sys_res;
  167|       |
  168|       |    pid_t pid = gettid();
  169|       |
  170|       |
  171|       |    i4_sys_res = syscall(__NR_sched_setaffinity, pid, sizeof(i4_mask), &i4_mask);
  172|       |    if(i4_sys_res)
  173|       |    {
  174|       |        //WORD32 err;
  175|       |        //err = errno;
  176|       |        //perror("Error in setaffinity syscall PERROR : ");
  177|       |        //LOG_ERROR("Error in the syscall setaffinity: mask=0x%x err=0x%x", i4_mask, i4_sys_res);
  178|       |        return -1;
  179|       |    }
  180|       |#endif
  181|       |
  182|   215k|    return core_id;
  183|   215k|}
ithread_get_cond_struct_size:
  186|   220k|{
  187|   220k|    return (sizeof(pthread_cond_t));
  188|   220k|}
ithread_cond_init:
  191|   391k|{
  192|       |    return pthread_cond_init((pthread_cond_t *)cond, NULL);
  193|   391k|}
ithread_cond_destroy:
  196|   391k|{
  197|   391k|    return pthread_cond_destroy((pthread_cond_t *)cond);
  198|   391k|}
ithread_cond_wait:
  201|   119k|{
  202|   119k|    return pthread_cond_wait((pthread_cond_t *)cond, (pthread_mutex_t *)mutex);
  203|   119k|}
ithread_cond_signal:
  206|   204k|{
  207|   204k|    return pthread_cond_signal((pthread_cond_t *)cond);
  208|   204k|}

ihevc_itrans_recon_32x32_sse42:
  115|  46.3k|{
  116|       |    /* Inverse Transform */
  117|       |
  118|  46.3k|    WORD32 j;
  119|       |
  120|       |
  121|  46.3k|    WORD16 *pi2_tmp_orig;
  122|       |
  123|       |
  124|  46.3k|    WORD16 *o_temp_ptr;
  125|  46.3k|    WORD16 *temp_ptr;
  126|       |
  127|  46.3k|    __m128i m_temp_reg_0;
  128|  46.3k|    __m128i m_temp_reg_1;
  129|  46.3k|    __m128i m_temp_reg_2;
  130|  46.3k|    __m128i m_temp_reg_3;
  131|  46.3k|    __m128i m_temp_reg_4;
  132|  46.3k|    __m128i m_temp_reg_5;
  133|  46.3k|    __m128i m_temp_reg_6;
  134|  46.3k|    __m128i m_temp_reg_7;
  135|  46.3k|    __m128i m_temp_reg_10;
  136|  46.3k|    __m128i m_temp_reg_11;
  137|  46.3k|    __m128i m_temp_reg_12;
  138|  46.3k|    __m128i m_temp_reg_13;
  139|  46.3k|    __m128i m_temp_reg_14;
  140|  46.3k|    __m128i m_temp_reg_15;
  141|  46.3k|    __m128i m_temp_reg_16;
  142|  46.3k|    __m128i m_temp_reg_17;
  143|  46.3k|    __m128i m_temp_reg_18;
  144|  46.3k|    __m128i m_temp_reg_19;
  145|  46.3k|    __m128i m_temp_reg_20;
  146|  46.3k|    __m128i m_temp_reg_21;
  147|  46.3k|    __m128i m_temp_reg_22;
  148|  46.3k|    __m128i m_temp_reg_23;
  149|  46.3k|    __m128i m_temp_reg_30;
  150|  46.3k|    __m128i m_temp_reg_31;
  151|  46.3k|    __m128i m_temp_reg_32;
  152|  46.3k|    __m128i m_temp_reg_33;
  153|  46.3k|    __m128i m_temp_reg_34;
  154|  46.3k|    __m128i m_temp_reg_35;
  155|  46.3k|    __m128i m_temp_reg_36;
  156|  46.3k|    __m128i m_temp_reg_37;
  157|  46.3k|    __m128i m_temp_reg_40;
  158|  46.3k|    __m128i m_temp_reg_41;
  159|  46.3k|    __m128i m_temp_reg_42;
  160|  46.3k|    __m128i m_temp_reg_43;
  161|  46.3k|    __m128i m_temp_reg_44;
  162|  46.3k|    __m128i m_temp_reg_45;
  163|  46.3k|    __m128i m_temp_reg_46;
  164|  46.3k|    __m128i m_temp_reg_47;
  165|       |
  166|  46.3k|    __m128i m_temp_reg_70;
  167|  46.3k|    __m128i m_temp_reg_71;
  168|  46.3k|    __m128i m_temp_reg_72;
  169|  46.3k|    __m128i m_temp_reg_73;
  170|  46.3k|    __m128i m_temp_reg_74;
  171|  46.3k|    __m128i m_temp_reg_75;
  172|  46.3k|    __m128i m_temp_reg_76;
  173|  46.3k|    __m128i m_temp_reg_77;
  174|       |
  175|  46.3k|    __m128i m_temp_reg_80;
  176|  46.3k|    __m128i m_temp_reg_81;
  177|  46.3k|    __m128i m_temp_reg_82;
  178|  46.3k|    __m128i m_temp_reg_83;
  179|  46.3k|    __m128i m_temp_reg_84;
  180|  46.3k|    __m128i m_temp_reg_85;
  181|  46.3k|    __m128i m_temp_reg_86;
  182|  46.3k|    __m128i m_temp_reg_87;
  183|       |
  184|  46.3k|    __m128i m_temp_reg_90;
  185|  46.3k|    __m128i m_temp_reg_91;
  186|  46.3k|    __m128i m_temp_reg_92;
  187|  46.3k|    __m128i m_temp_reg_93;
  188|  46.3k|    __m128i m_temp_reg_94;
  189|  46.3k|    __m128i m_temp_reg_95;
  190|  46.3k|    __m128i m_temp_reg_96;
  191|  46.3k|    __m128i m_temp_reg_97;
  192|       |
  193|  46.3k|    __m128i m_rdng_factor;
  194|  46.3k|    __m128i m_count;
  195|  46.3k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
  196|  46.3k|    __m128i m_coeff5, m_coeff6, m_coeff7, m_coeff8;
  197|       |
  198|  46.3k|    __m128i temp1, temp2, temp3, temp4;
  199|  46.3k|    __m128i temp5, temp6, temp7, temp8;
  200|       |
  201|  46.3k|    __m128i all_zero_reg;
  202|  46.3k|    WORD32 i;
  203|       |
  204|       |    /*Lokesh*/
  205|  46.3k|    WORD32  zero_last24_cols_stg1;
  206|  46.3k|    WORD32  zero_last24_rows_stg1;
  207|  46.3k|    WORD32  zero_last28_rows_stg1;
  208|       |
  209|  46.3k|    WORD32  zero_last28_rows_stg2;
  210|  46.3k|    WORD32  zero_last24_rows_stg2;
  211|       |
  212|  46.3k|    WORD32  trans_size_stg1;
  213|       |
  214|  46.3k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  46.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
  215|  46.3k|    WORD32 trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|  46.3k|#define TRANS_SIZE_32 32
  ------------------
  216|       |
  217|       |
  218|       |    /* Last 8 cols of 16x16 block are skipped based on the below flag : Lokesh */
  219|  46.3k|    zero_last24_cols_stg1 = ((zero_cols & 0xFFFFFF00) == 0xFFFFFF00) ? 1 : 0;
  ------------------
  |  Branch (219:29): [True: 37.2k, False: 9.11k]
  ------------------
  220|  46.3k|    zero_last24_rows_stg1 = ((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) ? 1 : 0;
  ------------------
  |  Branch (220:29): [True: 38.7k, False: 7.64k]
  ------------------
  221|  46.3k|    zero_last28_rows_stg1 = ((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0) ? 1 : 0;
  ------------------
  |  Branch (221:29): [True: 28.1k, False: 18.2k]
  ------------------
  222|       |
  223|  46.3k|    zero_last28_rows_stg2 = ((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0) ? 1 : 0;
  ------------------
  |  Branch (223:29): [True: 21.0k, False: 25.3k]
  ------------------
  224|  46.3k|    zero_last24_rows_stg2 = zero_last24_cols_stg1;
  225|       |
  226|  46.3k|    if((zero_last28_rows_stg2) || (zero_last24_cols_stg1))
  ------------------
  |  Branch (226:8): [True: 20.9k, False: 25.3k]
  |  Branch (226:35): [True: 16.2k, False: 9.13k]
  ------------------
  227|  37.2k|    {
  228|  37.2k|        trans_size_stg1 = 8;
  229|       |
  230|  37.2k|    }
  231|  9.09k|    else
  232|  9.09k|    {
  233|  9.09k|        trans_size_stg1 = 32;
  234|  9.09k|    }
  235|       |
  236|  46.3k|    all_zero_reg = _mm_setzero_si128();
  237|       |
  238|  46.3k|    o_temp_ptr  = pi2_tmp;
  239|  46.3k|    temp_ptr = (pi2_tmp + 1024);
  240|       |
  241|  46.3k|    pi2_tmp += 2048;
  242|  46.3k|    pi2_tmp_orig = pi2_tmp;
  243|       |
  244|   120k|    for(i = 0; i < trans_size_stg1; i += 8)
  ------------------
  |  Branch (244:16): [True: 73.7k, False: 46.3k]
  ------------------
  245|  73.7k|    {
  246|       |
  247|  73.7k|        {
  248|  73.7k|            WORD16 *pi2_tmp_src = pi2_src;
  249|       |
  250|  73.7k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  251|  73.7k|            pi2_tmp_src += (src_strd << 1);
  252|  73.7k|            m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  253|  73.7k|            pi2_tmp_src += (src_strd << 1);
  254|  73.7k|            m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  255|  73.7k|            pi2_tmp_src += (src_strd << 1);
  256|  73.7k|            m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  257|  73.7k|            pi2_tmp_src += (src_strd << 1);
  258|  73.7k|            m_temp_reg_74 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  259|  73.7k|            pi2_tmp_src += (src_strd << 1);
  260|  73.7k|            m_temp_reg_75 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  261|  73.7k|            pi2_tmp_src += (src_strd << 1);
  262|  73.7k|            m_temp_reg_76 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  263|  73.7k|            pi2_tmp_src += (src_strd << 1);
  264|  73.7k|            m_temp_reg_77 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  265|  73.7k|            pi2_tmp_src += (src_strd << 1);
  266|       |
  267|  73.7k|            m_temp_reg_80 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  268|  73.7k|            pi2_tmp_src += (src_strd << 1);
  269|  73.7k|            m_temp_reg_81 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  270|  73.7k|            pi2_tmp_src += (src_strd << 1);
  271|  73.7k|            m_temp_reg_82 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  272|  73.7k|            pi2_tmp_src += (src_strd << 1);
  273|  73.7k|            m_temp_reg_83 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  274|  73.7k|            pi2_tmp_src += (src_strd << 1);
  275|  73.7k|            m_temp_reg_84 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  276|  73.7k|            pi2_tmp_src += (src_strd << 1);
  277|  73.7k|            m_temp_reg_85 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  278|  73.7k|            pi2_tmp_src += (src_strd << 1);
  279|  73.7k|            m_temp_reg_86 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  280|  73.7k|            pi2_tmp_src += (src_strd << 1);
  281|  73.7k|            m_temp_reg_87 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
  282|  73.7k|        }
  283|       |
  284|  73.7k|        if(zero_last28_rows_stg1)
  ------------------
  |  Branch (284:12): [True: 44.9k, False: 28.7k]
  ------------------
  285|  44.9k|        {
  286|       |            /* eeo */
  287|       |            /* eeeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
  288|       |            /* eeeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
  289|  44.9k|            {
  290|  44.9k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64
  291|       |
  292|  44.9k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  293|       |
  294|  44.9k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  295|       |
  296|       |/* eeeo[0]= m_temp_reg_20  */
  297|       |/* eeeo[1]= m_temp_reg_21  */
  298|       |/* eeee[0]= m_temp_reg_22  */
  299|       |/* eeee[1]= m_temp_reg_23  */
  300|       |
  301|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  302|  44.9k|                m_temp_reg_40 = m_temp_reg_14;
  303|       |
  304|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  305|  44.9k|                m_temp_reg_43 = m_temp_reg_14;
  306|       |
  307|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  308|  44.9k|                m_temp_reg_42 = m_temp_reg_14; //m_temp_reg_16;
  309|       |
  310|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  311|  44.9k|                m_temp_reg_41 = m_temp_reg_14; //m_temp_reg_16;
  312|       |
  313|  44.9k|                m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
  314|       |
  315|  44.9k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  316|       |
  317|  44.9k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  318|       |
  319|       |/* eeeo[0]= m_temp_reg_20  */
  320|       |/* eeeo[1]= m_temp_reg_21  */
  321|       |/* eeee[0]= m_temp_reg_22  */
  322|       |/* eeee[1]= m_temp_reg_23  */
  323|       |
  324|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  325|  44.9k|                m_temp_reg_44 = m_temp_reg_14;
  326|       |
  327|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  328|  44.9k|                m_temp_reg_47 = m_temp_reg_14;
  329|       |
  330|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  331|  44.9k|                m_temp_reg_46 = m_temp_reg_14; //m_temp_reg_16;
  332|       |
  333|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  334|  44.9k|                m_temp_reg_45 = m_temp_reg_14; //m_temp_reg_16;
  335|       |
  336|       |
  337|  44.9k|            }
  338|       |            /* eo */
  339|  44.9k|            {
  340|  44.9k|                WORD16 *pi2_scratch = o_temp_ptr;
  341|       |
  342|  44.9k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90
  343|  44.9k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87
  344|  44.9k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80
  345|  44.9k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70
  346|  44.9k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57
  347|  44.9k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43
  348|  44.9k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25
  349|  44.9k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //9
  350|       |
  351|  44.9k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, all_zero_reg);
  352|       |
  353|  44.9k|                m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
  354|       |
  355|       |                /* eo0[0-3] */
  356|  44.9k|                {
  357|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  358|       |
  359|  44.9k|                    m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_71, all_zero_reg);
  360|       |
  361|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  362|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  363|       |
  364|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  365|  44.9k|                    pi2_scratch += 8;
  366|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  367|  44.9k|                    pi2_scratch += 8;
  368|       |
  369|  44.9k|                }
  370|       |
  371|       |                /* eo0[4-7] */
  372|  44.9k|                {
  373|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  374|       |
  375|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  376|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  377|       |
  378|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  379|  44.9k|                    pi2_scratch += 8;
  380|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  381|  44.9k|                    pi2_scratch += 8;
  382|       |
  383|  44.9k|                }
  384|       |                /* eo1[0-3] */
  385|  44.9k|                {
  386|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
  387|       |
  388|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
  389|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
  390|       |
  391|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  392|  44.9k|                    pi2_scratch += 8;
  393|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  394|  44.9k|                    pi2_scratch += 8;
  395|       |
  396|  44.9k|                }
  397|       |
  398|       |                /* eo1[4-7] */
  399|  44.9k|                {
  400|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff2);
  401|       |
  402|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
  403|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
  404|       |
  405|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  406|  44.9k|                    pi2_scratch += 8;
  407|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  408|  44.9k|                    pi2_scratch += 8;
  409|       |
  410|  44.9k|                }
  411|       |
  412|       |                /* eo2[0-3] */
  413|  44.9k|                {
  414|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  415|       |
  416|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  417|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  418|       |
  419|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  420|  44.9k|                    pi2_scratch += 8;
  421|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  422|  44.9k|                    pi2_scratch += 8;
  423|       |
  424|  44.9k|                }
  425|       |
  426|       |                /* eo2[4-7] */
  427|  44.9k|                {
  428|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
  429|       |
  430|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  431|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  432|       |
  433|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  434|  44.9k|                    pi2_scratch += 8;
  435|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  436|  44.9k|                    pi2_scratch += 8;
  437|       |
  438|  44.9k|                }
  439|       |
  440|       |                /**************************************************************************/
  441|       |
  442|       |
  443|       |                /* eo3[0-3] */
  444|  44.9k|                {
  445|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
  446|       |
  447|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
  448|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
  449|       |
  450|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  451|  44.9k|                    pi2_scratch += 8;
  452|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  453|  44.9k|                    pi2_scratch += 8;
  454|       |
  455|  44.9k|                }
  456|       |
  457|       |                /* eo3[4-7] */
  458|  44.9k|                {
  459|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff4);
  460|       |
  461|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
  462|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
  463|       |
  464|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  465|  44.9k|                    pi2_scratch += 8;
  466|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  467|  44.9k|                    pi2_scratch += 8;
  468|       |
  469|  44.9k|                }
  470|       |
  471|       |
  472|       |                /* eo4[0-3] */
  473|  44.9k|                {
  474|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
  475|       |
  476|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
  477|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
  478|       |
  479|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  480|  44.9k|                    pi2_scratch += 8;
  481|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  482|  44.9k|                    pi2_scratch += 8;
  483|       |
  484|  44.9k|                }
  485|       |                /* eo4[4-7] */
  486|  44.9k|                {
  487|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
  488|       |
  489|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
  490|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
  491|       |
  492|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  493|  44.9k|                    pi2_scratch += 8;
  494|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  495|  44.9k|                    pi2_scratch += 8;
  496|       |
  497|  44.9k|                }
  498|       |
  499|       |                /***********************************************************************/
  500|       |
  501|       |                /* eo5[0-3] */
  502|  44.9k|                {
  503|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff6);
  504|       |
  505|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  506|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  507|       |
  508|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  509|  44.9k|                    pi2_scratch += 8;
  510|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  511|  44.9k|                    pi2_scratch += 8;
  512|       |
  513|  44.9k|                }
  514|       |
  515|       |
  516|       |                /* eo5[4-7] */
  517|  44.9k|                {
  518|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff6);
  519|       |
  520|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  521|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  522|       |
  523|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  524|  44.9k|                    pi2_scratch += 8;
  525|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  526|  44.9k|                    pi2_scratch += 8;
  527|       |
  528|  44.9k|                }
  529|       |
  530|       |                /* eo6[0-3] */
  531|  44.9k|                {
  532|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff7);
  533|       |
  534|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
  535|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
  536|       |
  537|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  538|  44.9k|                    pi2_scratch += 8;
  539|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  540|  44.9k|                    pi2_scratch += 8;
  541|       |
  542|  44.9k|                }
  543|       |
  544|       |
  545|       |                /* eo6[4-7] */
  546|  44.9k|                {
  547|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff7);
  548|       |
  549|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
  550|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
  551|       |
  552|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  553|  44.9k|                    pi2_scratch += 8;
  554|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  555|  44.9k|                    pi2_scratch += 8;
  556|       |
  557|  44.9k|                }
  558|       |
  559|       |
  560|       |                /* eo7[0-3] */
  561|  44.9k|                {
  562|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff8);
  563|       |
  564|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  565|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  566|       |
  567|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  568|  44.9k|                    pi2_scratch += 8;
  569|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  570|  44.9k|                    pi2_scratch += 8;
  571|       |
  572|  44.9k|                }
  573|       |
  574|       |
  575|       |                /* eo7[4-7] */
  576|  44.9k|                {
  577|  44.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff8);
  578|       |
  579|  44.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  580|  44.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  581|       |
  582|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  583|  44.9k|                    pi2_scratch += 8;
  584|  44.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  585|  44.9k|                    pi2_scratch += 8;
  586|       |
  587|  44.9k|                }
  588|       |
  589|  44.9k|            }
  590|  44.9k|        }
  591|  28.7k|        else if(zero_last24_rows_stg1)
  ------------------
  |  Branch (591:17): [True: 13.4k, False: 15.2k]
  ------------------
  592|  13.4k|        {
  593|  13.4k|            {
  594|       |                /* eeo */
  595|       |                /* eeeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
  596|       |                /* eeeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
  597|       |
  598|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83 36
  599|  13.4k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36 -83
  600|       |
  601|  13.4k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64 64
  602|       |
  603|  13.4k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  604|       |
  605|  13.4k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  606|       |
  607|       |                /* eeeo[0]= m_temp_reg_20  */
  608|       |                /* eeeo[1]= m_temp_reg_21  */
  609|       |                /* eeee[0]= m_temp_reg_22  */
  610|       |                /* eeee[1]= m_temp_reg_23  */
  611|       |
  612|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  613|  13.4k|                m_temp_reg_40 = m_temp_reg_14;
  614|       |
  615|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  616|  13.4k|                m_temp_reg_43 = m_temp_reg_14;
  617|       |
  618|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  619|  13.4k|                m_temp_reg_42 = m_temp_reg_14; //m_temp_reg_16;
  620|       |
  621|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  622|  13.4k|                m_temp_reg_41 = m_temp_reg_14; //m_temp_reg_16;
  623|       |
  624|       |                /* for row 4 to 7 */
  625|       |
  626|  13.4k|                m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
  627|       |
  628|  13.4k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  629|       |
  630|  13.4k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  631|       |
  632|       |                /* eeeo[0]= m_temp_reg_20  */
  633|       |                /* eeeo[1]= m_temp_reg_21  */
  634|       |                /* eeee[0]= m_temp_reg_22  */
  635|       |                /* eeee[1]= m_temp_reg_23  */
  636|       |
  637|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  638|  13.4k|                m_temp_reg_44 = m_temp_reg_14;
  639|       |
  640|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  641|  13.4k|                m_temp_reg_47 = m_temp_reg_14;
  642|       |
  643|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  644|  13.4k|                m_temp_reg_46 = m_temp_reg_14; //m_temp_reg_16;
  645|       |
  646|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  647|  13.4k|                m_temp_reg_45 = m_temp_reg_14; //m_temp_reg_16;
  648|       |
  649|       |
  650|       |                // eeo[]
  651|       |                /* for(k = 0; k < 4; k++) */
  652|       |
  653|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
  654|  13.4k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75
  655|  13.4k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18
  656|  13.4k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[5][0]); //50 18
  657|       |
  658|  13.4k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, all_zero_reg);
  659|       |
  660|  13.4k|                m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
  661|       |
  662|  13.4k|                m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_72, all_zero_reg);
  663|       |
  664|  13.4k|                m_temp_reg_33 = _mm_setzero_si128();
  665|       |
  666|       |                /* eeo */
  667|  13.4k|                {
  668|       |                    /* eeo0[0-3] */
  669|  13.4k|                    {
  670|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  671|       |
  672|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  673|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  674|       |
  675|  13.4k|                        m_temp_reg_90 = m_temp_reg_34;
  676|  13.4k|                        m_temp_reg_97 = m_temp_reg_35;
  677|  13.4k|                    }
  678|       |                    /* eeo0[4-7] */
  679|  13.4k|                    {
  680|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  681|       |
  682|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  683|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  684|       |
  685|  13.4k|                        m_temp_reg_91 = m_temp_reg_34;
  686|  13.4k|                        m_temp_reg_96 = m_temp_reg_35;
  687|       |
  688|  13.4k|                    }
  689|       |
  690|       |                    /* eeo1[0-3] */
  691|  13.4k|                    {
  692|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
  693|       |
  694|       |                        /* e[1][0-3] stored in pi2_tmp[2][0-7] */
  695|       |                        /* e[6][0-3] stored in pi2_tmp[2][8-15] */
  696|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
  697|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
  698|       |
  699|  13.4k|                        m_temp_reg_92 = m_temp_reg_34;
  700|  13.4k|                        m_temp_reg_95 = m_temp_reg_35;
  701|       |
  702|  13.4k|                    }
  703|       |
  704|       |                    /* eo1[4-7] */
  705|  13.4k|                    {
  706|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff2);
  707|       |
  708|       |                        /* e[1][4-7] stored in pi2_tmp[3][0-7] */
  709|       |                        /* e[6][4-7] stored in pi2_tmp[3][8-15] */
  710|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
  711|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
  712|       |
  713|  13.4k|                        m_temp_reg_93 = m_temp_reg_34;
  714|  13.4k|                        m_temp_reg_94 = m_temp_reg_35;
  715|       |
  716|       |
  717|  13.4k|                    }
  718|       |
  719|       |                    /* eo2[0-3] */
  720|  13.4k|                    {
  721|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
  722|       |
  723|       |                        /* e[2][0-3] stored in pi2_tmp[4][0-7] */
  724|       |                        /* e[5][0-3] stored in pi2_tmp[4][8-15] */
  725|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  726|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  727|       |
  728|  13.4k|                        temp1 = m_temp_reg_34;
  729|  13.4k|                        temp7 = m_temp_reg_35;
  730|       |
  731|  13.4k|                    }
  732|       |
  733|       |                    /* eo2[4-7] */
  734|  13.4k|                    {
  735|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff4);
  736|       |
  737|       |                        /* e[2][4-7] stored in pi2_tmp[5][0-7] */
  738|       |                        /* e[5][4-7] stored in pi2_tmp[5][8-15] */
  739|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  740|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  741|       |
  742|  13.4k|                        temp2 = m_temp_reg_34;
  743|  13.4k|                        temp6 = m_temp_reg_35;
  744|       |
  745|  13.4k|                    }
  746|       |
  747|       |                    /* eo3[0-3] */
  748|  13.4k|                    {
  749|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  750|       |
  751|       |                        /* e[3][0-3] stored in pi2_tmp[6][0-7] */
  752|       |                        /* e[4][0-3] stored in pi2_tmp[6][8-15] */
  753|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
  754|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
  755|       |
  756|  13.4k|                        temp3 = m_temp_reg_34;
  757|  13.4k|                        temp5 = m_temp_reg_35;
  758|       |
  759|  13.4k|                    }
  760|       |
  761|       |
  762|       |                    /* eo3[4-7] */
  763|  13.4k|                    {
  764|  13.4k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
  765|       |
  766|       |                        /* e[3][4-7] stored in pi2_tmp[7][0-7] */
  767|       |                        /* e[4][4-7] stored in pi2_tmp[7][8-15] */
  768|  13.4k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
  769|  13.4k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
  770|       |
  771|  13.4k|                        temp4 = m_temp_reg_34;
  772|  13.4k|                        temp8 = m_temp_reg_35;
  773|       |
  774|       |
  775|  13.4k|                    }
  776|       |                    /* All values of ee[] array in pi2_temp */
  777|       |
  778|  13.4k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
  779|  13.4k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[1][0]); //80 70
  780|  13.4k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57 43
  781|  13.4k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25 9
  782|       |
  783|  13.4k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  784|       |
  785|  13.4k|                    m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
  786|  13.4k|                    m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
  787|       |
  788|  13.4k|                }
  789|  13.4k|            }
  790|       |            /* eo */
  791|  13.4k|            {
  792|       |
  793|  13.4k|                WORD16 *pi2_scratch = o_temp_ptr;
  794|       |
  795|       |                /* eo0[0-3] */
  796|  13.4k|                {
  797|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  798|       |
  799|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_30);
  800|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_30);
  801|       |
  802|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  803|  13.4k|                    pi2_scratch += 8;
  804|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  805|  13.4k|                    pi2_scratch += 8;
  806|       |
  807|  13.4k|                }
  808|       |
  809|       |
  810|       |                /* eo0[4-7] */
  811|  13.4k|                {
  812|  13.4k|                    m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  813|       |
  814|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  815|       |
  816|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_30);
  817|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_30);
  818|       |
  819|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  820|  13.4k|                    pi2_scratch += 8;
  821|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  822|  13.4k|                    pi2_scratch += 8;
  823|       |
  824|  13.4k|                }
  825|       |
  826|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
  827|       |
  828|       |                /* eo1[0-3] */
  829|  13.4k|                {
  830|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  831|       |
  832|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_30);
  833|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_30);
  834|       |
  835|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  836|  13.4k|                    pi2_scratch += 8;
  837|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  838|  13.4k|                    pi2_scratch += 8;
  839|       |
  840|  13.4k|                }
  841|       |
  842|       |
  843|       |                /* eo1[4-7] */
  844|  13.4k|                {
  845|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  846|       |
  847|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_30);
  848|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_30);
  849|       |
  850|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  851|  13.4k|                    pi2_scratch += 8;
  852|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  853|  13.4k|                    pi2_scratch += 8;
  854|       |
  855|  13.4k|                }
  856|       |
  857|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
  858|       |
  859|       |                /* eo2[0-3] */
  860|  13.4k|                {
  861|       |
  862|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  863|       |
  864|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp1, m_temp_reg_30);
  865|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp1, m_temp_reg_30);
  866|       |
  867|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  868|  13.4k|                    pi2_scratch += 8;
  869|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  870|  13.4k|                    pi2_scratch += 8;
  871|       |
  872|  13.4k|                }
  873|       |
  874|       |                /* eo2[4-7] */
  875|  13.4k|                {
  876|       |
  877|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  878|       |
  879|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp2, m_temp_reg_30);
  880|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp2, m_temp_reg_30);
  881|       |
  882|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  883|  13.4k|                    pi2_scratch += 8;
  884|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  885|  13.4k|                    pi2_scratch += 8;
  886|       |
  887|  13.4k|                }
  888|       |
  889|       |                /**************************************************************************/
  890|       |
  891|       |
  892|       |
  893|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
  894|       |
  895|       |                /* eo3[0-3] */
  896|  13.4k|                {
  897|       |
  898|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  899|       |
  900|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp3, m_temp_reg_30);
  901|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp3, m_temp_reg_30);
  902|       |
  903|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  904|  13.4k|                    pi2_scratch += 8;
  905|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  906|  13.4k|                    pi2_scratch += 8;
  907|       |
  908|  13.4k|                }
  909|       |
  910|       |
  911|       |                /* eo3[4-7] */
  912|  13.4k|                {
  913|       |
  914|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  915|       |
  916|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp4, m_temp_reg_30);
  917|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp4, m_temp_reg_30);
  918|       |
  919|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  920|  13.4k|                    pi2_scratch += 8;
  921|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  922|  13.4k|                    pi2_scratch += 8;
  923|       |
  924|  13.4k|                }
  925|       |
  926|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
  927|       |
  928|       |                /* eo4[0-3] */
  929|  13.4k|                {
  930|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  931|       |
  932|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp5, m_temp_reg_30);
  933|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp5, m_temp_reg_30);
  934|       |
  935|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  936|  13.4k|                    pi2_scratch += 8;
  937|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  938|  13.4k|                    pi2_scratch += 8;
  939|       |
  940|  13.4k|                }
  941|       |                /* eo4[4-7] */
  942|  13.4k|                {
  943|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  944|       |
  945|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp8, m_temp_reg_30);
  946|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp8, m_temp_reg_30);
  947|       |
  948|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  949|  13.4k|                    pi2_scratch += 8;
  950|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  951|  13.4k|                    pi2_scratch += 8;
  952|       |
  953|  13.4k|                }
  954|       |
  955|       |                /***********************************************************************/
  956|       |
  957|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
  958|       |
  959|       |                /* eo5[0-3] */
  960|  13.4k|                {
  961|       |
  962|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  963|       |
  964|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp7, m_temp_reg_30);
  965|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp7, m_temp_reg_30);
  966|       |
  967|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  968|  13.4k|                    pi2_scratch += 8;
  969|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  970|  13.4k|                    pi2_scratch += 8;
  971|       |
  972|  13.4k|                }
  973|       |
  974|       |
  975|       |                /* eo5[4-7] */
  976|  13.4k|                {
  977|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  978|       |
  979|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(temp6, m_temp_reg_30);
  980|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(temp6, m_temp_reg_30);
  981|       |
  982|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  983|  13.4k|                    pi2_scratch += 8;
  984|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  985|  13.4k|                    pi2_scratch += 8;
  986|       |
  987|  13.4k|                }
  988|       |
  989|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
  990|       |
  991|       |                /* eo6[0-3] */
  992|  13.4k|                {
  993|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  994|       |
  995|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_30);
  996|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_30);
  997|       |
  998|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  999|  13.4k|                    pi2_scratch += 8;
 1000|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1001|  13.4k|                    pi2_scratch += 8;
 1002|       |
 1003|  13.4k|                }
 1004|       |
 1005|       |
 1006|       |                /* eo6[4-7] */
 1007|  13.4k|                {
 1008|       |
 1009|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1010|       |
 1011|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_30);
 1012|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_30);
 1013|       |
 1014|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1015|  13.4k|                    pi2_scratch += 8;
 1016|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1017|  13.4k|                    pi2_scratch += 8;
 1018|       |
 1019|  13.4k|                }
 1020|       |
 1021|  13.4k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 1022|       |
 1023|       |                /* eo7[0-3] */
 1024|  13.4k|                {
 1025|       |
 1026|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1027|       |
 1028|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_30);
 1029|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_30);
 1030|       |
 1031|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1032|  13.4k|                    pi2_scratch += 8;
 1033|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1034|  13.4k|                    pi2_scratch += 8;
 1035|       |
 1036|  13.4k|                }
 1037|       |
 1038|       |
 1039|       |                /* eo7[4-7] */
 1040|  13.4k|                {
 1041|  13.4k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1042|       |
 1043|  13.4k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_30);
 1044|  13.4k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_30);
 1045|       |
 1046|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1047|  13.4k|                    pi2_scratch += 8;
 1048|  13.4k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1049|  13.4k|                    pi2_scratch += 8;
 1050|       |
 1051|  13.4k|                }
 1052|       |
 1053|  13.4k|            }
 1054|       |
 1055|  13.4k|        }
 1056|  15.2k|        else
 1057|  15.2k|        {
 1058|       |
 1059|  15.2k|            {
 1060|       |                /* eeo */
 1061|       |                /* eeeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
 1062|       |                /* eeeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
 1063|       |
 1064|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83 36
 1065|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36 -83
 1066|       |
 1067|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64 64
 1068|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[3][0]); //64 -64
 1069|       |
 1070|  15.2k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_84);
 1071|       |
 1072|  15.2k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_80);
 1073|       |
 1074|  15.2k|                m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);  /* eeeo[0] */
 1075|  15.2k|                m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);  /* eeeo[1] */
 1076|       |
 1077|  15.2k|                m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);  /* eeee[0] */
 1078|  15.2k|                m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);  /* eeee[1] */
 1079|       |
 1080|       |
 1081|       |                /* eeeo[0]= m_temp_reg_20  */
 1082|       |                /* eeeo[1]= m_temp_reg_21  */
 1083|       |                /* eeee[0]= m_temp_reg_22  */
 1084|       |                /* eeee[1]= m_temp_reg_23  */
 1085|       |
 1086|       |                /* eee[0] = eeee[0] + eeeo[0]; */
 1087|  15.2k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[0] */
 1088|       |
 1089|       |                /* eee[3] = eeee[0] - eeeo[0]; */
 1090|  15.2k|                m_temp_reg_43 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[1] */
 1091|       |
 1092|       |                /* eee[2] = eeee[1] - eeeo[1]; */
 1093|  15.2k|                m_temp_reg_42 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[1] */
 1094|       |
 1095|       |                /* eee[1] = eeee[1] + eeeo[1];*/
 1096|  15.2k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[0] */
 1097|       |
 1098|       |                /* for row 4 to 7 */
 1099|       |
 1100|  15.2k|                m_temp_reg_74 = _mm_srli_si128(m_temp_reg_74, 8);
 1101|  15.2k|                m_temp_reg_84 = _mm_srli_si128(m_temp_reg_84, 8);
 1102|       |
 1103|       |                /* Interleaving row 8 and row 24*/
 1104|  15.2k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_84);
 1105|       |
 1106|  15.2k|                m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 1107|  15.2k|                m_temp_reg_80 = _mm_srli_si128(m_temp_reg_80, 8);
 1108|       |
 1109|  15.2k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_80);
 1110|       |
 1111|  15.2k|                m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);  /* eeeo[0] */
 1112|  15.2k|                m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);  /* eeeo[1] */
 1113|       |
 1114|  15.2k|                m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);  /* eeee[0] */
 1115|  15.2k|                m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);  /* eeee[1] */
 1116|       |
 1117|       |
 1118|       |                /* eeeo[0]= m_temp_reg_20  */
 1119|       |                /* eeeo[1]= m_temp_reg_21  */
 1120|       |                /* eeee[0]= m_temp_reg_22  */
 1121|       |                /* eeee[1]= m_temp_reg_23  */
 1122|       |
 1123|       |                /* eee[0] = eeee[0] + eeeo[0]; */
 1124|  15.2k|                m_temp_reg_44 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[0] */
 1125|       |
 1126|       |                /* eee[3] = eeee[0] - eeeo[0]; */
 1127|  15.2k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[1] */
 1128|       |
 1129|       |                /* eee[2] = eeee[1] - eeeo[1]; */
 1130|  15.2k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[1] */
 1131|       |
 1132|       |                /* eee[1] = eeee[1] + eeeo[1];*/
 1133|  15.2k|                m_temp_reg_45 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[0] */
 1134|       |
 1135|       |
 1136|       |                // eeo[]
 1137|       |                /* for(k = 0; k < 4; k++) */
 1138|       |
 1139|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
 1140|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[5][0]); //50 18
 1141|       |
 1142|       |                /* eeo */
 1143|  15.2k|                {
 1144|       |                    /* eeo0[0-3] */
 1145|  15.2k|                    {
 1146|  15.2k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1147|  15.2k|                        m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_86);
 1148|       |
 1149|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1150|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1151|       |
 1152|  15.2k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1153|       |
 1154|  15.2k|                        m_temp_reg_90 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1155|  15.2k|                        m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1156|       |
 1157|  15.2k|                    }
 1158|       |
 1159|  15.2k|                    m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
 1160|  15.2k|                    m_temp_reg_76 = _mm_srli_si128(m_temp_reg_76, 8);
 1161|  15.2k|                    m_temp_reg_82 = _mm_srli_si128(m_temp_reg_82, 8);
 1162|  15.2k|                    m_temp_reg_86 = _mm_srli_si128(m_temp_reg_86, 8);
 1163|       |
 1164|       |                    /* eeo0[4-7] */
 1165|  15.2k|                    {
 1166|  15.2k|                        m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1167|  15.2k|                        m_temp_reg_15 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_86);
 1168|       |
 1169|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1170|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1171|       |
 1172|  15.2k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1173|       |
 1174|  15.2k|                        m_temp_reg_91 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
 1175|  15.2k|                        m_temp_reg_96 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
 1176|       |
 1177|  15.2k|                    }
 1178|       |
 1179|       |
 1180|  15.2k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75 -18
 1181|  15.2k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[7][0]); //89  50
 1182|       |
 1183|       |                    /* eeo1[0-3] */
 1184|  15.2k|                    {
 1185|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1186|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 1187|       |
 1188|  15.2k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
 1189|  15.2k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
 1190|       |
 1191|  15.2k|                        m_temp_reg_92 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_31);
 1192|  15.2k|                        m_temp_reg_95 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_31);
 1193|       |
 1194|  15.2k|                    }
 1195|       |
 1196|       |                    /* eeo1[4-7] */
 1197|  15.2k|                    {
 1198|       |
 1199|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1200|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff4);
 1201|       |
 1202|  15.2k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
 1203|  15.2k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
 1204|       |
 1205|  15.2k|                        m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_31);
 1206|  15.2k|                        m_temp_reg_94 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_31);
 1207|       |
 1208|       |
 1209|  15.2k|                    }
 1210|       |
 1211|  15.2k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[8][0]); //50 -89
 1212|  15.2k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18  75
 1213|       |
 1214|       |                    /* eeo2[0-3] */
 1215|  15.2k|                    {
 1216|       |
 1217|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1218|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 1219|       |
 1220|       |                        /* e[2][0-3] stored in pi2_tmp[4][0-7] */
 1221|       |                        /* e[5][0-3] stored in pi2_tmp[4][8-15] */
 1222|       |
 1223|  15.2k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
 1224|  15.2k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
 1225|       |
 1226|  15.2k|                        temp1 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1227|  15.2k|                        temp7 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1228|       |
 1229|  15.2k|                    }
 1230|       |
 1231|       |                    /* eeo2[4-7] */
 1232|  15.2k|                    {
 1233|       |
 1234|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1235|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff4);
 1236|       |
 1237|       |                        /* e[2][4-7] stored in pi2_tmp[5][0-7] */
 1238|       |                        /* e[5][4-7] stored in pi2_tmp[5][8-15] */
 1239|       |
 1240|  15.2k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
 1241|  15.2k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
 1242|       |
 1243|  15.2k|                        temp2 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1244|  15.2k|                        temp6 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1245|       |
 1246|  15.2k|                    }
 1247|       |
 1248|  15.2k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[10][0]); //18 -50
 1249|  15.2k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[11][0]); //75  -89
 1250|       |
 1251|       |                    /* eeo3[0-3] */
 1252|  15.2k|                    {
 1253|       |
 1254|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1255|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 1256|       |
 1257|       |                        /* e[3][0-3] stored in pi2_tmp[6][0-7] */
 1258|       |                        /* e[4][0-3] stored in pi2_tmp[6][8-15] */
 1259|       |
 1260|  15.2k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
 1261|  15.2k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
 1262|       |
 1263|  15.2k|                        temp3 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1264|  15.2k|                        temp5 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1265|       |
 1266|       |
 1267|  15.2k|                    }
 1268|       |
 1269|       |                    /* eeo3[4-7] */
 1270|  15.2k|                    {
 1271|       |
 1272|  15.2k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1273|  15.2k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff4);
 1274|       |
 1275|       |                        /* e[3][4-7] stored in pi2_tmp[7][0-7] */
 1276|       |                        /* e[4][4-7] stored in pi2_tmp[7][8-15] */
 1277|       |
 1278|  15.2k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
 1279|  15.2k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
 1280|  15.2k|                        temp4 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1281|  15.2k|                        temp8 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1282|       |
 1283|  15.2k|                    }
 1284|       |
 1285|       |
 1286|       |                    /* All values of ee[] array in pi2_temp */
 1287|       |
 1288|       |                    /* for(k = 0; k < 8; k++) */
 1289|  15.2k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 1290|  15.2k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[1][0]); //80 70
 1291|  15.2k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57 43
 1292|  15.2k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25 9
 1293|  15.2k|                }
 1294|  15.2k|            }
 1295|       |            /* eo */
 1296|  15.2k|            {
 1297|       |
 1298|  15.2k|                WORD16 *pi2_scratch = o_temp_ptr;
 1299|       |
 1300|  15.2k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1301|  15.2k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1302|  15.2k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_81, m_temp_reg_83);
 1303|  15.2k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_85, m_temp_reg_87);
 1304|       |
 1305|  15.2k|                m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 1306|  15.2k|                m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
 1307|  15.2k|                m_temp_reg_75 = _mm_srli_si128(m_temp_reg_75, 8);
 1308|  15.2k|                m_temp_reg_77 = _mm_srli_si128(m_temp_reg_77, 8);
 1309|       |
 1310|  15.2k|                m_temp_reg_81 = _mm_srli_si128(m_temp_reg_81, 8);
 1311|  15.2k|                m_temp_reg_83 = _mm_srli_si128(m_temp_reg_83, 8);
 1312|  15.2k|                m_temp_reg_85 = _mm_srli_si128(m_temp_reg_85, 8);
 1313|  15.2k|                m_temp_reg_87 = _mm_srli_si128(m_temp_reg_87, 8);
 1314|       |
 1315|       |                /* eo0[0-3] */
 1316|  15.2k|                {
 1317|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1318|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1319|       |
 1320|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1321|       |
 1322|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1323|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1324|       |
 1325|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1326|       |
 1327|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1328|       |
 1329|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_30);
 1330|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_30);
 1331|       |
 1332|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1333|  15.2k|                    pi2_scratch += 8;
 1334|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1335|  15.2k|                    pi2_scratch += 8;
 1336|       |
 1337|  15.2k|                }
 1338|       |                /* eo0[4-7] */
 1339|  15.2k|                {
 1340|  15.2k|                    m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1341|  15.2k|                    m_temp_reg_15 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1342|  15.2k|                    m_temp_reg_16 = _mm_unpacklo_epi16(m_temp_reg_81, m_temp_reg_83);
 1343|  15.2k|                    m_temp_reg_17 = _mm_unpacklo_epi16(m_temp_reg_85, m_temp_reg_87);
 1344|       |
 1345|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1346|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1347|       |
 1348|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1349|       |
 1350|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1351|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1352|       |
 1353|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1354|       |
 1355|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1356|       |
 1357|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_30);
 1358|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_30);
 1359|       |
 1360|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1361|  15.2k|                    pi2_scratch += 8;
 1362|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1363|  15.2k|                    pi2_scratch += 8;
 1364|       |
 1365|  15.2k|                }
 1366|       |
 1367|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
 1368|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //0  -43
 1369|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80  90
 1370|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70  25
 1371|       |
 1372|       |                /* eo1[0-3] */
 1373|  15.2k|                {
 1374|       |
 1375|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1376|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1377|       |
 1378|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1379|       |
 1380|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1381|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1382|       |
 1383|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1384|       |
 1385|  15.2k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_32);
 1386|       |
 1387|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_30);
 1388|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_30);
 1389|       |
 1390|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1391|  15.2k|                    pi2_scratch += 8;
 1392|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1393|  15.2k|                    pi2_scratch += 8;
 1394|       |
 1395|  15.2k|                }
 1396|       |
 1397|       |                /* eo1[4-7] */
 1398|  15.2k|                {
 1399|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1400|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1401|       |
 1402|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1403|       |
 1404|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1405|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1406|       |
 1407|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1408|       |
 1409|  15.2k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_32);
 1410|       |
 1411|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_30);
 1412|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_30);
 1413|       |
 1414|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1415|  15.2k|                    pi2_scratch += 8;
 1416|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1417|  15.2k|                    pi2_scratch += 8;
 1418|       |
 1419|  15.2k|                }
 1420|       |
 1421|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
 1422|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[9][0]); //70  87
 1423|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[10][0]); //-25  57
 1424|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[11][0]); //90  43
 1425|       |
 1426|       |                /* eo2[0-3] */
 1427|  15.2k|                {
 1428|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1429|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1430|       |
 1431|  15.2k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 1432|       |
 1433|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1434|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1435|       |
 1436|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1437|       |
 1438|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1439|       |
 1440|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp1, m_temp_reg_30);
 1441|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp1, m_temp_reg_30);
 1442|       |
 1443|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1444|  15.2k|                    pi2_scratch += 8;
 1445|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1446|  15.2k|                    pi2_scratch += 8;
 1447|       |
 1448|  15.2k|                }
 1449|       |
 1450|       |
 1451|       |                /* eo2[4-7] */
 1452|  15.2k|                {
 1453|       |
 1454|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1455|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1456|       |
 1457|  15.2k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 1458|       |
 1459|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1460|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1461|       |
 1462|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1463|       |
 1464|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1465|       |
 1466|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp2, m_temp_reg_30);
 1467|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp2, m_temp_reg_30);
 1468|       |
 1469|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1470|  15.2k|                    pi2_scratch += 8;
 1471|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1472|  15.2k|                    pi2_scratch += 8;
 1473|       |
 1474|  15.2k|                }
 1475|       |                /**************************************************************************/
 1476|       |
 1477|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
 1478|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[13][0]); //-87  9
 1479|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[14][0]); //90  25
 1480|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[15][0]); //80  57
 1481|       |
 1482|       |                /* eo3[0-3] */
 1483|  15.2k|                {
 1484|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1485|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1486|       |
 1487|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1488|       |
 1489|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1490|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1491|       |
 1492|  15.2k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_32, m_temp_reg_33);
 1493|       |
 1494|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1495|       |
 1496|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp3, m_temp_reg_30);
 1497|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp3, m_temp_reg_30);
 1498|       |
 1499|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1500|  15.2k|                    pi2_scratch += 8;
 1501|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1502|  15.2k|                    pi2_scratch += 8;
 1503|       |
 1504|  15.2k|                }
 1505|       |
 1506|       |
 1507|       |                /* eo3[4-7] */
 1508|  15.2k|                {
 1509|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1510|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1511|       |
 1512|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1513|       |
 1514|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1515|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1516|       |
 1517|  15.2k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_32, m_temp_reg_33);
 1518|       |
 1519|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1520|       |
 1521|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp4, m_temp_reg_30);
 1522|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp4, m_temp_reg_30);
 1523|       |
 1524|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1525|  15.2k|                    pi2_scratch += 8;
 1526|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1527|  15.2k|                    pi2_scratch += 8;
 1528|       |
 1529|  15.2k|                }
 1530|       |
 1531|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
 1532|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[17][0]); //-25  90
 1533|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[18][0]); //9  87
 1534|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43  70
 1535|       |
 1536|       |                /* eo4[0-3] */
 1537|  15.2k|                {
 1538|       |
 1539|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1540|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1541|       |
 1542|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1543|       |
 1544|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1545|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1546|       |
 1547|  15.2k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
 1548|       |
 1549|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1550|       |
 1551|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp5, m_temp_reg_30);
 1552|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp5, m_temp_reg_30);
 1553|       |
 1554|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1555|  15.2k|                    pi2_scratch += 8;
 1556|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1557|  15.2k|                    pi2_scratch += 8;
 1558|       |
 1559|  15.2k|                }
 1560|       |
 1561|       |
 1562|       |                /* eo4[4-7] */
 1563|  15.2k|                {
 1564|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1565|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1566|       |
 1567|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1568|       |
 1569|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1570|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1571|       |
 1572|  15.2k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
 1573|       |
 1574|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1575|       |
 1576|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp8, m_temp_reg_30);
 1577|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp8, m_temp_reg_30);
 1578|       |
 1579|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1580|  15.2k|                    pi2_scratch += 8;
 1581|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1582|  15.2k|                    pi2_scratch += 8;
 1583|       |
 1584|  15.2k|                }
 1585|       |
 1586|       |                /***********************************************************************/
 1587|       |
 1588|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
 1589|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[21][0]); //57  25
 1590|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[22][0]); //-87  70
 1591|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[23][0]); //9  -80
 1592|       |
 1593|       |                /* eo5[0-3] */
 1594|  15.2k|                {
 1595|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1596|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1597|       |
 1598|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1599|       |
 1600|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1601|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1602|       |
 1603|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1604|       |
 1605|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1606|       |
 1607|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp7, m_temp_reg_30);
 1608|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp7, m_temp_reg_30);
 1609|       |
 1610|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1611|  15.2k|                    pi2_scratch += 8;
 1612|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1613|  15.2k|                    pi2_scratch += 8;
 1614|       |
 1615|  15.2k|                }
 1616|       |
 1617|       |
 1618|       |                /* eo5[4-7] */
 1619|  15.2k|                {
 1620|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1621|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1622|       |
 1623|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1624|       |
 1625|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1626|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1627|       |
 1628|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1629|       |
 1630|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1631|       |
 1632|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(temp6, m_temp_reg_30);
 1633|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(temp6, m_temp_reg_30);
 1634|       |
 1635|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1636|  15.2k|                    pi2_scratch += 8;
 1637|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1638|  15.2k|                    pi2_scratch += 8;
 1639|       |
 1640|  15.2k|                }
 1641|       |
 1642|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
 1643|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[25][0]); //90  -80
 1644|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[26][0]); //43  9
 1645|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[27][0]); //-57  87
 1646|       |
 1647|       |                /* eo6[0-3] */
 1648|  15.2k|                {
 1649|       |
 1650|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1651|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1652|       |
 1653|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1654|       |
 1655|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1656|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1657|       |
 1658|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1659|       |
 1660|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1661|       |
 1662|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_30);
 1663|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_30);
 1664|       |
 1665|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1666|  15.2k|                    pi2_scratch += 8;
 1667|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1668|  15.2k|                    pi2_scratch += 8;
 1669|       |
 1670|  15.2k|                }
 1671|       |
 1672|       |
 1673|       |                /* eo6[4-7] */
 1674|  15.2k|                {
 1675|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1676|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1677|       |
 1678|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1679|       |
 1680|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1681|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1682|       |
 1683|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1684|       |
 1685|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1686|       |
 1687|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_30);
 1688|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_30);
 1689|       |
 1690|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1691|  15.2k|                    pi2_scratch += 8;
 1692|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1693|  15.2k|                    pi2_scratch += 8;
 1694|       |
 1695|  15.2k|                }
 1696|       |
 1697|  15.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 1698|  15.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[29][0]); //43  -57
 1699|  15.2k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[30][0]); //70  -80
 1700|  15.2k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[31][0]); //87  -90
 1701|       |
 1702|       |                /* eo7[0-3] */
 1703|  15.2k|                {
 1704|       |
 1705|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1706|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1707|       |
 1708|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1709|       |
 1710|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1711|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1712|       |
 1713|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1714|       |
 1715|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1716|       |
 1717|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_30);
 1718|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_30);
 1719|       |
 1720|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1721|  15.2k|                    pi2_scratch += 8;
 1722|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1723|  15.2k|                    pi2_scratch += 8;
 1724|       |
 1725|  15.2k|                }
 1726|       |
 1727|       |
 1728|       |                /* eo7[4-7] */
 1729|  15.2k|                {
 1730|       |
 1731|  15.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1732|  15.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1733|       |
 1734|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1735|       |
 1736|  15.2k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1737|  15.2k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1738|       |
 1739|  15.2k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1740|       |
 1741|  15.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1742|       |
 1743|  15.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_30);
 1744|  15.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_30);
 1745|       |
 1746|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1747|  15.2k|                    pi2_scratch += 8;
 1748|  15.2k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1749|  15.2k|                    pi2_scratch += 8;
 1750|       |
 1751|  15.2k|                }
 1752|       |
 1753|  15.2k|            }
 1754|       |
 1755|  15.2k|        }
 1756|       |        /*  All e[] are done */
 1757|       |        /****************************/
 1758|       |
 1759|  73.7k|        {
 1760|       |
 1761|  73.7k|            WORD16 *pi2_tmp_src = pi2_src + src_strd;
 1762|       |
 1763|  73.7k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1764|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1765|  73.7k|            m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1766|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1767|  73.7k|            m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1768|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1769|  73.7k|            m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1770|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1771|  73.7k|            m_temp_reg_74 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1772|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1773|  73.7k|            m_temp_reg_75 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1774|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1775|  73.7k|            m_temp_reg_76 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1776|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1777|  73.7k|            m_temp_reg_77 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1778|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1779|       |
 1780|  73.7k|            m_temp_reg_80 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1781|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1782|  73.7k|            m_temp_reg_81 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1783|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1784|  73.7k|            m_temp_reg_82 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1785|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1786|  73.7k|            m_temp_reg_83 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1787|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1788|  73.7k|            m_temp_reg_84 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1789|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1790|  73.7k|            m_temp_reg_85 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1791|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1792|  73.7k|            m_temp_reg_86 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1793|  73.7k|            pi2_tmp_src += (src_strd << 1);
 1794|  73.7k|            m_temp_reg_87 = _mm_loadu_si128((__m128i *)pi2_tmp_src);
 1795|  73.7k|        }
 1796|       |
 1797|  73.7k|        if(zero_last28_rows_stg1)
  ------------------
  |  Branch (1797:12): [True: 44.9k, False: 28.7k]
  ------------------
 1798|  44.9k|        {
 1799|       |            /* o & stage 1 out */
 1800|  44.9k|            {
 1801|  44.9k|                WORD32 j;
 1802|  44.9k|                WORD16 *pi2_src_scratch = o_temp_ptr;
 1803|  44.9k|                WORD16 *pi2_dst_scratch = temp_ptr;
 1804|  44.9k|                WORD32 out_stride = (trans_size << 1);
 1805|  44.9k|                WORD32 in_stride = trans_size;
 1806|       |
 1807|   134k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (1807:28): [True: 89.9k, False: 44.9k]
  ------------------
 1808|  89.9k|                {
 1809|  89.9k|                    if(j)
  ------------------
  |  Branch (1809:24): [True: 45.0k, False: 44.9k]
  ------------------
 1810|  45.0k|                    {
 1811|  45.0k|                        m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 1812|  45.0k|                        m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 1813|  45.0k|                    }
 1814|       |
 1815|  89.9k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 1816|       |
 1817|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 1818|       |
 1819|       |                    /* o0[0-3] */
 1820|  89.9k|                    {
 1821|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1822|       |
 1823|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1824|  89.9k|                        pi2_src_scratch += in_stride;
 1825|       |
 1826|  89.9k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1827|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1828|       |
 1829|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1830|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1831|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1832|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1833|       |
 1834|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1835|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1836|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1837|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1838|       |
 1839|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1840|       |
 1841|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1842|  89.9k|                        pi2_dst_scratch += out_stride;
 1843|       |
 1844|  89.9k|                    }
 1845|       |
 1846|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 1847|       |
 1848|       |                    /* o1[0-3] */
 1849|  89.9k|                    {
 1850|       |
 1851|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1852|       |
 1853|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1854|  89.9k|                        pi2_src_scratch += in_stride;
 1855|       |
 1856|  89.9k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1857|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1858|       |
 1859|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1860|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1861|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1862|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1863|       |
 1864|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1865|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1866|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1867|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1868|       |
 1869|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1870|       |
 1871|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1872|  89.9k|                        pi2_dst_scratch += out_stride;
 1873|       |
 1874|  89.9k|                    }
 1875|       |
 1876|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 1877|       |
 1878|       |                    /* o2[0-3] */
 1879|  89.9k|                    {
 1880|       |
 1881|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1882|       |
 1883|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1884|  89.9k|                        pi2_src_scratch += in_stride;
 1885|       |
 1886|  89.9k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1887|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1888|       |
 1889|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1890|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1891|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1892|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1893|       |
 1894|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1895|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1896|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1897|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1898|       |
 1899|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1900|       |
 1901|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1902|  89.9k|                        pi2_dst_scratch += out_stride;
 1903|       |
 1904|  89.9k|                    }
 1905|       |
 1906|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 1907|       |
 1908|       |                    /* o3[0-3] */
 1909|  89.9k|                    {
 1910|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1911|       |
 1912|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1913|  89.9k|                        pi2_src_scratch += in_stride;
 1914|       |
 1915|  89.9k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1916|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1917|       |
 1918|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1919|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1920|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1921|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1922|       |
 1923|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1924|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1925|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1926|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1927|       |
 1928|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1929|       |
 1930|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1931|  89.9k|                        pi2_dst_scratch += out_stride;
 1932|       |
 1933|  89.9k|                    }
 1934|       |
 1935|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 1936|       |
 1937|       |                    /* o4[0-3] */
 1938|  89.9k|                    {
 1939|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1940|       |
 1941|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1942|  89.9k|                        pi2_src_scratch += in_stride;
 1943|       |
 1944|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1945|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1946|       |
 1947|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1948|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1949|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1950|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1951|       |
 1952|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1953|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1954|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1955|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1956|       |
 1957|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1958|       |
 1959|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1960|  89.9k|                        pi2_dst_scratch += out_stride;
 1961|       |
 1962|  89.9k|                    }
 1963|       |
 1964|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 1965|       |
 1966|       |                    /* o5[0-3] */
 1967|  89.9k|                    {
 1968|       |
 1969|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1970|       |
 1971|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1972|  89.9k|                        pi2_src_scratch += in_stride;
 1973|       |
 1974|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1975|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1976|       |
 1977|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1978|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1979|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1980|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1981|       |
 1982|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1983|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1984|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1985|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1986|       |
 1987|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1988|       |
 1989|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1990|  89.9k|                        pi2_dst_scratch += out_stride;
 1991|       |
 1992|  89.9k|                    }
 1993|       |
 1994|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 1995|       |
 1996|       |                    /* o6[0-3] */
 1997|  89.9k|                    {
 1998|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1999|       |
 2000|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2001|  89.9k|                        pi2_src_scratch += in_stride;
 2002|       |
 2003|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2004|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2005|       |
 2006|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2007|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2008|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2009|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2010|       |
 2011|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2012|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2013|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2014|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2015|       |
 2016|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2017|       |
 2018|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2019|  89.9k|                        pi2_dst_scratch += out_stride;
 2020|       |
 2021|  89.9k|                    }
 2022|       |
 2023|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 2024|       |
 2025|       |                    /* o7[0-3] */
 2026|  89.9k|                    {
 2027|       |
 2028|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2029|       |
 2030|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2031|  89.9k|                        pi2_src_scratch += 8;
 2032|       |
 2033|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2034|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2035|       |
 2036|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2037|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2038|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2039|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2040|       |
 2041|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2042|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2043|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2044|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2045|       |
 2046|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2047|       |
 2048|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2049|  89.9k|                        pi2_dst_scratch += 8;
 2050|       |
 2051|  89.9k|                    }
 2052|       |
 2053|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 2054|       |
 2055|       |                    /* o8[0-3] */
 2056|  89.9k|                    {
 2057|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2058|       |
 2059|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2060|  89.9k|                        pi2_src_scratch -= in_stride;
 2061|       |
 2062|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2063|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2064|       |
 2065|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2066|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2067|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2068|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2069|       |
 2070|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2071|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2072|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2073|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2074|       |
 2075|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2076|       |
 2077|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2078|  89.9k|                        pi2_dst_scratch -= out_stride;
 2079|  89.9k|                    }
 2080|       |
 2081|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 2082|       |
 2083|       |                    /* o9[0-3] */
 2084|  89.9k|                    {
 2085|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2086|       |
 2087|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2088|  89.9k|                        pi2_src_scratch -= in_stride;
 2089|       |
 2090|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2091|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2092|       |
 2093|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2094|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2095|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2096|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2097|       |
 2098|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2099|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2100|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2101|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2102|       |
 2103|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2104|       |
 2105|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2106|  89.9k|                        pi2_dst_scratch -= out_stride;
 2107|  89.9k|                    }
 2108|       |
 2109|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 2110|       |
 2111|       |                    /* o10[0-3] */
 2112|  89.9k|                    {
 2113|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2114|       |
 2115|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2116|  89.9k|                        pi2_src_scratch -= in_stride;
 2117|       |
 2118|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2119|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2120|       |
 2121|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2122|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2123|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2124|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2125|       |
 2126|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2127|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2128|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2129|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2130|       |
 2131|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2132|       |
 2133|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2134|  89.9k|                        pi2_dst_scratch -= out_stride;
 2135|  89.9k|                    }
 2136|       |
 2137|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 2138|       |
 2139|       |                    /* o11[0-3] */
 2140|  89.9k|                    {
 2141|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2142|       |
 2143|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2144|  89.9k|                        pi2_src_scratch -= in_stride;
 2145|       |
 2146|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2147|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2148|       |
 2149|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2150|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2151|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2152|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2153|       |
 2154|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2155|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2156|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2157|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2158|       |
 2159|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2160|       |
 2161|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2162|  89.9k|                        pi2_dst_scratch -= out_stride;
 2163|       |
 2164|  89.9k|                    }
 2165|       |
 2166|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 2167|       |
 2168|       |                    /* o12[0-3] */
 2169|  89.9k|                    {
 2170|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2171|       |
 2172|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2173|  89.9k|                        pi2_src_scratch -= in_stride;
 2174|       |
 2175|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2176|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2177|       |
 2178|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2179|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2180|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2181|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2182|       |
 2183|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2184|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2185|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2186|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2187|       |
 2188|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2189|       |
 2190|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2191|  89.9k|                        pi2_dst_scratch -= out_stride;
 2192|       |
 2193|  89.9k|                    }
 2194|       |
 2195|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 2196|       |
 2197|       |                    /* o13[0-3] */
 2198|  89.9k|                    {
 2199|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2200|       |
 2201|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2202|  89.9k|                        pi2_src_scratch -= in_stride;
 2203|       |
 2204|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2205|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2206|       |
 2207|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2208|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2209|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2210|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2211|       |
 2212|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2213|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2214|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2215|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2216|       |
 2217|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2218|       |
 2219|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2220|  89.9k|                        pi2_dst_scratch -= out_stride;
 2221|  89.9k|                    }
 2222|       |
 2223|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 2224|       |
 2225|       |                    /* o14[0-3] */
 2226|  89.9k|                    {
 2227|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2228|       |
 2229|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2230|  89.9k|                        pi2_src_scratch -= in_stride;
 2231|       |
 2232|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2233|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2234|       |
 2235|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2236|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2237|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2238|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2239|       |
 2240|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2241|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2242|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2243|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2244|       |
 2245|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2246|       |
 2247|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2248|  89.9k|                        pi2_dst_scratch -= out_stride;
 2249|       |
 2250|  89.9k|                    }
 2251|       |
 2252|  89.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 2253|       |
 2254|       |                    /* o15[0-3] */
 2255|  89.9k|                    {
 2256|  89.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2257|       |
 2258|  89.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2259|  89.9k|                        pi2_src_scratch += 8;
 2260|       |
 2261|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2262|  89.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2263|       |
 2264|  89.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2265|  89.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2266|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2267|  89.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2268|       |
 2269|  89.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2270|  89.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2271|  89.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2272|  89.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2273|       |
 2274|  89.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2275|       |
 2276|  89.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2277|  89.9k|                        pi2_dst_scratch += 8;
 2278|  89.9k|                    }
 2279|       |
 2280|  89.9k|                }
 2281|  44.9k|            }
 2282|  44.9k|        }
 2283|  28.7k|        else if(zero_last24_rows_stg1)
  ------------------
  |  Branch (2283:17): [True: 13.4k, False: 15.2k]
  ------------------
 2284|  13.4k|        {
 2285|       |            /* o & stage 1 out */
 2286|  13.4k|            {
 2287|  13.4k|                WORD32 j;
 2288|       |
 2289|  13.4k|                WORD16 *pi2_src_scratch = o_temp_ptr;
 2290|  13.4k|                WORD16 *pi2_dst_scratch = temp_ptr;
 2291|  13.4k|                WORD32 out_stride = (trans_size << 1);
 2292|       |
 2293|  13.4k|                WORD32 in_stride = trans_size;
 2294|       |
 2295|  40.4k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2295:28): [True: 26.9k, False: 13.4k]
  ------------------
 2296|  26.9k|                {
 2297|  26.9k|                    if(j)
  ------------------
  |  Branch (2297:24): [True: 13.4k, False: 13.4k]
  ------------------
 2298|  13.4k|                    {
 2299|  13.4k|                        m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 2300|  13.4k|                        m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 2301|  13.4k|                        m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
 2302|  13.4k|                        m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
 2303|  13.4k|                    }
 2304|       |
 2305|  26.9k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 2306|  26.9k|                    m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 interleaved
 2307|       |
 2308|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 2309|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 2310|       |
 2311|       |                    /* o0[0-3] */
 2312|  26.9k|                    {
 2313|       |
 2314|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2315|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2316|       |
 2317|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2318|       |
 2319|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2320|  26.9k|                        pi2_src_scratch += in_stride;
 2321|       |
 2322|  26.9k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2323|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2324|       |
 2325|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2326|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2327|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2328|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2329|       |
 2330|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2331|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2332|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2333|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2334|       |
 2335|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2336|       |
 2337|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2338|  26.9k|                        pi2_dst_scratch += out_stride;
 2339|       |
 2340|  26.9k|                    }
 2341|       |
 2342|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 2343|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 2344|       |
 2345|       |                    /* o1[0-3] */
 2346|  26.9k|                    {
 2347|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2348|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2349|       |
 2350|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2351|       |
 2352|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2353|  26.9k|                        pi2_src_scratch += in_stride;
 2354|       |
 2355|  26.9k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2356|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2357|       |
 2358|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2359|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2360|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2361|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2362|       |
 2363|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2364|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2365|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2366|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2367|       |
 2368|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2369|       |
 2370|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2371|  26.9k|                        pi2_dst_scratch += out_stride;
 2372|       |
 2373|  26.9k|                    }
 2374|       |
 2375|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 2376|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 2377|       |
 2378|       |                    /* o2[0-3] */
 2379|  26.9k|                    {
 2380|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2381|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2382|       |
 2383|  26.9k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 2384|       |
 2385|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2386|  26.9k|                        pi2_src_scratch += in_stride;
 2387|       |
 2388|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2389|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2390|       |
 2391|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2392|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2393|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2394|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2395|       |
 2396|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2397|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2398|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2399|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2400|       |
 2401|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2402|       |
 2403|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2404|  26.9k|                        pi2_dst_scratch += out_stride;
 2405|       |
 2406|  26.9k|                    }
 2407|       |
 2408|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 2409|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 2410|       |
 2411|       |                    /* o3[0-3] */
 2412|  26.9k|                    {
 2413|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2414|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2415|       |
 2416|  26.9k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 2417|       |
 2418|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2419|  26.9k|                        pi2_src_scratch += in_stride;
 2420|       |
 2421|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2422|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2423|       |
 2424|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2425|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2426|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2427|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2428|       |
 2429|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2430|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2431|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2432|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2433|       |
 2434|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2435|       |
 2436|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2437|  26.9k|                        pi2_dst_scratch += out_stride;
 2438|       |
 2439|  26.9k|                    }
 2440|       |
 2441|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 2442|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 2443|       |
 2444|       |                    /* o4[0-3] */
 2445|  26.9k|                    {
 2446|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2447|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2448|       |
 2449|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2450|       |
 2451|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2452|  26.9k|                        pi2_src_scratch += in_stride;
 2453|       |
 2454|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2455|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2456|       |
 2457|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2458|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2459|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2460|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2461|       |
 2462|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2463|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2464|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2465|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2466|       |
 2467|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2468|       |
 2469|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2470|  26.9k|                        pi2_dst_scratch += out_stride;
 2471|       |
 2472|  26.9k|                    }
 2473|       |
 2474|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 2475|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 2476|       |
 2477|       |                    /* o5[0-3] */
 2478|  26.9k|                    {
 2479|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2480|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2481|       |
 2482|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2483|       |
 2484|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2485|  26.9k|                        pi2_src_scratch += in_stride;
 2486|       |
 2487|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2488|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2489|       |
 2490|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2491|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2492|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2493|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2494|       |
 2495|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2496|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2497|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2498|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2499|       |
 2500|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2501|       |
 2502|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2503|  26.9k|                        pi2_dst_scratch += out_stride;
 2504|       |
 2505|  26.9k|                    }
 2506|       |
 2507|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 2508|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 2509|       |
 2510|       |                    /* o6[0-3] */
 2511|  26.9k|                    {
 2512|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2513|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2514|       |
 2515|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2516|       |
 2517|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2518|  26.9k|                        pi2_src_scratch += in_stride;
 2519|       |
 2520|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2521|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2522|       |
 2523|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2524|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2525|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2526|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2527|       |
 2528|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2529|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2530|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2531|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2532|       |
 2533|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2534|       |
 2535|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2536|  26.9k|                        pi2_dst_scratch += out_stride;
 2537|       |
 2538|  26.9k|                    }
 2539|       |
 2540|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 2541|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 2542|       |
 2543|       |                    /* o7[0-3] */
 2544|  26.9k|                    {
 2545|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2546|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2547|       |
 2548|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2549|       |
 2550|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2551|  26.9k|                        pi2_src_scratch += 8;
 2552|       |
 2553|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2554|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2555|       |
 2556|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2557|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2558|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2559|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2560|       |
 2561|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2562|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2563|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2564|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2565|       |
 2566|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2567|       |
 2568|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2569|  26.9k|                        pi2_dst_scratch += 8;
 2570|       |
 2571|  26.9k|                    }
 2572|       |
 2573|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 2574|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 2575|       |
 2576|       |                    /* o8[0-3] */
 2577|  26.9k|                    {
 2578|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2579|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2580|       |
 2581|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2582|       |
 2583|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2584|  26.9k|                        pi2_src_scratch -= in_stride;
 2585|       |
 2586|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2587|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2588|       |
 2589|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2590|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2591|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2592|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2593|       |
 2594|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2595|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2596|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2597|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2598|       |
 2599|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2600|       |
 2601|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2602|  26.9k|                        pi2_dst_scratch -= out_stride;
 2603|  26.9k|                    }
 2604|       |
 2605|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 2606|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 2607|       |
 2608|       |                    /* o9[0-3] */
 2609|  26.9k|                    {
 2610|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2611|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2612|       |
 2613|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2614|       |
 2615|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2616|  26.9k|                        pi2_src_scratch -= in_stride;
 2617|       |
 2618|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2619|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2620|       |
 2621|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2622|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2623|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2624|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2625|       |
 2626|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2627|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2628|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2629|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2630|       |
 2631|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2632|       |
 2633|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2634|  26.9k|                        pi2_dst_scratch -= out_stride;
 2635|  26.9k|                    }
 2636|       |
 2637|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 2638|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 2639|       |
 2640|       |                    /* o10[0-3] */
 2641|  26.9k|                    {
 2642|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2643|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2644|       |
 2645|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2646|       |
 2647|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2648|  26.9k|                        pi2_src_scratch -= in_stride;
 2649|       |
 2650|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2651|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2652|       |
 2653|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2654|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2655|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2656|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2657|       |
 2658|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2659|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2660|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2661|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2662|       |
 2663|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2664|       |
 2665|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2666|  26.9k|                        pi2_dst_scratch -= out_stride;
 2667|  26.9k|                    }
 2668|       |
 2669|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 2670|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 2671|       |
 2672|       |                    /* o11[0-3] */
 2673|  26.9k|                    {
 2674|       |
 2675|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2676|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2677|       |
 2678|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2679|       |
 2680|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2681|  26.9k|                        pi2_src_scratch -= in_stride;
 2682|       |
 2683|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2684|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2685|       |
 2686|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2687|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2688|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2689|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2690|       |
 2691|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2692|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2693|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2694|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2695|       |
 2696|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2697|       |
 2698|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2699|  26.9k|                        pi2_dst_scratch -= out_stride;
 2700|       |
 2701|  26.9k|                    }
 2702|       |
 2703|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 2704|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 2705|       |
 2706|       |                    /* o12[0-3] */
 2707|  26.9k|                    {
 2708|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2709|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2710|       |
 2711|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2712|       |
 2713|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2714|  26.9k|                        pi2_src_scratch -= in_stride;
 2715|       |
 2716|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2717|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2718|       |
 2719|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2720|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2721|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2722|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2723|       |
 2724|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2725|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2726|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2727|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2728|       |
 2729|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2730|       |
 2731|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2732|  26.9k|                        pi2_dst_scratch -= out_stride;
 2733|       |
 2734|  26.9k|                    }
 2735|       |
 2736|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 2737|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 2738|       |
 2739|       |                    /* o13[0-3] */
 2740|  26.9k|                    {
 2741|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2742|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2743|       |
 2744|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2745|       |
 2746|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2747|  26.9k|                        pi2_src_scratch -= in_stride;
 2748|       |
 2749|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2750|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2751|       |
 2752|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2753|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2754|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2755|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2756|       |
 2757|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2758|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2759|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2760|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2761|       |
 2762|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2763|       |
 2764|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2765|  26.9k|                        pi2_dst_scratch -= out_stride;
 2766|  26.9k|                    }
 2767|       |
 2768|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 2769|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 2770|       |
 2771|       |                    /* o14[0-3] */
 2772|  26.9k|                    {
 2773|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2774|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2775|       |
 2776|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2777|       |
 2778|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2779|  26.9k|                        pi2_src_scratch -= in_stride;
 2780|       |
 2781|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2782|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2783|       |
 2784|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2785|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2786|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2787|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2788|       |
 2789|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2790|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2791|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2792|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2793|       |
 2794|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2795|       |
 2796|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2797|  26.9k|                        pi2_dst_scratch -= out_stride;
 2798|       |
 2799|  26.9k|                    }
 2800|       |
 2801|  26.9k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 2802|  26.9k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 2803|       |
 2804|       |                    /* o15[0-3] */
 2805|  26.9k|                    {
 2806|  26.9k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2807|  26.9k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2808|       |
 2809|  26.9k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2810|       |
 2811|  26.9k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2812|  26.9k|                        pi2_src_scratch += 8;
 2813|       |
 2814|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2815|  26.9k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2816|       |
 2817|  26.9k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2818|  26.9k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2819|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2820|  26.9k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2821|       |
 2822|  26.9k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2823|  26.9k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2824|  26.9k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2825|  26.9k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2826|       |
 2827|  26.9k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2828|       |
 2829|  26.9k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2830|  26.9k|                        pi2_dst_scratch += 8;
 2831|  26.9k|                    }
 2832|       |
 2833|  26.9k|                }
 2834|  13.4k|            }
 2835|  13.4k|        }
 2836|  15.2k|        else
 2837|  15.2k|        {
 2838|       |            /* o & stage 1 out */
 2839|  15.2k|            {
 2840|  15.2k|                WORD32 j;
 2841|       |
 2842|  15.2k|                WORD16 *pi2_src_scratch = o_temp_ptr;
 2843|  15.2k|                WORD16 *pi2_dst_scratch = temp_ptr;
 2844|  15.2k|                WORD32 out_stride = (trans_size << 1);
 2845|       |
 2846|  15.2k|                WORD32 in_stride = trans_size;
 2847|       |
 2848|       |
 2849|  45.9k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2849:28): [True: 30.6k, False: 15.2k]
  ------------------
 2850|  30.6k|                {
 2851|  30.6k|                    if(j)
  ------------------
  |  Branch (2851:24): [True: 15.3k, False: 15.3k]
  ------------------
 2852|  15.3k|                    {
 2853|  15.3k|                        m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 2854|  15.3k|                        m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 2855|  15.3k|                        m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
 2856|  15.3k|                        m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
 2857|  15.3k|                        m_temp_reg_74 = _mm_srli_si128(m_temp_reg_74, 8);
 2858|  15.3k|                        m_temp_reg_75 = _mm_srli_si128(m_temp_reg_75, 8);
 2859|  15.3k|                        m_temp_reg_76 = _mm_srli_si128(m_temp_reg_76, 8);
 2860|  15.3k|                        m_temp_reg_77 = _mm_srli_si128(m_temp_reg_77, 8);
 2861|       |
 2862|  15.3k|                        m_temp_reg_80 = _mm_srli_si128(m_temp_reg_80, 8);
 2863|  15.3k|                        m_temp_reg_81 = _mm_srli_si128(m_temp_reg_81, 8);
 2864|  15.3k|                        m_temp_reg_82 = _mm_srli_si128(m_temp_reg_82, 8);
 2865|  15.3k|                        m_temp_reg_83 = _mm_srli_si128(m_temp_reg_83, 8);
 2866|  15.3k|                        m_temp_reg_84 = _mm_srli_si128(m_temp_reg_84, 8);
 2867|  15.3k|                        m_temp_reg_85 = _mm_srli_si128(m_temp_reg_85, 8);
 2868|  15.3k|                        m_temp_reg_86 = _mm_srli_si128(m_temp_reg_86, 8);
 2869|  15.3k|                        m_temp_reg_87 = _mm_srli_si128(m_temp_reg_87, 8);
 2870|  15.3k|                    }
 2871|       |
 2872|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 2873|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 2874|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[2][0]);
 2875|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[3][0]);
 2876|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[4][0]);
 2877|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[5][0]);
 2878|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[6][0]);
 2879|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[7][0]);
 2880|       |
 2881|  30.6k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 2882|  30.6k|                    m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 interleaved
 2883|  30.6k|                    m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 interleaved
 2884|  30.6k|                    m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 interleaved
 2885|  30.6k|                    temp1 = _mm_unpacklo_epi16(m_temp_reg_80, m_temp_reg_81); //row 17 and row 19 interleaved
 2886|  30.6k|                    temp2 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_83); //row 21 and row 23 interleaved
 2887|  30.6k|                    temp3 = _mm_unpacklo_epi16(m_temp_reg_84, m_temp_reg_85); //row 25 and row 27 interleaved
 2888|  30.6k|                    temp4 = _mm_unpacklo_epi16(m_temp_reg_86, m_temp_reg_87); //row 29 and row 31 interleaved
 2889|       |
 2890|       |
 2891|       |                    /* o0[0-3] */
 2892|  30.6k|                    {
 2893|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2894|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2895|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 2896|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2897|       |
 2898|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2899|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 2900|       |
 2901|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 2902|       |
 2903|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 2904|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 2905|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 2906|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 2907|       |
 2908|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 2909|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 2910|       |
 2911|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 2912|       |
 2913|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 2914|       |
 2915|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2916|  30.6k|                        pi2_src_scratch += in_stride;
 2917|       |
 2918|  30.6k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2919|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2920|       |
 2921|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2922|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2923|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2924|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2925|       |
 2926|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2927|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2928|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2929|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2930|       |
 2931|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2932|       |
 2933|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2934|  30.6k|                        pi2_dst_scratch += out_stride;
 2935|       |
 2936|  30.6k|                    }
 2937|       |
 2938|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 2939|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 2940|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[10][0]);
 2941|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[11][0]);
 2942|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[12][0]);
 2943|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[13][0]);
 2944|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[14][0]);
 2945|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[15][0]);
 2946|       |
 2947|       |
 2948|       |                    /* o1[0-3] */
 2949|  30.6k|                    {
 2950|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2951|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2952|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 2953|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2954|       |
 2955|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2956|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 2957|       |
 2958|  30.6k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_20);
 2959|       |
 2960|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 2961|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 2962|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 2963|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 2964|       |
 2965|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 2966|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 2967|       |
 2968|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 2969|       |
 2970|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 2971|       |
 2972|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 2973|  30.6k|                        pi2_src_scratch += in_stride;
 2974|       |
 2975|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2976|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2977|       |
 2978|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2979|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2980|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2981|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2982|       |
 2983|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2984|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2985|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2986|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2987|       |
 2988|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2989|       |
 2990|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2991|  30.6k|                        pi2_dst_scratch += out_stride;
 2992|       |
 2993|  30.6k|                    }
 2994|       |
 2995|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 2996|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 2997|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[18][0]);
 2998|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[19][0]);
 2999|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[20][0]);
 3000|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[21][0]);
 3001|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[22][0]);
 3002|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[23][0]);
 3003|       |
 3004|       |                    /* o2[0-3] */
 3005|  30.6k|                    {
 3006|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3007|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3008|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3009|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3010|       |
 3011|  30.6k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 3012|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3013|       |
 3014|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3015|       |
 3016|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3017|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3018|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3019|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3020|       |
 3021|  30.6k|                        m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_41);
 3022|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3023|       |
 3024|  30.6k|                        m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_42);
 3025|       |
 3026|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3027|       |
 3028|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3029|  30.6k|                        pi2_src_scratch += in_stride;
 3030|       |
 3031|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3032|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3033|       |
 3034|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3035|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3036|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3037|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3038|       |
 3039|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3040|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3041|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3042|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3043|       |
 3044|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3045|       |
 3046|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3047|  30.6k|                        pi2_dst_scratch += out_stride;
 3048|       |
 3049|  30.6k|                    }
 3050|       |
 3051|       |
 3052|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 3053|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 3054|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[26][0]);
 3055|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[27][0]);
 3056|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[28][0]);
 3057|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[29][0]);
 3058|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[30][0]);
 3059|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[31][0]);
 3060|       |
 3061|       |                    /* o3[0-3] */
 3062|  30.6k|                    {
 3063|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3064|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3065|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3066|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3067|       |
 3068|  30.6k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 3069|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3070|       |
 3071|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3072|       |
 3073|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3074|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3075|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3076|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3077|       |
 3078|  30.6k|                        m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_40);
 3079|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3080|       |
 3081|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3082|       |
 3083|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3084|       |
 3085|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3086|  30.6k|                        pi2_src_scratch += in_stride;
 3087|       |
 3088|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3089|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3090|       |
 3091|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3092|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3093|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3094|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3095|       |
 3096|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3097|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3098|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3099|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3100|       |
 3101|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3102|       |
 3103|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3104|  30.6k|                        pi2_dst_scratch += out_stride;
 3105|       |
 3106|  30.6k|                    }
 3107|       |
 3108|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 3109|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 3110|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[34][0]);
 3111|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[35][0]);
 3112|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[36][0]);
 3113|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[37][0]);
 3114|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[38][0]);
 3115|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[39][0]);
 3116|       |
 3117|       |                    /* o4[0-3] */
 3118|  30.6k|                    {
 3119|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3120|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3121|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3122|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3123|       |
 3124|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3125|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3126|       |
 3127|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3128|       |
 3129|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3130|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3131|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3132|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3133|       |
 3134|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3135|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3136|       |
 3137|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3138|       |
 3139|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3140|       |
 3141|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3142|  30.6k|                        pi2_src_scratch += in_stride;
 3143|       |
 3144|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3145|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3146|       |
 3147|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3148|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3149|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3150|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3151|       |
 3152|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3153|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3154|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3155|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3156|       |
 3157|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3158|       |
 3159|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3160|  30.6k|                        pi2_dst_scratch += out_stride;
 3161|       |
 3162|  30.6k|                    }
 3163|       |
 3164|       |
 3165|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 3166|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 3167|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[42][0]);
 3168|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[43][0]);
 3169|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[44][0]);
 3170|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[45][0]);
 3171|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[46][0]);
 3172|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[47][0]);
 3173|       |
 3174|       |                    /* o5[0-3] */
 3175|  30.6k|                    {
 3176|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3177|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3178|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3179|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3180|       |
 3181|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3182|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3183|       |
 3184|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3185|       |
 3186|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3187|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3188|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3189|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3190|       |
 3191|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3192|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3193|       |
 3194|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3195|       |
 3196|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3197|       |
 3198|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3199|  30.6k|                        pi2_src_scratch += in_stride;
 3200|       |
 3201|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3202|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3203|       |
 3204|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3205|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3206|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3207|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3208|       |
 3209|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3210|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3211|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3212|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3213|       |
 3214|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3215|       |
 3216|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3217|  30.6k|                        pi2_dst_scratch += out_stride;
 3218|       |
 3219|  30.6k|                    }
 3220|       |
 3221|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 3222|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 3223|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[50][0]);
 3224|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[51][0]);
 3225|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[52][0]);
 3226|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[53][0]);
 3227|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[54][0]);
 3228|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[55][0]);
 3229|       |
 3230|       |
 3231|       |                    /* o6[0-3] */
 3232|  30.6k|                    {
 3233|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3234|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3235|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3236|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3237|       |
 3238|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3239|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3240|       |
 3241|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3242|       |
 3243|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3244|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3245|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3246|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3247|       |
 3248|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3249|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3250|       |
 3251|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3252|       |
 3253|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3254|       |
 3255|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3256|  30.6k|                        pi2_src_scratch += in_stride;
 3257|       |
 3258|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3259|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3260|       |
 3261|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3262|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3263|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3264|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3265|       |
 3266|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3267|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3268|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3269|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3270|       |
 3271|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3272|       |
 3273|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3274|  30.6k|                        pi2_dst_scratch += out_stride;
 3275|       |
 3276|  30.6k|                    }
 3277|       |
 3278|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 3279|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 3280|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[58][0]);
 3281|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[59][0]);
 3282|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[60][0]);
 3283|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[61][0]);
 3284|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[62][0]);
 3285|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[63][0]);
 3286|       |
 3287|       |                    /* o7[0-3] */
 3288|  30.6k|                    {
 3289|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3290|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3291|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3292|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3293|       |
 3294|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3295|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3296|       |
 3297|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3298|       |
 3299|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3300|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3301|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3302|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3303|       |
 3304|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3305|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3306|       |
 3307|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3308|       |
 3309|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3310|       |
 3311|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3312|  30.6k|                        pi2_src_scratch += 8;
 3313|       |
 3314|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3315|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3316|       |
 3317|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3318|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3319|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3320|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3321|       |
 3322|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3323|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3324|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3325|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3326|       |
 3327|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3328|       |
 3329|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3330|  30.6k|                        pi2_dst_scratch += 8;
 3331|       |
 3332|  30.6k|                    }
 3333|       |
 3334|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 3335|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 3336|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[66][0]);
 3337|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[67][0]);
 3338|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[68][0]);
 3339|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[69][0]);
 3340|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[70][0]);
 3341|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[71][0]);
 3342|       |
 3343|       |
 3344|       |                    /* o8[0-3] */
 3345|  30.6k|                    {
 3346|       |
 3347|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3348|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3349|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3350|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3351|       |
 3352|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3353|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3354|       |
 3355|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3356|       |
 3357|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3358|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3359|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3360|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3361|       |
 3362|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3363|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3364|       |
 3365|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3366|       |
 3367|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3368|       |
 3369|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3370|  30.6k|                        pi2_src_scratch -= in_stride;
 3371|       |
 3372|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3373|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3374|       |
 3375|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3376|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3377|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3378|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3379|       |
 3380|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3381|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3382|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3383|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3384|       |
 3385|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3386|       |
 3387|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3388|  30.6k|                        pi2_dst_scratch -= out_stride;
 3389|  30.6k|                    }
 3390|       |
 3391|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 3392|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 3393|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[74][0]);
 3394|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[75][0]);
 3395|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[76][0]);
 3396|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[77][0]);
 3397|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[78][0]);
 3398|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[79][0]);
 3399|       |
 3400|       |
 3401|       |                    /* o9[0-3] */
 3402|  30.6k|                    {
 3403|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3404|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3405|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3406|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3407|       |
 3408|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3409|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3410|       |
 3411|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3412|       |
 3413|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3414|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3415|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3416|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3417|       |
 3418|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3419|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3420|       |
 3421|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3422|       |
 3423|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3424|       |
 3425|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3426|  30.6k|                        pi2_src_scratch -= in_stride;
 3427|       |
 3428|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3429|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3430|       |
 3431|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3432|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3433|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3434|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3435|       |
 3436|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3437|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3438|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3439|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3440|       |
 3441|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3442|       |
 3443|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3444|  30.6k|                        pi2_dst_scratch -= out_stride;
 3445|  30.6k|                    }
 3446|       |
 3447|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 3448|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 3449|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[82][0]);
 3450|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[83][0]);
 3451|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[84][0]);
 3452|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[85][0]);
 3453|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[86][0]);
 3454|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[87][0]);
 3455|       |
 3456|       |                    /* o10[0-3] */
 3457|  30.6k|                    {
 3458|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3459|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3460|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3461|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3462|       |
 3463|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3464|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3465|       |
 3466|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3467|       |
 3468|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3469|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3470|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3471|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3472|       |
 3473|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3474|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3475|       |
 3476|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3477|       |
 3478|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3479|       |
 3480|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3481|  30.6k|                        pi2_src_scratch -= in_stride;
 3482|       |
 3483|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3484|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3485|       |
 3486|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3487|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3488|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3489|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3490|       |
 3491|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3492|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3493|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3494|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3495|       |
 3496|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3497|       |
 3498|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3499|  30.6k|                        pi2_dst_scratch -= out_stride;
 3500|  30.6k|                    }
 3501|       |
 3502|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 3503|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 3504|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[90][0]);
 3505|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[91][0]);
 3506|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[92][0]);
 3507|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[93][0]);
 3508|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[94][0]);
 3509|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[95][0]);
 3510|       |
 3511|       |                    /* o11[0-3] */
 3512|  30.6k|                    {
 3513|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3514|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3515|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3516|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3517|       |
 3518|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3519|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3520|       |
 3521|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3522|       |
 3523|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3524|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3525|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3526|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3527|       |
 3528|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3529|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3530|       |
 3531|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3532|       |
 3533|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3534|       |
 3535|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3536|  30.6k|                        pi2_src_scratch -= in_stride;
 3537|       |
 3538|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3539|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3540|       |
 3541|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3542|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3543|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3544|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3545|       |
 3546|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3547|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3548|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3549|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3550|       |
 3551|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3552|       |
 3553|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3554|  30.6k|                        pi2_dst_scratch -= out_stride;
 3555|       |
 3556|  30.6k|                    }
 3557|       |
 3558|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 3559|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 3560|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[98][0]);
 3561|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[99][0]);
 3562|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[100][0]);
 3563|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[101][0]);
 3564|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[102][0]);
 3565|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[103][0]);
 3566|       |
 3567|       |
 3568|       |                    /* o12[0-3] */
 3569|  30.6k|                    {
 3570|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3571|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3572|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3573|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3574|       |
 3575|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3576|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3577|       |
 3578|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3579|       |
 3580|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3581|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3582|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3583|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3584|       |
 3585|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3586|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3587|       |
 3588|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3589|       |
 3590|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3591|       |
 3592|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3593|  30.6k|                        pi2_src_scratch -= in_stride;
 3594|       |
 3595|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3596|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3597|       |
 3598|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3599|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3600|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3601|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3602|       |
 3603|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3604|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3605|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3606|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3607|       |
 3608|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3609|       |
 3610|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3611|  30.6k|                        pi2_dst_scratch -= out_stride;
 3612|       |
 3613|  30.6k|                    }
 3614|       |
 3615|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 3616|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 3617|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[106][0]);
 3618|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[107][0]);
 3619|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[108][0]);
 3620|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[109][0]);
 3621|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[110][0]);
 3622|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[111][0]);
 3623|       |
 3624|       |
 3625|       |                    /* o13[0-3] */
 3626|  30.6k|                    {
 3627|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3628|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3629|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3630|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3631|       |
 3632|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3633|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3634|       |
 3635|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3636|       |
 3637|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3638|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3639|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3640|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3641|       |
 3642|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3643|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3644|       |
 3645|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3646|       |
 3647|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3648|       |
 3649|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3650|  30.6k|                        pi2_src_scratch -= in_stride;
 3651|       |
 3652|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3653|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3654|       |
 3655|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3656|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3657|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3658|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3659|       |
 3660|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3661|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3662|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3663|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3664|       |
 3665|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3666|       |
 3667|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3668|  30.6k|                        pi2_dst_scratch -= out_stride;
 3669|  30.6k|                    }
 3670|       |
 3671|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 3672|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 3673|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[114][0]);
 3674|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[115][0]);
 3675|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[116][0]);
 3676|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[117][0]);
 3677|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[118][0]);
 3678|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[119][0]);
 3679|       |
 3680|       |
 3681|       |                    /* o14[0-3] */
 3682|  30.6k|                    {
 3683|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3684|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3685|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3686|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3687|       |
 3688|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3689|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3690|       |
 3691|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3692|       |
 3693|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3694|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3695|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3696|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3697|       |
 3698|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3699|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3700|       |
 3701|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3702|       |
 3703|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3704|       |
 3705|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3706|  30.6k|                        pi2_src_scratch -= in_stride;
 3707|       |
 3708|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3709|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3710|       |
 3711|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3712|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3713|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3714|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3715|       |
 3716|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3717|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3718|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3719|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3720|       |
 3721|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3722|       |
 3723|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3724|  30.6k|                        pi2_dst_scratch -= out_stride;
 3725|       |
 3726|  30.6k|                    }
 3727|       |
 3728|  30.6k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 3729|  30.6k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 3730|  30.6k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[122][0]);
 3731|  30.6k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[123][0]);
 3732|  30.6k|                    m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[124][0]);
 3733|  30.6k|                    m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[125][0]);
 3734|  30.6k|                    m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[126][0]);
 3735|  30.6k|                    m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[127][0]);
 3736|       |
 3737|       |                    /* o15[0-3] */
 3738|  30.6k|                    {
 3739|  30.6k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3740|  30.6k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3741|  30.6k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3742|  30.6k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3743|       |
 3744|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3745|  30.6k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3746|       |
 3747|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3748|       |
 3749|  30.6k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3750|  30.6k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3751|  30.6k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3752|  30.6k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3753|       |
 3754|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3755|  30.6k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3756|       |
 3757|  30.6k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3758|       |
 3759|  30.6k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3760|       |
 3761|  30.6k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 3762|  30.6k|                        pi2_src_scratch += 8;
 3763|       |
 3764|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3765|  30.6k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3766|       |
 3767|  30.6k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3768|  30.6k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3769|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3770|  30.6k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3771|       |
 3772|  30.6k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3773|  30.6k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3774|  30.6k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3775|  30.6k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3776|       |
 3777|  30.6k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3778|       |
 3779|  30.6k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3780|  30.6k|                        pi2_dst_scratch += 8;
 3781|  30.6k|                    }
 3782|       |
 3783|  30.6k|                }
 3784|  15.2k|            }
 3785|  15.2k|        }
 3786|       |        /* Transpose */
 3787|  73.7k|        {
 3788|  73.7k|            WORD16 *pi2_src_scratch = temp_ptr;
 3789|  73.7k|            WORD16 *pi2_dst_scratch = pi2_tmp;
 3790|  73.7k|            WORD32 in_stride = (trans_size << 1);
 3791|       |
 3792|   221k|            for(j = 0; j < 2; j++)
  ------------------
  |  Branch (3792:24): [True: 147k, False: 73.7k]
  ------------------
 3793|   147k|            {
 3794|   147k|                m_temp_reg_30 =  _mm_load_si128((__m128i *)pi2_src_scratch);
 3795|   147k|                pi2_src_scratch += in_stride;
 3796|   147k|                m_temp_reg_31 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3797|   147k|                pi2_src_scratch += in_stride;
 3798|   147k|                m_temp_reg_32 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3799|   147k|                pi2_src_scratch += in_stride;
 3800|   147k|                m_temp_reg_33 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3801|   147k|                pi2_src_scratch += in_stride;
 3802|   147k|                m_temp_reg_34 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3803|   147k|                pi2_src_scratch += in_stride;
 3804|   147k|                m_temp_reg_35 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3805|   147k|                pi2_src_scratch += in_stride;
 3806|   147k|                m_temp_reg_36 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3807|   147k|                pi2_src_scratch += in_stride;
 3808|   147k|                m_temp_reg_37 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3809|   147k|                pi2_src_scratch += 8;
 3810|       |
 3811|   147k|                m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3812|   147k|                pi2_src_scratch -= in_stride;
 3813|   147k|                m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3814|   147k|                pi2_src_scratch -= in_stride;
 3815|   147k|                m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3816|   147k|                pi2_src_scratch -= in_stride;
 3817|   147k|                m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3818|   147k|                pi2_src_scratch -= in_stride;
 3819|   147k|                m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3820|   147k|                pi2_src_scratch -= in_stride;
 3821|   147k|                m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3822|   147k|                pi2_src_scratch -= in_stride;
 3823|   147k|                m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3824|   147k|                pi2_src_scratch -= in_stride;
 3825|   147k|                m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3826|   147k|                pi2_src_scratch += 8;
 3827|       |
 3828|       |
 3829|   147k|                m_temp_reg_40 = _mm_unpacklo_epi16(m_temp_reg_30, m_temp_reg_31);
 3830|   147k|                m_temp_reg_41 = _mm_unpackhi_epi16(m_temp_reg_31, m_temp_reg_30);
 3831|       |
 3832|   147k|                m_temp_reg_42 = _mm_unpacklo_epi16(m_temp_reg_32, m_temp_reg_33);
 3833|   147k|                m_temp_reg_43 = _mm_unpackhi_epi16(m_temp_reg_33, m_temp_reg_32);
 3834|       |
 3835|   147k|                m_temp_reg_44 = _mm_unpacklo_epi16(m_temp_reg_34, m_temp_reg_35);
 3836|   147k|                m_temp_reg_45 = _mm_unpackhi_epi16(m_temp_reg_35, m_temp_reg_34);
 3837|       |
 3838|   147k|                m_temp_reg_46 = _mm_unpacklo_epi16(m_temp_reg_36, m_temp_reg_37);
 3839|   147k|                m_temp_reg_47 = _mm_unpackhi_epi16(m_temp_reg_37, m_temp_reg_36);
 3840|       |
 3841|   147k|                m_temp_reg_80 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 3842|   147k|                m_temp_reg_81 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_70);
 3843|       |
 3844|   147k|                m_temp_reg_82 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73);
 3845|   147k|                m_temp_reg_83 = _mm_unpackhi_epi16(m_temp_reg_73, m_temp_reg_72);
 3846|       |
 3847|   147k|                m_temp_reg_84 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75);
 3848|   147k|                m_temp_reg_85 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_74);
 3849|       |
 3850|   147k|                m_temp_reg_86 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77);
 3851|   147k|                m_temp_reg_87 = _mm_unpackhi_epi16(m_temp_reg_77, m_temp_reg_76);
 3852|       |
 3853|       |                /****************/
 3854|       |
 3855|   147k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_40, m_temp_reg_42);
 3856|   147k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_40, m_temp_reg_42);
 3857|       |
 3858|   147k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_44, m_temp_reg_46);
 3859|   147k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_44, m_temp_reg_46);
 3860|       |
 3861|   147k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_80, m_temp_reg_82);
 3862|   147k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_80, m_temp_reg_82);
 3863|       |
 3864|   147k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_84, m_temp_reg_86);
 3865|   147k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_84, m_temp_reg_86);
 3866|       |
 3867|   147k|                m_temp_reg_90 = _mm_unpacklo_epi32(m_temp_reg_43, m_temp_reg_41);
 3868|   147k|                m_temp_reg_91 = _mm_unpackhi_epi32(m_temp_reg_43, m_temp_reg_41);
 3869|       |
 3870|   147k|                m_temp_reg_92 = _mm_unpacklo_epi32(m_temp_reg_47, m_temp_reg_45);
 3871|   147k|                m_temp_reg_93 = _mm_unpackhi_epi32(m_temp_reg_47, m_temp_reg_45);
 3872|       |
 3873|   147k|                m_temp_reg_94 = _mm_unpacklo_epi32(m_temp_reg_83, m_temp_reg_81);
 3874|   147k|                m_temp_reg_95 = _mm_unpackhi_epi32(m_temp_reg_83, m_temp_reg_81);
 3875|       |
 3876|   147k|                m_temp_reg_96 = _mm_unpacklo_epi32(m_temp_reg_87, m_temp_reg_85);
 3877|   147k|                m_temp_reg_97 = _mm_unpackhi_epi32(m_temp_reg_87, m_temp_reg_85);
 3878|       |
 3879|       |                /******************/
 3880|       |
 3881|   147k|                m_temp_reg_30 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_2);
 3882|   147k|                m_temp_reg_31 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_2);
 3883|       |
 3884|   147k|                m_temp_reg_32 = _mm_unpacklo_epi64(m_temp_reg_92, m_temp_reg_90);
 3885|   147k|                m_temp_reg_33 = _mm_unpackhi_epi64(m_temp_reg_92, m_temp_reg_90);
 3886|       |
 3887|   147k|                m_temp_reg_34 = _mm_unpacklo_epi64(m_temp_reg_4, m_temp_reg_6);
 3888|   147k|                m_temp_reg_35 = _mm_unpackhi_epi64(m_temp_reg_4, m_temp_reg_6);
 3889|       |
 3890|   147k|                m_temp_reg_36 = _mm_unpacklo_epi64(m_temp_reg_96, m_temp_reg_94);
 3891|   147k|                m_temp_reg_37 = _mm_unpackhi_epi64(m_temp_reg_96, m_temp_reg_94);
 3892|       |
 3893|   147k|                m_temp_reg_80 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_3);
 3894|   147k|                m_temp_reg_81 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_3);
 3895|       |
 3896|   147k|                m_temp_reg_82 = _mm_unpacklo_epi64(m_temp_reg_93, m_temp_reg_91);
 3897|   147k|                m_temp_reg_83 = _mm_unpackhi_epi64(m_temp_reg_93, m_temp_reg_91);
 3898|       |
 3899|   147k|                m_temp_reg_84 = _mm_unpacklo_epi64(m_temp_reg_5, m_temp_reg_7);
 3900|   147k|                m_temp_reg_85 = _mm_unpackhi_epi64(m_temp_reg_5, m_temp_reg_7);
 3901|       |
 3902|   147k|                m_temp_reg_86 = _mm_unpacklo_epi64(m_temp_reg_97, m_temp_reg_95);
 3903|   147k|                m_temp_reg_87 = _mm_unpackhi_epi64(m_temp_reg_97, m_temp_reg_95);
 3904|       |
 3905|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size), m_temp_reg_30);
 3906|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 8), m_temp_reg_34);
 3907|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 16), m_temp_reg_36);
 3908|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 24), m_temp_reg_32);
 3909|       |
 3910|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size), m_temp_reg_31);
 3911|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 8), m_temp_reg_35);
 3912|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 16), m_temp_reg_37);
 3913|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 24), m_temp_reg_33);
 3914|       |
 3915|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size), m_temp_reg_80);
 3916|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 8), m_temp_reg_84);
 3917|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 16), m_temp_reg_86);
 3918|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 24), m_temp_reg_82);
 3919|       |
 3920|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size), m_temp_reg_81);
 3921|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 8), m_temp_reg_85);
 3922|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 16), m_temp_reg_87);
 3923|   147k|                _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 24), m_temp_reg_83);
 3924|       |
 3925|   147k|                pi2_dst_scratch += 4 * trans_size;
 3926|   147k|            }
 3927|  73.7k|        }
 3928|  73.7k|        pi2_src += 8;
 3929|       |//      pi2_dequant_coeff +=8;
 3930|  73.7k|        pi2_tmp += 8 * trans_size;
 3931|  73.7k|        zero_cols = zero_cols >> 1;
 3932|  73.7k|    }
 3933|       |
 3934|  46.3k|    if(trans_size_stg1 != TRANS_SIZE_32)
  ------------------
  |  |  432|  46.3k|#define TRANS_SIZE_32 32
  ------------------
  |  Branch (3934:8): [True: 37.3k, False: 9.00k]
  ------------------
 3935|  37.3k|    {
 3936|  37.3k|        m_temp_reg_10 = _mm_setzero_si128();
 3937|       |
 3938|   149k|        for(i = trans_size_stg1; i < 32; i += 8)
  ------------------
  |  Branch (3938:34): [True: 111k, False: 37.3k]
  ------------------
 3939|   111k|        {
 3940|   111k|            WORD16 *pi2_dst_scratch = pi2_tmp;
 3941|       |
 3942|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size), m_temp_reg_10);
 3943|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 8), m_temp_reg_10);
 3944|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 16), m_temp_reg_10);
 3945|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 24), m_temp_reg_10);
 3946|       |
 3947|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size), m_temp_reg_10);
 3948|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 8), m_temp_reg_10);
 3949|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 16), m_temp_reg_10);
 3950|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 24), m_temp_reg_10);
 3951|       |
 3952|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size), m_temp_reg_10);
 3953|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 8), m_temp_reg_10);
 3954|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 16), m_temp_reg_10);
 3955|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 24), m_temp_reg_10);
 3956|       |
 3957|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size), m_temp_reg_10);
 3958|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 8), m_temp_reg_10);
 3959|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 16), m_temp_reg_10);
 3960|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 24), m_temp_reg_10);
 3961|       |
 3962|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size), m_temp_reg_10);
 3963|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size + 8), m_temp_reg_10);
 3964|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size + 16), m_temp_reg_10);
 3965|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size + 24), m_temp_reg_10);
 3966|       |
 3967|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size), m_temp_reg_10);
 3968|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size + 8), m_temp_reg_10);
 3969|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size + 16), m_temp_reg_10);
 3970|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size + 24), m_temp_reg_10);
 3971|       |
 3972|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size), m_temp_reg_10);
 3973|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size + 8), m_temp_reg_10);
 3974|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size + 16), m_temp_reg_10);
 3975|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size + 24), m_temp_reg_10);
 3976|       |
 3977|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size), m_temp_reg_10);
 3978|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size + 8), m_temp_reg_10);
 3979|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size + 16), m_temp_reg_10);
 3980|   111k|            _mm_storeu_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size + 24), m_temp_reg_10);
 3981|       |
 3982|   111k|            pi2_tmp += 8 * trans_size;
 3983|   111k|        }
 3984|  37.3k|    }
 3985|       |
 3986|  46.3k|    pi2_tmp = pi2_tmp_orig;
 3987|       |
 3988|       |    /* Inverse Transform 2nd stage */
 3989|       |
 3990|       |
 3991|   416k|    for(j = 0; j < trans_size; j += 4)
  ------------------
  |  Branch (3991:16): [True: 369k, False: 46.3k]
  ------------------
 3992|   369k|    {
 3993|   369k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   369k|#define IT_SHIFT_STAGE_2 12
  ------------------
 3994|       |
 3995|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 3996|   369k|        if(zero_last28_rows_stg2)
  ------------------
  |  Branch (3996:12): [True: 168k, False: 201k]
  ------------------
 3997|   168k|        {
 3998|   168k|            {
 3999|       |
 4000|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 4001|   168k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87
 4002|   168k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80
 4003|   168k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70
 4004|   168k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57
 4005|   168k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43
 4006|   168k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25
 4007|   168k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //9
 4008|       |
 4009|   168k|                m_temp_reg_10 = _mm_loadu_si128((__m128i *)&pi2_tmp[2 * trans_size]);
 4010|       |
 4011|   168k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_10, all_zero_reg);
 4012|       |
 4013|       |                /* eo0[0-3] */
 4014|   168k|                {
 4015|   168k|                    m_temp_reg_90 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4016|       |
 4017|   168k|                }
 4018|       |                /* eo1[0-3] */
 4019|   168k|                {
 4020|   168k|                    m_temp_reg_91 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
 4021|       |
 4022|   168k|                }
 4023|       |                /* eo2[0-3] */
 4024|   168k|                {
 4025|   168k|                    m_temp_reg_92 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 4026|   168k|                }
 4027|       |
 4028|       |                /* eo3[0-3] */
 4029|   168k|                {
 4030|   168k|                    m_temp_reg_93 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
 4031|   168k|                }
 4032|       |                /* eo4[0-3] */
 4033|   168k|                {
 4034|   168k|                    m_temp_reg_94 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 4035|   168k|                }
 4036|       |
 4037|       |                /* eo5[0-3] */
 4038|   168k|                {
 4039|   168k|                    m_temp_reg_95 = _mm_madd_epi16(m_temp_reg_10, m_coeff6);
 4040|   168k|                }
 4041|       |
 4042|       |                /* eo6[0-3] */
 4043|   168k|                {
 4044|   168k|                    m_temp_reg_96 = _mm_madd_epi16(m_temp_reg_10, m_coeff7);
 4045|   168k|                }
 4046|       |                /* eo7[0-3] */
 4047|   168k|                {
 4048|   168k|                    m_temp_reg_97 = _mm_madd_epi16(m_temp_reg_10, m_coeff8);
 4049|   168k|                }
 4050|   168k|            }
 4051|       |
 4052|   168k|            m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64
 4053|       |
 4054|   168k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[0 * trans_size]);
 4055|       |
 4056|   168k|            m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
 4057|       |
 4058|   168k|            m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4059|       |
 4060|   168k|            m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4061|       |
 4062|       |            /* e[]*/
 4063|       |
 4064|   168k|            temp1 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_90);  /* ee[0] */
 4065|   168k|            temp2 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_90);  /* ee[15] */
 4066|       |
 4067|   168k|            temp3 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_91);  /* ee[1] */
 4068|   168k|            temp4 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_91);  /* ee[14] */
 4069|       |
 4070|   168k|            temp5 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_92);  /* ee[2] */
 4071|   168k|            temp6 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_92);  /* ee[13] */
 4072|       |
 4073|   168k|            temp7 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_93);  /* ee[3] */
 4074|   168k|            temp8 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_93);  /* ee[12] */
 4075|       |
 4076|   168k|            m_temp_reg_90 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_94);  /* ee[4] */
 4077|   168k|            m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_94);  /* ee[11] */
 4078|       |
 4079|   168k|            m_temp_reg_92 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_95);  /* ee[5] */
 4080|   168k|            m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_95);  /* ee[10] */
 4081|       |
 4082|   168k|            m_temp_reg_94 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_96);  /* ee[6] */
 4083|   168k|            m_temp_reg_95 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_96);  /* ee[9] */
 4084|       |
 4085|   168k|            m_temp_reg_96 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_97);  /* ee[7] */
 4086|   168k|            m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_97);  /* ee[8] */
 4087|       |
 4088|       |            /*o[k]*/
 4089|   168k|            {
 4090|       |
 4091|   168k|                WORD16 *pi2_dst_scratch = temp_ptr;
 4092|   168k|                WORD32 out_stride = 8;
 4093|       |
 4094|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 4095|       |
 4096|   168k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[trans_size]);
 4097|   168k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)&pi2_tmp[3 * trans_size]);
 4098|       |
 4099|   168k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 4100|       |
 4101|       |
 4102|       |                /* o0[0-3] */
 4103|   168k|                {
 4104|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4105|       |
 4106|   168k|                    m_temp_reg_31 = _mm_sub_epi32(temp1, m_temp_reg_20);
 4107|   168k|                    m_temp_reg_30 = _mm_add_epi32(temp1, m_temp_reg_20);
 4108|       |
 4109|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4110|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4111|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4112|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4113|       |
 4114|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4115|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4116|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4117|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4118|       |
 4119|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4120|       |
 4121|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4122|   168k|                    pi2_dst_scratch += out_stride;
 4123|       |
 4124|   168k|                }
 4125|       |
 4126|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 4127|       |
 4128|       |                /* o1[0-3] */
 4129|   168k|                {
 4130|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4131|       |
 4132|   168k|                    m_temp_reg_31 = _mm_sub_epi32(temp3, m_temp_reg_20);
 4133|   168k|                    m_temp_reg_30 = _mm_add_epi32(temp3, m_temp_reg_20);
 4134|       |
 4135|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4136|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4137|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4138|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4139|       |
 4140|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4141|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4142|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4143|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4144|       |
 4145|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4146|       |
 4147|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4148|   168k|                    pi2_dst_scratch += out_stride;
 4149|       |
 4150|   168k|                }
 4151|       |
 4152|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 4153|       |
 4154|       |                /* o2[0-3] */
 4155|   168k|                {
 4156|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4157|       |
 4158|   168k|                    m_temp_reg_31 = _mm_sub_epi32(temp5, m_temp_reg_20);
 4159|   168k|                    m_temp_reg_30 = _mm_add_epi32(temp5, m_temp_reg_20);
 4160|       |
 4161|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4162|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4163|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4164|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4165|       |
 4166|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4167|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4168|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4169|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4170|       |
 4171|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4172|       |
 4173|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4174|   168k|                    pi2_dst_scratch += out_stride;
 4175|       |
 4176|   168k|                }
 4177|       |
 4178|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 4179|       |
 4180|       |                /* o3[0-3] */
 4181|   168k|                {
 4182|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4183|       |
 4184|   168k|                    m_temp_reg_31 = _mm_sub_epi32(temp7, m_temp_reg_20);
 4185|   168k|                    m_temp_reg_30 = _mm_add_epi32(temp7, m_temp_reg_20);
 4186|       |
 4187|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4188|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4189|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4190|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4191|       |
 4192|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4193|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4194|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4195|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4196|       |
 4197|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4198|       |
 4199|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4200|   168k|                    pi2_dst_scratch += out_stride;
 4201|       |
 4202|   168k|                }
 4203|       |
 4204|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 4205|       |
 4206|       |                /* o4[0-3] */
 4207|   168k|                {
 4208|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4209|       |
 4210|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_20);
 4211|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_20);
 4212|       |
 4213|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4214|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4215|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4216|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4217|       |
 4218|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4219|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4220|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4221|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4222|       |
 4223|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4224|       |
 4225|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4226|   168k|                    pi2_dst_scratch += out_stride;
 4227|       |
 4228|   168k|                }
 4229|       |
 4230|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 4231|       |
 4232|       |                /* o5[0-3] */
 4233|   168k|                {
 4234|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4235|       |
 4236|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_20);
 4237|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_20);
 4238|       |
 4239|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4240|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4241|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4242|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4243|       |
 4244|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4245|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4246|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4247|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4248|       |
 4249|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4250|       |
 4251|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4252|   168k|                    pi2_dst_scratch += out_stride;
 4253|       |
 4254|   168k|                }
 4255|       |
 4256|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 4257|       |
 4258|       |                /* o6[0-3] */
 4259|   168k|                {
 4260|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4261|       |
 4262|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_20);
 4263|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_20);
 4264|       |
 4265|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4266|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4267|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4268|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4269|       |
 4270|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4271|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4272|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4273|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4274|       |
 4275|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4276|       |
 4277|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4278|   168k|                    pi2_dst_scratch += out_stride;
 4279|       |
 4280|   168k|                }
 4281|       |
 4282|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 4283|       |
 4284|       |                /* o7[0-3] */
 4285|   168k|                {
 4286|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4287|       |
 4288|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_20);
 4289|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_20);
 4290|       |
 4291|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4292|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4293|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4294|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4295|       |
 4296|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4297|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4298|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4299|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4300|       |
 4301|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4302|       |
 4303|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4304|   168k|                    pi2_dst_scratch += 8;
 4305|       |
 4306|   168k|                }
 4307|       |
 4308|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 4309|       |
 4310|       |                /* o8[0-3] */
 4311|   168k|                {
 4312|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4313|       |
 4314|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_20);
 4315|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_20);
 4316|       |
 4317|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4318|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4319|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4320|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4321|       |
 4322|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4323|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4324|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4325|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4326|       |
 4327|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4328|       |
 4329|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4330|   168k|                    pi2_dst_scratch += out_stride;
 4331|   168k|                }
 4332|       |
 4333|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 4334|       |
 4335|       |                /* o9[0-3] */
 4336|   168k|                {
 4337|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4338|       |
 4339|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_20);
 4340|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_20);
 4341|       |
 4342|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4343|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4344|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4345|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4346|       |
 4347|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4348|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4349|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4350|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4351|       |
 4352|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4353|       |
 4354|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4355|   168k|                    pi2_dst_scratch += out_stride;
 4356|       |
 4357|   168k|                }
 4358|       |
 4359|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 4360|       |
 4361|       |                /* o10[0-3] */
 4362|   168k|                {
 4363|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4364|       |
 4365|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_20);
 4366|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_20);
 4367|       |
 4368|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4369|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4370|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4371|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4372|       |
 4373|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4374|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4375|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4376|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4377|       |
 4378|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4379|       |
 4380|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4381|   168k|                    pi2_dst_scratch += out_stride;
 4382|   168k|                }
 4383|       |
 4384|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 4385|       |
 4386|       |                /* o11[0-3] */
 4387|   168k|                {
 4388|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4389|       |
 4390|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_20);
 4391|   168k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_20);
 4392|       |
 4393|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4394|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4395|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4396|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4397|       |
 4398|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4399|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4400|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4401|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4402|       |
 4403|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4404|       |
 4405|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4406|   168k|                    pi2_dst_scratch += out_stride;
 4407|       |
 4408|   168k|                }
 4409|       |
 4410|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 4411|       |
 4412|       |                /* o12[0-3] */
 4413|   168k|                {
 4414|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4415|       |
 4416|   168k|                    m_temp_reg_31 = _mm_add_epi32(temp8, m_temp_reg_20);
 4417|   168k|                    m_temp_reg_30 = _mm_sub_epi32(temp8, m_temp_reg_20);
 4418|       |
 4419|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4420|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4421|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4422|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4423|       |
 4424|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4425|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4426|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4427|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4428|       |
 4429|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4430|       |
 4431|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4432|   168k|                    pi2_dst_scratch += out_stride;
 4433|       |
 4434|   168k|                }
 4435|       |
 4436|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 4437|       |
 4438|       |                /* o13[0-3] */
 4439|   168k|                {
 4440|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4441|       |
 4442|   168k|                    m_temp_reg_31 = _mm_add_epi32(temp6, m_temp_reg_20);
 4443|   168k|                    m_temp_reg_30 = _mm_sub_epi32(temp6, m_temp_reg_20);
 4444|       |
 4445|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4446|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4447|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4448|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4449|       |
 4450|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4451|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4452|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4453|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4454|       |
 4455|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4456|       |
 4457|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4458|   168k|                    pi2_dst_scratch += out_stride;
 4459|   168k|                }
 4460|       |
 4461|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 4462|       |
 4463|       |                /* o14[0-3] */
 4464|   168k|                {
 4465|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4466|       |
 4467|   168k|                    m_temp_reg_31 = _mm_add_epi32(temp4, m_temp_reg_20);
 4468|   168k|                    m_temp_reg_30 = _mm_sub_epi32(temp4, m_temp_reg_20);
 4469|       |
 4470|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4471|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4472|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4473|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4474|       |
 4475|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4476|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4477|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4478|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4479|       |
 4480|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4481|       |
 4482|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4483|   168k|                    pi2_dst_scratch += out_stride;
 4484|       |
 4485|   168k|                }
 4486|       |
 4487|   168k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 4488|       |
 4489|       |                /* o15[0-3] */
 4490|   168k|                {
 4491|   168k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4492|       |
 4493|   168k|                    m_temp_reg_31 = _mm_add_epi32(temp2, m_temp_reg_20);
 4494|   168k|                    m_temp_reg_30 = _mm_sub_epi32(temp2, m_temp_reg_20);
 4495|       |
 4496|   168k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4497|   168k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4498|   168k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4499|   168k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4500|       |
 4501|   168k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4502|   168k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4503|   168k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4504|   168k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4505|       |
 4506|   168k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4507|       |
 4508|   168k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4509|   168k|                    pi2_dst_scratch += 8;
 4510|   168k|                }
 4511|       |
 4512|   168k|            }
 4513|       |
 4514|   168k|        }
 4515|   201k|        else if(zero_last24_rows_stg2)
  ------------------
  |  Branch (4515:17): [True: 130k, False: 71.5k]
  ------------------
 4516|   130k|        {
 4517|       |            /* eo */
 4518|   130k|            {
 4519|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 4520|       |
 4521|   130k|                m_temp_reg_10 = _mm_loadu_si128((__m128i *)&pi2_tmp[2 * trans_size]);
 4522|   130k|                m_temp_reg_11 = _mm_loadu_si128((__m128i *)&pi2_tmp[6 * trans_size]);
 4523|       |
 4524|   130k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_10, m_temp_reg_11);
 4525|       |
 4526|       |
 4527|       |                /* eo0[0-3] */
 4528|   130k|                {
 4529|   130k|                    m_temp_reg_90 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4530|       |
 4531|   130k|                }
 4532|       |
 4533|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
 4534|       |
 4535|       |                /* eo1[0-3] */
 4536|   130k|                {
 4537|   130k|                    m_temp_reg_91 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4538|       |
 4539|   130k|                }
 4540|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
 4541|       |
 4542|       |                /* eo2[0-3] */
 4543|   130k|                {
 4544|   130k|                    m_temp_reg_92 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4545|       |
 4546|   130k|                }
 4547|       |
 4548|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
 4549|       |
 4550|       |                /* eo3[0-3] */
 4551|   130k|                {
 4552|       |
 4553|   130k|                    m_temp_reg_93 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4554|       |
 4555|   130k|                }
 4556|       |
 4557|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
 4558|       |
 4559|       |                /* eo4[0-3] */
 4560|   130k|                {
 4561|   130k|                    m_temp_reg_94 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4562|       |
 4563|   130k|                }
 4564|       |
 4565|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
 4566|       |
 4567|       |                /* eo5[0-3] */
 4568|   130k|                {
 4569|   130k|                    m_temp_reg_95 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4570|   130k|                }
 4571|       |
 4572|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
 4573|       |                /* eo6[0-3] */
 4574|   130k|                {
 4575|   130k|                    m_temp_reg_96 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4576|   130k|                }
 4577|       |
 4578|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 4579|       |                /* eo7[0-3] */
 4580|   130k|                {
 4581|   130k|                    m_temp_reg_97 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4582|       |
 4583|   130k|                }
 4584|       |
 4585|   130k|            }
 4586|       |
 4587|       |            /* eeo */
 4588|   130k|            {
 4589|       |
 4590|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
 4591|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75
 4592|   130k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18
 4593|   130k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[8][0]); //50
 4594|       |
 4595|   130k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[4 * trans_size]);
 4596|       |
 4597|   130k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, all_zero_reg);
 4598|       |
 4599|       |                /* eeo0[0-3] */
 4600|   130k|                {
 4601|   130k|                    temp1 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4602|       |
 4603|   130k|                }
 4604|       |
 4605|       |                /* eeo1[0-3] */
 4606|   130k|                {
 4607|   130k|                    temp2 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
 4608|       |
 4609|   130k|                }
 4610|       |
 4611|       |                /* eo2[0-3] */
 4612|   130k|                {
 4613|   130k|                    temp3 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
 4614|       |
 4615|   130k|                }
 4616|       |
 4617|       |
 4618|       |                /* eo3[0-3] */
 4619|   130k|                {
 4620|   130k|                    temp4 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 4621|       |
 4622|   130k|                }
 4623|       |
 4624|   130k|            }
 4625|       |
 4626|   130k|            m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83
 4627|   130k|            m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36
 4628|   130k|            m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64
 4629|       |
 4630|   130k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[0 * trans_size]);
 4631|       |
 4632|       |            //m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_70);
 4633|   130k|            m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
 4634|       |
 4635|   130k|            m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4636|   130k|            m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4637|       |
 4638|   130k|            m_temp_reg_70 = _mm_add_epi32(m_temp_reg_14, temp1);  /* ee[0] */
 4639|   130k|            m_temp_reg_71 = _mm_sub_epi32(m_temp_reg_14, temp1);  /* ee[7] */
 4640|       |
 4641|   130k|            m_temp_reg_72 = _mm_add_epi32(m_temp_reg_16, temp2);  /* ee[1] */
 4642|   130k|            m_temp_reg_73 = _mm_sub_epi32(m_temp_reg_16, temp2);  /* ee[6] */
 4643|       |
 4644|   130k|            m_temp_reg_74 = _mm_add_epi32(m_temp_reg_16, temp3);  /* ee[2] */
 4645|   130k|            m_temp_reg_75 = _mm_sub_epi32(m_temp_reg_16, temp3);  /* ee[5] */
 4646|       |
 4647|   130k|            m_temp_reg_76 = _mm_add_epi32(m_temp_reg_14, temp4);  /* ee[3] */
 4648|   130k|            m_temp_reg_77 = _mm_sub_epi32(m_temp_reg_14, temp4);  /* ee[4] */
 4649|       |
 4650|       |            /* e[]*/
 4651|       |
 4652|   130k|            temp1 = _mm_add_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[0] */
 4653|   130k|            temp2 = _mm_sub_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[15] */
 4654|       |
 4655|   130k|            temp3 = _mm_add_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[1] */
 4656|   130k|            temp4 = _mm_sub_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[14] */
 4657|       |
 4658|   130k|            temp5 = _mm_add_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[2] */
 4659|   130k|            temp6 = _mm_sub_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[13] */
 4660|       |
 4661|   130k|            temp7 = _mm_add_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[3] */
 4662|   130k|            temp8 = _mm_sub_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[12] */
 4663|       |
 4664|   130k|            m_temp_reg_90 = _mm_add_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[4] */
 4665|   130k|            m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[11] */
 4666|       |
 4667|   130k|            m_temp_reg_92 = _mm_add_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[5] */
 4668|   130k|            m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[10] */
 4669|       |
 4670|   130k|            m_temp_reg_94 = _mm_add_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[6] */
 4671|   130k|            m_temp_reg_95 = _mm_sub_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[9] */
 4672|       |
 4673|   130k|            m_temp_reg_96 = _mm_add_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[7] */
 4674|   130k|            m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[8] */
 4675|       |
 4676|       |            /*o[k] */
 4677|   130k|            {
 4678|       |
 4679|   130k|                WORD16 *pi2_dst_scratch = temp_ptr;
 4680|   130k|                WORD32 out_stride = 8;
 4681|       |
 4682|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 4683|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 4684|       |
 4685|   130k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[trans_size]);
 4686|   130k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)&pi2_tmp[3 * trans_size]);
 4687|   130k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[5 * trans_size]);
 4688|   130k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)&pi2_tmp[7 * trans_size]);
 4689|       |
 4690|   130k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 4691|   130k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73);
 4692|       |
 4693|       |                /* o0[0-3] */
 4694|   130k|                {
 4695|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4696|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4697|       |
 4698|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 4699|       |
 4700|   130k|                    m_temp_reg_31 = _mm_sub_epi32(temp1, m_temp_reg_20);
 4701|   130k|                    m_temp_reg_30 = _mm_add_epi32(temp1, m_temp_reg_20);
 4702|       |
 4703|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4704|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4705|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4706|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4707|       |
 4708|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4709|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4710|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4711|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4712|       |
 4713|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4714|       |
 4715|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4716|   130k|                    pi2_dst_scratch += out_stride;
 4717|       |
 4718|   130k|                }
 4719|       |
 4720|       |
 4721|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 4722|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 4723|       |
 4724|       |                /* o1[0-3] */
 4725|   130k|                {
 4726|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4727|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4728|       |
 4729|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 4730|       |
 4731|   130k|                    m_temp_reg_31 = _mm_sub_epi32(temp3, m_temp_reg_20);
 4732|   130k|                    m_temp_reg_30 = _mm_add_epi32(temp3, m_temp_reg_20);
 4733|       |
 4734|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4735|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4736|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4737|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4738|       |
 4739|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4740|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4741|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4742|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4743|       |
 4744|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4745|       |
 4746|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4747|   130k|                    pi2_dst_scratch += out_stride;
 4748|       |
 4749|   130k|                }
 4750|       |
 4751|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 4752|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 4753|       |
 4754|       |                /* o2[0-3] */
 4755|   130k|                {
 4756|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4757|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4758|       |
 4759|   130k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 4760|       |
 4761|   130k|                    m_temp_reg_31 = _mm_add_epi32(temp5, m_temp_reg_20);
 4762|   130k|                    m_temp_reg_30 = _mm_sub_epi32(temp5, m_temp_reg_20);
 4763|       |
 4764|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4765|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4766|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4767|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4768|       |
 4769|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4770|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4771|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4772|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4773|       |
 4774|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4775|       |
 4776|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4777|   130k|                    pi2_dst_scratch += out_stride;
 4778|       |
 4779|   130k|                }
 4780|       |
 4781|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 4782|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 4783|       |
 4784|       |                /* o3[0-3] */
 4785|   130k|                {
 4786|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4787|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4788|       |
 4789|   130k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 4790|       |
 4791|   130k|                    m_temp_reg_31 = _mm_add_epi32(temp7, m_temp_reg_20);
 4792|   130k|                    m_temp_reg_30 = _mm_sub_epi32(temp7, m_temp_reg_20);
 4793|       |
 4794|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4795|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4796|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4797|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4798|       |
 4799|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4800|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4801|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4802|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4803|       |
 4804|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4805|       |
 4806|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4807|   130k|                    pi2_dst_scratch += out_stride;
 4808|       |
 4809|   130k|                }
 4810|       |
 4811|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 4812|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 4813|       |
 4814|       |                /* o4[0-3] */
 4815|   130k|                {
 4816|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4817|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4818|       |
 4819|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4820|       |
 4821|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_20);
 4822|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_20);
 4823|       |
 4824|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4825|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4826|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4827|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4828|       |
 4829|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4830|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4831|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4832|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4833|       |
 4834|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4835|       |
 4836|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4837|   130k|                    pi2_dst_scratch += out_stride;
 4838|       |
 4839|   130k|                }
 4840|       |
 4841|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 4842|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 4843|       |
 4844|       |                /* o5[0-3] */
 4845|   130k|                {
 4846|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4847|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4848|       |
 4849|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4850|       |
 4851|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_20);
 4852|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_20);
 4853|       |
 4854|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4855|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4856|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4857|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4858|       |
 4859|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4860|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4861|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4862|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4863|       |
 4864|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4865|       |
 4866|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4867|   130k|                    pi2_dst_scratch += out_stride;
 4868|       |
 4869|   130k|                }
 4870|       |
 4871|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 4872|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 4873|       |
 4874|       |                /* o6[0-3] */
 4875|   130k|                {
 4876|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4877|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4878|       |
 4879|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4880|       |
 4881|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_20);
 4882|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_20);
 4883|       |
 4884|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4885|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4886|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4887|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4888|       |
 4889|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4890|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4891|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4892|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4893|       |
 4894|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4895|       |
 4896|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4897|   130k|                    pi2_dst_scratch += out_stride;
 4898|       |
 4899|   130k|                }
 4900|       |
 4901|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 4902|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 4903|       |
 4904|       |                /* o7[0-3] */
 4905|   130k|                {
 4906|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4907|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4908|       |
 4909|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4910|       |
 4911|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_20);
 4912|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_20);
 4913|       |
 4914|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4915|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4916|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4917|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4918|       |
 4919|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4920|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4921|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4922|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4923|       |
 4924|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4925|       |
 4926|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4927|   130k|                    pi2_dst_scratch += 8;
 4928|       |
 4929|   130k|                }
 4930|       |
 4931|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 4932|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 4933|       |
 4934|       |                /* o8[0-3] */
 4935|   130k|                {
 4936|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4937|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4938|       |
 4939|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4940|       |
 4941|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_20);
 4942|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_20);
 4943|       |
 4944|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4945|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4946|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4947|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4948|       |
 4949|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4950|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4951|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4952|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4953|       |
 4954|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4955|       |
 4956|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4957|   130k|                    pi2_dst_scratch += out_stride;
 4958|   130k|                }
 4959|       |
 4960|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 4961|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 4962|       |
 4963|       |                /* o9[0-3] */
 4964|   130k|                {
 4965|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4966|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4967|       |
 4968|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4969|       |
 4970|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_20);
 4971|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_20);
 4972|       |
 4973|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4974|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4975|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4976|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4977|       |
 4978|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4979|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4980|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4981|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4982|       |
 4983|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4984|       |
 4985|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4986|   130k|                    pi2_dst_scratch += out_stride;
 4987|   130k|                }
 4988|       |
 4989|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 4990|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 4991|       |
 4992|       |                /* o10[0-3] */
 4993|   130k|                {
 4994|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4995|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4996|       |
 4997|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4998|       |
 4999|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_20);
 5000|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_20);
 5001|       |
 5002|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5003|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5004|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5005|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5006|       |
 5007|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5008|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5009|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5010|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5011|       |
 5012|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5013|       |
 5014|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5015|   130k|                    pi2_dst_scratch += out_stride;
 5016|   130k|                }
 5017|       |
 5018|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 5019|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 5020|       |
 5021|       |                /* o11[0-3] */
 5022|   130k|                {
 5023|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5024|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5025|       |
 5026|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5027|       |
 5028|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_20);
 5029|   130k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_20);
 5030|       |
 5031|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5032|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5033|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5034|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5035|       |
 5036|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5037|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5038|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5039|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5040|       |
 5041|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5042|       |
 5043|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5044|   130k|                    pi2_dst_scratch += out_stride;
 5045|       |
 5046|   130k|                }
 5047|       |
 5048|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 5049|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 5050|       |
 5051|       |                /* o12[0-3] */
 5052|   130k|                {
 5053|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5054|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5055|       |
 5056|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5057|       |
 5058|   130k|                    m_temp_reg_31 = _mm_add_epi32(temp8, m_temp_reg_20);
 5059|   130k|                    m_temp_reg_30 = _mm_sub_epi32(temp8, m_temp_reg_20);
 5060|       |
 5061|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5062|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5063|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5064|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5065|       |
 5066|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5067|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5068|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5069|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5070|       |
 5071|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5072|       |
 5073|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5074|   130k|                    pi2_dst_scratch += out_stride;
 5075|       |
 5076|   130k|                }
 5077|       |
 5078|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 5079|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 5080|       |
 5081|       |                /* o13[0-3] */
 5082|   130k|                {
 5083|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5084|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5085|       |
 5086|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5087|       |
 5088|   130k|                    m_temp_reg_31 = _mm_add_epi32(temp6, m_temp_reg_20);
 5089|   130k|                    m_temp_reg_30 = _mm_sub_epi32(temp6, m_temp_reg_20);
 5090|       |
 5091|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5092|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5093|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5094|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5095|       |
 5096|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5097|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5098|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5099|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5100|       |
 5101|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5102|       |
 5103|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5104|   130k|                    pi2_dst_scratch += out_stride;
 5105|   130k|                }
 5106|       |
 5107|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 5108|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 5109|       |
 5110|       |                /* o14[0-3] */
 5111|   130k|                {
 5112|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5113|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5114|       |
 5115|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5116|       |
 5117|   130k|                    m_temp_reg_31 = _mm_add_epi32(temp4, m_temp_reg_20);
 5118|   130k|                    m_temp_reg_30 = _mm_sub_epi32(temp4, m_temp_reg_20);
 5119|       |
 5120|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5121|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5122|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5123|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5124|       |
 5125|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5126|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5127|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5128|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5129|       |
 5130|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5131|       |
 5132|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5133|   130k|                    pi2_dst_scratch += out_stride;
 5134|   130k|                }
 5135|       |
 5136|   130k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 5137|   130k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 5138|       |
 5139|       |                /* o15[0-3] */
 5140|   130k|                {
 5141|   130k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5142|   130k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5143|       |
 5144|   130k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5145|       |
 5146|   130k|                    m_temp_reg_31 = _mm_add_epi32(temp2, m_temp_reg_20);
 5147|   130k|                    m_temp_reg_30 = _mm_sub_epi32(temp2, m_temp_reg_20);
 5148|       |
 5149|   130k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5150|   130k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5151|   130k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5152|   130k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5153|       |
 5154|   130k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5155|   130k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5156|   130k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5157|   130k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5158|       |
 5159|   130k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5160|       |
 5161|   130k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5162|   130k|                    pi2_dst_scratch += 8;
 5163|   130k|                }
 5164|       |
 5165|   130k|            }
 5166|   130k|        }
 5167|  71.5k|        else
 5168|  71.5k|        {
 5169|       |            /* eo */
 5170|  71.5k|            {
 5171|       |
 5172|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 5173|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[1][0]); //80 70
 5174|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57 43
 5175|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25 9
 5176|       |
 5177|       |
 5178|  71.5k|                m_temp_reg_10 = _mm_loadu_si128((__m128i *)&pi2_tmp[2 * trans_size]);
 5179|  71.5k|                m_temp_reg_11 = _mm_loadu_si128((__m128i *)&pi2_tmp[6 * trans_size]);
 5180|  71.5k|                m_temp_reg_12 = _mm_loadu_si128((__m128i *)&pi2_tmp[10 * trans_size]);
 5181|  71.5k|                m_temp_reg_13 = _mm_loadu_si128((__m128i *)&pi2_tmp[14 * trans_size]);
 5182|  71.5k|                m_temp_reg_18 = _mm_loadu_si128((__m128i *)&pi2_tmp[18 * trans_size]);
 5183|  71.5k|                m_temp_reg_19 = _mm_loadu_si128((__m128i *)&pi2_tmp[22 * trans_size]);
 5184|  71.5k|                m_temp_reg_20 = _mm_loadu_si128((__m128i *)&pi2_tmp[26 * trans_size]);
 5185|  71.5k|                m_temp_reg_21 = _mm_loadu_si128((__m128i *)&pi2_tmp[30 * trans_size]);
 5186|       |
 5187|  71.5k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_10, m_temp_reg_11);
 5188|  71.5k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_12, m_temp_reg_13);
 5189|  71.5k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_18, m_temp_reg_19);
 5190|  71.5k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_21);
 5191|       |
 5192|       |                /* eo0[0-3] */
 5193|  71.5k|                {
 5194|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5195|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5196|       |
 5197|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5198|       |
 5199|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5200|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5201|       |
 5202|  71.5k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5203|       |
 5204|  71.5k|                    m_temp_reg_90 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5205|       |
 5206|  71.5k|                }
 5207|       |
 5208|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
 5209|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //0  -43
 5210|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80  90
 5211|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70  25
 5212|       |
 5213|       |                /* eo1[0-3] */
 5214|  71.5k|                {
 5215|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5216|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5217|       |
 5218|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5219|       |
 5220|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5221|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5222|       |
 5223|  71.5k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5224|       |
 5225|  71.5k|                    m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_32);
 5226|       |
 5227|  71.5k|                }
 5228|       |
 5229|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
 5230|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[9][0]); //70  87
 5231|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[10][0]); //-25  57
 5232|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[11][0]); //90  43
 5233|       |
 5234|       |                /* eo2[0-3] */
 5235|  71.5k|                {
 5236|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5237|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5238|       |
 5239|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 5240|       |
 5241|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5242|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5243|       |
 5244|  71.5k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5245|       |
 5246|  71.5k|                    m_temp_reg_92 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5247|       |
 5248|  71.5k|                }
 5249|       |
 5250|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
 5251|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[13][0]); //-87  9
 5252|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[14][0]); //90  25
 5253|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[15][0]); //80  57
 5254|       |
 5255|       |                /* eo3[0-3] */
 5256|  71.5k|                {
 5257|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5258|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5259|       |
 5260|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5261|       |
 5262|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5263|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5264|       |
 5265|  71.5k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_32, m_temp_reg_33);
 5266|       |
 5267|  71.5k|                    m_temp_reg_93 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5268|       |
 5269|  71.5k|                }
 5270|       |
 5271|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
 5272|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[17][0]); //-25  90
 5273|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[18][0]); //9  87
 5274|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43  70
 5275|       |
 5276|       |
 5277|       |                /* eo4[0-3] */
 5278|  71.5k|                {
 5279|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5280|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5281|       |
 5282|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5283|       |
 5284|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5285|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5286|       |
 5287|  71.5k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
 5288|       |
 5289|  71.5k|                    m_temp_reg_94 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5290|       |
 5291|  71.5k|                }
 5292|       |
 5293|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
 5294|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[21][0]); //57  25
 5295|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[22][0]); //-87  70
 5296|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[23][0]); //9  -80
 5297|       |
 5298|       |                /* eo5[0-3] */
 5299|  71.5k|                {
 5300|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5301|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5302|       |
 5303|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5304|       |
 5305|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5306|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5307|       |
 5308|  71.5k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5309|       |
 5310|  71.5k|                    m_temp_reg_95 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5311|  71.5k|                }
 5312|       |
 5313|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
 5314|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[25][0]); //90  -80
 5315|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[26][0]); //43  9
 5316|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[27][0]); //-57  87
 5317|       |
 5318|       |                /* eo6[0-3] */
 5319|  71.5k|                {
 5320|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5321|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5322|       |
 5323|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5324|       |
 5325|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5326|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5327|       |
 5328|  71.5k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5329|       |
 5330|  71.5k|                    m_temp_reg_96 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5331|       |
 5332|  71.5k|                }
 5333|       |
 5334|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 5335|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[29][0]); //43  -57
 5336|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[30][0]); //70  -80
 5337|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[31][0]); //87  -90
 5338|       |
 5339|       |                /* eo7[0-3] */
 5340|  71.5k|                {
 5341|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5342|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5343|       |
 5344|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5345|       |
 5346|  71.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5347|  71.5k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5348|       |
 5349|  71.5k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5350|       |
 5351|  71.5k|                    m_temp_reg_97 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5352|       |
 5353|       |
 5354|  71.5k|                }
 5355|       |
 5356|  71.5k|            }
 5357|       |
 5358|       |            /* eeo */
 5359|  71.5k|            {
 5360|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
 5361|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[5][0]); //50 18
 5362|       |
 5363|  71.5k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[4 * trans_size]);
 5364|  71.5k|                m_temp_reg_76 = _mm_loadu_si128((__m128i *)&pi2_tmp[12 * trans_size]);
 5365|  71.5k|                m_temp_reg_82 = _mm_loadu_si128((__m128i *)&pi2_tmp[20 * trans_size]);
 5366|  71.5k|                m_temp_reg_86 = _mm_loadu_si128((__m128i *)&pi2_tmp[28 * trans_size]);
 5367|       |
 5368|       |                /* eeo0[0-3] */
 5369|  71.5k|                {
 5370|       |
 5371|  71.5k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 5372|  71.5k|                    m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_86);
 5373|       |
 5374|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5375|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5376|       |
 5377|  71.5k|                    temp1 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5378|       |
 5379|  71.5k|                }
 5380|       |
 5381|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75 -18
 5382|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[7][0]); //89  50
 5383|       |
 5384|       |                /* eeo1[0-3] */
 5385|  71.5k|                {
 5386|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 5387|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 5388|       |
 5389|  71.5k|                    temp2 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 5390|       |
 5391|  71.5k|                }
 5392|       |
 5393|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[8][0]); //50 -89
 5394|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18  75
 5395|       |
 5396|       |                /* eo2[0-3] */
 5397|  71.5k|                {
 5398|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 5399|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 5400|       |
 5401|  71.5k|                    temp3 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5402|       |
 5403|  71.5k|                }
 5404|       |
 5405|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[10][0]); //18 -50
 5406|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[11][0]); //75  -89
 5407|       |
 5408|       |                /* eo3[0-3] */
 5409|  71.5k|                {
 5410|  71.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 5411|  71.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 5412|       |
 5413|  71.5k|                    temp4 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5414|       |
 5415|  71.5k|                }
 5416|       |
 5417|       |
 5418|  71.5k|            }
 5419|       |
 5420|  71.5k|            m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83 36
 5421|  71.5k|            m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36 -83
 5422|       |
 5423|  71.5k|            m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64 64
 5424|  71.5k|            m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[3][0]); //64 -64
 5425|       |
 5426|  71.5k|            m_temp_reg_74 = _mm_loadu_si128((__m128i *)&pi2_tmp[8 * trans_size]);
 5427|  71.5k|            m_temp_reg_84 = _mm_loadu_si128((__m128i *)&pi2_tmp[24 * trans_size]);
 5428|       |
 5429|  71.5k|            m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_84);
 5430|       |
 5431|  71.5k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[0 * trans_size]);
 5432|  71.5k|            m_temp_reg_80 = _mm_loadu_si128((__m128i *)&pi2_tmp[16 * trans_size]);
 5433|       |
 5434|  71.5k|            m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_80);
 5435|       |
 5436|  71.5k|            m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);  /* eeeo[0] */
 5437|  71.5k|            m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);  /* eeeo[1] */
 5438|       |
 5439|  71.5k|            m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);  /* eeee[0] */
 5440|  71.5k|            m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);  /* eeee[1] */
 5441|       |
 5442|       |/* eeeo[0]= m_temp_reg_20  */
 5443|       |/* eeeo[1]= m_temp_reg_21  */
 5444|       |/* eeee[0]= m_temp_reg_22  */
 5445|       |/* eeee[1]= m_temp_reg_23  */
 5446|       |
 5447|       |            /* eee[0] = eeee[0] + eeeo[0]; */
 5448|  71.5k|            m_temp_reg_40 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[0] */
 5449|       |
 5450|       |            /* eee[3] = eeee[0] - eeeo[0]; */
 5451|  71.5k|            m_temp_reg_43 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[1] */
 5452|       |
 5453|       |            /* eee[2] = eeee[1] - eeeo[1]; */
 5454|  71.5k|            m_temp_reg_42 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[1] */
 5455|       |
 5456|       |            /* eee[1] = eeee[1] + eeeo[1];*/
 5457|  71.5k|            m_temp_reg_41 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[0] */
 5458|       |
 5459|  71.5k|            m_temp_reg_70 = _mm_add_epi32(m_temp_reg_40, temp1);  /* ee[0] */
 5460|  71.5k|            m_temp_reg_71 = _mm_sub_epi32(m_temp_reg_40, temp1);  /* ee[7] */
 5461|       |
 5462|  71.5k|            m_temp_reg_72 = _mm_add_epi32(m_temp_reg_41, temp2);  /* ee[1] */
 5463|  71.5k|            m_temp_reg_73 = _mm_sub_epi32(m_temp_reg_41, temp2);  /* ee[6] */
 5464|       |
 5465|  71.5k|            m_temp_reg_74 = _mm_add_epi32(m_temp_reg_42, temp3);  /* ee[2] */
 5466|  71.5k|            m_temp_reg_75 = _mm_sub_epi32(m_temp_reg_42, temp3);  /* ee[5] */
 5467|       |
 5468|  71.5k|            m_temp_reg_76 = _mm_add_epi32(m_temp_reg_43, temp4);  /* ee[3] */
 5469|  71.5k|            m_temp_reg_77 = _mm_sub_epi32(m_temp_reg_43, temp4);  /* ee[4] */
 5470|       |
 5471|       |/* e[]*/
 5472|       |
 5473|  71.5k|            temp1 = _mm_add_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[0] */
 5474|  71.5k|            temp2 = _mm_sub_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[15] */
 5475|       |
 5476|  71.5k|            temp3 = _mm_add_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[1] */
 5477|  71.5k|            temp4 = _mm_sub_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[14] */
 5478|       |
 5479|  71.5k|            temp5 = _mm_add_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[2] */
 5480|  71.5k|            temp6 = _mm_sub_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[13] */
 5481|       |
 5482|  71.5k|            temp7 = _mm_add_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[3] */
 5483|  71.5k|            temp8 = _mm_sub_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[12] */
 5484|       |
 5485|  71.5k|            m_temp_reg_90 = _mm_add_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[4] */
 5486|  71.5k|            m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[11] */
 5487|       |
 5488|  71.5k|            m_temp_reg_92 = _mm_add_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[5] */
 5489|  71.5k|            m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[10] */
 5490|       |
 5491|  71.5k|            m_temp_reg_94 = _mm_add_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[6] */
 5492|  71.5k|            m_temp_reg_95 = _mm_sub_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[9] */
 5493|       |
 5494|  71.5k|            m_temp_reg_96 = _mm_add_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[7] */
 5495|  71.5k|            m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[8] */
 5496|       |
 5497|       |/*o[k] */
 5498|  71.5k|            {
 5499|       |
 5500|  71.5k|                WORD16 *pi2_dst_scratch = temp_ptr;
 5501|  71.5k|                WORD32 out_stride = 8;
 5502|       |
 5503|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 5504|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 5505|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[2][0]);
 5506|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[3][0]);
 5507|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[4][0]);
 5508|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[5][0]);
 5509|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[6][0]);
 5510|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[7][0]);
 5511|       |
 5512|       |
 5513|  71.5k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[trans_size]);
 5514|  71.5k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)&pi2_tmp[3 * trans_size]);
 5515|  71.5k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[5 * trans_size]);
 5516|  71.5k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)&pi2_tmp[7 * trans_size]);
 5517|  71.5k|                m_temp_reg_74 = _mm_loadu_si128((__m128i *)&pi2_tmp[9 * trans_size]);
 5518|  71.5k|                m_temp_reg_75 = _mm_loadu_si128((__m128i *)&pi2_tmp[11 * trans_size]);
 5519|  71.5k|                m_temp_reg_76 = _mm_loadu_si128((__m128i *)&pi2_tmp[13 * trans_size]);
 5520|  71.5k|                m_temp_reg_77 = _mm_loadu_si128((__m128i *)&pi2_tmp[15 * trans_size]);
 5521|       |
 5522|  71.5k|                m_temp_reg_80 = _mm_loadu_si128((__m128i *)&pi2_tmp[17 * trans_size]);
 5523|  71.5k|                m_temp_reg_81 = _mm_loadu_si128((__m128i *)&pi2_tmp[19 * trans_size]);
 5524|  71.5k|                m_temp_reg_82 = _mm_loadu_si128((__m128i *)&pi2_tmp[21 * trans_size]);
 5525|  71.5k|                m_temp_reg_83 = _mm_loadu_si128((__m128i *)&pi2_tmp[23 * trans_size]);
 5526|  71.5k|                m_temp_reg_84 = _mm_loadu_si128((__m128i *)&pi2_tmp[25 * trans_size]);
 5527|  71.5k|                m_temp_reg_85 = _mm_loadu_si128((__m128i *)&pi2_tmp[27 * trans_size]);
 5528|  71.5k|                m_temp_reg_86 = _mm_loadu_si128((__m128i *)&pi2_tmp[29 * trans_size]);
 5529|  71.5k|                m_temp_reg_87 = _mm_loadu_si128((__m128i *)&pi2_tmp[31 * trans_size]);
 5530|       |
 5531|  71.5k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 5532|  71.5k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 interleaved
 5533|  71.5k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 interleaved
 5534|  71.5k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 interleaved
 5535|  71.5k|                m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_80, m_temp_reg_81); //row 17 and row 19 interleaved
 5536|  71.5k|                m_temp_reg_15 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_83); //row 21 and row 23 interleaved
 5537|  71.5k|                m_temp_reg_16 = _mm_unpacklo_epi16(m_temp_reg_84, m_temp_reg_85); //row 25 and row 27 interleaved
 5538|  71.5k|                m_temp_reg_17 = _mm_unpacklo_epi16(m_temp_reg_86, m_temp_reg_87); //row 29 and row 31 interleaved
 5539|       |
 5540|       |                /* o0[0-3] */
 5541|  71.5k|                {
 5542|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5543|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5544|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5545|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5546|       |
 5547|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5548|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5549|       |
 5550|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5551|       |
 5552|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5553|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5554|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5555|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5556|       |
 5557|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5558|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5559|       |
 5560|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5561|       |
 5562|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5563|       |
 5564|  71.5k|                    m_temp_reg_31 = _mm_sub_epi32(temp1, m_temp_reg_20);
 5565|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(temp1, m_temp_reg_20);
 5566|       |
 5567|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5568|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5569|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5570|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5571|       |
 5572|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5573|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5574|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5575|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5576|       |
 5577|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5578|       |
 5579|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5580|  71.5k|                    pi2_dst_scratch += out_stride;
 5581|       |
 5582|  71.5k|                }
 5583|       |
 5584|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 5585|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 5586|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[10][0]);
 5587|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[11][0]);
 5588|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[12][0]);
 5589|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[13][0]);
 5590|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[14][0]);
 5591|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[15][0]);
 5592|       |
 5593|       |                /* o1[0-3] */
 5594|  71.5k|                {
 5595|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5596|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5597|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5598|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5599|       |
 5600|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5601|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5602|       |
 5603|  71.5k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_20);
 5604|       |
 5605|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5606|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5607|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5608|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5609|       |
 5610|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5611|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5612|       |
 5613|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5614|       |
 5615|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5616|       |
 5617|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp3, m_temp_reg_20);
 5618|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp3, m_temp_reg_20);
 5619|       |
 5620|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5621|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5622|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5623|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5624|       |
 5625|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5626|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5627|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5628|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5629|       |
 5630|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5631|       |
 5632|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5633|  71.5k|                    pi2_dst_scratch += out_stride;
 5634|       |
 5635|  71.5k|                }
 5636|       |
 5637|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 5638|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 5639|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[18][0]);
 5640|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[19][0]);
 5641|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[20][0]);
 5642|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[21][0]);
 5643|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[22][0]);
 5644|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[23][0]);
 5645|       |
 5646|       |                /* o2[0-3] */
 5647|  71.5k|                {
 5648|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5649|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5650|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5651|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5652|       |
 5653|  71.5k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 5654|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5655|       |
 5656|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5657|       |
 5658|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5659|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5660|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5661|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5662|       |
 5663|  71.5k|                    m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_41);
 5664|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5665|       |
 5666|  71.5k|                    m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_42);
 5667|       |
 5668|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5669|       |
 5670|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp5, m_temp_reg_20);
 5671|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp5, m_temp_reg_20);
 5672|       |
 5673|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5674|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5675|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5676|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5677|       |
 5678|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5679|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5680|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5681|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5682|       |
 5683|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5684|       |
 5685|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5686|  71.5k|                    pi2_dst_scratch += out_stride;
 5687|       |
 5688|  71.5k|                }
 5689|       |
 5690|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 5691|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 5692|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[26][0]);
 5693|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[27][0]);
 5694|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[28][0]);
 5695|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[29][0]);
 5696|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[30][0]);
 5697|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[31][0]);
 5698|       |
 5699|       |                /* o3[0-3] */
 5700|  71.5k|                {
 5701|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5702|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5703|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5704|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5705|       |
 5706|  71.5k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 5707|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5708|       |
 5709|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5710|       |
 5711|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5712|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5713|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5714|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5715|       |
 5716|  71.5k|                    m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_40);
 5717|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5718|       |
 5719|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5720|       |
 5721|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5722|       |
 5723|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp7, m_temp_reg_20);
 5724|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp7, m_temp_reg_20);
 5725|       |
 5726|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5727|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5728|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5729|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5730|       |
 5731|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5732|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5733|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5734|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5735|       |
 5736|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5737|       |
 5738|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5739|  71.5k|                    pi2_dst_scratch += out_stride;
 5740|       |
 5741|  71.5k|                }
 5742|       |
 5743|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 5744|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 5745|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[34][0]);
 5746|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[35][0]);
 5747|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[36][0]);
 5748|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[37][0]);
 5749|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[38][0]);
 5750|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[39][0]);
 5751|       |
 5752|       |                /* o4[0-3] */
 5753|  71.5k|                {
 5754|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5755|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5756|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5757|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5758|       |
 5759|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5760|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5761|       |
 5762|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5763|       |
 5764|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5765|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5766|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5767|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5768|       |
 5769|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5770|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5771|       |
 5772|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5773|       |
 5774|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5775|       |
 5776|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_20);
 5777|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_20);
 5778|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5779|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5780|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5781|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5782|       |
 5783|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5784|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5785|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5786|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5787|       |
 5788|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5789|       |
 5790|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5791|  71.5k|                    pi2_dst_scratch += out_stride;
 5792|       |
 5793|  71.5k|                }
 5794|       |
 5795|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 5796|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 5797|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[42][0]);
 5798|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[43][0]);
 5799|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[44][0]);
 5800|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[45][0]);
 5801|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[46][0]);
 5802|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[47][0]);
 5803|       |
 5804|       |                /* o5[0-3] */
 5805|  71.5k|                {
 5806|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5807|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5808|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5809|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5810|       |
 5811|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5812|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5813|       |
 5814|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5815|       |
 5816|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5817|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5818|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5819|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5820|       |
 5821|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5822|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5823|       |
 5824|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5825|       |
 5826|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5827|       |
 5828|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_20);
 5829|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_20);
 5830|       |
 5831|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5832|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5833|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5834|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5835|       |
 5836|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5837|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5838|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5839|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5840|       |
 5841|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5842|       |
 5843|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5844|  71.5k|                    pi2_dst_scratch += out_stride;
 5845|       |
 5846|  71.5k|                }
 5847|       |
 5848|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 5849|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 5850|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[50][0]);
 5851|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[51][0]);
 5852|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[52][0]);
 5853|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[53][0]);
 5854|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[54][0]);
 5855|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[55][0]);
 5856|       |
 5857|       |                /* o6[0-3] */
 5858|  71.5k|                {
 5859|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5860|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5861|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5862|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5863|       |
 5864|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5865|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5866|       |
 5867|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5868|       |
 5869|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5870|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5871|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5872|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5873|       |
 5874|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5875|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5876|       |
 5877|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5878|       |
 5879|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5880|       |
 5881|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_20);
 5882|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_20);
 5883|       |
 5884|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5885|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5886|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5887|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5888|       |
 5889|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5890|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5891|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5892|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5893|       |
 5894|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5895|       |
 5896|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5897|  71.5k|                    pi2_dst_scratch += out_stride;
 5898|       |
 5899|  71.5k|                }
 5900|       |
 5901|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 5902|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 5903|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[58][0]);
 5904|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[59][0]);
 5905|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[60][0]);
 5906|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[61][0]);
 5907|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[62][0]);
 5908|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[63][0]);
 5909|       |
 5910|       |                /* o7[0-3] */
 5911|  71.5k|                {
 5912|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5913|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5914|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5915|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5916|       |
 5917|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5918|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5919|       |
 5920|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5921|       |
 5922|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5923|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5924|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5925|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5926|       |
 5927|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5928|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5929|       |
 5930|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5931|       |
 5932|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5933|       |
 5934|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_20);
 5935|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_20);
 5936|       |
 5937|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5938|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5939|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5940|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5941|       |
 5942|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5943|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5944|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5945|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5946|       |
 5947|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5948|       |
 5949|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5950|  71.5k|                    pi2_dst_scratch += 8;
 5951|       |
 5952|  71.5k|                }
 5953|       |
 5954|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 5955|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 5956|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[66][0]);
 5957|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[67][0]);
 5958|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[68][0]);
 5959|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[69][0]);
 5960|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[70][0]);
 5961|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[71][0]);
 5962|       |
 5963|       |                /* o8[0-3] */
 5964|  71.5k|                {
 5965|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5966|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5967|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5968|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5969|       |
 5970|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5971|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5972|       |
 5973|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5974|       |
 5975|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5976|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5977|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5978|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5979|       |
 5980|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5981|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5982|       |
 5983|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5984|       |
 5985|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5986|       |
 5987|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_20);
 5988|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_20);
 5989|       |
 5990|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5991|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5992|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5993|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5994|       |
 5995|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5996|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5997|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5998|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5999|       |
 6000|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6001|       |
 6002|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6003|  71.5k|                    pi2_dst_scratch += out_stride;
 6004|  71.5k|                }
 6005|       |
 6006|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 6007|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 6008|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[74][0]);
 6009|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[75][0]);
 6010|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[76][0]);
 6011|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[77][0]);
 6012|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[78][0]);
 6013|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[79][0]);
 6014|       |
 6015|       |                /* o9[0-3] */
 6016|  71.5k|                {
 6017|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6018|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6019|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6020|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6021|       |
 6022|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6023|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6024|       |
 6025|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6026|       |
 6027|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6028|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6029|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6030|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6031|       |
 6032|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6033|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6034|       |
 6035|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6036|       |
 6037|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6038|       |
 6039|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_20);
 6040|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_20);
 6041|       |
 6042|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6043|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6044|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6045|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6046|       |
 6047|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6048|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6049|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6050|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6051|       |
 6052|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6053|       |
 6054|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6055|  71.5k|                    pi2_dst_scratch += out_stride;
 6056|  71.5k|                }
 6057|       |
 6058|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 6059|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 6060|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[82][0]);
 6061|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[83][0]);
 6062|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[84][0]);
 6063|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[85][0]);
 6064|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[86][0]);
 6065|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[87][0]);
 6066|       |
 6067|       |                /* o10[0-3] */
 6068|  71.5k|                {
 6069|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6070|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6071|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6072|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6073|       |
 6074|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6075|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6076|       |
 6077|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6078|       |
 6079|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6080|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6081|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6082|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6083|       |
 6084|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6085|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6086|       |
 6087|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6088|       |
 6089|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6090|       |
 6091|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_20);
 6092|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_20);
 6093|       |
 6094|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6095|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6096|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6097|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6098|       |
 6099|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6100|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6101|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6102|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6103|       |
 6104|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6105|       |
 6106|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6107|  71.5k|                    pi2_dst_scratch += out_stride;
 6108|  71.5k|                }
 6109|       |
 6110|       |
 6111|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 6112|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 6113|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[90][0]);
 6114|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[91][0]);
 6115|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[92][0]);
 6116|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[93][0]);
 6117|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[94][0]);
 6118|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[95][0]);
 6119|       |
 6120|       |                /* o11[0-3] */
 6121|  71.5k|                {
 6122|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6123|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6124|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6125|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6126|       |
 6127|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6128|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6129|       |
 6130|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6131|       |
 6132|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6133|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6134|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6135|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6136|       |
 6137|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6138|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6139|       |
 6140|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6141|       |
 6142|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6143|       |
 6144|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_20);
 6145|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_20);
 6146|       |
 6147|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6148|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6149|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6150|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6151|       |
 6152|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6153|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6154|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6155|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6156|       |
 6157|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6158|       |
 6159|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6160|  71.5k|                    pi2_dst_scratch += out_stride;
 6161|       |
 6162|  71.5k|                }
 6163|       |
 6164|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 6165|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 6166|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[98][0]);
 6167|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[99][0]);
 6168|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[100][0]);
 6169|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[101][0]);
 6170|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[102][0]);
 6171|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[103][0]);
 6172|       |
 6173|       |                /* o12[0-3] */
 6174|  71.5k|                {
 6175|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6176|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6177|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6178|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6179|       |
 6180|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6181|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6182|       |
 6183|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6184|       |
 6185|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6186|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6187|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6188|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6189|       |
 6190|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6191|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6192|       |
 6193|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6194|       |
 6195|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6196|       |
 6197|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp8, m_temp_reg_20);
 6198|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp8, m_temp_reg_20);
 6199|       |
 6200|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6201|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6202|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6203|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6204|       |
 6205|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6206|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6207|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6208|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6209|       |
 6210|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6211|       |
 6212|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6213|  71.5k|                    pi2_dst_scratch += out_stride;
 6214|       |
 6215|  71.5k|                }
 6216|       |
 6217|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 6218|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 6219|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[106][0]);
 6220|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[107][0]);
 6221|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[108][0]);
 6222|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[109][0]);
 6223|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[110][0]);
 6224|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[111][0]);
 6225|       |
 6226|       |                /* o13[0-3] */
 6227|  71.5k|                {
 6228|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6229|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6230|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6231|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6232|       |
 6233|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6234|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6235|       |
 6236|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6237|       |
 6238|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6239|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6240|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6241|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6242|       |
 6243|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6244|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6245|       |
 6246|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6247|       |
 6248|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6249|       |
 6250|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp6, m_temp_reg_20);
 6251|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp6, m_temp_reg_20);
 6252|       |
 6253|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6254|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6255|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6256|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6257|       |
 6258|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6259|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6260|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6261|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6262|       |
 6263|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6264|       |
 6265|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6266|  71.5k|                    pi2_dst_scratch += out_stride;
 6267|  71.5k|                }
 6268|       |
 6269|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 6270|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 6271|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[114][0]);
 6272|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[115][0]);
 6273|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[116][0]);
 6274|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[117][0]);
 6275|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[118][0]);
 6276|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[119][0]);
 6277|       |
 6278|       |                /* o14[0-3] */
 6279|  71.5k|                {
 6280|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6281|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6282|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6283|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6284|       |
 6285|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6286|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6287|       |
 6288|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6289|       |
 6290|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6291|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6292|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6293|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6294|       |
 6295|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6296|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6297|       |
 6298|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6299|       |
 6300|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6301|       |
 6302|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp4, m_temp_reg_20);
 6303|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp4, m_temp_reg_20);
 6304|       |
 6305|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6306|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6307|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6308|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6309|       |
 6310|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6311|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6312|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6313|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6314|       |
 6315|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6316|       |
 6317|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6318|  71.5k|                    pi2_dst_scratch += out_stride;
 6319|       |
 6320|  71.5k|                }
 6321|       |
 6322|  71.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 6323|  71.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 6324|  71.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[122][0]);
 6325|  71.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[123][0]);
 6326|  71.5k|                m_coeff5 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[124][0]);
 6327|  71.5k|                m_coeff6 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[125][0]);
 6328|  71.5k|                m_coeff7 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[126][0]);
 6329|  71.5k|                m_coeff8 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[127][0]);
 6330|       |
 6331|       |                /* o15[0-3] */
 6332|  71.5k|                {
 6333|  71.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6334|  71.5k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6335|  71.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6336|  71.5k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6337|       |
 6338|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6339|  71.5k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6340|       |
 6341|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6342|       |
 6343|  71.5k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6344|  71.5k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6345|  71.5k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6346|  71.5k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6347|       |
 6348|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6349|  71.5k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6350|       |
 6351|  71.5k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6352|       |
 6353|  71.5k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6354|       |
 6355|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(temp2, m_temp_reg_20);
 6356|  71.5k|                    m_temp_reg_30 = _mm_sub_epi32(temp2, m_temp_reg_20);
 6357|       |
 6358|  71.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6359|  71.5k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6360|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6361|  71.5k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6362|       |
 6363|  71.5k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6364|  71.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6365|  71.5k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6366|  71.5k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6367|       |
 6368|  71.5k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6369|       |
 6370|  71.5k|                    _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6371|  71.5k|                    pi2_dst_scratch += 8;
 6372|  71.5k|                }
 6373|       |
 6374|  71.5k|            }
 6375|  71.5k|        }
 6376|       |
 6377|       |        /* Transpose */
 6378|   369k|        {
 6379|       |
 6380|   369k|            WORD16 *pi2_src_scratch = temp_ptr;
 6381|   369k|            WORD32 out_stride = dst_strd;
 6382|   369k|            WORD32 in_stride = 8;
 6383|       |
 6384|   369k|            m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6385|   369k|            pi2_src_scratch += in_stride;
 6386|   369k|            m_temp_reg_31 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6387|   369k|            pi2_src_scratch += in_stride;
 6388|   369k|            m_temp_reg_32 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6389|   369k|            pi2_src_scratch += in_stride;
 6390|   369k|            m_temp_reg_33 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6391|   369k|            pi2_src_scratch += in_stride;
 6392|   369k|            m_temp_reg_34 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6393|   369k|            pi2_src_scratch += in_stride;
 6394|   369k|            m_temp_reg_35 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6395|   369k|            pi2_src_scratch += in_stride;
 6396|   369k|            m_temp_reg_36 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6397|   369k|            pi2_src_scratch += in_stride;
 6398|   369k|            m_temp_reg_37 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6399|   369k|            pi2_src_scratch += 8;
 6400|       |
 6401|   369k|            m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6402|   369k|            pi2_src_scratch += in_stride;
 6403|   369k|            m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6404|   369k|            pi2_src_scratch += in_stride;
 6405|   369k|            m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6406|   369k|            pi2_src_scratch += in_stride;
 6407|   369k|            m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6408|   369k|            pi2_src_scratch += in_stride;
 6409|   369k|            m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6410|   369k|            pi2_src_scratch += in_stride;
 6411|   369k|            m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6412|   369k|            pi2_src_scratch += in_stride;
 6413|   369k|            m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6414|   369k|            pi2_src_scratch += in_stride;
 6415|   369k|            m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6416|   369k|            pi2_src_scratch += 8;
 6417|       |
 6418|       |
 6419|   369k|            m_temp_reg_40 = _mm_unpacklo_epi16(m_temp_reg_30, m_temp_reg_31);
 6420|   369k|            m_temp_reg_41 = _mm_unpackhi_epi16(m_temp_reg_31, m_temp_reg_30);
 6421|       |
 6422|   369k|            m_temp_reg_42 = _mm_unpacklo_epi16(m_temp_reg_32, m_temp_reg_33);
 6423|   369k|            m_temp_reg_43 = _mm_unpackhi_epi16(m_temp_reg_33, m_temp_reg_32);
 6424|       |
 6425|   369k|            m_temp_reg_44 = _mm_unpacklo_epi16(m_temp_reg_34, m_temp_reg_35);
 6426|   369k|            m_temp_reg_45 = _mm_unpackhi_epi16(m_temp_reg_35, m_temp_reg_34);
 6427|       |
 6428|   369k|            m_temp_reg_46 = _mm_unpacklo_epi16(m_temp_reg_36, m_temp_reg_37);
 6429|   369k|            m_temp_reg_47 = _mm_unpackhi_epi16(m_temp_reg_37, m_temp_reg_36);
 6430|       |
 6431|   369k|            m_temp_reg_80 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 6432|   369k|            m_temp_reg_81 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_70);
 6433|       |
 6434|   369k|            m_temp_reg_82 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73);
 6435|   369k|            m_temp_reg_83 = _mm_unpackhi_epi16(m_temp_reg_73, m_temp_reg_72);
 6436|       |
 6437|   369k|            m_temp_reg_84 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75);
 6438|   369k|            m_temp_reg_85 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_74);
 6439|       |
 6440|   369k|            m_temp_reg_86 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77);
 6441|   369k|            m_temp_reg_87 = _mm_unpackhi_epi16(m_temp_reg_77, m_temp_reg_76);
 6442|       |
 6443|       |
 6444|   369k|            m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_40, m_temp_reg_42);
 6445|   369k|            m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_40, m_temp_reg_42);
 6446|       |
 6447|   369k|            m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_44, m_temp_reg_46);
 6448|   369k|            m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_44, m_temp_reg_46);
 6449|       |
 6450|   369k|            m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_80, m_temp_reg_82);
 6451|   369k|            m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_80, m_temp_reg_82);
 6452|       |
 6453|   369k|            m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_84, m_temp_reg_86);
 6454|   369k|            m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_84, m_temp_reg_86);
 6455|       |
 6456|   369k|            m_temp_reg_90 = _mm_unpacklo_epi32(m_temp_reg_43, m_temp_reg_41);
 6457|   369k|            m_temp_reg_91 = _mm_unpackhi_epi32(m_temp_reg_43, m_temp_reg_41);
 6458|       |
 6459|   369k|            m_temp_reg_92 = _mm_unpacklo_epi32(m_temp_reg_47, m_temp_reg_45);
 6460|   369k|            m_temp_reg_93 = _mm_unpackhi_epi32(m_temp_reg_47, m_temp_reg_45);
 6461|       |
 6462|   369k|            m_temp_reg_94 = _mm_unpacklo_epi32(m_temp_reg_83, m_temp_reg_81);
 6463|   369k|            m_temp_reg_95 = _mm_unpackhi_epi32(m_temp_reg_83, m_temp_reg_81);
 6464|       |
 6465|   369k|            m_temp_reg_96 = _mm_unpacklo_epi32(m_temp_reg_87, m_temp_reg_85);
 6466|   369k|            m_temp_reg_97 = _mm_unpackhi_epi32(m_temp_reg_87, m_temp_reg_85);
 6467|       |
 6468|       |
 6469|   369k|            m_temp_reg_30 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_2);       // row0 = 0-7
 6470|   369k|            m_temp_reg_31 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_2);       // row1 = 0-7
 6471|       |
 6472|   369k|            m_temp_reg_32 = _mm_unpacklo_epi64(m_temp_reg_92, m_temp_reg_90);     // row0=24-31
 6473|   369k|            m_temp_reg_33 = _mm_unpackhi_epi64(m_temp_reg_92, m_temp_reg_90);     // row1=24-31
 6474|       |
 6475|   369k|            m_temp_reg_34 = _mm_unpacklo_epi64(m_temp_reg_4, m_temp_reg_6);       // row0=8-15
 6476|   369k|            m_temp_reg_35 = _mm_unpackhi_epi64(m_temp_reg_4, m_temp_reg_6);       // row1=8-15
 6477|       |
 6478|   369k|            m_temp_reg_36 = _mm_unpacklo_epi64(m_temp_reg_96, m_temp_reg_94);     // row0=16-23
 6479|   369k|            m_temp_reg_37 = _mm_unpackhi_epi64(m_temp_reg_96, m_temp_reg_94);     // row1=16-23
 6480|       |
 6481|   369k|            m_temp_reg_80 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_3);      // row2 =0-7
 6482|   369k|            m_temp_reg_81 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_3);      // row3 =0-7
 6483|       |
 6484|   369k|            m_temp_reg_82 = _mm_unpacklo_epi64(m_temp_reg_93, m_temp_reg_91);    // row2=24-31
 6485|   369k|            m_temp_reg_83 = _mm_unpackhi_epi64(m_temp_reg_93, m_temp_reg_91);    // row3=24-31
 6486|       |
 6487|   369k|            m_temp_reg_84 = _mm_unpacklo_epi64(m_temp_reg_5, m_temp_reg_7);      // row2=8-15
 6488|   369k|            m_temp_reg_85 = _mm_unpackhi_epi64(m_temp_reg_5, m_temp_reg_7);      // row3=8-15
 6489|       |
 6490|   369k|            m_temp_reg_86 = _mm_unpacklo_epi64(m_temp_reg_97, m_temp_reg_95);    // row2=16-23
 6491|   369k|            m_temp_reg_87 = _mm_unpackhi_epi64(m_temp_reg_97, m_temp_reg_95);    // row3=16-23
 6492|       |
 6493|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6494|       |
 6495|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6496|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6497|       |
 6498|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_30, m_temp_reg_0);
 6499|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6500|       |
 6501|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6502|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6503|       |
 6504|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_34, m_temp_reg_0);
 6505|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6506|       |
 6507|   369k|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6508|       |
 6509|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6510|       |
 6511|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6512|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6513|       |
 6514|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_36, m_temp_reg_0);
 6515|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6516|       |
 6517|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6518|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6519|       |
 6520|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_32, m_temp_reg_0);
 6521|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6522|       |
 6523|   369k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6524|   369k|            pu1_dst += out_stride;
 6525|   369k|            pu1_pred += pred_strd;
 6526|       |
 6527|       |
 6528|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6529|       |
 6530|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6531|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6532|       |
 6533|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_31, m_temp_reg_0);
 6534|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6535|       |
 6536|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6537|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6538|       |
 6539|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_35, m_temp_reg_0);
 6540|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6541|       |
 6542|   369k|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6543|       |
 6544|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6545|       |
 6546|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6547|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6548|       |
 6549|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_37, m_temp_reg_0);
 6550|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6551|       |
 6552|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6553|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6554|       |
 6555|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_33, m_temp_reg_0);
 6556|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6557|       |
 6558|   369k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6559|   369k|            pu1_dst += out_stride;
 6560|   369k|            pu1_pred += pred_strd;
 6561|       |
 6562|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6563|       |
 6564|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6565|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6566|       |
 6567|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_80, m_temp_reg_0);
 6568|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6569|       |
 6570|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6571|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6572|       |
 6573|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_84, m_temp_reg_0);
 6574|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6575|       |
 6576|   369k|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6577|       |
 6578|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6579|       |
 6580|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6581|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6582|       |
 6583|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_86, m_temp_reg_0);
 6584|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6585|       |
 6586|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6587|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6588|       |
 6589|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_82, m_temp_reg_0);
 6590|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6591|       |
 6592|   369k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6593|   369k|            pu1_dst += out_stride;
 6594|   369k|            pu1_pred += pred_strd;
 6595|       |
 6596|       |
 6597|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6598|       |
 6599|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6600|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6601|       |
 6602|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_81, m_temp_reg_0);
 6603|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6604|       |
 6605|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6606|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6607|       |
 6608|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_85, m_temp_reg_0);
 6609|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6610|       |
 6611|   369k|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6612|       |
 6613|   369k|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6614|       |
 6615|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_20);
 6616|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6617|       |
 6618|   369k|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_87, m_temp_reg_0);
 6619|   369k|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6620|       |
 6621|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
 6622|   369k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6623|       |
 6624|   369k|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_83, m_temp_reg_0);
 6625|   369k|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6626|       |
 6627|   369k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6628|   369k|            pu1_dst += out_stride;
 6629|   369k|            pu1_pred += pred_strd;
 6630|       |
 6631|   369k|        }
 6632|   369k|        pi2_tmp += 4;
 6633|   369k|    }
 6634|  46.3k|}

ihevc_intra_pred_chroma_planar_sse42:
  114|  91.2k|{
  115|       |
  116|  91.2k|    WORD32 row, col;
  117|  91.2k|    WORD32 log2nt = 5;
  118|  91.2k|    WORD32 two_nt, three_nt;
  119|       |
  120|  91.2k|    __m128i const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  121|  91.2k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b;
  122|  91.2k|    UNUSED(src_strd);
  ------------------
  |  |   38|  91.2k|#define UNUSED(x) ((void)(x))
  ------------------
  123|  91.2k|    UNUSED(mode);
  ------------------
  |  |   38|  91.2k|#define UNUSED(x) ((void)(x))
  ------------------
  124|       |
  125|  91.2k|    switch(nt)
  126|  91.2k|    {
  127|      0|        case 32:
  ------------------
  |  Branch (127:9): [True: 0, False: 91.2k]
  ------------------
  128|      0|            log2nt = 5;
  129|      0|            break;
  130|  39.4k|        case 16:
  ------------------
  |  Branch (130:9): [True: 39.4k, False: 51.7k]
  ------------------
  131|  39.4k|            log2nt = 4;
  132|  39.4k|            break;
  133|  16.8k|        case 8:
  ------------------
  |  Branch (133:9): [True: 16.8k, False: 74.3k]
  ------------------
  134|  16.8k|            log2nt = 3;
  135|  16.8k|            break;
  136|  35.0k|        case 4:
  ------------------
  |  Branch (136:9): [True: 35.0k, False: 56.2k]
  ------------------
  137|  35.0k|            log2nt = 2;
  138|  35.0k|            break;
  139|      0|        default:
  ------------------
  |  Branch (139:9): [True: 0, False: 91.2k]
  ------------------
  140|      0|            break;
  141|  91.2k|    }
  142|  91.2k|    two_nt = 2 * nt;
  143|  91.2k|    three_nt = 3 * nt;
  144|       |
  145|       |    /* Planar filtering */
  146|       |
  147|       |/* setting vallues in  registera*/
  148|       |
  149|       |//  pu1_ref[2*(two_nt - 1 - row)]
  150|       |//  pu1_ref[2 * (three_nt + 1)]
  151|       |//  pu1_ref[2 * (two_nt + 1) + col]
  152|       |//  pu1_ref[2 * (nt - 1)]
  153|       |
  154|  91.2k|    const_temp_4x32b  = _mm_set_epi16(pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1],
  155|  91.2k|                                      pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  156|  91.2k|                                      pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  157|       |
  158|  91.2k|    const_temp1_4x32b = _mm_set_epi16(pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)],
  159|  91.2k|                                      pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  160|       |
  161|  91.2k|    const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  162|  91.2k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  163|  91.2k|    const_temp7_4x32b = _mm_set1_epi16(4);
  164|       |
  165|  91.2k|    zero_8x16b = _mm_set1_epi32(0);
  166|       |
  167|  91.2k|    if(nt % 4 == 0 && nt < 32)
  ------------------
  |  Branch (167:8): [True: 91.1k, False: 9]
  |  Branch (167:23): [True: 91.1k, False: 18.4E]
  ------------------
  168|  91.1k|    {
  169|  91.1k|        const_temp7_4x32b = _mm_set1_epi16(4);
  170|       |
  171|   992k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (171:22): [True: 900k, False: 91.1k]
  ------------------
  172|   900k|        {
  173|   900k|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  174|   900k|            __m128i res_temp3_8x16b;
  175|       |
  176|   900k|            const_temp2_4x32b  = _mm_set_epi16(pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1],
  177|   900k|                                               pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  178|   900k|                                               pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  179|       |
  180|   900k|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  181|   900k|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  182|       |
  183|   900k|            const_temp5_4x32b = _mm_set_epi16(3, 3, 2, 2, 1, 1, 0, 0);
  184|   900k|            col_8x16b = _mm_set_epi16(4, 4, 3, 3, 2, 2, 1, 1);
  185|       |
  186|   900k|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  187|       |
  188|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  189|   900k|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  190|       |
  191|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  192|   900k|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  193|       |
  194|  3.81M|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (194:26): [True: 2.91M, False: 900k]
  ------------------
  195|  2.91M|            {
  196|  2.91M|                __m128i src_temp_8x16b;
  197|       |
  198|       |                /* loding 8bit 16 pixles*/
  199|  2.91M|                src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  200|       |
  201|  2.91M|                src_temp_8x16b =  _mm_cvtepu8_epi16(src_temp_8x16b); /* row=0*/
  202|       |
  203|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  204|  2.91M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  205|       |
  206|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  207|  2.91M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  208|       |
  209|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  210|  2.91M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  211|       |
  212|  2.91M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  213|  2.91M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  214|  2.91M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  215|       |
  216|  2.91M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, (log2nt + 1));
  217|  2.91M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  218|       |
  219|  2.91M|                _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd) + col), res_temp1_8x16b);
  220|       |
  221|  2.91M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  222|  2.91M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  223|  2.91M|            } /* inner loop ends here */
  224|   900k|        }
  225|  91.1k|    }
  226|      6|    else if(nt == 32)
  ------------------
  |  Branch (226:13): [True: 0, False: 6]
  ------------------
  227|      0|    {
  228|       |        /* 32-bit accumulation path for nt=32 to prevent overflow */
  229|      0|        __m128i top_right_4x32b, bottom_left_4x32b;
  230|      0|        __m128i top_right_factor_lo_4x32b, top_right_factor_hi_4x32b;
  231|      0|        __m128i left_factor_lo_4x32b, left_factor_hi_4x32b;
  232|      0|        __m128i const_4_4x32b;
  233|       |
  234|       |        /* pu1_ref[2 * (three_nt + 1)] = p[nTbS][-1] - top right reference */
  235|      0|        top_right_4x32b  = _mm_set_epi32(pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  236|      0|                                         pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  237|       |
  238|       |        /* pu1_ref[2 * (nt - 1)] = p[-1][nTbS] - bottom left reference */
  239|      0|        bottom_left_4x32b = _mm_set_epi32(pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)],
  240|      0|                                          pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  241|       |
  242|      0|        const_4_4x32b = _mm_set1_epi32(4);
  243|       |
  244|      0|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (244:22): [True: 0, False: 0]
  ------------------
  245|      0|        {
  246|      0|            __m128i left_4x32b, row_factor_4x32b, top_factor_4x32b;
  247|      0|            __m128i base_4x32b;
  248|       |
  249|       |            /* pu1_ref[2 * (two_nt - 1 - row)] = p[-1][y] - left reference for current row */
  250|      0|            left_4x32b = _mm_set_epi32(pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  251|      0|                                       pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  252|       |
  253|       |            /* Row factors: (y + 1) and (nTbS - 1 - y) */
  254|      0|            row_factor_4x32b = _mm_set1_epi32(row + 1);
  255|      0|            top_factor_4x32b = _mm_set1_epi32(nt - 1 - row);
  256|       |
  257|       |            /* Initialize column factors for first iteration */
  258|      0|            top_right_factor_lo_4x32b = _mm_set_epi32(2, 2, 1, 1);
  259|      0|            top_right_factor_hi_4x32b = _mm_set_epi32(4, 4, 3, 3);
  260|      0|            left_factor_lo_4x32b = _mm_set_epi32(nt - 2, nt - 2, nt - 1, nt - 1);
  261|      0|            left_factor_hi_4x32b = _mm_set_epi32(nt - 4, nt - 4, nt - 3, nt - 3);
  262|       |
  263|       |            /* Base value: (y + 1) * p[-1][nTbS] + nTbS */
  264|      0|            base_4x32b = _mm_mullo_epi32(row_factor_4x32b, bottom_left_4x32b);
  265|      0|            base_4x32b = _mm_add_epi32(base_4x32b, _mm_set1_epi32(nt));
  266|       |
  267|      0|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (267:26): [True: 0, False: 0]
  ------------------
  268|      0|            {
  269|      0|                __m128i top_8x16b, top_lo_4x32b, top_hi_4x32b;
  270|      0|                __m128i res_temp1_4x32b, res_temp2_4x32b, res_temp3_4x32b;
  271|       |
  272|       |                /* Load 8 bytes of top reference: p[x][-1] */
  273|      0|                top_8x16b = _mm_loadl_epi64((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  274|      0|                top_8x16b    = _mm_cvtepu8_epi16(top_8x16b);
  275|       |
  276|       |                /* Unpack to 32-bit for low and high halves */
  277|      0|                top_lo_4x32b = _mm_cvtepu16_epi32(top_8x16b);
  278|      0|                top_8x16b    = _mm_srli_si128(top_8x16b, 8);
  279|      0|                top_hi_4x32b = _mm_cvtepu16_epi32(top_8x16b);
  280|       |
  281|       |                /* (nTbS - 1 - y) * p[x][-1] */
  282|      0|                res_temp1_4x32b = _mm_mullo_epi32(top_factor_4x32b, top_lo_4x32b);
  283|       |
  284|       |                /* (x + 1) * p[nTbS][-1] */
  285|      0|                res_temp2_4x32b = _mm_mullo_epi32(top_right_factor_lo_4x32b, top_right_4x32b);
  286|       |
  287|       |                /* (nTbS - 1 - x) * p[-1][y] */
  288|      0|                res_temp3_4x32b = _mm_mullo_epi32(left_factor_lo_4x32b, left_4x32b);
  289|       |
  290|       |                /* Accumulate all terms */
  291|      0|                res_temp1_4x32b = _mm_add_epi32(base_4x32b, res_temp1_4x32b);
  292|      0|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp2_4x32b);
  293|      0|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp3_4x32b);
  294|       |
  295|      0|                res_temp1_4x32b = _mm_srli_epi32(res_temp1_4x32b, log2nt + 1);
  296|       |
  297|      0|                res_temp2_4x32b = _mm_mullo_epi32(top_factor_4x32b, top_hi_4x32b);
  298|      0|                res_temp3_4x32b = _mm_mullo_epi32(top_right_factor_hi_4x32b, top_right_4x32b);
  299|      0|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, res_temp3_4x32b);
  300|       |
  301|      0|                res_temp3_4x32b = _mm_mullo_epi32(left_factor_hi_4x32b, left_4x32b);
  302|      0|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, res_temp3_4x32b);
  303|      0|                res_temp2_4x32b = _mm_add_epi32(base_4x32b, res_temp2_4x32b);
  304|       |
  305|      0|                res_temp2_4x32b = _mm_srli_epi32(res_temp2_4x32b, log2nt + 1);
  306|       |
  307|       |                /* Pack 32-bit -> 16-bit -> 8-bit and store */
  308|      0|                top_8x16b = _mm_packus_epi32(res_temp1_4x32b, res_temp2_4x32b);
  309|      0|                top_8x16b = _mm_packus_epi16(top_8x16b, zero_8x16b);
  310|      0|                _mm_storel_epi64((__m128i *)(pu1_dst + row * dst_strd + col), top_8x16b);
  311|       |
  312|       |                /* Update column factors for next iteration */
  313|      0|                left_factor_lo_4x32b = _mm_sub_epi32(left_factor_lo_4x32b, const_4_4x32b);
  314|      0|                left_factor_hi_4x32b = _mm_sub_epi32(left_factor_hi_4x32b, const_4_4x32b);
  315|      0|                top_right_factor_lo_4x32b = _mm_add_epi32(top_right_factor_lo_4x32b, const_4_4x32b);
  316|      0|                top_right_factor_hi_4x32b = _mm_add_epi32(top_right_factor_hi_4x32b, const_4_4x32b);
  317|      0|            }
  318|      0|        }
  319|      0|    }
  320|  91.2k|}
ihevc_intra_pred_chroma_dc_sse42:
  365|  37.6k|{
  366|       |
  367|  37.6k|    WORD32 acc_dc_u, acc_dc_v;
  368|  37.6k|    WORD32 dc_val_u, dc_val_v;
  369|  37.6k|    WORD32 row, i;
  370|  37.6k|    WORD32 log2nt = 5;
  371|  37.6k|    __m128i src_temp1, src_temp3, src_temp4, src_temp5, src_temp6, m_mask;
  372|  37.6k|    __m128i src_temp7, src_temp8, src_temp9, src_temp10, src_temp11;
  373|  37.6k|    __m128i m_zero = _mm_set1_epi32(0);
  374|  37.6k|    UNUSED(src_strd);
  ------------------
  |  |   38|  37.6k|#define UNUSED(x) ((void)(x))
  ------------------
  375|  37.6k|    UNUSED(mode);
  ------------------
  |  |   38|  37.6k|#define UNUSED(x) ((void)(x))
  ------------------
  376|       |
  377|  37.6k|    switch(nt)
  378|  37.6k|    {
  379|      0|        case 32:
  ------------------
  |  Branch (379:9): [True: 0, False: 37.6k]
  ------------------
  380|      0|            log2nt = 5;
  381|      0|            break;
  382|  11.9k|        case 16:
  ------------------
  |  Branch (382:9): [True: 11.9k, False: 25.7k]
  ------------------
  383|  11.9k|            log2nt = 4;
  384|  11.9k|            break;
  385|  5.85k|        case 8:
  ------------------
  |  Branch (385:9): [True: 5.85k, False: 31.8k]
  ------------------
  386|  5.85k|            log2nt = 3;
  387|  5.85k|            break;
  388|  19.8k|        case 4:
  ------------------
  |  Branch (388:9): [True: 19.8k, False: 17.7k]
  ------------------
  389|  19.8k|            log2nt = 2;
  390|  19.8k|            break;
  391|      0|        default:
  ------------------
  |  Branch (391:9): [True: 0, False: 37.6k]
  ------------------
  392|      0|            break;
  393|  37.6k|    }
  394|       |
  395|  37.6k|    acc_dc_u = 0;
  396|  37.6k|    acc_dc_v = 0;
  397|       |
  398|       |    /* Calculate DC value for the transform block */
  399|       |
  400|  37.6k|    m_mask = _mm_loadu_si128((__m128i *)&IHEVCE_SHUFFLEMASKY9[0]);
  401|       |
  402|  37.6k|    if(nt == 32)
  ------------------
  |  Branch (402:8): [True: 0, False: 37.6k]
  ------------------
  403|      0|    {
  404|      0|        __m128i temp_sad;
  405|       |
  406|      0|        src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  407|      0|        src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  408|      0|        src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  409|      0|        src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  410|       |
  411|      0|        src_temp5  = _mm_cvtepu8_epi16(src_temp3);
  412|      0|        src_temp6  = _mm_cvtepu8_epi16(src_temp4);
  413|      0|        src_temp9  = _mm_cvtepu8_epi16(src_temp7);
  414|      0|        src_temp10 = _mm_cvtepu8_epi16(src_temp8);
  415|       |
  416|      0|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  417|      0|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  418|      0|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  419|      0|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  420|       |
  421|      0|        src_temp3 = _mm_cvtepu8_epi16(src_temp3);
  422|      0|        src_temp4 = _mm_cvtepu8_epi16(src_temp4);
  423|      0|        src_temp7 = _mm_cvtepu8_epi16(src_temp7);
  424|      0|        src_temp8 = _mm_cvtepu8_epi16(src_temp8);
  425|       |
  426|      0|        src_temp4  = _mm_add_epi16(src_temp4,  src_temp6);
  427|      0|        src_temp6  = _mm_add_epi16(src_temp3,  src_temp5);
  428|      0|        src_temp8  = _mm_add_epi16(src_temp7,  src_temp8);
  429|      0|        src_temp10 = _mm_add_epi16(src_temp9,  src_temp10);
  430|       |
  431|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  432|      0|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  433|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  434|       |
  435|      0|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 64));
  436|      0|        src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 80));
  437|      0|        src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 96));
  438|      0|        src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 112));
  439|       |
  440|      0|        src_temp5  = _mm_cvtepu8_epi16(src_temp3);
  441|      0|        src_temp9  = _mm_cvtepu8_epi16(src_temp6);
  442|      0|        src_temp10 = _mm_cvtepu8_epi16(src_temp7);
  443|      0|        src_temp11 = _mm_cvtepu8_epi16(src_temp8);
  444|       |
  445|      0|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  446|      0|        src_temp6 = _mm_srli_si128(src_temp6, 8);
  447|      0|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  448|      0|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  449|       |
  450|      0|        src_temp3 = _mm_cvtepu8_epi16(src_temp3);
  451|      0|        src_temp6 = _mm_cvtepu8_epi16(src_temp6);
  452|      0|        src_temp7 = _mm_cvtepu8_epi16(src_temp7);
  453|      0|        src_temp8 = _mm_cvtepu8_epi16(src_temp8);
  454|       |
  455|      0|        src_temp3 = _mm_add_epi16(src_temp3, src_temp5);
  456|      0|        src_temp6 = _mm_add_epi16(src_temp6, src_temp9);
  457|      0|        src_temp7 = _mm_add_epi16(src_temp7, src_temp10);
  458|      0|        src_temp8 = _mm_add_epi16(src_temp8, src_temp11);
  459|       |
  460|      0|        src_temp3 = _mm_add_epi16(src_temp3, src_temp6);
  461|      0|        src_temp7 = _mm_add_epi16(src_temp7, src_temp8);
  462|      0|        src_temp3 = _mm_add_epi16(src_temp3, src_temp7);
  463|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp3);
  464|       |
  465|      0|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  466|      0|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  467|      0|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  468|       |
  469|      0|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  470|      0|        temp_sad  = _mm_srli_si128(src_temp4, 4);
  471|      0|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  472|      0|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  473|      0|    }
  474|  37.6k|    else if(nt == 16)
  ------------------
  |  Branch (474:13): [True: 11.9k, False: 25.7k]
  ------------------
  475|  11.9k|    {
  476|  11.9k|        __m128i temp_sad;
  477|       |
  478|  11.9k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  479|  11.9k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  480|  11.9k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  481|  11.9k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  482|       |
  483|  11.9k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  484|  11.9k|        src_temp6 =  _mm_cvtepu8_epi16(src_temp4);
  485|  11.9k|        src_temp9 =  _mm_cvtepu8_epi16(src_temp7);
  486|  11.9k|        src_temp10 =  _mm_cvtepu8_epi16(src_temp8);
  487|       |
  488|  11.9k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  489|  11.9k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  490|  11.9k|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  491|  11.9k|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  492|       |
  493|  11.9k|        src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  494|  11.9k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  495|  11.9k|        src_temp7 =  _mm_cvtepu8_epi16(src_temp7);
  496|  11.9k|        src_temp8 =  _mm_cvtepu8_epi16(src_temp8);
  497|       |
  498|  11.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  499|  11.9k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  500|  11.9k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  501|  11.9k|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  502|       |
  503|  11.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  504|  11.9k|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  505|       |
  506|  11.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  507|  11.9k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  508|  11.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  509|  11.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  510|       |
  511|  11.9k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  512|  11.9k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  513|  11.9k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  514|  11.9k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  515|  11.9k|    }
  516|       |
  517|  25.7k|    else if(nt == 8)
  ------------------
  |  Branch (517:13): [True: 5.85k, False: 19.8k]
  ------------------
  518|  5.85k|    {
  519|  5.85k|        __m128i temp_sad;
  520|  5.85k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  521|  5.85k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  522|       |
  523|  5.85k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  524|  5.85k|        src_temp6 =  _mm_cvtepu8_epi16(src_temp4);
  525|       |
  526|  5.85k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  527|  5.85k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  528|       |
  529|  5.85k|        src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  530|  5.85k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  531|       |
  532|  5.85k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  533|  5.85k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  534|       |
  535|  5.85k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  536|  5.85k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  537|  5.85k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  538|  5.85k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  539|       |
  540|  5.85k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  541|  5.85k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  542|  5.85k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  543|  5.85k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  544|  5.85k|    }
  545|       |
  546|  19.8k|    else if(nt == 4)
  ------------------
  |  Branch (546:13): [True: 19.8k, False: 18.4E]
  ------------------
  547|  19.8k|    {
  548|  19.8k|        __m128i temp_sad;
  549|  19.8k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  550|       |
  551|  19.8k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  552|  19.8k|        src_temp4 = _mm_srli_si128(src_temp3, 8);
  553|  19.8k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  554|       |
  555|  19.8k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  556|       |
  557|  19.8k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  558|  19.8k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  559|  19.8k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  560|       |
  561|  19.8k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  562|  19.8k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  563|  19.8k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  564|  19.8k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  565|  19.8k|    }
  566|       |
  567|       |
  568|  37.6k|    acc_dc_u += pu1_ref[6 * nt];
  569|  37.6k|    acc_dc_v += pu1_ref[6 * nt + 1];
  570|       |
  571|  37.6k|    acc_dc_u -= pu1_ref[4 * nt];
  572|  37.6k|    acc_dc_v -= pu1_ref[4 * nt + 1];
  573|       |
  574|  37.6k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  575|  37.6k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  576|       |
  577|  37.6k|    dc_val_u = dc_val_u | (dc_val_v << 8);
  578|       |
  579|       |    /* Fill the remaining rows with DC value*/
  580|       |
  581|  37.6k|    if(nt == 4)
  ------------------
  |  Branch (581:8): [True: 19.8k, False: 17.7k]
  ------------------
  582|  19.8k|    {
  583|  19.8k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  584|       |
  585|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  586|  19.8k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  587|  19.8k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  588|  19.8k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  589|  19.8k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  590|       |
  591|  19.8k|    }
  592|  17.7k|    else if(nt == 8)
  ------------------
  |  Branch (592:13): [True: 5.85k, False: 11.9k]
  ------------------
  593|  5.85k|    {
  594|  5.85k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  595|       |
  596|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  597|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  598|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  599|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  600|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  601|       |
  602|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  603|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  604|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  605|  5.85k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  606|       |
  607|  5.85k|    }
  608|       |
  609|  11.9k|    else if(nt == 16) /* nt == 16 */
  ------------------
  |  Branch (609:13): [True: 11.9k, False: 18.4E]
  ------------------
  610|  11.9k|    {
  611|       |
  612|  11.9k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  613|       |
  614|  35.7k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (614:22): [True: 23.8k, False: 11.9k]
  ------------------
  615|  23.8k|        {
  616|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  617|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  618|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  619|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  620|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  621|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp1);
  622|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp1);
  623|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp1);
  624|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp1);
  625|       |
  626|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  627|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  628|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  629|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  630|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp1);
  631|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp1);
  632|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp1);
  633|  23.8k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp1);
  634|       |
  635|  23.8k|            pu1_dst += 8 * dst_strd;
  636|  23.8k|        }
  637|       |
  638|       |
  639|  11.9k|    }
  640|  18.4E|    else /* nt == 32 */
  641|  18.4E|    {
  642|  18.4E|        src_temp1 = _mm_set1_epi16(dc_val_u);
  643|       |
  644|  18.4E|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (644:22): [True: 0, False: 18.4E]
  ------------------
  645|      0|        {
  646|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  647|      0|            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (647:24): [True: 0, False: 0]
  ------------------
  648|      0|            {
  649|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) +  0), src_temp1);
  650|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 16), src_temp1);
  651|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 32), src_temp1);
  652|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 48), src_temp1);
  653|      0|            }
  654|      0|            pu1_dst += 8 * dst_strd;
  655|      0|        }
  656|  18.4E|    }
  657|       |
  658|  37.6k|}

ihevc_intra_pred_chroma_planar_ssse3:
  133|   439k|{
  134|       |
  135|   439k|    WORD32 row, col;
  136|   439k|    WORD32 log2nt = 5;
  137|   439k|    WORD32 two_nt, three_nt;
  138|       |
  139|   439k|    __m128i const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  140|   439k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b;
  141|   439k|    UNUSED(src_strd);
  ------------------
  |  |   38|   439k|#define UNUSED(x) ((void)(x))
  ------------------
  142|   439k|    UNUSED(mode);
  ------------------
  |  |   38|   439k|#define UNUSED(x) ((void)(x))
  ------------------
  143|   439k|    switch(nt)
  144|   439k|    {
  145|      0|        case 32:
  ------------------
  |  Branch (145:9): [True: 0, False: 439k]
  ------------------
  146|      0|            log2nt = 5;
  147|      0|            break;
  148|   141k|        case 16:
  ------------------
  |  Branch (148:9): [True: 141k, False: 298k]
  ------------------
  149|   141k|            log2nt = 4;
  150|   141k|            break;
  151|   147k|        case 8:
  ------------------
  |  Branch (151:9): [True: 147k, False: 292k]
  ------------------
  152|   147k|            log2nt = 3;
  153|   147k|            break;
  154|   151k|        case 4:
  ------------------
  |  Branch (154:9): [True: 151k, False: 288k]
  ------------------
  155|   151k|            log2nt = 2;
  156|   151k|            break;
  157|      0|        default:
  ------------------
  |  Branch (157:9): [True: 0, False: 439k]
  ------------------
  158|      0|            break;
  159|   439k|    }
  160|   439k|    two_nt = 2 * nt;
  161|   439k|    three_nt = 3 * nt;
  162|       |
  163|       |    /* Planar filtering */
  164|       |
  165|       |/* setting vallues in  registera*/
  166|       |
  167|       |//  pu1_ref[2*(two_nt - 1 - row)]
  168|       |//  pu1_ref[2 * (three_nt + 1)]
  169|       |//  pu1_ref[2 * (two_nt + 1) + col]
  170|       |//  pu1_ref[2 * (nt - 1)]
  171|       |
  172|   439k|    const_temp_4x32b  = _mm_set_epi16(pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1],
  173|   439k|                                      pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  174|   439k|                                      pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  175|       |
  176|   439k|    const_temp1_4x32b = _mm_set_epi16(pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)],
  177|   439k|                                      pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  178|       |
  179|   439k|    const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  180|   439k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  181|   439k|    const_temp7_4x32b = _mm_set1_epi16(4);
  182|       |
  183|   439k|    zero_8x16b = _mm_set1_epi32(0);
  184|       |
  185|   439k|    if(nt % 4 == 0 && nt < 32)
  ------------------
  |  Branch (185:8): [True: 439k, False: 6]
  |  Branch (185:23): [True: 439k, False: 18.4E]
  ------------------
  186|   439k|    {
  187|   439k|        const_temp7_4x32b = _mm_set1_epi16(4);
  188|       |
  189|  4.46M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (189:22): [True: 4.02M, False: 439k]
  ------------------
  190|  4.02M|        {
  191|  4.02M|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  192|  4.02M|            __m128i res_temp3_8x16b;
  193|       |
  194|  4.02M|            const_temp2_4x32b  = _mm_set_epi16(pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1],
  195|  4.02M|                                               pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  196|  4.02M|                                               pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  197|       |
  198|  4.02M|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  199|  4.02M|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  200|       |
  201|  4.02M|            const_temp5_4x32b = _mm_set_epi16(3, 3, 2, 2, 1, 1, 0, 0);
  202|  4.02M|            col_8x16b = _mm_set_epi16(4, 4, 3, 3, 2, 2, 1, 1);
  203|       |
  204|  4.02M|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  205|       |
  206|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  207|  4.02M|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  208|       |
  209|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  210|  4.02M|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  211|       |
  212|  15.9M|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (212:26): [True: 11.9M, False: 4.02M]
  ------------------
  213|  11.9M|            {
  214|  11.9M|                __m128i src_temp_8x16b;
  215|       |
  216|       |                /* loding 8bit 16 pixles*/
  217|  11.9M|                src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  218|       |
  219|       |                //src_temp_8x16b =  _mm_cvtepu8_epi16 (src_temp_8x16b); /* row=0*/
  220|  11.9M|                src_temp_8x16b = _mm_unpacklo_epi8(src_temp_8x16b, zero_8x16b);
  221|       |
  222|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  223|  11.9M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  224|       |
  225|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  226|  11.9M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  227|       |
  228|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  229|  11.9M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  230|       |
  231|  11.9M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  232|  11.9M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  233|  11.9M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  234|       |
  235|  11.9M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, (log2nt + 1));
  236|  11.9M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  237|       |
  238|  11.9M|                _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd) + col), res_temp1_8x16b);
  239|       |
  240|  11.9M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  241|  11.9M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  242|  11.9M|            } /* inner loop ends here */
  243|  4.02M|        }
  244|   439k|    }
  245|      2|    else if(nt == 32)
  ------------------
  |  Branch (245:13): [True: 0, False: 2]
  ------------------
  246|      0|    {
  247|       |        /* 32-bit accumulation path for nt=32 to prevent overflow */
  248|      0|        __m128i top_right_4x32b, bottom_left_4x32b;
  249|      0|        __m128i top_right_factor_lo_4x32b, top_right_factor_hi_4x32b;
  250|      0|        __m128i left_factor_lo_4x32b, left_factor_hi_4x32b;
  251|      0|        __m128i const_4_4x32b;
  252|       |
  253|       |        /* pu1_ref[2 * (three_nt + 1)] = p[nTbS][-1] - top right reference */
  254|      0|        top_right_4x32b  = _mm_set_epi32(pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  255|      0|                                         pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  256|       |
  257|       |        /* pu1_ref[2 * (nt - 1)] = p[-1][nTbS] - bottom left reference */
  258|      0|        bottom_left_4x32b = _mm_set_epi32(pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)],
  259|      0|                                          pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  260|       |
  261|      0|        const_4_4x32b = _mm_set1_epi32(4);
  262|       |
  263|      0|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (263:22): [True: 0, False: 0]
  ------------------
  264|      0|        {
  265|      0|            __m128i left_4x32b, row_factor_4x32b, top_factor_4x32b;
  266|      0|            __m128i base_4x32b;
  267|       |
  268|       |            /* pu1_ref[2 * (two_nt - 1 - row)] = p[-1][y] - left reference for current row */
  269|      0|            left_4x32b = _mm_set_epi32(pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  270|      0|                                       pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  271|       |
  272|       |            /* Row factors: (y + 1) and (nTbS - 1 - y) */
  273|      0|            row_factor_4x32b = _mm_set1_epi32(row + 1);
  274|      0|            top_factor_4x32b = _mm_set1_epi32(nt - 1 - row);
  275|       |
  276|       |            /* Initialize column factors for first iteration */
  277|      0|            top_right_factor_lo_4x32b = _mm_set_epi32(2, 2, 1, 1);
  278|      0|            top_right_factor_hi_4x32b = _mm_set_epi32(4, 4, 3, 3);
  279|      0|            left_factor_lo_4x32b = _mm_set_epi32(nt - 2, nt - 2, nt - 1, nt - 1);
  280|      0|            left_factor_hi_4x32b = _mm_set_epi32(nt - 4, nt - 4, nt - 3, nt - 3);
  281|       |
  282|       |            /* Base value: (y + 1) * p[-1][nTbS] + nTbS */
  283|      0|            base_4x32b = _mm_mullo_epi32(row_factor_4x32b, bottom_left_4x32b);
  284|      0|            base_4x32b = _mm_add_epi32(base_4x32b, _mm_set1_epi32(nt));
  285|       |
  286|      0|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (286:26): [True: 0, False: 0]
  ------------------
  287|      0|            {
  288|      0|                __m128i top_8x16b, top_lo_4x32b, top_hi_4x32b;
  289|      0|                __m128i res_temp1_4x32b, res_temp2_4x32b, res_temp3_4x32b;
  290|       |
  291|       |                /* Load 8 bytes of top reference: p[x][-1] */
  292|      0|                top_8x16b = _mm_loadl_epi64((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  293|      0|                top_8x16b = _mm_unpacklo_epi8(top_8x16b, zero_8x16b);
  294|       |
  295|       |                /* Unpack to 32-bit for low and high halves */
  296|      0|                top_lo_4x32b = _mm_unpacklo_epi16(top_8x16b, zero_8x16b);
  297|      0|                top_hi_4x32b = _mm_unpackhi_epi16(top_8x16b, zero_8x16b);
  298|       |
  299|       |                /* (nTbS - 1 - y) * p[x][-1] */
  300|      0|                res_temp1_4x32b = _mm_mullo_epi32(top_factor_4x32b, top_lo_4x32b);
  301|       |
  302|       |                /* (x + 1) * p[nTbS][-1] */
  303|      0|                res_temp2_4x32b = _mm_mullo_epi32(top_right_factor_lo_4x32b, top_right_4x32b);
  304|       |
  305|       |                /* (nTbS - 1 - x) * p[-1][y] */
  306|      0|                res_temp3_4x32b = _mm_mullo_epi32(left_factor_lo_4x32b, left_4x32b);
  307|       |
  308|       |                /* Accumulate all terms */
  309|      0|                res_temp1_4x32b = _mm_add_epi32(base_4x32b, res_temp1_4x32b);
  310|      0|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp2_4x32b);
  311|      0|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp3_4x32b);
  312|       |
  313|      0|                res_temp1_4x32b = _mm_srli_epi32(res_temp1_4x32b, log2nt + 1);
  314|       |
  315|      0|                res_temp2_4x32b = _mm_mullo_epi32(top_factor_4x32b, top_hi_4x32b);
  316|      0|                res_temp3_4x32b = _mm_mullo_epi32(top_right_factor_hi_4x32b, top_right_4x32b);
  317|      0|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, res_temp3_4x32b);
  318|       |
  319|      0|                res_temp3_4x32b = _mm_mullo_epi32(left_factor_hi_4x32b, left_4x32b);
  320|      0|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, res_temp3_4x32b);
  321|      0|                res_temp2_4x32b = _mm_add_epi32(base_4x32b, res_temp2_4x32b);
  322|       |
  323|      0|                res_temp2_4x32b = _mm_srli_epi32(res_temp2_4x32b, log2nt + 1);
  324|       |
  325|       |                /* Pack 32-bit -> 16-bit -> 8-bit and store */
  326|      0|                top_8x16b = _mm_packus_epi32(res_temp1_4x32b, res_temp2_4x32b);
  327|      0|                top_8x16b = _mm_packus_epi16(top_8x16b, zero_8x16b);
  328|      0|                _mm_storel_epi64((__m128i *)(pu1_dst + row * dst_strd + col), top_8x16b);
  329|       |
  330|       |                /* Update column factors for next iteration */
  331|      0|                left_factor_lo_4x32b = _mm_sub_epi32(left_factor_lo_4x32b, const_4_4x32b);
  332|      0|                left_factor_hi_4x32b = _mm_sub_epi32(left_factor_hi_4x32b, const_4_4x32b);
  333|      0|                top_right_factor_lo_4x32b = _mm_add_epi32(top_right_factor_lo_4x32b, const_4_4x32b);
  334|      0|                top_right_factor_hi_4x32b = _mm_add_epi32(top_right_factor_hi_4x32b, const_4_4x32b);
  335|      0|            }
  336|      0|        }
  337|      0|    }
  338|   439k|}
ihevc_intra_pred_chroma_dc_ssse3:
  383|   182k|{
  384|       |
  385|   182k|    WORD32 acc_dc_u, acc_dc_v;
  386|   182k|    WORD32 dc_val_u, dc_val_v;
  387|   182k|    WORD32 row, i;
  388|   182k|    WORD32 log2nt = 5;
  389|   182k|    __m128i src_temp1, src_temp3, src_temp4, src_temp5, src_temp6, m_mask;
  390|   182k|    __m128i src_temp7, src_temp8, src_temp9, src_temp10, src_temp11;
  391|   182k|    __m128i m_zero = _mm_set1_epi32(0);
  392|   182k|    UNUSED(src_strd);
  ------------------
  |  |   38|   182k|#define UNUSED(x) ((void)(x))
  ------------------
  393|   182k|    UNUSED(mode);
  ------------------
  |  |   38|   182k|#define UNUSED(x) ((void)(x))
  ------------------
  394|       |
  395|   182k|    switch(nt)
  396|   182k|    {
  397|      0|        case 32:
  ------------------
  |  Branch (397:9): [True: 0, False: 182k]
  ------------------
  398|      0|            log2nt = 5;
  399|      0|            break;
  400|  45.7k|        case 16:
  ------------------
  |  Branch (400:9): [True: 45.7k, False: 136k]
  ------------------
  401|  45.7k|            log2nt = 4;
  402|  45.7k|            break;
  403|  46.6k|        case 8:
  ------------------
  |  Branch (403:9): [True: 46.6k, False: 136k]
  ------------------
  404|  46.6k|            log2nt = 3;
  405|  46.6k|            break;
  406|  90.3k|        case 4:
  ------------------
  |  Branch (406:9): [True: 90.3k, False: 92.3k]
  ------------------
  407|  90.3k|            log2nt = 2;
  408|  90.3k|            break;
  409|      0|        default:
  ------------------
  |  Branch (409:9): [True: 0, False: 182k]
  ------------------
  410|      0|            break;
  411|   182k|    }
  412|       |
  413|   182k|    acc_dc_u = 0;
  414|   182k|    acc_dc_v = 0;
  415|       |
  416|       |    /* Calculate DC value for the transform block */
  417|       |
  418|   182k|    m_mask = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY9[0]);
  419|       |
  420|   182k|    if(nt == 32)
  ------------------
  |  Branch (420:8): [True: 0, False: 182k]
  ------------------
  421|      0|    {
  422|      0|        __m128i temp_sad, sign_8x16b;
  423|       |
  424|      0|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  425|      0|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  426|      0|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  427|      0|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  428|       |
  429|      0|        src_temp5  = _mm_unpacklo_epi8(src_temp3, m_zero);
  430|      0|        src_temp6  = _mm_unpacklo_epi8(src_temp4, m_zero);
  431|      0|        src_temp9  = _mm_unpacklo_epi8(src_temp7, m_zero);
  432|      0|        src_temp10 = _mm_unpacklo_epi8(src_temp8, m_zero);
  433|       |
  434|      0|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  435|      0|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  436|      0|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  437|      0|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  438|       |
  439|      0|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  440|      0|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  441|      0|        src_temp7 = _mm_unpacklo_epi8(src_temp7, m_zero);
  442|      0|        src_temp8 = _mm_unpacklo_epi8(src_temp8, m_zero);
  443|       |
  444|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  445|      0|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  446|      0|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  447|      0|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  448|       |
  449|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  450|      0|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  451|       |
  452|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  453|       |
  454|      0|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 64));
  455|      0|        src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 80));
  456|      0|        src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 96));
  457|      0|        src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 112));
  458|       |
  459|      0|        src_temp5  = _mm_unpacklo_epi8(src_temp3, m_zero);
  460|      0|        src_temp9  = _mm_unpacklo_epi8(src_temp6, m_zero);
  461|      0|        src_temp10 = _mm_unpacklo_epi8(src_temp7, m_zero);
  462|      0|        src_temp11 = _mm_unpacklo_epi8(src_temp8, m_zero);
  463|       |
  464|      0|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  465|      0|        src_temp6 = _mm_srli_si128(src_temp6, 8);
  466|      0|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  467|      0|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  468|       |
  469|      0|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  470|      0|        src_temp6 = _mm_unpacklo_epi8(src_temp6, m_zero);
  471|      0|        src_temp7 = _mm_unpacklo_epi8(src_temp7, m_zero);
  472|      0|        src_temp8 = _mm_unpacklo_epi8(src_temp8, m_zero);
  473|       |
  474|      0|        src_temp3 = _mm_add_epi16(src_temp3, src_temp5);
  475|      0|        src_temp6 = _mm_add_epi16(src_temp6, src_temp9);
  476|      0|        src_temp7 = _mm_add_epi16(src_temp7, src_temp10);
  477|      0|        src_temp8 = _mm_add_epi16(src_temp8, src_temp11);
  478|       |
  479|      0|        src_temp3 = _mm_add_epi16(src_temp3, src_temp6);
  480|      0|        src_temp7 = _mm_add_epi16(src_temp7, src_temp8);
  481|       |
  482|      0|        src_temp3 = _mm_add_epi16(src_temp3, src_temp7);
  483|      0|        src_temp4 = _mm_add_epi16(src_temp4, src_temp3);
  484|       |
  485|      0|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  486|      0|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  487|      0|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  488|       |
  489|      0|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  490|      0|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  491|       |
  492|      0|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  493|      0|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  494|      0|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  495|      0|    }
  496|   182k|    else if(nt == 16)
  ------------------
  |  Branch (496:13): [True: 45.7k, False: 136k]
  ------------------
  497|  45.7k|    {
  498|  45.7k|        __m128i temp_sad, sign_8x16b;
  499|       |
  500|  45.7k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  501|  45.7k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  502|  45.7k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  503|  45.7k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  504|       |
  505|  45.7k|        src_temp5  = _mm_unpacklo_epi8(src_temp3, m_zero);
  506|  45.7k|        src_temp6  = _mm_unpacklo_epi8(src_temp4, m_zero);
  507|  45.7k|        src_temp9  = _mm_unpacklo_epi8(src_temp7, m_zero);
  508|  45.7k|        src_temp10 = _mm_unpacklo_epi8(src_temp8, m_zero);
  509|       |
  510|  45.7k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  511|  45.7k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  512|  45.7k|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  513|  45.7k|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  514|       |
  515|  45.7k|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  516|  45.7k|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  517|  45.7k|        src_temp7 = _mm_unpacklo_epi8(src_temp7, m_zero);
  518|  45.7k|        src_temp8 = _mm_unpacklo_epi8(src_temp8, m_zero);
  519|       |
  520|  45.7k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  521|  45.7k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  522|  45.7k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  523|  45.7k|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  524|       |
  525|  45.7k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  526|  45.7k|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  527|       |
  528|  45.7k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  529|  45.7k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  530|  45.7k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  531|  45.7k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  532|       |
  533|  45.7k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  534|  45.7k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  535|       |
  536|  45.7k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  537|  45.7k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  538|  45.7k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  539|  45.7k|    }
  540|       |
  541|   136k|    else if(nt == 8)
  ------------------
  |  Branch (541:13): [True: 46.6k, False: 90.2k]
  ------------------
  542|  46.6k|    {
  543|  46.6k|        __m128i temp_sad, sign_8x16b;
  544|  46.6k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  545|  46.6k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  546|       |
  547|  46.6k|        src_temp5 = _mm_unpacklo_epi8(src_temp3, m_zero);
  548|  46.6k|        src_temp6 = _mm_unpacklo_epi8(src_temp4, m_zero);
  549|       |
  550|  46.6k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  551|  46.6k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  552|       |
  553|  46.6k|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  554|  46.6k|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  555|       |
  556|  46.6k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  557|  46.6k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  558|       |
  559|  46.6k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  560|  46.6k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  561|  46.6k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  562|  46.6k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  563|       |
  564|  46.6k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  565|  46.6k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  566|       |
  567|  46.6k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  568|  46.6k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  569|  46.6k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  570|  46.6k|    }
  571|       |
  572|  90.2k|    else if(nt == 4)
  ------------------
  |  Branch (572:13): [True: 90.3k, False: 18.4E]
  ------------------
  573|  90.3k|    {
  574|  90.3k|        __m128i temp_sad, sign_8x16b;
  575|  90.3k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  576|       |
  577|  90.3k|        src_temp5 =  _mm_unpacklo_epi8(src_temp3, m_zero);
  578|  90.3k|        src_temp4 = _mm_srli_si128(src_temp3, 8);
  579|       |
  580|  90.3k|        src_temp4 =  _mm_unpacklo_epi8(src_temp4, m_zero);
  581|       |
  582|  90.3k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  583|       |
  584|  90.3k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  585|  90.3k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  586|  90.3k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  587|       |
  588|  90.3k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  589|  90.3k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  590|       |
  591|  90.3k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  592|  90.3k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  593|  90.3k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  594|  90.3k|    }
  595|       |
  596|       |
  597|   182k|    acc_dc_u += pu1_ref[6 * nt];
  598|   182k|    acc_dc_v += pu1_ref[6 * nt + 1];
  599|       |
  600|   182k|    acc_dc_u -= pu1_ref[4 * nt];
  601|   182k|    acc_dc_v -= pu1_ref[4 * nt + 1];
  602|       |
  603|   182k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  604|   182k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  605|       |
  606|   182k|    dc_val_u = dc_val_u | (dc_val_v << 8);
  607|       |
  608|       |    /* Fill the remaining rows with DC value*/
  609|       |
  610|   182k|    if(nt == 4)
  ------------------
  |  Branch (610:8): [True: 90.3k, False: 92.3k]
  ------------------
  611|  90.3k|    {
  612|  90.3k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  613|       |
  614|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  615|  90.3k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  616|  90.3k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  617|  90.3k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  618|  90.3k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  619|       |
  620|  90.3k|    }
  621|  92.3k|    else if(nt == 8)
  ------------------
  |  Branch (621:13): [True: 46.6k, False: 45.7k]
  ------------------
  622|  46.6k|    {
  623|  46.6k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  624|       |
  625|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  626|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  627|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  628|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  629|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  630|       |
  631|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  632|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  633|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  634|  46.6k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  635|       |
  636|  46.6k|    }
  637|  45.7k|    else if(nt == 16)
  ------------------
  |  Branch (637:13): [True: 45.7k, False: 18.4E]
  ------------------
  638|  45.7k|    {
  639|  45.7k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  640|       |
  641|   137k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (641:22): [True: 91.5k, False: 45.7k]
  ------------------
  642|  91.5k|        {
  643|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  644|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  645|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  646|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  647|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  648|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp1);
  649|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp1);
  650|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp1);
  651|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp1);
  652|       |
  653|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  654|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  655|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  656|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  657|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp1);
  658|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp1);
  659|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp1);
  660|  91.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp1);
  661|       |
  662|  91.5k|            pu1_dst += 8 * dst_strd;
  663|  91.5k|        }
  664|  45.7k|    }
  665|  18.4E|    else /* nt == 32 */
  666|  18.4E|    {
  667|  18.4E|        src_temp1 = _mm_set1_epi16(dc_val_u);
  668|       |
  669|  18.4E|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (669:22): [True: 0, False: 18.4E]
  ------------------
  670|      0|        {
  671|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  672|      0|            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (672:24): [True: 0, False: 0]
  ------------------
  673|      0|            {
  674|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 0), src_temp1);
  675|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 16), src_temp1);
  676|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 32), src_temp1);
  677|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (i * dst_strd) + 48), src_temp1);
  678|      0|            }
  679|       |
  680|      0|            pu1_dst += 8 * dst_strd;
  681|      0|        }
  682|  18.4E|    }
  683|       |
  684|   182k|}
ihevc_intra_pred_chroma_horz_ssse3:
  730|  83.1k|{
  731|       |
  732|  83.1k|    WORD32 row, col;
  733|  83.1k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6,  temp7, temp8;
  734|  83.1k|    UNUSED(src_strd);
  ------------------
  |  |   38|  83.1k|#define UNUSED(x) ((void)(x))
  ------------------
  735|  83.1k|    UNUSED(mode);
  ------------------
  |  |   38|  83.1k|#define UNUSED(x) ((void)(x))
  ------------------
  736|       |
  737|       |    /* Replication to next rows*/
  738|       |
  739|  83.1k|    if(nt == 8)
  ------------------
  |  Branch (739:8): [True: 12.8k, False: 70.2k]
  ------------------
  740|  12.8k|    {
  741|  38.6k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (741:22): [True: 25.7k, False: 12.8k]
  ------------------
  742|  25.7k|        {
  743|  25.7k|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  744|  25.7k|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  745|  25.7k|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  746|  25.7k|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  747|  25.7k|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  748|  25.7k|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  749|  25.7k|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  750|  25.7k|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  751|       |
  752|  25.7k|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  753|  25.7k|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  754|  25.7k|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  755|  25.7k|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  756|       |
  757|  25.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), temp2);
  758|  25.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), temp4);
  759|  25.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), temp6);
  760|  25.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), temp8);
  761|       |
  762|  25.7k|        }
  763|  12.8k|    }
  764|  70.2k|    else if(nt == 16)
  ------------------
  |  Branch (764:13): [True: 34.2k, False: 35.9k]
  ------------------
  765|  34.2k|    {
  766|   171k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (766:22): [True: 136k, False: 34.2k]
  ------------------
  767|   136k|        {
  768|   136k|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  769|   136k|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  770|       |
  771|   136k|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  772|   136k|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  773|       |
  774|   136k|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  775|   136k|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  776|       |
  777|   136k|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  778|   136k|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  779|       |
  780|   136k|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  781|   136k|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  782|   136k|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  783|   136k|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  784|       |
  785|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + 0), temp2);
  786|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + 16), temp2);
  787|       |
  788|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 0), temp4);
  789|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 16), temp4);
  790|       |
  791|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 0), temp6);
  792|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 16), temp6);
  793|       |
  794|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 0), temp8);
  795|   136k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 16), temp8);
  796|       |
  797|       |
  798|   136k|        }
  799|  34.2k|    }
  800|  35.9k|    else if(nt == 32)
  ------------------
  |  Branch (800:13): [True: 0, False: 35.9k]
  ------------------
  801|      0|    {
  802|      0|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (802:22): [True: 0, False: 0]
  ------------------
  803|      0|        {
  804|      0|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  805|      0|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  806|      0|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  807|      0|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  808|      0|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  809|      0|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  810|      0|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  811|      0|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  812|       |
  813|      0|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  814|      0|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  815|      0|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  816|      0|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  817|       |
  818|      0|            for(col = 0; col < 64; col += 16)
  ------------------
  |  Branch (818:26): [True: 0, False: 0]
  ------------------
  819|      0|            {
  820|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + col), temp2);
  821|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + col), temp4);
  822|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + col), temp6);
  823|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + col), temp8);
  824|      0|            }
  825|      0|        }
  826|      0|    }
  827|  35.9k|    else
  828|  35.9k|    {
  829|  35.9k|        temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 0]);
  830|  35.9k|        temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 0]);
  831|       |
  832|  35.9k|        temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 1]);
  833|  35.9k|        temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 1]);
  834|       |
  835|  35.9k|        temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 2]);
  836|  35.9k|        temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 2]);
  837|       |
  838|  35.9k|        temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 3]);
  839|  35.9k|        temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 3]);
  840|       |
  841|  35.9k|        temp2 = _mm_unpacklo_epi8(temp1, temp2);
  842|  35.9k|        temp4 = _mm_unpacklo_epi8(temp3, temp4);
  843|  35.9k|        temp6 = _mm_unpacklo_epi8(temp5, temp6);
  844|  35.9k|        temp8 = _mm_unpacklo_epi8(temp7, temp8);
  845|       |
  846|  35.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), temp2);
  847|  35.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), temp4);
  848|  35.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), temp6);
  849|  35.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), temp8);
  850|  35.9k|    }
  851|  83.1k|}
ihevc_intra_pred_chroma_ver_ssse3:
  897|   176k|{
  898|   176k|    WORD32 row;
  899|   176k|    __m128i src_temp1;
  900|   176k|    UNUSED(src_strd);
  ------------------
  |  |   38|   176k|#define UNUSED(x) ((void)(x))
  ------------------
  901|   176k|    UNUSED(mode);
  ------------------
  |  |   38|   176k|#define UNUSED(x) ((void)(x))
  ------------------
  902|       |
  903|       |    /* Replication to next columns*/
  904|   176k|    if(nt == 8)
  ------------------
  |  Branch (904:8): [True: 53.1k, False: 123k]
  ------------------
  905|  53.1k|    {
  906|  53.1k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  907|       |
  908|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), src_temp1);
  909|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
  910|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp1);
  911|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp1);
  912|       |
  913|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp1);
  914|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp1);
  915|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp1);
  916|  53.1k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp1);
  917|       |
  918|  53.1k|    }
  919|   176k|    if(nt == 16)
  ------------------
  |  Branch (919:8): [True: 73.8k, False: 102k]
  ------------------
  920|  73.8k|    {
  921|  73.8k|        __m128i temp1, temp2;
  922|       |
  923|  73.8k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  924|  73.8k|        temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 16));
  925|       |
  926|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  927|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp1);
  928|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp1);
  929|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp1);
  930|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp1);
  931|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp1);
  932|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp1);
  933|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp1);
  934|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp1);
  935|       |
  936|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp2);
  937|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp2);
  938|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp2);
  939|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp2);
  940|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp2);
  941|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp2);
  942|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp2);
  943|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp2);
  944|       |
  945|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp1);
  946|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp1);
  947|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp1);
  948|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp1);
  949|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp1);
  950|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp1);
  951|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp1);
  952|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp1);
  953|       |
  954|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp2);
  955|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp2);
  956|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp2);
  957|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp2);
  958|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp2);
  959|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp2);
  960|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp2);
  961|  73.8k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp2);
  962|       |
  963|  73.8k|    }
  964|   176k|    if(nt == 32)
  ------------------
  |  Branch (964:8): [True: 0, False: 176k]
  ------------------
  965|      0|    {
  966|      0|        __m128i temp1, temp2, temp3, temp4;
  967|       |
  968|      0|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  969|      0|        temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 16));
  970|      0|        temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 32));
  971|      0|        temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 48));
  972|      0|        for(row = 0; row < 32; row++)
  ------------------
  |  Branch (972:22): [True: 0, False: 0]
  ------------------
  973|      0|        {
  974|      0|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd) + 0),  temp1);
  975|      0|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd) + 16), temp2);
  976|      0|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd) + 32), temp3);
  977|      0|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd) + 48), temp4);
  978|      0|        }
  979|      0|    }
  980|   176k|    else
  981|   176k|    {
  982|   176k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  983|       |
  984|   176k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  985|   176k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  986|   176k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  987|   176k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  988|       |
  989|       |
  990|   176k|    }
  991|       |
  992|   176k|}
ihevc_intra_pred_chroma_mode2_ssse3:
 1037|   161k|{
 1038|   161k|    WORD32 row, col;
 1039|       |
 1040|       |
 1041|   161k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8, sm2, sm3;
 1042|   161k|    UNUSED(src_strd);
  ------------------
  |  |   38|   161k|#define UNUSED(x) ((void)(x))
  ------------------
 1043|   161k|    UNUSED(mode);
  ------------------
  |  |   38|   161k|#define UNUSED(x) ((void)(x))
  ------------------
 1044|       |
 1045|   161k|    sm2 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY7[0]);
 1046|   161k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY8[0]);
 1047|       |
 1048|       |    /* For the angle 45, replication is done from the corresponding angle */
 1049|       |    /* intra_pred_ang = tan(angle) in q5 format */
 1050|       |
 1051|   161k|    if(nt == 4)
  ------------------
  |  Branch (1051:8): [True: 59.0k, False: 102k]
  ------------------
 1052|  59.0k|    {
 1053|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1054|  59.0k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 0 - 8 - 2));
 1055|  59.0k|        src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 1 - 8 - 2));
 1056|  59.0k|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 2 - 8 - 2));
 1057|  59.0k|        src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 3 - 8 - 2));
 1058|       |
 1059|  59.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), _mm_shuffle_epi8(src_temp1, sm2));
 1060|  59.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), _mm_shuffle_epi8(src_temp2, sm2));
 1061|  59.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), _mm_shuffle_epi8(src_temp3, sm2));
 1062|  59.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), _mm_shuffle_epi8(src_temp4, sm2));
 1063|       |
 1064|  59.0k|    }
 1065|   102k|    else if(nt == 8)
  ------------------
  |  Branch (1065:13): [True: 27.3k, False: 74.7k]
  ------------------
 1066|  27.3k|    {
 1067|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1068|  27.3k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 0 - 16 - 2));
 1069|  27.3k|        src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 1 - 16 - 2));
 1070|  27.3k|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 2 - 16 - 2));
 1071|  27.3k|        src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 3 - 16 - 2));
 1072|  27.3k|        src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 4 - 16 - 2));
 1073|  27.3k|        src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 5 - 16 - 2));
 1074|  27.3k|        src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 6 - 16 - 2));
 1075|  27.3k|        src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 7 - 16 - 2));
 1076|       |
 1077|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), _mm_shuffle_epi8(src_temp1, sm3));
 1078|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), _mm_shuffle_epi8(src_temp2, sm3));
 1079|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), _mm_shuffle_epi8(src_temp3, sm3));
 1080|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), _mm_shuffle_epi8(src_temp4, sm3));
 1081|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), _mm_shuffle_epi8(src_temp5, sm3));
 1082|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), _mm_shuffle_epi8(src_temp6, sm3));
 1083|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), _mm_shuffle_epi8(src_temp7, sm3));
 1084|  27.3k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), _mm_shuffle_epi8(src_temp8, sm3));
 1085|       |
 1086|       |
 1087|  27.3k|    }
 1088|  74.7k|    else
 1089|  74.7k|    {
 1090|   224k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1090:22): [True: 149k, False: 74.7k]
  ------------------
 1091|   149k|        {
 1092|   448k|            for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1092:26): [True: 299k, False: 149k]
  ------------------
 1093|   299k|            {   /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1094|   299k|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 0) - (col + 16) - 2));
 1095|   299k|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 1) - (col + 16) - 2));
 1096|   299k|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 2) - (col + 16) - 2));
 1097|   299k|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 3) - (col + 16) - 2));
 1098|   299k|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 4) - (col + 16) - 2));
 1099|   299k|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 5) - (col + 16) - 2));
 1100|   299k|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 6) - (col + 16) - 2));
 1101|   299k|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 7) - (col + 16) - 2));
 1102|       |
 1103|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 0) * dst_strd)), _mm_shuffle_epi8(src_temp1, sm3));
 1104|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 1) * dst_strd)), _mm_shuffle_epi8(src_temp2, sm3));
 1105|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 2) * dst_strd)), _mm_shuffle_epi8(src_temp3, sm3));
 1106|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 3) * dst_strd)), _mm_shuffle_epi8(src_temp4, sm3));
 1107|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 4) * dst_strd)), _mm_shuffle_epi8(src_temp5, sm3));
 1108|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 5) * dst_strd)), _mm_shuffle_epi8(src_temp6, sm3));
 1109|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 6) * dst_strd)), _mm_shuffle_epi8(src_temp7, sm3));
 1110|   299k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 7) * dst_strd)), _mm_shuffle_epi8(src_temp8, sm3));
 1111|   299k|            }
 1112|   149k|        }
 1113|  74.7k|    }
 1114|   161k|}
ihevc_intra_pred_chroma_mode_18_34_ssse3:
 1159|  87.8k|{
 1160|  87.8k|    WORD32 row, col;
 1161|  87.8k|    WORD32 idx = 0;
 1162|       |
 1163|  87.8k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
 1164|  87.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  87.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1165|       |
 1166|  87.8k|    if(mode == 34)
  ------------------
  |  Branch (1166:8): [True: 59.1k, False: 28.7k]
  ------------------
 1167|  59.1k|    {
 1168|  59.1k|        if(nt == 4)
  ------------------
  |  Branch (1168:12): [True: 31.6k, False: 27.5k]
  ------------------
 1169|  31.6k|        {
 1170|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1171|  31.6k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1172|  31.6k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1173|  31.6k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1174|  31.6k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1175|       |
 1176|  31.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1177|  31.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1178|  31.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1179|  31.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1180|       |
 1181|  31.6k|        }
 1182|  27.5k|        else if(nt == 8)
  ------------------
  |  Branch (1182:17): [True: 9.27k, False: 18.2k]
  ------------------
 1183|  9.27k|        {
 1184|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1185|  9.27k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1186|  9.27k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1187|  9.27k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1188|  9.27k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1189|  9.27k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + (4 * nt) + 2 * idx + 2));
 1190|  9.27k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + (4 * nt) + 2 * idx + 2));
 1191|  9.27k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + (4 * nt) + 2 * idx + 2));
 1192|  9.27k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + (4 * nt) + 2 * idx + 2));
 1193|       |
 1194|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1195|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1196|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1197|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1198|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
 1199|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
 1200|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
 1201|  9.27k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
 1202|       |
 1203|       |
 1204|  9.27k|        }
 1205|  18.2k|        else if(nt == 16)
  ------------------
  |  Branch (1205:17): [True: 18.2k, False: 18.4E]
  ------------------
 1206|  18.2k|        {
 1207|  18.2k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 1208|  54.7k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1208:26): [True: 36.5k, False: 18.2k]
  ------------------
 1209|  36.5k|            {
 1210|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 1211|  36.5k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1212|  36.5k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1213|  36.5k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1214|  36.5k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1215|  36.5k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1216|  36.5k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1217|  36.5k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1218|  36.5k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1219|       |
 1220|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 1221|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 1222|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 1223|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 1224|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 1225|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 1226|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 1227|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 1228|       |
 1229|  36.5k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1230|  36.5k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1231|  36.5k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1232|  36.5k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1233|  36.5k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1234|  36.5k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1235|  36.5k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1236|  36.5k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1237|       |
 1238|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 1239|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 1240|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 1241|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 1242|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 1243|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 1244|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 1245|  36.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 1246|       |
 1247|  36.5k|                pu1_ref += 2 * 8;
 1248|  36.5k|                pu1_dst += 8 * dst_strd;
 1249|  36.5k|            }
 1250|  18.2k|        }
 1251|  18.4E|        else // nt == 32
 1252|  18.4E|        {
 1253|  18.4E|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1253:26): [True: 0, False: 18.4E]
  ------------------
 1254|      0|            {
 1255|      0|                for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1255:30): [True: 0, False: 0]
  ------------------
 1256|      0|                {
 1257|       |                    /*pu1_ref[two_nt + col + idx + 1]*/
 1258|      0|                    src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + col + (4 * nt) + 2 * idx + 2));
 1259|      0|                    src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + col + (4 * nt) + 2 * idx + 2));
 1260|      0|                    src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + col + (4 * nt) + 2 * idx + 2));
 1261|      0|                    src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + col + (4 * nt) + 2 * idx + 2));
 1262|      0|                    src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + col + (4 * nt) + 2 * idx + 2));
 1263|      0|                    src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + col + (4 * nt) + 2 * idx + 2));
 1264|      0|                    src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + col + (4 * nt) + 2 * idx + 2));
 1265|      0|                    src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + col + (4 * nt) + 2 * idx + 2));
 1266|       |
 1267|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (0 * dst_strd)), src_temp1);
 1268|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (1 * dst_strd)), src_temp2);
 1269|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (2 * dst_strd)), src_temp3);
 1270|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (3 * dst_strd)), src_temp4);
 1271|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (4 * dst_strd)), src_temp5);
 1272|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (5 * dst_strd)), src_temp6);
 1273|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (6 * dst_strd)), src_temp7);
 1274|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (7 * dst_strd)), src_temp8);
 1275|      0|                }
 1276|      0|                pu1_ref += 2 * 8;
 1277|      0|                pu1_dst += 8 * dst_strd;
 1278|      0|            }
 1279|  18.4E|        }
 1280|  59.1k|    }
 1281|  28.7k|    else
 1282|  28.7k|    {
 1283|  28.7k|        if(nt == 4)
  ------------------
  |  Branch (1283:12): [True: 7.28k, False: 21.4k]
  ------------------
 1284|  7.28k|        {
 1285|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1286|  7.28k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1287|  7.28k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1288|  7.28k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1289|  7.28k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1290|       |
 1291|  7.28k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1292|  7.28k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1293|  7.28k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1294|  7.28k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1295|       |
 1296|       |
 1297|  7.28k|        }
 1298|  21.4k|        else if(nt == 8)
  ------------------
  |  Branch (1298:17): [True: 5.29k, False: 16.1k]
  ------------------
 1299|  5.29k|        {
 1300|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1301|  5.29k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1302|  5.29k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1303|  5.29k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1304|  5.29k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1305|  5.29k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + (4 * nt) + 2 * idx + 2));
 1306|  5.29k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + (4 * nt) + 2 * idx + 2));
 1307|  5.29k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + (4 * nt) + 2 * idx + 2));
 1308|  5.29k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + (4 * nt) + 2 * idx + 2));
 1309|       |
 1310|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1311|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1312|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1313|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1314|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
 1315|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
 1316|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
 1317|  5.29k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
 1318|       |
 1319|       |
 1320|  5.29k|        }
 1321|  16.1k|        else if(nt == 16)
  ------------------
  |  Branch (1321:17): [True: 16.1k, False: 18.4E]
  ------------------
 1322|  16.1k|        {
 1323|  16.1k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 1324|  48.5k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1324:26): [True: 32.3k, False: 16.1k]
  ------------------
 1325|  32.3k|            {
 1326|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 1327|  32.3k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1328|  32.3k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1329|  32.3k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1330|  32.3k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1331|  32.3k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1332|  32.3k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1333|  32.3k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1334|  32.3k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1335|       |
 1336|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 1337|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 1338|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 1339|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 1340|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 1341|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 1342|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 1343|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 1344|       |
 1345|  32.3k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1346|  32.3k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1347|  32.3k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1348|  32.3k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1349|  32.3k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1350|  32.3k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1351|  32.3k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1352|  32.3k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1353|       |
 1354|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 1355|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 1356|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 1357|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 1358|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 1359|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 1360|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 1361|  32.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 1362|       |
 1363|  32.3k|                pu1_ref -= 2 * 8;
 1364|  32.3k|                pu1_dst += 8 * dst_strd;
 1365|  32.3k|            }
 1366|  16.1k|        }
 1367|  18.4E|        else // nt == 32
 1368|  18.4E|        {
 1369|  18.4E|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1369:26): [True: 0, False: 18.4E]
  ------------------
 1370|      0|            {
 1371|      0|                for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1371:30): [True: 0, False: 0]
  ------------------
 1372|      0|                {
 1373|       |                    /*pu1_ref[two_nt + col + idx + 1]*/
 1374|      0|                    src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + col + (4 * nt) + 2 * idx + 2));
 1375|      0|                    src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + col + (4 * nt) + 2 * idx + 2));
 1376|      0|                    src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + col + (4 * nt) + 2 * idx + 2));
 1377|      0|                    src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + col + (4 * nt) + 2 * idx + 2));
 1378|      0|                    src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + col + (4 * nt) + 2 * idx + 2));
 1379|      0|                    src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + col + (4 * nt) + 2 * idx + 2));
 1380|      0|                    src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + col + (4 * nt) + 2 * idx + 2));
 1381|      0|                    src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + col + (4 * nt) + 2 * idx + 2));
 1382|       |
 1383|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (0 * dst_strd)), src_temp1);
 1384|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (1 * dst_strd)), src_temp2);
 1385|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (2 * dst_strd)), src_temp3);
 1386|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (3 * dst_strd)), src_temp4);
 1387|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (4 * dst_strd)), src_temp5);
 1388|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (5 * dst_strd)), src_temp6);
 1389|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (6 * dst_strd)), src_temp7);
 1390|      0|                    _mm_storeu_si128((__m128i *)(pu1_dst + col + (7 * dst_strd)), src_temp8);
 1391|      0|                }
 1392|      0|                pu1_ref -= 2 * 8;
 1393|      0|                pu1_dst += 8 * dst_strd;
 1394|      0|            }
 1395|  18.4E|        }
 1396|  28.7k|    }
 1397|       |
 1398|  87.8k|}
ihevc_intra_pred_chroma_mode_3_to_9_ssse3:
 1443|   241k|{
 1444|   241k|    WORD32 row, col;
 1445|       |
 1446|   241k|    WORD32 intra_pred_ang;
 1447|       |
 1448|   241k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1449|   241k|    __m128i fract_4x32b, zero_8x16b, intra_pred_ang_4x32b;
 1450|   241k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm1;
 1451|   241k|    UNUSED(src_strd);
  ------------------
  |  |   38|   241k|#define UNUSED(x) ((void)(x))
  ------------------
 1452|       |
 1453|       |    /* Intra Pred Angle according to the mode */
 1454|   241k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1455|       |
 1456|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1457|       |    /* samples dependent on distance to obtain destination sample */
 1458|       |
 1459|   241k|    sm1 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY7[0]);
 1460|   241k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1461|   241k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1462|   241k|    const_temp3_4x32b = _mm_set1_epi16(32);
 1463|   241k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1464|       |
 1465|   241k|    two_nt_4x32b = _mm_set1_epi32(1);
 1466|       |
 1467|   241k|    zero_8x16b = _mm_set1_epi16(0);
 1468|       |
 1469|       |
 1470|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1471|   241k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1472|       |
 1473|   241k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1474|       |
 1475|   241k|    if(nt == 4)
  ------------------
  |  Branch (1475:8): [True: 47.5k, False: 193k]
  ------------------
 1476|  47.5k|    {
 1477|  47.5k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1478|  47.5k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1479|  47.5k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1480|  47.5k|        const_temp4_4x32b = _mm_set1_epi16(4);
 1481|  47.5k|        two_nt_4x32b = _mm_set1_epi16((4 * nt) - 2);
 1482|       |
 1483|  47.5k|        {
 1484|  47.5k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1485|  47.5k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1486|       |
 1487|  47.5k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1488|  47.5k|            __m128i src_values10;
 1489|       |
 1490|  47.5k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1491|       |
 1492|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1493|  47.5k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1494|       |
 1495|       |            /* fract = pos & (31); */
 1496|  47.5k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1497|       |
 1498|  47.5k|            ref_main_idx_4x32b = _mm_srai_epi16(res_temp5_4x32b,  5);
 1499|       |
 1500|  47.5k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b,  ref_main_idx_4x32b);
 1501|       |
 1502|  47.5k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, ref_main_idx_4x32b);
 1503|       |
 1504|  47.5k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1505|       |
 1506|       |            /*(32 - fract) */
 1507|  47.5k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1508|       |
 1509|  47.5k|            _mm_storel_epi64((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1510|  47.5k|            _mm_storel_epi64((__m128i *)(ai1_src_temp_val),  src_values10);
 1511|       |
 1512|  47.5k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1513|  47.5k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1514|  47.5k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1515|  47.5k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1516|       |
 1517|  47.5k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1518|  47.5k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1519|  47.5k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1520|  47.5k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1521|       |
 1522|  47.5k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1523|  47.5k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1524|  47.5k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1525|  47.5k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1526|       |
 1527|  47.5k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1528|  47.5k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1529|  47.5k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1530|  47.5k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1531|       |
 1532|  47.5k|            {
 1533|  47.5k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1534|  47.5k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1535|       |
 1536|       |                /* loding 8-bit 16 pixels */
 1537|  47.5k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 8)); /* col=0*/
 1538|  47.5k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 8)); /* col=1*/
 1539|  47.5k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 8)); /* col=2*/
 1540|  47.5k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 8)); /* col=3*/
 1541|       |
 1542|  47.5k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1543|  47.5k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1544|  47.5k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1545|  47.5k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1546|       |
 1547|  47.5k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp1_8x16b, src_temp5_8x16b); /* col=0*/
 1548|  47.5k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp2_8x16b, src_temp6_8x16b); /* col=1*/
 1549|  47.5k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp3_8x16b, src_temp7_8x16b); /* col=2*/
 1550|  47.5k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp4_8x16b, src_temp8_8x16b); /* col=3*/
 1551|       |
 1552|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1553|  47.5k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1554|  47.5k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1555|  47.5k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1556|  47.5k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1557|       |
 1558|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1559|  47.5k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1560|  47.5k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1561|  47.5k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1562|  47.5k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1563|       |
 1564|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1565|  47.5k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1566|  47.5k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1567|  47.5k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1568|  47.5k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1569|       |
 1570|       |                /* converting 16 bit to 8 bit */
 1571|  47.5k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1572|  47.5k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1573|  47.5k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1574|  47.5k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1575|       |
 1576|  47.5k|                src_temp1_8x16b = _mm_shuffle_epi8(src_temp1_8x16b, sm1);
 1577|  47.5k|                src_temp2_8x16b = _mm_shuffle_epi8(src_temp2_8x16b, sm1);
 1578|  47.5k|                src_temp3_8x16b = _mm_shuffle_epi8(src_temp3_8x16b, sm1);
 1579|  47.5k|                src_temp4_8x16b = _mm_shuffle_epi8(src_temp4_8x16b, sm1);
 1580|       |
 1581|  47.5k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1582|  47.5k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1583|       |
 1584|  47.5k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1585|  47.5k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1586|       |
 1587|  47.5k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp8_8x16b);             /* row=0*/
 1588|       |
 1589|  47.5k|                src_temp2_8x16b  = _mm_shuffle_epi32(src_temp8_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1590|  47.5k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp2_8x16b);       /* row=1*/
 1591|       |
 1592|  47.5k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp7_8x16b);       /* row=2*/
 1593|       |
 1594|  47.5k|                src_temp4_8x16b  = _mm_shuffle_epi32(src_temp7_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1595|  47.5k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp4_8x16b);       /* row=4*/
 1596|       |
 1597|  47.5k|            }
 1598|  47.5k|        }
 1599|  47.5k|    }
 1600|   193k|    else
 1601|   193k|    {
 1602|   193k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1603|   193k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1604|   193k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1605|   193k|        const_temp4_4x32b = _mm_set1_epi16(8);
 1606|   193k|        two_nt_4x32b = _mm_set1_epi16((4 * nt) - 2);
 1607|       |
 1608|   542k|        for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1608:22): [True: 349k, False: 193k]
  ------------------
 1609|   349k|        {
 1610|   349k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1611|   349k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 1612|   349k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1613|       |
 1614|   349k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1615|   349k|            __m128i fract5_8x16b, fract6_8x16b, fract7_8x16b, fract8_8x16b, src_values10;
 1616|       |
 1617|   349k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1618|   349k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 1619|       |
 1620|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1621|   349k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1622|       |
 1623|       |            /* fract = pos & (31); */
 1624|   349k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1625|       |
 1626|   349k|            ref_main_idx_4x32b = _mm_srai_epi16(res_temp5_4x32b,  5);
 1627|       |
 1628|   349k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b,  ref_main_idx_4x32b);
 1629|       |
 1630|   349k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, ref_main_idx_4x32b);
 1631|       |
 1632|   349k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1633|       |
 1634|       |            /*(32 - fract) */
 1635|   349k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1636|       |
 1637|   349k|            _mm_storeu_si128((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1638|   349k|            _mm_storeu_si128((__m128i *)(ai1_src_temp_val),  src_values10);
 1639|       |
 1640|   349k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1641|   349k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1642|   349k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1643|   349k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1644|       |
 1645|   349k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1646|   349k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1647|   349k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1648|   349k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1649|       |
 1650|   349k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1651|   349k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1652|   349k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1653|   349k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1654|       |
 1655|   349k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1656|   349k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1657|   349k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1658|   349k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1659|       |
 1660|   349k|            fract5_8x16b = _mm_set1_epi8(ai1_fract_temp_val[8]);  /* col=5*/
 1661|   349k|            fract6_8x16b = _mm_set1_epi8(ai1_fract_temp_val[10]);  /* col=6*/
 1662|   349k|            fract7_8x16b = _mm_set1_epi8(ai1_fract_temp_val[12]);  /* col=7*/
 1663|   349k|            fract8_8x16b = _mm_set1_epi8(ai1_fract_temp_val[14]);  /* col=8*/
 1664|       |
 1665|   349k|            temp11_8x16b = _mm_set1_epi8(ai1_src_temp_val[8]);  /* col=0*/
 1666|   349k|            temp12_8x16b = _mm_set1_epi8(ai1_src_temp_val[10]);  /* col=1*/
 1667|   349k|            temp13_8x16b = _mm_set1_epi8(ai1_src_temp_val[12]);  /* col=2*/
 1668|   349k|            temp14_8x16b = _mm_set1_epi8(ai1_src_temp_val[14]);  /* col=3*/
 1669|       |
 1670|   349k|            temp11_8x16b = _mm_unpacklo_epi8(temp11_8x16b, fract5_8x16b);
 1671|   349k|            temp12_8x16b = _mm_unpacklo_epi8(temp12_8x16b, fract6_8x16b);
 1672|   349k|            temp13_8x16b = _mm_unpacklo_epi8(temp13_8x16b, fract7_8x16b);
 1673|   349k|            temp14_8x16b = _mm_unpacklo_epi8(temp14_8x16b, fract8_8x16b);
 1674|       |
 1675|   349k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 1676|   349k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 1677|   349k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 1678|   349k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 1679|       |
 1680|  1.66M|            for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (1680:26): [True: 1.32M, False: 349k]
  ------------------
 1681|  1.32M|            {
 1682|  1.32M|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1683|  1.32M|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1684|       |
 1685|  1.32M|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 1686|  1.32M|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 1687|       |
 1688|       |                /* loding 8-bit 16 pixels */
 1689|  1.32M|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - row - (8 + row))); /* col=0*/
 1690|  1.32M|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - row - (8 + row))); /* col=1*/
 1691|  1.32M|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - row - (8 + row))); /* col=2*/
 1692|  1.32M|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - row - (8 + row))); /* col=3*/
 1693|       |
 1694|  1.32M|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1695|  1.32M|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1696|  1.32M|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1697|  1.32M|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1698|       |
 1699|  1.32M|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp1_8x16b, src_temp5_8x16b); /* col=0*/
 1700|  1.32M|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp2_8x16b, src_temp6_8x16b); /* col=1*/
 1701|  1.32M|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp3_8x16b, src_temp7_8x16b); /* col=2*/
 1702|  1.32M|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp4_8x16b, src_temp8_8x16b); /* col=3*/
 1703|       |
 1704|       |                /* loding 8-bit 16 pixels */
 1705|  1.32M|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - row - row - 8)); /* col=5*/
 1706|  1.32M|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - row - row - 8)); /* col=6*/
 1707|  1.32M|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - row - row - 8)); /* col=7*/
 1708|  1.32M|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - row - row - 8)); /* col=8*/
 1709|       |
 1710|  1.32M|                src_temp11_8x16b = _mm_srli_si128(src_temp15_8x16b, 2); /* col=5*/
 1711|  1.32M|                src_temp12_8x16b = _mm_srli_si128(src_temp16_8x16b, 2); /* col=6*/
 1712|  1.32M|                src_temp13_8x16b = _mm_srli_si128(src_temp17_8x16b, 2); /* col=7*/
 1713|  1.32M|                src_temp14_8x16b = _mm_srli_si128(src_temp18_8x16b, 2); /* col=8*/
 1714|       |
 1715|  1.32M|                src_temp11_8x16b =  _mm_unpacklo_epi8(src_temp11_8x16b, src_temp15_8x16b); /* col=0*/
 1716|  1.32M|                src_temp12_8x16b =  _mm_unpacklo_epi8(src_temp12_8x16b, src_temp16_8x16b); /* col=1*/
 1717|  1.32M|                src_temp13_8x16b =  _mm_unpacklo_epi8(src_temp13_8x16b, src_temp17_8x16b); /* col=2*/
 1718|  1.32M|                src_temp14_8x16b =  _mm_unpacklo_epi8(src_temp14_8x16b, src_temp18_8x16b); /* col=3*/
 1719|       |
 1720|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1721|  1.32M|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1722|  1.32M|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1723|  1.32M|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1724|  1.32M|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1725|       |
 1726|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1727|  1.32M|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 1728|  1.32M|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 1729|  1.32M|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 1730|  1.32M|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 1731|       |
 1732|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1733|  1.32M|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1734|  1.32M|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1735|  1.32M|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1736|  1.32M|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1737|       |
 1738|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1739|  1.32M|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1740|  1.32M|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1741|  1.32M|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1742|  1.32M|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1743|       |
 1744|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1745|  1.32M|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 1746|  1.32M|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 1747|  1.32M|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 1748|  1.32M|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 1749|       |
 1750|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1751|  1.32M|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 1752|  1.32M|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 1753|  1.32M|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 1754|  1.32M|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 1755|       |
 1756|       |                /* converting 16 bit to 8 bit */
 1757|  1.32M|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1758|  1.32M|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1759|  1.32M|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1760|  1.32M|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1761|       |
 1762|  1.32M|                src_temp1_8x16b = _mm_shuffle_epi8(src_temp1_8x16b, sm1);
 1763|  1.32M|                src_temp2_8x16b = _mm_shuffle_epi8(src_temp2_8x16b, sm1);
 1764|  1.32M|                src_temp3_8x16b = _mm_shuffle_epi8(src_temp3_8x16b, sm1);
 1765|  1.32M|                src_temp4_8x16b = _mm_shuffle_epi8(src_temp4_8x16b, sm1);
 1766|       |
 1767|       |                /* converting 16 bit to 8 bit */
 1768|  1.32M|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, zero_8x16b); /* col=5*/
 1769|  1.32M|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, zero_8x16b); /* col=6*/
 1770|  1.32M|                src_temp13_8x16b = _mm_packus_epi16(src_temp13_8x16b, zero_8x16b); /* col=7*/
 1771|  1.32M|                src_temp14_8x16b = _mm_packus_epi16(src_temp14_8x16b, zero_8x16b); /* col=8*/
 1772|       |
 1773|  1.32M|                src_temp11_8x16b = _mm_shuffle_epi8(src_temp11_8x16b, sm1);
 1774|  1.32M|                src_temp12_8x16b = _mm_shuffle_epi8(src_temp12_8x16b, sm1);
 1775|  1.32M|                src_temp13_8x16b = _mm_shuffle_epi8(src_temp13_8x16b, sm1);
 1776|  1.32M|                src_temp14_8x16b = _mm_shuffle_epi8(src_temp14_8x16b, sm1);
 1777|       |
 1778|  1.32M|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1779|  1.32M|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1780|       |
 1781|  1.32M|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1782|  1.32M|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1783|       |
 1784|  1.32M|                src_temp15_8x16b = _mm_unpacklo_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1785|  1.32M|                src_temp16_8x16b = _mm_unpacklo_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1786|       |
 1787|  1.32M|                src_temp18_8x16b = _mm_unpacklo_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1788|  1.32M|                src_temp17_8x16b = _mm_unpackhi_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1789|       |
 1790|  1.32M|                src_temp11_8x16b = _mm_unpacklo_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1791|  1.32M|                src_temp12_8x16b = _mm_unpackhi_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1792|  1.32M|                src_temp13_8x16b = _mm_unpacklo_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1793|  1.32M|                src_temp14_8x16b = _mm_unpackhi_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1794|       |
 1795|  1.32M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * row)),    src_temp11_8x16b);          /* row=0*/
 1796|  1.32M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp12_8x16b);       /* row=1*/
 1797|  1.32M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp13_8x16b);       /* row=2*/
 1798|  1.32M|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp14_8x16b);       /* row=4*/
 1799|       |
 1800|  1.32M|            }
 1801|   349k|        }
 1802|   193k|    }
 1803|   241k|}
ihevc_intra_pred_chroma_mode_11_to_17_ssse3:
 1849|   195k|{
 1850|       |    /* This function and ihevc_intra_pred_CHROMA_mode_19_to_25 are same except*/
 1851|       |    /* for ref main & side samples assignment,can be combined for */
 1852|       |    /* optimzation*/
 1853|       |
 1854|   195k|    WORD32 row, col, k;
 1855|   195k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1856|   195k|    WORD32 ref_idx;
 1857|       |
 1858|       |
 1859|   195k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1860|   195k|    __m128i fract_4x32b, zero_8x16b, intra_pred_ang_4x32b;
 1861|   195k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b;
 1862|       |
 1863|       |    /* In case of nt 32, during the last row loop, the load reads past the base array size of [(2 * MAX_CU_SIZE) + 2] */
 1864|   195k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 2 + 4];
 1865|   195k|    UWORD8 *ref_main;
 1866|   195k|    UNUSED(src_strd);
  ------------------
  |  |   38|   195k|#define UNUSED(x) ((void)(x))
  ------------------
 1867|       |
 1868|   195k|    inv_ang_sum = 128;
 1869|       |
 1870|   195k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1871|       |
 1872|   195k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1873|       |    /* Intermediate reference samples for negative angle modes */
 1874|       |    /* This have to be removed during optimization*/
 1875|       |
 1876|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1877|       |
 1878|       |
 1879|   195k|    ref_main = ref_temp + 2 * nt;
 1880|  2.67M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1880:16): [True: 2.48M, False: 195k]
  ------------------
 1881|  2.48M|    {
 1882|  2.48M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k];
 1883|  2.48M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k + 1];
 1884|  2.48M|    }
 1885|       |
 1886|   195k|    ref_main = ref_temp + (2 * (nt - 1));
 1887|   195k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1888|       |
 1889|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1890|       |    /* For negative angled derive the main reference samples from side */
 1891|       |    /* reference samples refer to section 8.4.4.2.6 */
 1892|       |
 1893|  1.05M|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1893:17): [True: 863k, False: 195k]
  ------------------
 1894|   863k|    {
 1895|   863k|        inv_ang_sum += inv_ang;
 1896|   863k|        ref_main[k] = pu1_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1897|   863k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1898|   863k|    }
 1899|       |
 1900|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1901|       |    /* samples dependent on distance to obtain destination sample */
 1902|       |
 1903|   195k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1904|   195k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1905|   195k|    const_temp3_4x32b = _mm_set1_epi16(32);
 1906|   195k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1907|       |
 1908|   195k|    two_nt_4x32b = _mm_set1_epi32(1);
 1909|       |
 1910|   195k|    zero_8x16b = _mm_set1_epi16(0);
 1911|       |
 1912|       |
 1913|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1914|   195k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1915|       |
 1916|   195k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1917|       |
 1918|   195k|    if(nt == 4)
  ------------------
  |  Branch (1918:8): [True: 45.3k, False: 150k]
  ------------------
 1919|  45.3k|    {
 1920|  45.3k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1921|  45.3k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1922|  45.3k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1923|  45.3k|        const_temp4_4x32b = _mm_set1_epi16(4);
 1924|  45.3k|        two_nt_4x32b = _mm_set1_epi16(1);
 1925|       |
 1926|  45.3k|        {
 1927|  45.3k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1928|  45.3k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1929|       |
 1930|  45.3k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1931|  45.3k|            __m128i src_values10;
 1932|       |
 1933|  45.3k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1934|       |
 1935|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1936|  45.3k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1937|       |
 1938|       |            /* fract = pos & (31); */
 1939|  45.3k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1940|       |
 1941|  45.3k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 1942|  45.3k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b, ref_main_idx_4x32b);
 1943|       |
 1944|  45.3k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1945|       |
 1946|       |            /*(32 - fract) */
 1947|  45.3k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1948|       |
 1949|  45.3k|            _mm_storel_epi64((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1950|  45.3k|            _mm_storel_epi64((__m128i *)(ai1_src_temp_val),  src_values10);
 1951|       |
 1952|  45.3k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1953|  45.3k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1954|  45.3k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1955|  45.3k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1956|       |
 1957|  45.3k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1958|  45.3k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1959|  45.3k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1960|  45.3k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1961|       |
 1962|  45.3k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1963|  45.3k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1964|  45.3k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1965|  45.3k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1966|       |
 1967|  45.3k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1968|  45.3k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1969|  45.3k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1970|  45.3k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1971|       |
 1972|  45.3k|            {
 1973|  45.3k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1974|  45.3k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1975|       |
 1976|       |                /* loding 8-bit 16 pixels */
 1977|  45.3k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1)); /* col=0*/
 1978|  45.3k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2)); /* col=1*/
 1979|  45.3k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3)); /* col=2*/
 1980|  45.3k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4)); /* col=3*/
 1981|       |
 1982|  45.3k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1983|  45.3k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1984|  45.3k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1985|  45.3k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1986|       |
 1987|  45.3k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp5_8x16b, src_temp1_8x16b); /* col=0*/
 1988|  45.3k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp6_8x16b, src_temp2_8x16b); /* col=1*/
 1989|  45.3k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp7_8x16b, src_temp3_8x16b); /* col=2*/
 1990|  45.3k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp8_8x16b, src_temp4_8x16b); /* col=3*/
 1991|       |
 1992|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1993|  45.3k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1994|  45.3k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1995|  45.3k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1996|  45.3k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1997|       |
 1998|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1999|  45.3k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2000|  45.3k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2001|  45.3k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2002|  45.3k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2003|       |
 2004|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2005|  45.3k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2006|  45.3k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2007|  45.3k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2008|  45.3k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2009|       |
 2010|       |                /* converting 16 bit to 8 bit */
 2011|  45.3k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 2012|  45.3k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 2013|  45.3k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 2014|  45.3k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 2015|       |
 2016|  45.3k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2017|  45.3k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 2018|       |
 2019|  45.3k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2020|  45.3k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2021|       |
 2022|  45.3k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp8_8x16b);             /* row=0*/
 2023|       |
 2024|  45.3k|                src_temp2_8x16b  = _mm_shuffle_epi32(src_temp8_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 2025|  45.3k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp2_8x16b);       /* row=1*/
 2026|       |
 2027|  45.3k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp7_8x16b);       /* row=2*/
 2028|       |
 2029|  45.3k|                src_temp4_8x16b  = _mm_shuffle_epi32(src_temp7_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 2030|  45.3k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp4_8x16b);       /* row=4*/
 2031|       |
 2032|  45.3k|            }
 2033|  45.3k|        }
 2034|  45.3k|    }
 2035|   150k|    else
 2036|   150k|    {
 2037|   150k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2038|   150k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2039|   150k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2040|   150k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2041|   150k|        two_nt_4x32b = _mm_set1_epi16(1);
 2042|       |
 2043|   413k|        for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (2043:22): [True: 263k, False: 150k]
  ------------------
 2044|   263k|        {
 2045|   263k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2046|   263k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2047|   263k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 2048|       |
 2049|   263k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 2050|   263k|            __m128i fract5_8x16b, fract6_8x16b, fract7_8x16b, fract8_8x16b, src_values10;
 2051|       |
 2052|   263k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2053|   263k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2054|       |
 2055|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2056|   263k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2057|       |
 2058|       |            /* fract = pos & (31); */
 2059|   263k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2060|       |
 2061|   263k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2062|   263k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b, ref_main_idx_4x32b);
 2063|       |
 2064|   263k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 2065|       |
 2066|       |            /*(32 - fract) */
 2067|   263k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2068|       |
 2069|   263k|            _mm_storeu_si128((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 2070|   263k|            _mm_storeu_si128((__m128i *)(ai1_src_temp_val),  src_values10);
 2071|       |
 2072|   263k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 2073|   263k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 2074|   263k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 2075|   263k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 2076|       |
 2077|   263k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 2078|   263k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 2079|   263k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 2080|   263k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 2081|       |
 2082|   263k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2083|   263k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2084|   263k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2085|   263k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2086|       |
 2087|   263k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2088|   263k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2089|   263k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2090|   263k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2091|       |
 2092|   263k|            fract5_8x16b = _mm_set1_epi8(ai1_fract_temp_val[8]);  /* col=5*/
 2093|   263k|            fract6_8x16b = _mm_set1_epi8(ai1_fract_temp_val[10]);  /* col=6*/
 2094|   263k|            fract7_8x16b = _mm_set1_epi8(ai1_fract_temp_val[12]);  /* col=7*/
 2095|   263k|            fract8_8x16b = _mm_set1_epi8(ai1_fract_temp_val[14]);  /* col=8*/
 2096|       |
 2097|   263k|            temp11_8x16b = _mm_set1_epi8(ai1_src_temp_val[8]);  /* col=0*/
 2098|   263k|            temp12_8x16b = _mm_set1_epi8(ai1_src_temp_val[10]);  /* col=1*/
 2099|   263k|            temp13_8x16b = _mm_set1_epi8(ai1_src_temp_val[12]);  /* col=2*/
 2100|   263k|            temp14_8x16b = _mm_set1_epi8(ai1_src_temp_val[14]);  /* col=3*/
 2101|       |
 2102|   263k|            temp11_8x16b = _mm_unpacklo_epi8(temp11_8x16b, fract5_8x16b);
 2103|   263k|            temp12_8x16b = _mm_unpacklo_epi8(temp12_8x16b, fract6_8x16b);
 2104|   263k|            temp13_8x16b = _mm_unpacklo_epi8(temp13_8x16b, fract7_8x16b);
 2105|   263k|            temp14_8x16b = _mm_unpacklo_epi8(temp14_8x16b, fract8_8x16b);
 2106|       |
 2107|   263k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2108|   263k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2109|   263k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2110|   263k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 2111|       |
 2112|  1.24M|            for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (2112:26): [True: 978k, False: 263k]
  ------------------
 2113|   978k|            {
 2114|   978k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2115|   978k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2116|       |
 2117|   978k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2118|   978k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2119|       |
 2120|       |                /* loding 8-bit 16 pixels */
 2121|   978k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row + row)); /* col=0*/
 2122|   978k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row + row)); /* col=1*/
 2123|   978k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row + row)); /* col=2*/
 2124|   978k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row + row)); /* col=3*/
 2125|       |
 2126|   978k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 2127|   978k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 2128|   978k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 2129|   978k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 2130|       |
 2131|   978k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp5_8x16b, src_temp1_8x16b); /* col=0*/
 2132|   978k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp6_8x16b, src_temp2_8x16b); /* col=1*/
 2133|   978k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp7_8x16b, src_temp3_8x16b); /* col=2*/
 2134|   978k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp8_8x16b, src_temp4_8x16b); /* col=3*/
 2135|       |
 2136|       |                /* loding 8-bit 16 pixels */
 2137|   978k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row + row)); /* col=5*/
 2138|   978k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row + row)); /* col=6*/
 2139|   978k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row + row)); /* col=7*/
 2140|   978k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row + row)); /* col=8*/
 2141|       |
 2142|   978k|                src_temp11_8x16b = _mm_srli_si128(src_temp15_8x16b, 2); /* col=5*/
 2143|   978k|                src_temp12_8x16b = _mm_srli_si128(src_temp16_8x16b, 2); /* col=6*/
 2144|   978k|                src_temp13_8x16b = _mm_srli_si128(src_temp17_8x16b, 2); /* col=7*/
 2145|   978k|                src_temp14_8x16b = _mm_srli_si128(src_temp18_8x16b, 2); /* col=8*/
 2146|       |
 2147|   978k|                src_temp11_8x16b =  _mm_unpacklo_epi8(src_temp15_8x16b, src_temp11_8x16b); /* col=0*/
 2148|   978k|                src_temp12_8x16b =  _mm_unpacklo_epi8(src_temp16_8x16b, src_temp12_8x16b); /* col=1*/
 2149|   978k|                src_temp13_8x16b =  _mm_unpacklo_epi8(src_temp17_8x16b, src_temp13_8x16b); /* col=2*/
 2150|   978k|                src_temp14_8x16b =  _mm_unpacklo_epi8(src_temp18_8x16b, src_temp14_8x16b); /* col=3*/
 2151|       |
 2152|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2153|   978k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2154|   978k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2155|   978k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2156|   978k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2157|       |
 2158|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2159|   978k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2160|   978k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2161|   978k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2162|   978k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 2163|       |
 2164|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2165|   978k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2166|   978k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2167|   978k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2168|   978k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2169|       |
 2170|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2171|   978k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2172|   978k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2173|   978k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2174|   978k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2175|       |
 2176|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2177|   978k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2178|   978k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2179|   978k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2180|   978k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 2181|       |
 2182|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2183|   978k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2184|   978k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2185|   978k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2186|   978k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2187|       |
 2188|       |                /* converting 16 bit to 8 bit */
 2189|   978k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 2190|   978k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 2191|   978k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 2192|   978k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 2193|       |
 2194|       |                /* converting 16 bit to 8 bit */
 2195|   978k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, zero_8x16b); /* col=5*/
 2196|   978k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, zero_8x16b); /* col=6*/
 2197|   978k|                src_temp13_8x16b = _mm_packus_epi16(src_temp13_8x16b, zero_8x16b); /* col=7*/
 2198|   978k|                src_temp14_8x16b = _mm_packus_epi16(src_temp14_8x16b, zero_8x16b); /* col=8*/
 2199|       |
 2200|   978k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2201|   978k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 2202|       |
 2203|   978k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2204|   978k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 2205|       |
 2206|   978k|                src_temp15_8x16b = _mm_unpacklo_epi16(src_temp11_8x16b, src_temp12_8x16b);
 2207|   978k|                src_temp16_8x16b = _mm_unpacklo_epi16(src_temp13_8x16b, src_temp14_8x16b);
 2208|       |
 2209|   978k|                src_temp18_8x16b = _mm_unpacklo_epi32(src_temp15_8x16b, src_temp16_8x16b);
 2210|   978k|                src_temp17_8x16b = _mm_unpackhi_epi32(src_temp15_8x16b, src_temp16_8x16b);
 2211|       |
 2212|   978k|                src_temp11_8x16b = _mm_unpacklo_epi64(src_temp8_8x16b, src_temp18_8x16b);
 2213|   978k|                src_temp12_8x16b = _mm_unpackhi_epi64(src_temp8_8x16b, src_temp18_8x16b);
 2214|   978k|                src_temp13_8x16b = _mm_unpacklo_epi64(src_temp7_8x16b, src_temp17_8x16b);
 2215|   978k|                src_temp14_8x16b = _mm_unpackhi_epi64(src_temp7_8x16b, src_temp17_8x16b);
 2216|       |
 2217|   978k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * row)),    src_temp11_8x16b);          /* row=0*/
 2218|   978k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp12_8x16b);       /* row=1*/
 2219|   978k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp13_8x16b);       /* row=2*/
 2220|   978k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp14_8x16b);       /* row=4*/
 2221|       |
 2222|   978k|            }
 2223|   263k|        }
 2224|   150k|    }
 2225|   195k|}
ihevc_intra_pred_chroma_mode_19_to_25_ssse3:
 2270|   210k|{
 2271|   210k|    WORD32 row, k;
 2272|   210k|    WORD32 intra_pred_ang, idx;
 2273|   210k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 2274|   210k|    WORD32 ref_main_idx, ref_idx;
 2275|       |    /* In case of nt 32, during the last column loop, the load reads past the base array size of [(2 * MAX_CU_SIZE) + 2] */
 2276|   210k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 2 + 4];
 2277|   210k|    UWORD8 *ref_main;
 2278|       |
 2279|   210k|    __m128i zero_8x16b, fract_8x16b, const_temp_8x16b;
 2280|   210k|    UNUSED(src_strd);
  ------------------
  |  |   38|   210k|#define UNUSED(x) ((void)(x))
  ------------------
 2281|       |
 2282|   210k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 2283|   210k|    inv_ang = gai4_ihevc_inv_ang_table_chroma[mode - 12];
 2284|       |
 2285|       |    /* Intermediate reference samples for negative angle modes */
 2286|       |    /* This have to be removed during optimization*/
 2287|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 2288|   210k|    ref_main = ref_temp + 2 * nt;
 2289|  2.56M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (2289:16): [True: 2.35M, False: 210k]
  ------------------
 2290|  2.35M|    {
 2291|  2.35M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k];
 2292|  2.35M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k + 1];
 2293|  2.35M|    }
 2294|       |
 2295|   210k|    ref_idx = (nt * intra_pred_ang) >> 5;
 2296|   210k|    inv_ang_sum = 128;
 2297|   210k|    ref_main = ref_temp + (2 * (nt - 1));
 2298|       |    /* SIMD Optimization can be done using look-up table for the loop */
 2299|       |    /* For negative angled derive the main reference samples from side */
 2300|       |    /*  reference samples refer to section 8.4.4.2.6 */
 2301|   930k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (2301:17): [True: 720k, False: 210k]
  ------------------
 2302|   720k|    {
 2303|   720k|        inv_ang_sum += inv_ang;
 2304|   720k|        ref_main[k] = pu1_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 2305|   720k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 2306|   720k|    }
 2307|       |
 2308|   210k|    const_temp_8x16b = _mm_set1_epi16(16);
 2309|       |
 2310|   210k|    if(nt == 4) /* if nt =4*/
  ------------------
  |  Branch (2310:8): [True: 69.9k, False: 140k]
  ------------------
 2311|  69.9k|    {
 2312|  69.9k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 2313|  69.9k|        __m128i src_values10, src_values11, zero_8x16b, intra_pred_ang_4x32b;
 2314|  69.9k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2315|       |
 2316|       |
 2317|  69.9k|        const_temp2_4x32b = _mm_set1_epi32(31);
 2318|  69.9k|        const_temp3_4x32b = _mm_set1_epi32(32);
 2319|       |
 2320|  69.9k|        two_nt_4x32b = _mm_set1_epi32(2);
 2321|       |
 2322|  69.9k|        zero_8x16b = _mm_set1_epi16(0);
 2323|       |
 2324|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2325|  69.9k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2326|       |
 2327|  69.9k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2328|  69.9k|        {
 2329|  69.9k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2330|  69.9k|            WORD8  ai1_src_temp0_val[16], ai1_src_temp1_val[16];
 2331|       |
 2332|  69.9k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b, res_temp5_4x32b;
 2333|  69.9k|            __m128i src_values0, src_values1, src_values2, src_values3, src_values13;
 2334|  69.9k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2335|  69.9k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, sign_8x16b;
 2336|       |
 2337|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2338|  69.9k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2339|  69.9k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2340|  69.9k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2341|       |
 2342|  69.9k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2343|  69.9k|            src_values12 = _mm_add_epi32(src_values12, _mm_srai_epi32(res_temp5_4x32b,  5));
 2344|       |
 2345|  69.9k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 2346|  69.9k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 2347|  69.9k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 2348|  69.9k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 2349|  69.9k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 2350|  69.9k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 2351|  69.9k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 2352|       |
 2353|       |            /* fract = pos & (31); */
 2354|  69.9k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2355|       |
 2356|       |            /*(32 - fract) */
 2357|  69.9k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 2358|       |
 2359|  69.9k|            _mm_storeu_si128((__m128i *)(ai1_src_temp1_val), src_values11);
 2360|  69.9k|            _mm_storeu_si128((__m128i *)(ai1_src_temp0_val), src_values10);
 2361|       |
 2362|  69.9k|            fract1_8x16b = _mm_set1_epi8(ai1_src_temp1_val[0]);  /* row=0*/
 2363|  69.9k|            fract2_8x16b = _mm_set1_epi8(ai1_src_temp1_val[4]);  /* row=1*/
 2364|  69.9k|            fract3_8x16b = _mm_set1_epi8(ai1_src_temp1_val[8]);  /* row=2*/
 2365|  69.9k|            fract4_8x16b = _mm_set1_epi8(ai1_src_temp1_val[12]);  /* row=3*/
 2366|       |
 2367|  69.9k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp0_val[0]);  /* row=0*/
 2368|  69.9k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp0_val[4]);  /* row=1*/
 2369|  69.9k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp0_val[8]);  /* row=2*/
 2370|  69.9k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp0_val[12]);  /* row=3*/
 2371|       |
 2372|  69.9k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2373|  69.9k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2374|  69.9k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2375|  69.9k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2376|       |
 2377|       |// inner loop starts from here
 2378|  69.9k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));  /* col = 0-7   */
 2379|  69.9k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2));  /* col = 8-15  */
 2380|  69.9k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3));  /* col = 16-23 */
 2381|  69.9k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4));  /* col = 24-31 */
 2382|       |
 2383|  69.9k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2384|  69.9k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2385|  69.9k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2386|  69.9k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2387|       |
 2388|  69.9k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2389|  69.9k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2390|  69.9k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2391|  69.9k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2392|       |
 2393|  69.9k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1_8x16b);
 2394|  69.9k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2_8x16b);
 2395|  69.9k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3_8x16b);
 2396|  69.9k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4_8x16b);
 2397|       |
 2398|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2399|  69.9k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2400|  69.9k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2401|  69.9k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2402|  69.9k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2403|       |
 2404|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2405|  69.9k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2406|  69.9k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2407|  69.9k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2408|  69.9k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2409|       |
 2410|       |            /* converting 16 bit to 8 bit */
 2411|  69.9k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2412|  69.9k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2413|  69.9k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2414|  69.9k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2415|       |
 2416|  69.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_values0);       /* row=0*/
 2417|  69.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_values1);   /* row=1*/
 2418|  69.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_values2);   /* row=2*/
 2419|  69.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_values3);   /* row=3*/
 2420|       |
 2421|  69.9k|        }
 2422|  69.9k|    }
 2423|   140k|    else if(nt == 8) /* for nt = 16 case */
  ------------------
  |  Branch (2423:13): [True: 49.6k, False: 91.3k]
  ------------------
 2424|  49.6k|    {
 2425|  49.6k|        WORD32 ref_main_idx1, fract1, temp, temp1;
 2426|  49.6k|        __m128i fract1_8x16b, temp_8x16b, temp1_8x16b;
 2427|       |
 2428|  49.6k|        zero_8x16b = _mm_set1_epi16(0);
 2429|       |
 2430|   248k|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (2430:22): [True: 198k, False: 49.6k]
  ------------------
 2431|   198k|        {
 2432|   198k|            __m128i src_values0, src_values1, src_values2, src_values3;
 2433|   198k|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2434|       |
 2435|   198k|            pos = ((row + 1) * intra_pred_ang);
 2436|   198k|            idx = pos >> 5;
 2437|   198k|            fract = pos & (31);
 2438|   198k|            temp = 32 - fract;
 2439|   198k|            ref_main_idx = 2 * idx + 2; /* col from 0-15 */
 2440|       |
 2441|   198k|            pos = ((row + 2) * intra_pred_ang);
 2442|   198k|            idx = pos >> 5;
 2443|   198k|            fract1 = pos & (31);
 2444|   198k|            temp1 = 32 - fract1;
 2445|   198k|            ref_main_idx1 = 2 * idx + 2; /* col from 0-15 */
 2446|       |
 2447|   198k|            fract_8x16b  = _mm_set1_epi8(fract);
 2448|   198k|            fract1_8x16b = _mm_set1_epi8(fract1);
 2449|   198k|            temp_8x16b   = _mm_set1_epi8(temp);
 2450|   198k|            temp1_8x16b  = _mm_set1_epi8(temp1);
 2451|       |
 2452|   198k|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2453|   198k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2454|       |
 2455|       |            /* row=0 */
 2456|   198k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx));     /* col = 0-7   */
 2457|   198k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 8));   /* col = 8-15  */
 2458|       |
 2459|       |            /* row=1 */
 2460|   198k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));   /* col = 0-7  */
 2461|   198k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1 + 8));  /* col = 8-15 */
 2462|       |
 2463|   198k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2464|   198k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2465|   198k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2466|   198k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2467|       |
 2468|   198k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2469|   198k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2470|   198k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2471|   198k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2472|       |
 2473|   198k|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2474|   198k|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2475|       |
 2476|   198k|            src_values2 = _mm_maddubs_epi16(src_values2, temp1_8x16b);
 2477|   198k|            src_values3 = _mm_maddubs_epi16(src_values3, temp1_8x16b);
 2478|       |
 2479|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2480|   198k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2481|   198k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2482|       |
 2483|   198k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2484|   198k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2485|       |
 2486|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2487|   198k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2488|   198k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2489|       |
 2490|   198k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2491|   198k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2492|       |
 2493|       |            /* converting 16 bit to 8 bit */
 2494|   198k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2495|   198k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2496|       |
 2497|   198k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2498|   198k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2499|       |
 2500|       |            /* loding 8-bit 8 pixels values */
 2501|   198k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2502|   198k|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2503|       |
 2504|   198k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_values2);
 2505|   198k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + 8), src_values3);
 2506|       |
 2507|   198k|            pu1_dst += 2 * dst_strd;
 2508|   198k|        }
 2509|  49.6k|    }
 2510|  91.3k|    else if(nt == 16)
  ------------------
  |  Branch (2510:13): [True: 91.7k, False: 18.4E]
  ------------------
 2511|  91.7k|    {
 2512|  91.7k|        WORD32 temp;
 2513|       |        /* unroll the col loop (inner) */
 2514|  91.7k|        zero_8x16b = _mm_set1_epi16(0);
 2515|       |
 2516|  1.55M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2516:22): [True: 1.46M, False: 91.7k]
  ------------------
 2517|  1.46M|        {
 2518|  1.46M|            __m128i  src_values0, src_values1, src_values2, src_values3, temp_8x16b;
 2519|  1.46M|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2520|       |
 2521|  1.46M|            pos = ((row + 1) * intra_pred_ang);
 2522|  1.46M|            idx = pos >> 5;
 2523|  1.46M|            fract = pos & (31);
 2524|  1.46M|            temp = 32 - fract;
 2525|  1.46M|            ref_main_idx = 2 * idx + 2; /* col from 0-31 */
 2526|       |
 2527|  1.46M|            fract_8x16b = _mm_set1_epi8(fract);
 2528|  1.46M|            temp_8x16b  = _mm_set1_epi8(temp);
 2529|       |
 2530|  1.46M|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2531|       |
 2532|  1.46M|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx));     /* col = 0-7   */
 2533|  1.46M|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 8));   /* col = 8-15  */
 2534|  1.46M|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 16));  /* col = 16-23 */
 2535|  1.46M|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 24));  /* col = 24-31 */
 2536|       |
 2537|  1.46M|            src_values10 = _mm_srli_si128(src_values0, 2);
 2538|  1.46M|            src_values11 = _mm_srli_si128(src_values1, 2);
 2539|  1.46M|            src_values12 = _mm_srli_si128(src_values2, 2);
 2540|  1.46M|            src_values13 = _mm_srli_si128(src_values3, 2);
 2541|       |
 2542|  1.46M|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2543|  1.46M|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2544|  1.46M|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2545|  1.46M|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2546|       |
 2547|       |            /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2548|  1.46M|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2549|  1.46M|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2550|  1.46M|            src_values2 = _mm_maddubs_epi16(src_values2, temp_8x16b);
 2551|  1.46M|            src_values3 = _mm_maddubs_epi16(src_values3, temp_8x16b);
 2552|       |
 2553|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2554|  1.46M|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2555|  1.46M|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2556|  1.46M|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2557|  1.46M|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2558|       |
 2559|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2560|  1.46M|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2561|  1.46M|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2562|  1.46M|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2563|  1.46M|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2564|       |
 2565|       |            /* converting 16 bit to 8 bit */
 2566|  1.46M|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2567|  1.46M|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2568|  1.46M|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2569|  1.46M|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2570|       |
 2571|       |            /* loding 8-bit 8 pixels values */
 2572|  1.46M|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2573|  1.46M|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2574|  1.46M|            _mm_storel_epi64((__m128i *)(pu1_dst + 16), src_values2);
 2575|  1.46M|            _mm_storel_epi64((__m128i *)(pu1_dst + 24), src_values3);
 2576|       |
 2577|  1.46M|            pu1_dst += dst_strd;
 2578|       |
 2579|  1.46M|        }
 2580|  91.7k|    }
 2581|  18.4E|    else if(nt == 32)
  ------------------
  |  Branch (2581:13): [True: 0, False: 18.4E]
  ------------------
 2582|      0|    {
 2583|      0|        WORD32 temp, col;
 2584|       |        /* unroll the col loop (inner) */
 2585|      0|        zero_8x16b = _mm_set1_epi16(0);
 2586|       |
 2587|      0|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2587:22): [True: 0, False: 0]
  ------------------
 2588|      0|        {
 2589|      0|            __m128i  src_values0, src_values1, temp_8x16b;
 2590|      0|            __m128i  src_values10, src_values11;
 2591|       |
 2592|      0|            pos = ((row + 1) * intra_pred_ang);
 2593|      0|            idx = pos >> 5;
 2594|      0|            fract = pos & (31);
 2595|      0|            temp = 32 - fract;
 2596|      0|            ref_main_idx = 2 * idx + 2;
 2597|       |
 2598|      0|            fract_8x16b = _mm_set1_epi8(fract);
 2599|      0|            temp_8x16b  = _mm_set1_epi8(temp);
 2600|       |
 2601|      0|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2602|       |
 2603|      0|            for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (2603:26): [True: 0, False: 0]
  ------------------
 2604|      0|            {
 2605|      0|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + col));
 2606|      0|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + col + 8));
 2607|       |
 2608|      0|                src_values10 = _mm_srli_si128(src_values0, 2);
 2609|      0|                src_values11 = _mm_srli_si128(src_values1, 2);
 2610|       |
 2611|      0|                src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2612|      0|                src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2613|       |
 2614|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2615|      0|                src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2616|      0|                src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2617|       |
 2618|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2619|      0|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2620|      0|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2621|       |
 2622|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2623|      0|                src_values0 = _mm_srai_epi16(src_values0,  5);
 2624|      0|                src_values1 = _mm_srai_epi16(src_values1,  5);
 2625|       |
 2626|       |                /* converting 16 bit to 8 bit */
 2627|      0|                src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2628|      0|                src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2629|       |
 2630|       |                /* store 8-bit 8 pixels values */
 2631|      0|                _mm_storel_epi64((__m128i *)(pu1_dst + col), src_values0);
 2632|      0|                _mm_storel_epi64((__m128i *)(pu1_dst + col + 8), src_values1);
 2633|      0|            }
 2634|      0|            pu1_dst += dst_strd;
 2635|      0|        }
 2636|      0|    }
 2637|   210k|}
ihevc_intra_pred_chroma_mode_27_to_33_ssse3:
 2683|   237k|{
 2684|   237k|    WORD32 row;
 2685|   237k|    WORD32 pos, fract;
 2686|   237k|    WORD32 intra_pred_ang;
 2687|   237k|    WORD32 idx, ref_main_idx;
 2688|       |
 2689|   237k|    __m128i zero_8x16b, fract_8x16b, const_temp_8x16b;
 2690|   237k|    UNUSED(src_strd);
  ------------------
  |  |   38|   237k|#define UNUSED(x) ((void)(x))
  ------------------
 2691|       |
 2692|   237k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 2693|   237k|    const_temp_8x16b = _mm_set1_epi16(16);
 2694|       |
 2695|   237k|    if(nt == 4) /* if nt =4*/
  ------------------
  |  Branch (2695:8): [True: 84.7k, False: 152k]
  ------------------
 2696|  84.7k|    {
 2697|  84.7k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 2698|  84.7k|        __m128i src_values10, src_values11, zero_8x16b, intra_pred_ang_4x32b;
 2699|  84.7k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2700|       |
 2701|  84.7k|        const_temp2_4x32b = _mm_set1_epi32(31);
 2702|  84.7k|        const_temp3_4x32b = _mm_set1_epi32(32);
 2703|       |
 2704|  84.7k|        two_nt_4x32b = _mm_set1_epi32((4 * nt) + 2);
 2705|       |
 2706|  84.7k|        zero_8x16b = _mm_set1_epi16(0);
 2707|       |
 2708|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2709|  84.7k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2710|  84.7k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2711|       |
 2712|  84.7k|        {
 2713|  84.7k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2714|  84.7k|            WORD8  ai1_src_temp0_val[16], ai1_src_temp1_val[16];
 2715|       |
 2716|  84.7k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b, res_temp5_4x32b;
 2717|  84.7k|            __m128i src_values0, src_values1, src_values2, src_values3, src_values13;
 2718|  84.7k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2719|  84.7k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, sign_8x16b;
 2720|       |
 2721|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2722|  84.7k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2723|  84.7k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2724|  84.7k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2725|       |
 2726|  84.7k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2727|  84.7k|            src_values12 = _mm_add_epi32(src_values12, _mm_srai_epi32(res_temp5_4x32b,  5));
 2728|       |
 2729|  84.7k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 2730|  84.7k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 2731|  84.7k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 2732|  84.7k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 2733|  84.7k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 2734|  84.7k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 2735|  84.7k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 2736|       |
 2737|       |            /* fract = pos & (31); */
 2738|  84.7k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2739|       |
 2740|       |            /*(32 - fract) */
 2741|  84.7k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 2742|       |
 2743|  84.7k|            _mm_storeu_si128((__m128i *)(ai1_src_temp1_val), src_values11);
 2744|  84.7k|            _mm_storeu_si128((__m128i *)(ai1_src_temp0_val), src_values10);
 2745|       |
 2746|  84.7k|            fract1_8x16b = _mm_set1_epi8(ai1_src_temp1_val[0]);  /* row=0*/
 2747|  84.7k|            fract2_8x16b = _mm_set1_epi8(ai1_src_temp1_val[4]);  /* row=1*/
 2748|  84.7k|            fract3_8x16b = _mm_set1_epi8(ai1_src_temp1_val[8]);  /* row=2*/
 2749|  84.7k|            fract4_8x16b = _mm_set1_epi8(ai1_src_temp1_val[12]);  /* row=3*/
 2750|       |
 2751|  84.7k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp0_val[0]);  /* row=0*/
 2752|  84.7k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp0_val[4]);  /* row=1*/
 2753|  84.7k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp0_val[8]);  /* row=2*/
 2754|  84.7k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp0_val[12]);  /* row=3*/
 2755|       |
 2756|  84.7k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2757|  84.7k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2758|  84.7k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2759|  84.7k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2760|       |
 2761|       |// inner loop starts from here
 2762|  84.7k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));  /* col = 0-7   */
 2763|  84.7k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2));  /* col = 8-15  */
 2764|  84.7k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3));  /* col = 16-23 */
 2765|  84.7k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4));  /* col = 24-31 */
 2766|       |
 2767|  84.7k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2768|  84.7k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2769|  84.7k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2770|  84.7k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2771|       |
 2772|  84.7k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2773|  84.7k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2774|  84.7k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2775|  84.7k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2776|       |
 2777|  84.7k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1_8x16b);
 2778|  84.7k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2_8x16b);
 2779|  84.7k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3_8x16b);
 2780|  84.7k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4_8x16b);
 2781|       |
 2782|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2783|  84.7k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2784|  84.7k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2785|  84.7k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2786|  84.7k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2787|       |
 2788|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2789|  84.7k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2790|  84.7k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2791|  84.7k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2792|  84.7k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2793|       |
 2794|       |            /* converting 16 bit to 8 bit */
 2795|  84.7k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2796|  84.7k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2797|  84.7k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2798|  84.7k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2799|       |
 2800|  84.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_values0);       /* row=0*/
 2801|  84.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_values1);   /* row=1*/
 2802|  84.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_values2);   /* row=2*/
 2803|  84.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_values3);   /* row=3*/
 2804|       |
 2805|  84.7k|        }
 2806|  84.7k|    }
 2807|       |
 2808|   152k|    else if(nt == 8) /* for nt = 16 case */
  ------------------
  |  Branch (2808:13): [True: 48.7k, False: 103k]
  ------------------
 2809|  48.7k|    {
 2810|  48.7k|        WORD32 ref_main_idx1, fract1, temp, temp1;
 2811|  48.7k|        __m128i fract1_8x16b, temp_8x16b, temp1_8x16b;
 2812|       |
 2813|  48.7k|        zero_8x16b = _mm_set1_epi16(0);
 2814|       |
 2815|   243k|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (2815:22): [True: 194k, False: 48.7k]
  ------------------
 2816|   194k|        {
 2817|   194k|            __m128i src_values0, src_values1, src_values2, src_values3;
 2818|   194k|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2819|       |
 2820|   194k|            pos = ((row + 1) * intra_pred_ang);
 2821|   194k|            idx = pos >> 5;
 2822|   194k|            fract = pos & (31);
 2823|   194k|            temp = 32 - fract;
 2824|   194k|            ref_main_idx = (4 * nt) + 2 * idx + 2; /* col from 0-15 */
 2825|       |
 2826|   194k|            pos = ((row + 2) * intra_pred_ang);
 2827|   194k|            idx = pos >> 5;
 2828|   194k|            fract1 = pos & (31);
 2829|   194k|            temp1 = 32 - fract1;
 2830|   194k|            ref_main_idx1 = (4 * nt) + 2 * idx + 2; /* col from 0-15 */
 2831|       |
 2832|   194k|            fract_8x16b  = _mm_set1_epi8(fract);
 2833|   194k|            fract1_8x16b = _mm_set1_epi8(fract1);
 2834|   194k|            temp_8x16b   = _mm_set1_epi8(temp);
 2835|   194k|            temp1_8x16b  = _mm_set1_epi8(temp1);
 2836|       |
 2837|   194k|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2838|   194k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2839|       |
 2840|       |            /* row=0 */
 2841|   194k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx));     /* col = 0-7   */
 2842|   194k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 8));   /* col = 8-15  */
 2843|       |
 2844|       |            /* row=1 */
 2845|   194k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));    /* col = 0-7  */
 2846|   194k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1 + 8));  /* col = 8-15 */
 2847|       |
 2848|   194k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2849|   194k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2850|   194k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2851|   194k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2852|       |
 2853|   194k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2854|   194k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2855|   194k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2856|   194k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2857|       |
 2858|   194k|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2859|   194k|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2860|       |
 2861|   194k|            src_values2 = _mm_maddubs_epi16(src_values2, temp1_8x16b);
 2862|   194k|            src_values3 = _mm_maddubs_epi16(src_values3, temp1_8x16b);
 2863|       |
 2864|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2865|   194k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2866|   194k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2867|       |
 2868|   194k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2869|   194k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2870|       |
 2871|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2872|   194k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2873|   194k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2874|       |
 2875|   194k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2876|   194k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2877|       |
 2878|       |            /* converting 16 bit to 8 bit */
 2879|   194k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2880|   194k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2881|       |
 2882|   194k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2883|   194k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2884|       |
 2885|       |            /* loding 8-bit 8 pixels values */
 2886|   194k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2887|   194k|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2888|       |
 2889|   194k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_values2);
 2890|   194k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + 8), src_values3);
 2891|       |
 2892|   194k|            pu1_dst += 2 * dst_strd;
 2893|   194k|        }
 2894|  48.7k|    }
 2895|   103k|    else if(nt == 16)
  ------------------
  |  Branch (2895:13): [True: 104k, False: 18.4E]
  ------------------
 2896|   104k|    {
 2897|   104k|        WORD32 temp;
 2898|       |        /* unroll the col loop (inner) */
 2899|   104k|        zero_8x16b = _mm_set1_epi16(0);
 2900|       |
 2901|  1.76M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2901:22): [True: 1.66M, False: 104k]
  ------------------
 2902|  1.66M|        {
 2903|  1.66M|            __m128i  src_values0, src_values1, src_values2, src_values3, temp_8x16b;
 2904|  1.66M|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2905|       |
 2906|  1.66M|            pos = ((row + 1) * intra_pred_ang);
 2907|  1.66M|            idx = pos >> 5;
 2908|  1.66M|            fract = pos & (31);
 2909|  1.66M|            temp = 32 - fract;
 2910|  1.66M|            ref_main_idx = (4 * nt) + 2 * idx + 2; /* col from 0-31 */
 2911|       |
 2912|  1.66M|            fract_8x16b = _mm_set1_epi8(fract);
 2913|  1.66M|            temp_8x16b  = _mm_set1_epi8(temp);
 2914|       |
 2915|  1.66M|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2916|       |
 2917|  1.66M|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx));     /* col = 0-7   */
 2918|  1.66M|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 8));   /* col = 8-15  */
 2919|  1.66M|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 16));  /* col = 16-23 */
 2920|  1.66M|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 24));  /* col = 24-31 */
 2921|       |
 2922|  1.66M|            src_values10 = _mm_srli_si128(src_values0, 2);
 2923|  1.66M|            src_values11 = _mm_srli_si128(src_values1, 2);
 2924|  1.66M|            src_values12 = _mm_srli_si128(src_values2, 2);
 2925|  1.66M|            src_values13 = _mm_srli_si128(src_values3, 2);
 2926|       |
 2927|  1.66M|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2928|  1.66M|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2929|  1.66M|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2930|  1.66M|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2931|       |
 2932|       |            /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2933|  1.66M|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2934|  1.66M|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2935|  1.66M|            src_values2 = _mm_maddubs_epi16(src_values2, temp_8x16b);
 2936|  1.66M|            src_values3 = _mm_maddubs_epi16(src_values3, temp_8x16b);
 2937|       |
 2938|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2939|  1.66M|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2940|  1.66M|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2941|  1.66M|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2942|  1.66M|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2943|       |
 2944|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2945|  1.66M|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2946|  1.66M|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2947|  1.66M|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2948|  1.66M|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2949|       |
 2950|       |            /* converting 16 bit to 8 bit */
 2951|  1.66M|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2952|  1.66M|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2953|  1.66M|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2954|  1.66M|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2955|       |
 2956|       |            /* loding 8-bit 8 pixels values */
 2957|  1.66M|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2958|  1.66M|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2959|  1.66M|            _mm_storel_epi64((__m128i *)(pu1_dst + 16), src_values2);
 2960|  1.66M|            _mm_storel_epi64((__m128i *)(pu1_dst + 24), src_values3);
 2961|       |
 2962|  1.66M|            pu1_dst += dst_strd;
 2963|       |
 2964|  1.66M|        }
 2965|   104k|    }
 2966|  18.4E|    else if(nt == 32)
  ------------------
  |  Branch (2966:13): [True: 0, False: 18.4E]
  ------------------
 2967|      0|    {
 2968|      0|        WORD32 temp, col;
 2969|       |
 2970|      0|        zero_8x16b = _mm_set1_epi16(0);
 2971|       |
 2972|      0|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2972:22): [True: 0, False: 0]
  ------------------
 2973|      0|        {
 2974|      0|            __m128i  src_values0, src_values1, temp_8x16b;
 2975|      0|            __m128i  src_values10, src_values11;
 2976|       |
 2977|      0|            pos = ((row + 1) * intra_pred_ang);
 2978|      0|            idx = pos >> 5;
 2979|      0|            fract = pos & (31);
 2980|      0|            temp = 32 - fract;
 2981|      0|            ref_main_idx = (4 * nt) + 2 * idx + 2;
 2982|       |
 2983|      0|            fract_8x16b = _mm_set1_epi8(fract);
 2984|      0|            temp_8x16b  = _mm_set1_epi8(temp);
 2985|       |
 2986|      0|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2987|       |
 2988|       |            /* Process all 64 bytes (32 UV pairs) in chunks of 16 bytes */
 2989|      0|            for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (2989:26): [True: 0, False: 0]
  ------------------
 2990|      0|            {
 2991|      0|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + col));
 2992|      0|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + col + 8));
 2993|       |
 2994|      0|                src_values10 = _mm_srli_si128(src_values0, 2);
 2995|      0|                src_values11 = _mm_srli_si128(src_values1, 2);
 2996|       |
 2997|      0|                src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2998|      0|                src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2999|       |
 3000|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3001|      0|                src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 3002|      0|                src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 3003|       |
 3004|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3005|      0|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3006|      0|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3007|       |
 3008|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3009|      0|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3010|      0|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3011|       |
 3012|       |                /* converting 16 bit to 8 bit */
 3013|      0|                src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 3014|      0|                src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 3015|       |
 3016|       |                /* store 8-bit 8 pixels values */
 3017|      0|                _mm_storel_epi64((__m128i *)(pu1_dst + col), src_values0);
 3018|      0|                _mm_storel_epi64((__m128i *)(pu1_dst + col + 8), src_values1);
 3019|      0|            }
 3020|       |
 3021|      0|            pu1_dst += dst_strd;
 3022|      0|        }
 3023|      0|    }
 3024|   237k|}

ihevc_deblk_luma_vert_ssse3:
  110|  62.4M|{
  111|  62.4M|    WORD32 qp_luma, beta_indx, tc_indx;
  112|  62.4M|    WORD32 beta, tc;
  113|  62.4M|    WORD32 d, dp, dq, d_sam0, d_sam3;
  114|       |
  115|  62.4M|    WORD32 d3, d0, de_0, de_1, de_2, de_3;
  116|  62.4M|    WORD32 de, dep, deq;
  117|  62.4M|    __m128i src_row0_8x16b, src_row1_8x16b, src_row2_8x16b, src_row3_8x16b;
  118|       |
  119|       |
  120|  62.4M|    {
  121|  62.4M|        __m128i src_tmp_8x16b, coef_8x16b, mask_d_result_4x32b, mask_de_result_8x16b;
  122|  62.4M|        __m128i mask_16x8b, temp_coef0_8x16b, temp_coef1_8x16b;
  123|       |
  124|       |
  125|       |
  126|  62.4M|        ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  62.4M|#define ASSERT(x) {}
  ------------------
  127|  62.4M|        ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  62.4M|#define ASSERT(x) {}
  ------------------
  128|       |
  129|  62.4M|        qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  130|  62.4M|        beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  62.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 62.3k, False: 62.4M]
  |  |  |  Branch (40:53): [True: 5.09k, False: 62.4M]
  |  |  ------------------
  ------------------
  131|       |
  132|       |        /* BS based on implementation can take value 3 if it is intra/inter egde          */
  133|       |        /* based on BS, tc index is calcuated by adding 2 * ( bs - 1) to QP and tc_offset */
  134|       |        /* for BS = 1 adding factor is (0*2), BS = 2 or 3 adding factor is (1*2)          */
  135|       |        /* the above desired functionallity is achieved by doing (2*(bs>>1))              */
  136|       |
  137|  62.4M|        tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  62.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 26.8k, False: 62.4M]
  |  |  |  Branch (40:53): [True: 7.17k, False: 62.4M]
  |  |  ------------------
  ------------------
  138|       |
  139|  62.4M|        beta = gai4_ihevc_beta_table[beta_indx];
  140|  62.4M|        tc = gai4_ihevc_tc_table[tc_indx];
  141|  62.4M|        if(0 == tc)
  ------------------
  |  Branch (141:12): [True: 1.72M, False: 60.7M]
  ------------------
  142|  1.72M|        {
  143|  1.72M|            return;
  144|  1.72M|        }
  145|  60.7M|        src_row0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 4));
  146|  60.7M|        src_row3_8x16b = _mm_loadl_epi64((__m128i *)((pu1_src - 4) + 3 * src_strd));
  147|       |
  148|  60.7M|        coef_8x16b = _mm_load_si128((__m128i *)(coef_d));
  149|  60.7M|        mask_16x8b =  _mm_load_si128((__m128i *)(shuffle_d));
  150|       |
  151|  60.7M|        src_tmp_8x16b = _mm_unpacklo_epi64(src_row0_8x16b, src_row3_8x16b);
  152|  60.7M|        mask_de_result_8x16b = _mm_shuffle_epi8(src_tmp_8x16b, mask_16x8b);
  153|       |
  154|  60.7M|        mask_d_result_4x32b = _mm_maddubs_epi16(src_tmp_8x16b, coef_8x16b);
  155|       |
  156|       |
  157|       |        //to get all 1's of 8 bit in (1)
  158|  60.7M|        temp_coef0_8x16b = _mm_cmpeq_epi16(src_tmp_8x16b, src_tmp_8x16b);
  159|  60.7M|        temp_coef1_8x16b = _mm_srli_epi16(temp_coef0_8x16b, 15);
  160|       |        //accumulating values foe dp3 dq3 , dp0 dq0 values
  161|  60.7M|        mask_d_result_4x32b = _mm_madd_epi16(mask_d_result_4x32b, temp_coef1_8x16b);
  162|       |
  163|  60.7M|        temp_coef1_8x16b = _mm_packus_epi16(temp_coef1_8x16b, temp_coef1_8x16b);
  164|       |        // to get all 1,-1 sets of 16 bits in (0)
  165|  60.7M|        temp_coef0_8x16b = _mm_unpacklo_epi8(temp_coef0_8x16b, temp_coef1_8x16b);
  166|       |        //q33-q30,p33-p30,q03-q00,p03-p00,0,q30-p30,0,q00-p00
  167|  60.7M|        mask_de_result_8x16b = _mm_maddubs_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  168|       |        //to get 16 bit 1's
  169|  60.7M|        temp_coef0_8x16b = _mm_srli_epi16(temp_coef1_8x16b, 8);
  170|       |
  171|       |
  172|       |        // dq3 dp3 dq0 dp0
  173|  60.7M|        mask_d_result_4x32b = _mm_abs_epi32(mask_d_result_4x32b);
  174|  60.7M|        mask_16x8b = _mm_shuffle_epi32(mask_d_result_4x32b, 0xec);
  175|  60.7M|        mask_d_result_4x32b = _mm_shuffle_epi32(mask_d_result_4x32b, 0x49);
  176|       |        // dq dp d3 d0
  177|  60.7M|        mask_d_result_4x32b = _mm_add_epi32(mask_d_result_4x32b, mask_16x8b);
  178|       |        //|q33-q30|,|p33-p30|,|q03-q00|,|p03-p00|,0,|q30-p30|,0,|q00-p00|
  179|  60.7M|        mask_de_result_8x16b = _mm_abs_epi16(mask_de_result_8x16b);
  180|       |        //|q33-q30|+|p33-p30|,|q03-q00|+|p03-p00|,0+|q30-p30|,0+|q00-p00|
  181|  60.7M|        mask_de_result_8x16b = _mm_madd_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  182|       |
  183|       |        ///store back in a single variable
  184|  60.7M|        temp_coef0_8x16b = _mm_srli_si128(mask_d_result_4x32b, 4);
  185|  60.7M|        temp_coef1_8x16b = _mm_srli_si128(mask_d_result_4x32b, 8);
  186|  60.7M|        mask_16x8b = _mm_srli_si128(mask_d_result_4x32b, 12);
  187|       |
  188|  60.7M|        d0 = _mm_cvtsi128_si32(mask_d_result_4x32b);
  189|  60.7M|        d3 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  190|  60.7M|        dp = _mm_cvtsi128_si32(temp_coef1_8x16b);
  191|  60.7M|        dq = _mm_cvtsi128_si32(mask_16x8b);
  192|       |        //getting d
  193|  60.7M|        d = d0 + d3;
  194|       |
  195|       |        ///store back in a single variable
  196|  60.7M|        temp_coef0_8x16b = _mm_srli_si128(mask_de_result_8x16b, 4);
  197|  60.7M|        temp_coef1_8x16b = _mm_srli_si128(mask_de_result_8x16b, 8);
  198|  60.7M|        mask_16x8b = _mm_srli_si128(mask_de_result_8x16b, 12);
  199|       |
  200|  60.7M|        de_0 = _mm_cvtsi128_si32(mask_de_result_8x16b);
  201|  60.7M|        de_1 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  202|  60.7M|        de_2 = _mm_cvtsi128_si32(temp_coef1_8x16b);
  203|  60.7M|        de_3 = _mm_cvtsi128_si32(mask_16x8b);
  204|       |
  205|  60.7M|        de = 0;
  206|  60.7M|        dep = 0;
  207|  60.7M|        deq = 0;
  208|  60.7M|        if(d < beta)
  ------------------
  |  Branch (208:12): [True: 59.4M, False: 1.33M]
  ------------------
  209|  59.4M|        {
  210|  59.4M|            d_sam0 = 0;
  211|  59.4M|            if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (211:16): [True: 57.9M, False: 1.49M]
  ------------------
  212|  57.9M|                            && (de_2 < (beta >> 3))
  ------------------
  |  Branch (212:32): [True: 54.8M, False: 3.05M]
  ------------------
  213|  54.8M|                            && (de_0 < ((5 * tc + 1) >> 1)))
  ------------------
  |  Branch (213:32): [True: 54.5M, False: 312k]
  ------------------
  214|  54.5M|            {
  215|  54.5M|                d_sam0 = 1;
  216|  54.5M|            }
  217|       |
  218|  59.4M|            d_sam3 = 0;
  219|  59.4M|            if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (219:16): [True: 57.9M, False: 1.43M]
  ------------------
  220|  57.9M|                            && (de_3 < (beta >> 3))
  ------------------
  |  Branch (220:32): [True: 54.9M, False: 3.02M]
  ------------------
  221|  54.9M|                            && de_1 < ((5 * tc + 1) >> 1))
  ------------------
  |  Branch (221:32): [True: 54.6M, False: 319k]
  ------------------
  222|  54.6M|            {
  223|  54.6M|                d_sam3 = 1;
  224|  54.6M|            }
  225|       |
  226|  59.4M|            de = (d_sam0 & d_sam3) + 1;
  227|  59.4M|            dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (227:19): [True: 58.5M, False: 916k]
  ------------------
  228|  59.4M|            deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (228:19): [True: 58.1M, False: 1.24M]
  ------------------
  229|  59.4M|            if(tc <= 1)
  ------------------
  |  Branch (229:16): [True: 10.0M, False: 49.3M]
  ------------------
  230|  10.0M|            {
  231|  10.0M|                dep = 0;
  232|  10.0M|                deq = 0;
  233|  10.0M|            }
  234|  59.4M|        }
  235|       |
  236|  60.7M|    }
  237|       |
  238|  60.7M|    if(de != 0)
  ------------------
  |  Branch (238:8): [True: 59.3M, False: 1.38M]
  ------------------
  239|  59.3M|    {
  240|       |
  241|       |
  242|  59.3M|        src_row1_8x16b = _mm_loadl_epi64((__m128i *)((pu1_src - 4) + src_strd));
  243|  59.3M|        src_row2_8x16b = _mm_loadl_epi64((__m128i *)((pu1_src - 4) + 2 * src_strd));
  244|       |
  245|  59.3M|        if(de == 2)
  ------------------
  |  Branch (245:12): [True: 53.9M, False: 5.42M]
  ------------------
  246|  53.9M|        {
  247|  53.9M|            __m128i temp_pq_str0_16x8b;
  248|  53.9M|            __m128i temp_pq1_str0_16x8b, temp_pq1_str1_16x8b;
  249|  53.9M|            __m128i temp_pq2_str0_16x8b;
  250|  53.9M|            __m128i temp_pq_str1_16x8b;
  251|  53.9M|            __m128i temp_str0_16x8b, temp_str1_16x8b, temp_str2_16x8b, temp_str3_16x8b;
  252|  53.9M|            __m128i temp_max0_16x8b, temp_max1_16x8b, temp_min0_16x8b, temp_min1_16x8b;
  253|  53.9M|            __m128i const2_8x16b, const2tc_8x16b;
  254|  53.9M|            LWORD64 mask, tc2;
  255|  53.9M|            tc = tc << 1;
  256|  53.9M|            mask = (((LWORD64)filter_flag_q) << 63) | (((LWORD64)filter_flag_p) << 31);
  257|  53.9M|            tc2 = ((LWORD64)tc);
  258|       |
  259|  53.9M|            const2_8x16b = _mm_cmpeq_epi16(src_row0_8x16b, src_row0_8x16b);
  260|       |            //q'0-q'1-2 ,p'0-p'1-2
  261|  53.9M|            src_row0_8x16b = _mm_unpacklo_epi64(src_row0_8x16b, src_row2_8x16b);
  262|  53.9M|            src_row1_8x16b = _mm_unpacklo_epi64(src_row1_8x16b, src_row3_8x16b);
  263|       |
  264|  53.9M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 15);
  265|  53.9M|            temp_pq_str0_16x8b = _mm_srli_epi64(src_row0_8x16b, 16);
  266|  53.9M|            temp_pq_str1_16x8b = _mm_srli_epi64(src_row1_8x16b, 16);
  267|       |            //arranged x x x x x x x x q31 q30 q1 q10 p30 p31 p10 p11 , x x x x x x x x q21 q20 q01 q00 p20 p21 p00 p01
  268|  53.9M|            temp_str0_16x8b = _mm_unpacklo_epi16(temp_pq_str0_16x8b, temp_pq_str1_16x8b);
  269|  53.9M|            temp_str1_16x8b = _mm_unpackhi_epi16(temp_pq_str0_16x8b, temp_pq_str1_16x8b);
  270|       |
  271|  53.9M|            const2_8x16b = _mm_packus_epi16(const2_8x16b, const2_8x16b);
  272|       |            //arranged q31 q30 q21 q20 q1 q10 q01 q00 p30 p31 p20 p21 p10 p11 p00 p01
  273|  53.9M|            temp_pq_str0_16x8b = _mm_unpacklo_epi32(temp_str0_16x8b, temp_str1_16x8b);
  274|       |
  275|  53.9M|            temp_pq_str0_16x8b = _mm_maddubs_epi16(temp_pq_str0_16x8b, const2_8x16b);
  276|       |
  277|       |            //q'1-2, p'1-2
  278|  53.9M|            temp_pq1_str0_16x8b = _mm_srli_epi64(src_row0_8x16b, 8);
  279|  53.9M|            temp_pq1_str1_16x8b = _mm_srli_epi64(src_row1_8x16b, 8);
  280|       |
  281|  53.9M|            temp_str2_16x8b = _mm_unpacklo_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  282|  53.9M|            temp_str3_16x8b = _mm_unpackhi_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  283|       |
  284|  53.9M|            temp_str2_16x8b = _mm_shuffle_epi32(temp_str2_16x8b, 0x58);
  285|  53.9M|            temp_str3_16x8b = _mm_shuffle_epi32(temp_str3_16x8b, 0x58);
  286|       |            // q30 p30 q20 p20 q10 p10 q01 q00 p30 q20 p20 q10 p10 q01 q00 p00
  287|  53.9M|            temp_pq1_str0_16x8b = _mm_unpackhi_epi32(temp_str2_16x8b, temp_str3_16x8b);
  288|       |            // q32 q31 q22 q21 q12 q11 q02 q01 p32 p31 p22 p21 p12 p11 p02 p01
  289|  53.9M|            temp_pq1_str1_16x8b = _mm_unpacklo_epi32(temp_str2_16x8b, temp_str3_16x8b);
  290|       |
  291|  53.9M|            temp_pq1_str0_16x8b = _mm_maddubs_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  292|  53.9M|            temp_pq1_str1_16x8b = _mm_maddubs_epi16(temp_pq1_str1_16x8b, const2_8x16b);
  293|       |
  294|       |            //clipping mask design
  295|  53.9M|            temp_str1_16x8b = _mm_setzero_si128();
  296|  53.9M|            temp_str0_16x8b = _mm_loadl_epi64((__m128i *)(&mask));
  297|  53.9M|            const2tc_8x16b  = _mm_loadl_epi64((__m128i *)(&tc2));
  298|  53.9M|            temp_str0_16x8b = _mm_shuffle_epi32(temp_str0_16x8b, 0x44);
  299|  53.9M|            const2tc_8x16b  = _mm_shuffle_epi8(const2tc_8x16b, temp_str1_16x8b);
  300|       |
  301|       |            //clipping mask design
  302|  53.9M|            temp_str0_16x8b = _mm_srai_epi32(temp_str0_16x8b, 31);
  303|  53.9M|            const2tc_8x16b = _mm_and_si128(const2tc_8x16b, temp_str0_16x8b);
  304|       |            //calculating Clipping MAX for all pixel values.
  305|  53.9M|            temp_max0_16x8b = _mm_adds_epu8(src_row0_8x16b, const2tc_8x16b);
  306|  53.9M|            temp_max1_16x8b = _mm_adds_epu8(src_row1_8x16b, const2tc_8x16b);
  307|       |
  308|       |
  309|       |            //q'2-q'0-2,p'2-p'0-2
  310|  53.9M|            temp_pq2_str0_16x8b = _mm_unpacklo_epi16(src_row0_8x16b, src_row2_8x16b);
  311|  53.9M|            temp_str3_16x8b     = _mm_unpacklo_epi16(src_row1_8x16b, src_row3_8x16b);
  312|       |
  313|  53.9M|            temp_pq2_str0_16x8b = _mm_shuffle_epi32(temp_pq2_str0_16x8b, 0x5c);
  314|  53.9M|            temp_str3_16x8b     = _mm_shuffle_epi32(temp_str3_16x8b, 0x5c);
  315|       |
  316|  53.9M|            const2_8x16b = _mm_slli_epi16(const2_8x16b, 1);
  317|       |            //arranged q33 q32 q23 q22 q13 q12 q03 q02 p33 p32 p23 p22 p13 p12 p03 p02
  318|  53.9M|            temp_str3_16x8b = _mm_unpacklo_epi16(temp_pq2_str0_16x8b, temp_str3_16x8b);
  319|       |
  320|  53.9M|            temp_pq2_str0_16x8b = _mm_maddubs_epi16(temp_str3_16x8b, const2_8x16b);
  321|       |
  322|       |            //calculating Clipping MIN for all pixel values.
  323|  53.9M|            temp_min0_16x8b = _mm_subs_epu8(src_row0_8x16b, const2tc_8x16b);
  324|  53.9M|            temp_min1_16x8b = _mm_subs_epu8(src_row1_8x16b, const2tc_8x16b);
  325|       |            //q'0-q'1-2 ,p'0-p'1-2
  326|  53.9M|            temp_pq_str1_16x8b = _mm_shuffle_epi32(temp_pq_str0_16x8b, 0x4e);
  327|  53.9M|            temp_pq_str0_16x8b = _mm_add_epi16(temp_pq_str0_16x8b, temp_pq_str1_16x8b);
  328|       |            //q'1-2 p'1-2
  329|  53.9M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  330|       |            //to get 2 in 16 bit
  331|  53.9M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 8);
  332|       |            //to get q33 q23 q13 q03, p33 p23 p13 p03
  333|  53.9M|            temp_pq1_str1_16x8b = _mm_slli_epi16(temp_str3_16x8b, 8);
  334|  53.9M|            temp_pq_str1_16x8b = _mm_srli_epi16(temp_str3_16x8b, 8);
  335|  53.9M|            temp_pq1_str1_16x8b = _mm_srli_epi16(temp_pq1_str1_16x8b, 8);
  336|       |
  337|       |            //q'1, p'1 (adding 2)
  338|  53.9M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  339|       |            //q'0-q'1,p'0-p'1
  340|  53.9M|            temp_pq_str0_16x8b = _mm_add_epi16(temp_pq_str0_16x8b, const2_8x16b);
  341|       |            //q'2-q'1,p'2-p'1
  342|  53.9M|            temp_pq2_str0_16x8b = _mm_add_epi16(temp_pq2_str0_16x8b, const2_8x16b);
  343|       |            //q'0 = (q'0-q'1)+q'1 ,p'0 = (p'0-p'1)+p'1;
  344|  53.9M|            temp_pq_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq_str0_16x8b);
  345|       |            //q'2 = (q'2-q'1)+q'1 ,p'2 = (p'2-p'1)+p'1;
  346|  53.9M|            temp_pq2_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq2_str0_16x8b);
  347|       |
  348|       |            //normalisation of all modified pixels
  349|  53.9M|            temp_pq_str0_16x8b  = _mm_srai_epi16(temp_pq_str0_16x8b, 3);
  350|  53.9M|            temp_pq1_str0_16x8b = _mm_srai_epi16(temp_pq1_str0_16x8b, 2);
  351|  53.9M|            temp_pq2_str0_16x8b = _mm_srai_epi16(temp_pq2_str0_16x8b, 3);
  352|       |
  353|       |            //getting p0 p1 together and p2 p3 together
  354|  53.9M|            temp_str0_16x8b = _mm_unpacklo_epi16(temp_pq1_str0_16x8b, temp_pq_str0_16x8b);
  355|  53.9M|            temp_str2_16x8b = _mm_unpacklo_epi16(temp_pq1_str1_16x8b, temp_pq2_str0_16x8b);
  356|       |            //getting q1 q0 together and  q3 q2 together
  357|  53.9M|            temp_pq_str0_16x8b = _mm_unpackhi_epi16(temp_pq_str0_16x8b, temp_pq1_str0_16x8b);
  358|  53.9M|            temp_pq2_str0_16x8b = _mm_unpackhi_epi16(temp_pq2_str0_16x8b, temp_pq_str1_16x8b);
  359|       |            //getting p's of row0 row1 together and of row2 row3 together
  360|  53.9M|            temp_pq_str1_16x8b = _mm_unpacklo_epi32(temp_str2_16x8b, temp_str0_16x8b);
  361|  53.9M|            temp_str2_16x8b    = _mm_unpackhi_epi32(temp_str2_16x8b, temp_str0_16x8b);
  362|       |            //getting q's of row0 row1 together and of row2 row3 together
  363|  53.9M|            temp_str0_16x8b    = _mm_unpacklo_epi32(temp_pq_str0_16x8b, temp_pq2_str0_16x8b);
  364|  53.9M|            temp_pq_str0_16x8b = _mm_unpackhi_epi32(temp_pq_str0_16x8b, temp_pq2_str0_16x8b);
  365|       |            //getting values for respective rows in 16 bit
  366|  53.9M|            src_row0_8x16b = _mm_unpacklo_epi64(temp_pq_str1_16x8b, temp_str0_16x8b);
  367|  53.9M|            src_row1_8x16b = _mm_unpackhi_epi64(temp_pq_str1_16x8b, temp_str0_16x8b);
  368|  53.9M|            src_row2_8x16b = _mm_unpacklo_epi64(temp_str2_16x8b, temp_pq_str0_16x8b);
  369|  53.9M|            src_row3_8x16b = _mm_unpackhi_epi64(temp_str2_16x8b, temp_pq_str0_16x8b);
  370|       |            //packing values to 8 bit
  371|  53.9M|            src_row0_8x16b = _mm_packus_epi16(src_row0_8x16b, src_row2_8x16b);
  372|  53.9M|            src_row1_8x16b = _mm_packus_epi16(src_row1_8x16b, src_row3_8x16b);
  373|       |            //Clipping MAX
  374|  53.9M|            src_row0_8x16b = _mm_min_epu8(src_row0_8x16b, temp_max0_16x8b);
  375|  53.9M|            src_row1_8x16b = _mm_min_epu8(src_row1_8x16b, temp_max1_16x8b);
  376|       |            //Clipping MIN
  377|  53.9M|            src_row0_8x16b = _mm_max_epu8(src_row0_8x16b, temp_min0_16x8b);
  378|  53.9M|            src_row1_8x16b = _mm_max_epu8(src_row1_8x16b, temp_min1_16x8b);
  379|       |            //separating row 2 and row 3
  380|  53.9M|            src_row2_8x16b = _mm_srli_si128(src_row0_8x16b, 8);
  381|  53.9M|            src_row3_8x16b = _mm_srli_si128(src_row1_8x16b, 8);
  382|       |
  383|  53.9M|        }
  384|       |
  385|  5.42M|        else
  386|  5.42M|        {
  387|       |
  388|  5.42M|            __m128i tmp_delta0_8x16b, tmp_delta1_8x16b, tmp_delta2_8x16b, tmp_delta3_8x16b;
  389|  5.42M|            __m128i tmp0_const_8x16b, tmp1_const_8x16b, tmp2_const_8x16b, tmp3_const_8x16b;
  390|  5.42M|            __m128i coefdelta_0_8x16b, mask_pq_8x16b;
  391|  5.42M|            __m128i const2_8x16b, consttc_8x16b;
  392|       |
  393|  5.42M|            LWORD64 mask1;
  394|  5.42M|            mask1 = (((LWORD64)(filter_flag_q & deq)) << 63) | (((LWORD64)filter_flag_q) << 47) | (((LWORD64)filter_flag_p) << 31) | (((LWORD64)(filter_flag_p & dep)) << 15);
  395|       |
  396|  5.42M|            consttc_8x16b = _mm_set1_epi32(tc);
  397|       |
  398|       |
  399|  5.42M|            src_row0_8x16b = _mm_unpacklo_epi64(src_row0_8x16b, src_row1_8x16b);
  400|  5.42M|            src_row2_8x16b = _mm_unpacklo_epi64(src_row2_8x16b, src_row3_8x16b);
  401|       |
  402|  5.42M|            tmp_delta2_8x16b = _mm_srli_epi64(src_row0_8x16b, 16);
  403|  5.42M|            tmp_delta3_8x16b = _mm_srli_epi64(src_row2_8x16b, 16);
  404|       |
  405|  5.42M|            tmp_delta2_8x16b = _mm_shuffle_epi32(tmp_delta2_8x16b, 0x08);
  406|  5.42M|            tmp_delta3_8x16b = _mm_shuffle_epi32(tmp_delta3_8x16b, 0x08);
  407|       |            //arranged q31 q30 p30 p31  q21 q20 p20 p21  q1 q10 p10 p11 q01 q00 p00 p01
  408|  5.42M|            tmp_delta2_8x16b = _mm_unpacklo_epi64(tmp_delta2_8x16b, tmp_delta3_8x16b);
  409|       |
  410|  5.42M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_de1);
  411|       |            // (-3q1+9q0),(-9p0+3p1)
  412|  5.42M|            tmp_delta3_8x16b = _mm_maddubs_epi16(tmp_delta2_8x16b, coefdelta_0_8x16b);
  413|       |            //converting to 16 bit
  414|  5.42M|            consttc_8x16b = _mm_packs_epi32(consttc_8x16b, consttc_8x16b);
  415|       |            //getting -tc store
  416|  5.42M|            tmp1_const_8x16b = _mm_cmpeq_epi32(consttc_8x16b, consttc_8x16b);
  417|       |            //calc 10 *tc = 2*tc +8*tc ; 2*tc
  418|  5.42M|            tmp2_const_8x16b = _mm_slli_epi16(consttc_8x16b, 1);
  419|       |            //calc 10 *tc = 2*tc +8*tc ; 8*tc
  420|  5.42M|            tmp0_const_8x16b = _mm_slli_epi16(consttc_8x16b, 3);
  421|       |            //getting -tc store
  422|  5.42M|            tmp3_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp1_const_8x16b);
  423|       |            //calc 10 *tc
  424|  5.42M|            tmp2_const_8x16b = _mm_add_epi16(tmp2_const_8x16b, tmp0_const_8x16b);
  425|       |            //const 1
  426|  5.42M|            const2_8x16b = _mm_srli_epi16(tmp1_const_8x16b, 15);
  427|  5.42M|            tmp_delta0_8x16b = _mm_madd_epi16(tmp_delta3_8x16b, const2_8x16b);
  428|  5.42M|            const2_8x16b = _mm_srli_epi32(tmp1_const_8x16b, 31);
  429|       |            //getting the mask values
  430|  5.42M|            mask_pq_8x16b = _mm_loadl_epi64((__m128i *)(&mask1));
  431|       |            //loaded coef for delta1 calculation
  432|  5.42M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_dep1);
  433|       |            //(-2q1+q0),(p0-2p1)
  434|  5.42M|            tmp_delta3_8x16b = _mm_maddubs_epi16(tmp_delta2_8x16b, coefdelta_0_8x16b);
  435|       |            //const 8
  436|  5.42M|            const2_8x16b = _mm_slli_epi32(const2_8x16b, 3);
  437|       |            //rearranging the mask values
  438|  5.42M|            mask_pq_8x16b = _mm_unpacklo_epi64(mask_pq_8x16b, mask_pq_8x16b);
  439|       |            //normalisation of the filter
  440|  5.42M|            tmp_delta0_8x16b = _mm_add_epi32(tmp_delta0_8x16b, const2_8x16b);
  441|  5.42M|            tmp_delta0_8x16b = _mm_srai_epi32(tmp_delta0_8x16b, 4);
  442|       |
  443|       |            //getting deltaq0
  444|  5.42M|            tmp_delta2_8x16b = _mm_sign_epi32(tmp_delta0_8x16b, tmp1_const_8x16b);
  445|       |            //packing  d3q d2q d1q d0q d3p d2p d1p d0p
  446|  5.42M|            tmp_delta0_8x16b = _mm_packs_epi32(tmp_delta0_8x16b, tmp_delta2_8x16b);
  447|       |            //absolute delta
  448|  5.42M|            tmp_delta2_8x16b = _mm_abs_epi16(tmp_delta0_8x16b);
  449|       |            //Clipping of delta0
  450|  5.42M|            tmp_delta0_8x16b = _mm_min_epi16(tmp_delta0_8x16b, consttc_8x16b);
  451|       |            //mask for |delta| < 10*tc
  452|  5.42M|            tmp0_const_8x16b = _mm_cmpgt_epi16(tmp2_const_8x16b, tmp_delta2_8x16b);
  453|       |            //Clipping of delta0
  454|  5.42M|            tmp_delta0_8x16b = _mm_max_epi16(tmp_delta0_8x16b, tmp3_const_8x16b);
  455|       |
  456|       |
  457|       |            //delta 1 calc starts
  458|       |
  459|       |            //getting q32 q22 q12 q02 p32 p12 p22 p02
  460|  5.42M|            tmp2_const_8x16b = _mm_loadl_epi64((__m128i *)(shuffle0));
  461|  5.42M|            tmp_delta2_8x16b = _mm_shuffle_epi8(src_row0_8x16b, tmp2_const_8x16b);
  462|  5.42M|            tmp_delta1_8x16b =  _mm_shuffle_epi8(src_row2_8x16b, tmp2_const_8x16b);
  463|  5.42M|            tmp_delta1_8x16b = _mm_unpacklo_epi32(tmp_delta2_8x16b, tmp_delta1_8x16b);
  464|       |            //constant 1
  465|  5.42M|            const2_8x16b = _mm_srli_epi16(tmp1_const_8x16b, 15);
  466|       |            //tc>>1 16 bit
  467|  5.42M|            consttc_8x16b = _mm_srai_epi16(consttc_8x16b, 1);
  468|       |
  469|       |            //getting -tc>>1 store  16 bit
  470|  5.42M|            tmp1_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp1_const_8x16b);
  471|       |            //2*delta0
  472|  5.42M|            tmp2_const_8x16b = _mm_add_epi16(tmp_delta0_8x16b, tmp_delta0_8x16b);
  473|       |
  474|       |            //getting  all respective q's and p's together
  475|  5.42M|            tmp3_const_8x16b = _mm_load_si128((__m128i *)(shuffle1));
  476|  5.42M|            tmp_delta3_8x16b = _mm_shuffle_epi8(tmp_delta3_8x16b, tmp3_const_8x16b);
  477|       |            //final adds for deltap1 and deltaq1
  478|  5.42M|            tmp_delta3_8x16b = _mm_add_epi16(tmp_delta3_8x16b, const2_8x16b);
  479|  5.42M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, tmp2_const_8x16b);
  480|  5.42M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, tmp_delta3_8x16b);
  481|  5.42M|            tmp2_const_8x16b = _mm_setzero_si128();
  482|  5.42M|            tmp_delta1_8x16b = _mm_srai_epi16(tmp_delta1_8x16b, 2);
  483|       |
  484|       |            // clipping delta1
  485|  5.42M|            tmp_delta1_8x16b = _mm_min_epi16(tmp_delta1_8x16b, consttc_8x16b);
  486|       |            // clipping delta1
  487|  5.42M|            tmp_delta1_8x16b = _mm_max_epi16(tmp_delta1_8x16b, tmp1_const_8x16b);
  488|       |
  489|       |            //getting the mask ready
  490|  5.42M|            mask_pq_8x16b = _mm_srai_epi16(mask_pq_8x16b, 15);
  491|       |            //masking of the delta values |delta|<10*tc
  492|  5.42M|            tmp_delta1_8x16b = _mm_and_si128(tmp_delta1_8x16b, tmp0_const_8x16b);
  493|  5.42M|            tmp_delta0_8x16b = _mm_and_si128(tmp_delta0_8x16b, tmp0_const_8x16b);
  494|       |            //packing dq1 dq0 dp0 dp1
  495|  5.42M|            tmp1_const_8x16b = _mm_unpacklo_epi16(tmp_delta1_8x16b, tmp_delta0_8x16b);
  496|  5.42M|            tmp_delta0_8x16b = _mm_unpackhi_epi16(tmp_delta0_8x16b, tmp_delta1_8x16b);
  497|  5.42M|            tmp_delta1_8x16b = _mm_unpackhi_epi32(tmp1_const_8x16b, tmp_delta0_8x16b);
  498|  5.42M|            tmp_delta0_8x16b = _mm_unpacklo_epi32(tmp1_const_8x16b, tmp_delta0_8x16b);
  499|       |
  500|       |            //masking of the delta values dep, deq , filter_p ,filter_q
  501|  5.42M|            tmp_delta0_8x16b = _mm_and_si128(tmp_delta0_8x16b, mask_pq_8x16b);
  502|  5.42M|            tmp_delta1_8x16b = _mm_and_si128(tmp_delta1_8x16b, mask_pq_8x16b);
  503|       |            //converting 8bit to 16 bit
  504|  5.42M|            src_row0_8x16b = _mm_unpacklo_epi8(src_row0_8x16b, tmp2_const_8x16b);
  505|  5.42M|            src_row1_8x16b = _mm_unpacklo_epi8(src_row1_8x16b, tmp2_const_8x16b);
  506|  5.42M|            src_row2_8x16b = _mm_unpacklo_epi8(src_row2_8x16b, tmp2_const_8x16b);
  507|  5.42M|            src_row3_8x16b = _mm_unpacklo_epi8(src_row3_8x16b, tmp2_const_8x16b);
  508|       |            //shuffle values loaded
  509|  5.42M|            tmp0_const_8x16b = _mm_load_si128((__m128i *)shuffle2);
  510|  5.42M|            tmp1_const_8x16b = _mm_load_si128((__m128i *)shuffle3);
  511|       |            //arranging each row delta in different registers
  512|  5.42M|            tmp_delta3_8x16b = _mm_shuffle_epi8(tmp_delta1_8x16b, tmp1_const_8x16b);
  513|  5.42M|            tmp_delta2_8x16b = _mm_shuffle_epi8(tmp_delta1_8x16b, tmp0_const_8x16b);
  514|  5.42M|            tmp_delta1_8x16b = _mm_shuffle_epi8(tmp_delta0_8x16b, tmp1_const_8x16b);
  515|  5.42M|            tmp_delta0_8x16b = _mm_shuffle_epi8(tmp_delta0_8x16b, tmp0_const_8x16b);
  516|       |
  517|       |            //adding the respective delta
  518|  5.42M|            src_row3_8x16b = _mm_add_epi16(tmp_delta3_8x16b, src_row3_8x16b);
  519|  5.42M|            src_row2_8x16b = _mm_add_epi16(tmp_delta2_8x16b, src_row2_8x16b);
  520|  5.42M|            src_row1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, src_row1_8x16b);
  521|  5.42M|            src_row0_8x16b = _mm_add_epi16(tmp_delta0_8x16b, src_row0_8x16b);
  522|       |            //saturating to 8 bit
  523|  5.42M|            src_row2_8x16b = _mm_packus_epi16(src_row2_8x16b, src_row3_8x16b);
  524|  5.42M|            src_row0_8x16b = _mm_packus_epi16(src_row0_8x16b, src_row1_8x16b);
  525|       |            //separating different rows
  526|  5.42M|            src_row1_8x16b = _mm_srli_si128(src_row0_8x16b, 8);
  527|  5.42M|            src_row3_8x16b = _mm_srli_si128(src_row2_8x16b, 8);
  528|  5.42M|        }
  529|       |
  530|  59.3M|        _mm_storel_epi64((__m128i *)(pu1_src - 4), src_row0_8x16b);
  531|  59.3M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + src_strd), src_row1_8x16b);
  532|  59.3M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 2 * src_strd), src_row2_8x16b);
  533|  59.3M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 3 * src_strd), src_row3_8x16b);
  534|  59.3M|    }
  535|  60.7M|}
ihevc_deblk_luma_horz_ssse3:
  546|  65.6M|{
  547|  65.6M|    WORD32 qp_luma, beta_indx, tc_indx;
  548|  65.6M|    WORD32 beta, tc;
  549|       |
  550|  65.6M|    WORD32 d0, d3, dp, dq, d;
  551|  65.6M|    WORD32 de_0, de_1, de_2, de_3;
  552|  65.6M|    WORD32 d_sam0, d_sam3;
  553|  65.6M|    WORD32 de, dep, deq;
  554|       |
  555|  65.6M|    __m128i src_q0_8x16b, src_q1_8x16b, src_p0_8x16b, src_p1_8x16b, src_q2_8x16b;
  556|  65.6M|    __m128i tmp_pq_str1_8x16b, src_p2_8x16b, tmp_pq_str0_8x16b;
  557|       |
  558|       |
  559|       |
  560|       |
  561|  65.6M|    {
  562|  65.6M|        __m128i src_tmp_p_0_8x16b, src_tmp_p_1_8x16b, src_tmp_q_0_8x16b, src_tmp_q_1_8x16b;
  563|  65.6M|        __m128i coef_8x16b, mask_d_result_4x32b, mask_de_result_8x16b;
  564|  65.6M|        __m128i mask_16x8b, temp_coef0_8x16b, temp_coef1_8x16b;
  565|       |
  566|  65.6M|        ASSERT((bs > 0));
  ------------------
  |  |   55|  65.6M|#define ASSERT(x) {}
  ------------------
  567|  65.6M|        ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  65.6M|#define ASSERT(x) {}
  ------------------
  568|       |
  569|  65.6M|        qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  570|  65.6M|        beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  65.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 66.3k, False: 65.6M]
  |  |  |  Branch (40:53): [True: 4.15k, False: 65.6M]
  |  |  ------------------
  ------------------
  571|       |
  572|       |        /* BS based on implementation can take value 3 if it is intra/inter egde          */
  573|       |        /* based on BS, tc index is calcuated by adding 2 * ( bs - 1) to QP and tc_offset */
  574|       |        /* for BS = 1 adding factor is (0*2), BS = 2 or 3 adding factor is (1*2)          */
  575|       |        /* the above desired functionallity is achieved by doing (2*(bs>>1))              */
  576|       |
  577|  65.6M|        tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  65.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 30.1k, False: 65.6M]
  |  |  |  Branch (40:53): [True: 6.24k, False: 65.6M]
  |  |  ------------------
  ------------------
  578|       |
  579|  65.6M|        beta = gai4_ihevc_beta_table[beta_indx];
  580|  65.6M|        tc = gai4_ihevc_tc_table[tc_indx];
  581|  65.6M|        if(0 == tc)
  ------------------
  |  Branch (581:12): [True: 1.92M, False: 63.7M]
  ------------------
  582|  1.92M|        {
  583|  1.92M|            return;
  584|  1.92M|        }
  585|  63.7M|        src_q0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src));
  586|  63.7M|        src_q1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  587|  63.7M|        src_p0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - src_strd));
  588|  63.7M|        src_p1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 2 * src_strd));
  589|  63.7M|        src_q2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd));
  590|  63.7M|        tmp_pq_str1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd));
  591|  63.7M|        src_p2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 3 * src_strd));
  592|  63.7M|        tmp_pq_str0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src - 4 * src_strd));
  593|       |
  594|       |
  595|  63.7M|        src_tmp_p_0_8x16b = _mm_unpacklo_epi8(src_p1_8x16b, src_p0_8x16b);
  596|  63.7M|        src_tmp_p_1_8x16b = _mm_unpacklo_epi8(tmp_pq_str0_8x16b, src_p2_8x16b);
  597|       |
  598|  63.7M|        src_tmp_q_0_8x16b = _mm_unpacklo_epi8(src_q0_8x16b, src_q1_8x16b);
  599|  63.7M|        src_tmp_q_1_8x16b = _mm_unpacklo_epi8(src_q2_8x16b, tmp_pq_str1_8x16b);
  600|       |
  601|  63.7M|        src_tmp_p_0_8x16b = _mm_unpacklo_epi16(src_tmp_p_1_8x16b, src_tmp_p_0_8x16b);
  602|  63.7M|        src_tmp_q_0_8x16b = _mm_unpacklo_epi16(src_tmp_q_0_8x16b, src_tmp_q_1_8x16b);
  603|       |
  604|  63.7M|        src_tmp_p_0_8x16b = _mm_shuffle_epi32(src_tmp_p_0_8x16b, 0x6c);
  605|  63.7M|        src_tmp_q_0_8x16b = _mm_shuffle_epi32(src_tmp_q_0_8x16b, 0x6c);
  606|       |
  607|  63.7M|        coef_8x16b = _mm_load_si128((__m128i *)(coef_d));
  608|  63.7M|        mask_16x8b =  _mm_load_si128((__m128i *)(shuffle_d));
  609|       |
  610|  63.7M|        src_tmp_p_0_8x16b = _mm_unpacklo_epi32(src_tmp_p_0_8x16b, src_tmp_q_0_8x16b);
  611|       |        //WORD32 shuffle_d[4]={0x80800403,0x80800c0b,0x03000704,0x0b080f0c};
  612|  63.7M|        mask_de_result_8x16b = _mm_shuffle_epi8(src_tmp_p_0_8x16b, mask_16x8b);
  613|       |
  614|  63.7M|        mask_d_result_4x32b = _mm_maddubs_epi16(src_tmp_p_0_8x16b, coef_8x16b);
  615|       |
  616|       |
  617|       |        //to get all 1's of 8 bit in (1)
  618|  63.7M|        temp_coef0_8x16b = _mm_cmpeq_epi16(src_tmp_p_0_8x16b, src_tmp_p_0_8x16b);
  619|  63.7M|        temp_coef1_8x16b = _mm_srli_epi16(temp_coef0_8x16b, 15);
  620|       |        //accumulating values foe dp3 dq3 , dp0 dq0 values
  621|  63.7M|        mask_d_result_4x32b = _mm_madd_epi16(mask_d_result_4x32b, temp_coef1_8x16b);
  622|       |
  623|  63.7M|        temp_coef1_8x16b = _mm_packus_epi16(temp_coef1_8x16b, temp_coef1_8x16b);
  624|       |        // to get all 1,-1 sets of 16 bits in (0)
  625|  63.7M|        temp_coef0_8x16b = _mm_unpacklo_epi8(temp_coef0_8x16b, temp_coef1_8x16b);
  626|       |        //q33-q30,p33-p30,q03-q00,p03-p00,0,q30-p30,0,q00-p00
  627|  63.7M|        mask_de_result_8x16b = _mm_maddubs_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  628|       |        //to get 16 bit 1's
  629|  63.7M|        temp_coef0_8x16b = _mm_srli_epi16(temp_coef1_8x16b, 8);
  630|       |
  631|       |
  632|       |        // dq3 dp3 dq0 dp0
  633|  63.7M|        mask_d_result_4x32b = _mm_abs_epi32(mask_d_result_4x32b);
  634|  63.7M|        mask_16x8b = _mm_shuffle_epi32(mask_d_result_4x32b, 0xec);
  635|  63.7M|        mask_d_result_4x32b = _mm_shuffle_epi32(mask_d_result_4x32b, 0x49);
  636|       |        // dq dp d3 d0
  637|  63.7M|        mask_d_result_4x32b = _mm_add_epi32(mask_d_result_4x32b, mask_16x8b);
  638|       |        //|q33-q30|,|p33-p30|,|q03-q00|,|p03-p00|,0,|q30-p30|,0,|q00-p00|
  639|  63.7M|        mask_de_result_8x16b = _mm_abs_epi16(mask_de_result_8x16b);
  640|       |        //|q33-q30|+|p33-p30|,|q03-q00|+|p03-p00|,0+|q30-p30|,0+|q00-p00|
  641|  63.7M|        mask_de_result_8x16b = _mm_madd_epi16(mask_de_result_8x16b, temp_coef0_8x16b);
  642|       |
  643|       |        ///store back in a single variable
  644|  63.7M|        temp_coef0_8x16b = _mm_srli_si128(mask_d_result_4x32b, 4);
  645|  63.7M|        temp_coef1_8x16b = _mm_srli_si128(mask_d_result_4x32b, 8);
  646|  63.7M|        mask_16x8b = _mm_srli_si128(mask_d_result_4x32b, 12);
  647|       |
  648|  63.7M|        d0 = _mm_cvtsi128_si32(mask_d_result_4x32b);
  649|  63.7M|        d3 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  650|  63.7M|        dp = _mm_cvtsi128_si32(temp_coef1_8x16b);
  651|  63.7M|        dq = _mm_cvtsi128_si32(mask_16x8b);
  652|       |        //getting d
  653|  63.7M|        d = d0 + d3;
  654|       |
  655|       |        ///store back in a single variable
  656|  63.7M|        temp_coef0_8x16b = _mm_srli_si128(mask_de_result_8x16b, 4);
  657|  63.7M|        temp_coef1_8x16b = _mm_srli_si128(mask_de_result_8x16b, 8);
  658|  63.7M|        mask_16x8b = _mm_srli_si128(mask_de_result_8x16b, 12);
  659|       |
  660|  63.7M|        de_0 = _mm_cvtsi128_si32(mask_de_result_8x16b);
  661|  63.7M|        de_1 = _mm_cvtsi128_si32(temp_coef0_8x16b);
  662|  63.7M|        de_2 = _mm_cvtsi128_si32(temp_coef1_8x16b);
  663|  63.7M|        de_3 = _mm_cvtsi128_si32(mask_16x8b);
  664|       |
  665|  63.7M|        de = 0;
  666|  63.7M|        dep = 0;
  667|  63.7M|        deq = 0;
  668|  63.7M|        if(d < beta)
  ------------------
  |  Branch (668:12): [True: 67.6M, False: 18.4E]
  ------------------
  669|  67.6M|        {
  670|  67.6M|            d_sam0 = 0;
  671|  67.6M|            if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (671:16): [True: 65.4M, False: 2.20M]
  ------------------
  672|  65.4M|                            && (de_2 < (beta >> 3))
  ------------------
  |  Branch (672:32): [True: 61.9M, False: 3.47M]
  ------------------
  673|  61.9M|                            && (de_0 < ((5 * tc + 1) >> 1)))
  ------------------
  |  Branch (673:32): [True: 61.5M, False: 472k]
  ------------------
  674|  61.5M|            {
  675|  61.5M|                d_sam0 = 1;
  676|  61.5M|            }
  677|       |
  678|  67.6M|            d_sam3 = 0;
  679|  67.6M|            if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (679:16): [True: 65.1M, False: 2.51M]
  ------------------
  680|  65.1M|                            && (de_3 < (beta >> 3))
  ------------------
  |  Branch (680:32): [True: 61.6M, False: 3.46M]
  ------------------
  681|  60.3M|                            && de_1 < ((5 * tc + 1) >> 1))
  ------------------
  |  Branch (681:32): [True: 59.8M, False: 470k]
  ------------------
  682|  59.8M|            {
  683|  59.8M|                d_sam3 = 1;
  684|  59.8M|            }
  685|       |
  686|  67.6M|            de = (d_sam0 & d_sam3) + 1;
  687|  67.6M|            dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (687:19): [True: 63.4M, False: 4.23M]
  ------------------
  688|  67.6M|            deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (688:19): [True: 63.1M, False: 4.53M]
  ------------------
  689|  67.6M|            if(tc <= 1)
  ------------------
  |  Branch (689:16): [True: 10.8M, False: 56.8M]
  ------------------
  690|  10.8M|            {
  691|  10.8M|                dep = 0;
  692|  10.8M|                deq = 0;
  693|  10.8M|            }
  694|  67.6M|        }
  695|       |
  696|  63.7M|    }
  697|       |
  698|  63.7M|    if(de != 0)
  ------------------
  |  Branch (698:8): [True: 64.4M, False: 18.4E]
  ------------------
  699|  64.4M|    {
  700|       |
  701|  64.4M|        if(2 == de)
  ------------------
  |  Branch (701:12): [True: 58.3M, False: 6.07M]
  ------------------
  702|  58.3M|        {
  703|       |
  704|  58.3M|            __m128i temp_pq0_str0_16x8b;
  705|  58.3M|            __m128i temp_pq1_str0_16x8b, temp_pq1_str1_16x8b;
  706|  58.3M|            __m128i temp_pq2_str0_16x8b;
  707|  58.3M|            __m128i temp_str0_16x8b, temp_str1_16x8b;
  708|  58.3M|            __m128i const2_8x16b, const2tc_8x16b;
  709|       |
  710|  58.3M|            LWORD64 mask, tc2;
  711|  58.3M|            tc = tc << 1;
  712|  58.3M|            mask = (((LWORD64)filter_flag_q) << 63) | (((LWORD64)filter_flag_p) << 31);
  713|  58.3M|            tc2 = ((LWORD64)tc);
  714|       |
  715|  58.3M|            const2_8x16b = _mm_cmpeq_epi16(src_p1_8x16b, src_p1_8x16b);
  716|       |            //q'0-q'1-2 ,p'0-p'1-2
  717|  58.3M|            temp_pq0_str0_16x8b = _mm_unpacklo_epi8(src_p1_8x16b, src_p0_8x16b);
  718|  58.3M|            temp_str0_16x8b   = _mm_unpacklo_epi8(src_q0_8x16b, src_q1_8x16b);
  719|  58.3M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 15);
  720|       |            //arranged q31 q30 q21 q20 q1 q10 q01 q00 p30 p31 p20 p21 p10 p11 p00 p01
  721|  58.3M|            temp_pq0_str0_16x8b = _mm_unpacklo_epi64(temp_pq0_str0_16x8b, temp_str0_16x8b);
  722|       |
  723|  58.3M|            const2_8x16b = _mm_packus_epi16(const2_8x16b, const2_8x16b);
  724|  58.3M|            temp_pq0_str0_16x8b = _mm_maddubs_epi16(temp_pq0_str0_16x8b, const2_8x16b);
  725|       |
  726|       |            //q'1-2, p'1-2
  727|  58.3M|            temp_pq1_str0_16x8b = _mm_unpacklo_epi8(src_p0_8x16b, src_q0_8x16b);
  728|  58.3M|            temp_pq1_str1_16x8b = _mm_unpacklo_epi8(src_q1_8x16b, src_q2_8x16b);
  729|  58.3M|            temp_str1_16x8b = _mm_unpacklo_epi8(src_p1_8x16b, src_p2_8x16b);
  730|       |            // q30 p30 q20 p20 q10 p10 q01 q00 p30 q20 p20 q10 p10 q01 q00 p00
  731|  58.3M|            temp_pq1_str0_16x8b = _mm_unpacklo_epi64(temp_pq1_str0_16x8b, temp_pq1_str0_16x8b);
  732|       |            // q32 q31 q22 q21 q12 q11 q02 q01 p32 p31 p22 p21 p12 p11 p02 p01
  733|  58.3M|            temp_pq1_str1_16x8b = _mm_unpacklo_epi64(temp_str1_16x8b, temp_pq1_str1_16x8b);
  734|       |
  735|  58.3M|            temp_pq1_str0_16x8b = _mm_maddubs_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  736|  58.3M|            temp_pq1_str1_16x8b = _mm_maddubs_epi16(temp_pq1_str1_16x8b, const2_8x16b);
  737|       |
  738|       |            //clipping mask design
  739|  58.3M|            temp_str1_16x8b = _mm_setzero_si128();
  740|  58.3M|            temp_str0_16x8b = _mm_loadl_epi64((__m128i *)(&mask));
  741|  58.3M|            const2tc_8x16b  = _mm_loadl_epi64((__m128i *)(&tc2));
  742|  58.3M|            temp_str0_16x8b = _mm_shuffle_epi32(temp_str0_16x8b, 0x44);
  743|  58.3M|            const2tc_8x16b  = _mm_shuffle_epi8(const2tc_8x16b, temp_str1_16x8b);
  744|       |
  745|       |            //clipping mask design
  746|  58.3M|            temp_str0_16x8b = _mm_srai_epi32(temp_str0_16x8b, 31);
  747|  58.3M|            const2tc_8x16b = _mm_and_si128(const2tc_8x16b, temp_str0_16x8b);
  748|       |            //calculating Clipping MAX for all pixel values.
  749|  58.3M|            src_p0_8x16b = _mm_unpacklo_epi32(src_p0_8x16b, src_q0_8x16b);
  750|  58.3M|            src_q0_8x16b = _mm_unpacklo_epi32(src_p1_8x16b, src_q1_8x16b);
  751|       |            //for clipping calc
  752|  58.3M|            src_p1_8x16b = _mm_unpacklo_epi64(src_p0_8x16b, src_q0_8x16b);
  753|       |            //saving the unmodified data of q1 p1 q0 p0
  754|  58.3M|            src_q1_8x16b = _mm_unpackhi_epi64(src_p0_8x16b, src_q0_8x16b);
  755|       |            //CLIpping MAX and MIN for q1 p1 q0 p0
  756|  58.3M|            src_p0_8x16b = _mm_adds_epu8(src_p1_8x16b, const2tc_8x16b);
  757|  58.3M|            src_p1_8x16b = _mm_subs_epu8(src_p1_8x16b, const2tc_8x16b);
  758|       |
  759|       |
  760|       |            //q'2-q'0-2,p'2-p'0-2
  761|  58.3M|            tmp_pq_str0_8x16b = _mm_unpacklo_epi8(src_p2_8x16b, tmp_pq_str0_8x16b);
  762|  58.3M|            temp_pq2_str0_16x8b = _mm_unpacklo_epi8(src_q2_8x16b, tmp_pq_str1_8x16b);
  763|  58.3M|            const2_8x16b = _mm_slli_epi16(const2_8x16b, 1);
  764|       |            //arranged q33 q32 q23 q22 q13 q12 q03 q02 p32 p33 p22 p23 p12 p13 p02 p03
  765|  58.3M|            temp_pq2_str0_16x8b = _mm_unpacklo_epi64(tmp_pq_str0_8x16b, temp_pq2_str0_16x8b);
  766|  58.3M|            src_p2_8x16b = _mm_unpacklo_epi32(src_p2_8x16b, src_q2_8x16b);
  767|  58.3M|            temp_pq2_str0_16x8b = _mm_maddubs_epi16(temp_pq2_str0_16x8b, const2_8x16b);
  768|       |
  769|       |            //calculating Clipping MAX and MIN for p2 and q2 .
  770|  58.3M|            tmp_pq_str0_8x16b = _mm_adds_epu8(src_p2_8x16b, const2tc_8x16b);
  771|  58.3M|            tmp_pq_str1_8x16b = _mm_subs_epu8(src_p2_8x16b, const2tc_8x16b);
  772|       |            //q'0-q'1-2 ,p'0-p'1-2
  773|  58.3M|            temp_str0_16x8b = _mm_shuffle_epi32(temp_pq0_str0_16x8b, 0x4e);
  774|  58.3M|            temp_pq0_str0_16x8b = _mm_add_epi16(temp_pq0_str0_16x8b, temp_str0_16x8b);
  775|       |            //q'1-2 p'1-2
  776|  58.3M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq1_str1_16x8b);
  777|       |            //to get 2 in 16 bit
  778|  58.3M|            const2_8x16b = _mm_srli_epi16(const2_8x16b, 8);
  779|       |
  780|       |
  781|       |            //q'1, p'1 (adding 2)
  782|  58.3M|            temp_pq1_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, const2_8x16b);
  783|       |            //q'0-q'1,p'0-p'1
  784|  58.3M|            temp_pq0_str0_16x8b = _mm_add_epi16(temp_pq0_str0_16x8b, const2_8x16b);
  785|       |            //q'2-q'1,p'2-p'1
  786|  58.3M|            temp_pq2_str0_16x8b = _mm_add_epi16(temp_pq2_str0_16x8b, const2_8x16b);
  787|       |            //q'0 = (q'0-q'1)+q'1 ,p'0 = (p'0-p'1)+p'1;
  788|  58.3M|            temp_pq0_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq0_str0_16x8b);
  789|       |            //q'2 = (q'2-q'1)+q'1 ,p'2 = (p'2-p'1)+p'1;
  790|  58.3M|            temp_pq2_str0_16x8b = _mm_add_epi16(temp_pq1_str0_16x8b, temp_pq2_str0_16x8b);
  791|       |
  792|       |            //normalisation of all modified pixels
  793|  58.3M|            temp_pq0_str0_16x8b = _mm_srai_epi16(temp_pq0_str0_16x8b, 3);
  794|  58.3M|            temp_pq1_str0_16x8b = _mm_srai_epi16(temp_pq1_str0_16x8b, 2);
  795|  58.3M|            temp_pq2_str0_16x8b = _mm_srai_epi16(temp_pq2_str0_16x8b, 3);
  796|       |            //q'1 p'1 q'0 p'0
  797|  58.3M|            temp_pq0_str0_16x8b = _mm_packus_epi16(temp_pq0_str0_16x8b, temp_pq1_str0_16x8b);
  798|  58.3M|            temp_pq2_str0_16x8b = _mm_packus_epi16(temp_pq2_str0_16x8b, temp_pq2_str0_16x8b);
  799|       |            //pack with the unmodified data of q2 and p2
  800|  58.3M|            src_p2_8x16b = _mm_unpackhi_epi64(temp_pq2_str0_16x8b, src_p2_8x16b);
  801|       |            //Clipping MAX and MIN for q'1 p'1 q'0 p'0 and q'2  p'2
  802|  58.3M|            temp_pq0_str0_16x8b = _mm_min_epu8(temp_pq0_str0_16x8b, src_p0_8x16b);
  803|  58.3M|            src_p2_8x16b = _mm_min_epu8(src_p2_8x16b, tmp_pq_str0_8x16b);
  804|  58.3M|            temp_pq0_str0_16x8b = _mm_max_epu8(temp_pq0_str0_16x8b, src_p1_8x16b);
  805|  58.3M|            src_p2_8x16b = _mm_max_epu8(src_p2_8x16b, tmp_pq_str1_8x16b);
  806|       |            //Reshuffling q'1 p'1 q'0 p'0 along with unmodified data
  807|  58.3M|            src_p0_8x16b = _mm_unpacklo_epi32(temp_pq0_str0_16x8b, src_q1_8x16b);
  808|  58.3M|            src_p1_8x16b = _mm_unpackhi_epi32(temp_pq0_str0_16x8b, src_q1_8x16b);
  809|  58.3M|            src_p2_8x16b = _mm_shuffle_epi32(src_p2_8x16b, 0xd8);
  810|  58.3M|            src_q0_8x16b = _mm_srli_si128(src_p0_8x16b, 8);
  811|  58.3M|            src_q1_8x16b = _mm_srli_si128(src_p1_8x16b, 8);
  812|  58.3M|            src_q2_8x16b = _mm_srli_si128(src_p2_8x16b, 8);
  813|       |
  814|  58.3M|            _mm_storel_epi64((__m128i *)(pu1_src - 3 * src_strd), src_p2_8x16b);
  815|  58.3M|            _mm_storel_epi64((__m128i *)(pu1_src - 2 * src_strd), src_p1_8x16b);
  816|  58.3M|            _mm_storel_epi64((__m128i *)(pu1_src - src_strd), src_p0_8x16b);
  817|  58.3M|            _mm_storel_epi64((__m128i *)(pu1_src), src_q0_8x16b);
  818|  58.3M|            _mm_storel_epi64((__m128i *)(pu1_src + src_strd), src_q1_8x16b);
  819|  58.3M|            _mm_storel_epi64((__m128i *)(pu1_src + 2 * src_strd), src_q2_8x16b);
  820|       |
  821|       |
  822|  58.3M|        }
  823|       |
  824|  6.07M|        else
  825|  6.07M|        {
  826|       |
  827|  6.07M|            __m128i tmp_delta0_8x16b, tmp_delta1_8x16b;
  828|  6.07M|            __m128i tmp0_const_8x16b, tmp1_const_8x16b, tmp2_const_8x16b;
  829|  6.07M|            __m128i coefdelta_0_8x16b;
  830|  6.07M|            __m128i const2_8x16b, consttc_8x16b;
  831|       |
  832|  6.07M|            LWORD64 maskp0, maskp1, maskq0, maskq1;
  833|  6.07M|            maskp0 = (LWORD64)filter_flag_p;
  834|  6.07M|            maskq0 = (LWORD64)filter_flag_q;
  835|  6.07M|            maskp1 = (LWORD64)dep;
  836|  6.07M|            maskq1 = (LWORD64)deq;
  837|  6.07M|            consttc_8x16b = _mm_set1_epi32(tc);
  838|       |
  839|  6.07M|            tmp_delta0_8x16b = _mm_unpacklo_epi8(src_p1_8x16b, src_p0_8x16b);
  840|  6.07M|            tmp_delta1_8x16b = _mm_unpacklo_epi8(src_q0_8x16b, src_q1_8x16b);
  841|       |            //arranged q31 q30 p30 p31  q21 q20 p20 p21  q1 q10 p10 p11 q01 q00 p00 p01
  842|  6.07M|            tmp_delta1_8x16b = _mm_unpacklo_epi16(tmp_delta0_8x16b, tmp_delta1_8x16b);
  843|       |
  844|  6.07M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_de1);
  845|       |            // (-3q1+9q0),(-9p0+3p1)
  846|  6.07M|            tmp_delta0_8x16b = _mm_maddubs_epi16(tmp_delta1_8x16b, coefdelta_0_8x16b);
  847|       |
  848|       |            //getting -tc store
  849|  6.07M|            tmp2_const_8x16b = _mm_cmpeq_epi32(consttc_8x16b, consttc_8x16b);
  850|       |
  851|       |            //getting tc in 16 bit
  852|  6.07M|            consttc_8x16b = _mm_packs_epi32(consttc_8x16b, consttc_8x16b);
  853|       |            //calc 10 *tc = 2*tc +8*tc ; 2*tc
  854|  6.07M|            tmp_pq_str0_8x16b = _mm_slli_epi16(consttc_8x16b, 1);
  855|       |            //calc 10 *tc = 2*tc +8*tc ; 8*tc
  856|  6.07M|            tmp_pq_str1_8x16b = _mm_slli_epi16(consttc_8x16b, 3);
  857|       |
  858|       |            //const 1
  859|  6.07M|            const2_8x16b = _mm_srli_epi16(tmp2_const_8x16b, 15);
  860|       |            //calc 10 *tc
  861|  6.07M|            tmp_pq_str0_8x16b = _mm_add_epi16(tmp_pq_str0_8x16b, tmp_pq_str1_8x16b);
  862|       |            //delta0 without normalisation and clipping
  863|  6.07M|            tmp_delta0_8x16b = _mm_madd_epi16(tmp_delta0_8x16b, const2_8x16b);
  864|       |
  865|  6.07M|            const2_8x16b = _mm_srli_epi32(tmp2_const_8x16b, 31);
  866|       |
  867|       |            //loaded coef for delta1 calculation
  868|  6.07M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)coef_dep1);
  869|       |            //(-2q1+q0),(p0-2p1)
  870|  6.07M|            tmp_delta1_8x16b = _mm_maddubs_epi16(tmp_delta1_8x16b, coefdelta_0_8x16b);
  871|       |            //const 8
  872|  6.07M|            const2_8x16b = _mm_slli_epi32(const2_8x16b, 3);
  873|       |
  874|       |            //normalisation of the filter
  875|  6.07M|            tmp_delta0_8x16b = _mm_add_epi32(tmp_delta0_8x16b, const2_8x16b);
  876|  6.07M|            tmp_delta0_8x16b = _mm_srai_epi32(tmp_delta0_8x16b, 4);
  877|       |
  878|       |            //getting deltaq0
  879|  6.07M|            tmp_pq_str1_8x16b = _mm_sign_epi32(tmp_delta0_8x16b, tmp2_const_8x16b);
  880|       |            //getting -tc
  881|  6.07M|            tmp1_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp2_const_8x16b);
  882|       |            //packing  d03q d02q d01q d0q d03p d02p d01p d00p
  883|  6.07M|            tmp_delta0_8x16b = _mm_packs_epi32(tmp_delta0_8x16b, tmp_pq_str1_8x16b);
  884|       |            //absolute delta
  885|  6.07M|            tmp_pq_str1_8x16b = _mm_abs_epi16(tmp_delta0_8x16b);
  886|       |
  887|       |            //Clipping of delta0
  888|  6.07M|            tmp_delta0_8x16b = _mm_min_epi16(tmp_delta0_8x16b, consttc_8x16b);
  889|       |            //tc>>1 16 bit
  890|  6.07M|            consttc_8x16b = _mm_srai_epi16(consttc_8x16b, 1);
  891|       |            //Clipping of delta0
  892|  6.07M|            tmp_delta0_8x16b = _mm_max_epi16(tmp_delta0_8x16b, tmp1_const_8x16b);
  893|       |
  894|       |            //(-tc)>>1 16 bit
  895|  6.07M|            tmp1_const_8x16b = _mm_sign_epi16(consttc_8x16b, tmp2_const_8x16b);
  896|       |            //mask for |delta| < 10*tc
  897|  6.07M|            tmp_pq_str0_8x16b = _mm_cmpgt_epi16(tmp_pq_str0_8x16b, tmp_pq_str1_8x16b);
  898|       |            //delta 1 calc starts
  899|       |
  900|       |            //getting q32 q22 q12 q02 p32 p12 p22 p02
  901|  6.07M|            tmp0_const_8x16b = _mm_setzero_si128();
  902|  6.07M|            src_q2_8x16b = _mm_unpacklo_epi8(src_q2_8x16b, tmp0_const_8x16b);
  903|  6.07M|            src_p2_8x16b = _mm_unpacklo_epi8(src_p2_8x16b, tmp0_const_8x16b);
  904|  6.07M|            src_p2_8x16b = _mm_unpacklo_epi64(src_p2_8x16b, src_q2_8x16b);
  905|       |            //constant 1
  906|  6.07M|            const2_8x16b = _mm_srli_epi16(tmp2_const_8x16b, 15);
  907|       |            //2*delta0
  908|  6.07M|            tmp2_const_8x16b = _mm_add_epi16(tmp_delta0_8x16b, tmp_delta0_8x16b);
  909|       |            //getting  all respective q's and p's together
  910|  6.07M|            coefdelta_0_8x16b = _mm_load_si128((__m128i *)(shuffle1));
  911|  6.07M|            tmp_delta1_8x16b = _mm_shuffle_epi8(tmp_delta1_8x16b, coefdelta_0_8x16b);
  912|       |            //final adds for deltap1 and deltaq1
  913|  6.07M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, const2_8x16b);
  914|  6.07M|            src_p2_8x16b = _mm_add_epi16(src_p2_8x16b, tmp2_const_8x16b);
  915|  6.07M|            tmp_delta1_8x16b = _mm_add_epi16(tmp_delta1_8x16b, src_p2_8x16b);
  916|  6.07M|            tmp_delta1_8x16b = _mm_srai_epi16(tmp_delta1_8x16b, 2);
  917|       |
  918|       |            //mask0= (((LWORD64)filter_flag_q)<<63)| (((LWORD64)filter_flag_p)<<31);
  919|  6.07M|            tmp_pq_str1_8x16b = _mm_loadl_epi64((__m128i *)(&(maskq0)));
  920|  6.07M|            src_p2_8x16b = _mm_loadl_epi64((__m128i *)(&(maskp0)));
  921|       |
  922|       |            //   src_p2_8x16b = _mm_set_epi32(filter_flag_q,filter_flag_p,filter_flag_q,filter_flag_p);
  923|       |            //mask1= (((LWORD64)(filter_flag_q&deq))<<63)|(((LWORD64)(filter_flag_p & dep))<<31);
  924|  6.07M|            src_q2_8x16b = _mm_loadl_epi64((__m128i *)(&(maskq1)));
  925|  6.07M|            coefdelta_0_8x16b = _mm_loadl_epi64((__m128i *)(&(maskp1)));
  926|       |
  927|  6.07M|            src_p2_8x16b = _mm_unpacklo_epi32(src_p2_8x16b, tmp_pq_str1_8x16b);
  928|  6.07M|            src_q2_8x16b = _mm_unpacklo_epi32(coefdelta_0_8x16b, src_q2_8x16b);
  929|       |            //src_q2_8x16b = _mm_set_epi32(deq,dep,deq,dep);
  930|  6.07M|            src_q2_8x16b = _mm_and_si128(src_q2_8x16b, src_p2_8x16b);
  931|       |
  932|       |            //rearranging the mask values
  933|  6.07M|            src_q2_8x16b = _mm_shuffle_epi32(src_q2_8x16b, 0x50);
  934|  6.07M|            src_p2_8x16b = _mm_shuffle_epi32(src_p2_8x16b, 0x50);
  935|       |
  936|  6.07M|            src_q2_8x16b = _mm_slli_epi32(src_q2_8x16b, 31);
  937|  6.07M|            src_p2_8x16b = _mm_slli_epi32(src_p2_8x16b, 31);
  938|  6.07M|            src_q2_8x16b = _mm_srai_epi32(src_q2_8x16b, 31);
  939|  6.07M|            src_p2_8x16b = _mm_srai_epi32(src_p2_8x16b, 31);
  940|       |
  941|       |            //combining mask delta1
  942|  6.07M|            tmp_pq_str1_8x16b = _mm_and_si128(tmp_pq_str0_8x16b, src_q2_8x16b);
  943|       |            // clipping delta1
  944|  6.07M|            tmp_delta1_8x16b = _mm_min_epi16(tmp_delta1_8x16b, consttc_8x16b);
  945|       |            //combining mask delat0
  946|  6.07M|            tmp_pq_str0_8x16b = _mm_and_si128(tmp_pq_str0_8x16b, src_p2_8x16b);
  947|       |            // clipping delta1
  948|  6.07M|            tmp_delta1_8x16b = _mm_max_epi16(tmp_delta1_8x16b, tmp1_const_8x16b);
  949|       |
  950|       |
  951|       |            //masking of the delta values |delta|<10*tc
  952|  6.07M|            tmp_delta1_8x16b = _mm_and_si128(tmp_delta1_8x16b, tmp_pq_str1_8x16b);
  953|  6.07M|            tmp_delta0_8x16b = _mm_and_si128(tmp_delta0_8x16b, tmp_pq_str0_8x16b);
  954|       |            //separating p and q delta 0 and addinq p0 and q0
  955|  6.07M|            tmp_pq_str0_8x16b = _mm_unpacklo_epi64(tmp_delta0_8x16b, tmp0_const_8x16b);
  956|  6.07M|            tmp_pq_str1_8x16b = _mm_unpackhi_epi64(tmp_delta0_8x16b, tmp0_const_8x16b);
  957|  6.07M|            src_p0_8x16b = _mm_unpacklo_epi8(src_p0_8x16b, tmp0_const_8x16b);
  958|  6.07M|            src_q0_8x16b = _mm_unpacklo_epi8(src_q0_8x16b, tmp0_const_8x16b);
  959|  6.07M|            src_p0_8x16b = _mm_add_epi16(src_p0_8x16b, tmp_pq_str0_8x16b);
  960|  6.07M|            src_q0_8x16b = _mm_add_epi16(src_q0_8x16b, tmp_pq_str1_8x16b);
  961|       |            //separating p and q delta 0 and addinq p0 and q0
  962|  6.07M|            tmp_pq_str0_8x16b = _mm_unpacklo_epi64(tmp_delta1_8x16b, tmp0_const_8x16b);
  963|  6.07M|            tmp_pq_str1_8x16b = _mm_unpackhi_epi64(tmp_delta1_8x16b, tmp0_const_8x16b);
  964|  6.07M|            src_p1_8x16b = _mm_unpacklo_epi8(src_p1_8x16b, tmp0_const_8x16b);
  965|  6.07M|            src_q1_8x16b = _mm_unpacklo_epi8(src_q1_8x16b, tmp0_const_8x16b);
  966|  6.07M|            src_p1_8x16b = _mm_add_epi16(src_p1_8x16b, tmp_pq_str0_8x16b);
  967|  6.07M|            src_q1_8x16b = _mm_add_epi16(src_q1_8x16b, tmp_pq_str1_8x16b);
  968|       |            //packing p1 q1 and p0 q0 to 8 bit
  969|  6.07M|            src_p1_8x16b = _mm_packus_epi16(src_p1_8x16b, src_q1_8x16b);
  970|  6.07M|            src_p0_8x16b = _mm_packus_epi16(src_p0_8x16b, src_q0_8x16b);
  971|       |
  972|  6.07M|            src_q1_8x16b = _mm_srli_si128(src_p1_8x16b, 8);
  973|  6.07M|            src_q0_8x16b = _mm_srli_si128(src_p0_8x16b, 8);
  974|       |
  975|  6.07M|            _mm_storel_epi64((__m128i *)(pu1_src - 2 * src_strd), src_p1_8x16b);
  976|  6.07M|            _mm_storel_epi64((__m128i *)(pu1_src - src_strd), src_p0_8x16b);
  977|  6.07M|            _mm_storel_epi64((__m128i *)(pu1_src), src_q0_8x16b);
  978|  6.07M|            _mm_storel_epi64((__m128i *)(pu1_src + src_strd), src_q1_8x16b);
  979|       |
  980|       |
  981|  6.07M|        }
  982|       |
  983|       |
  984|       |
  985|  64.4M|    }
  986|       |
  987|  63.7M|}
ihevc_deblk_chroma_vert_ssse3:
  999|  20.5M|{
 1000|  20.5M|    WORD32 qp_indx_u, qp_chroma_u;
 1001|  20.5M|    WORD32 qp_indx_v, qp_chroma_v;
 1002|  20.5M|    WORD32 tc_indx_u, tc_u;
 1003|  20.5M|    WORD32 tc_indx_v, tc_v;
 1004|       |
 1005|  20.5M|    __m128i src_row_0_16x8b, tmp_pxl_0_16x8b, src_row_2_16x8b, tmp_pxl_1_16x8b;
 1006|  20.5M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  20.5M|#define ASSERT(x) {}
  ------------------
 1007|       |
 1008|       |    /* chroma processing is done only if BS is 2             */
 1009|       |    /* this function is assumed to be called only if BS is 2 */
 1010|  20.5M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
 1011|  20.5M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
 1012|       |
 1013|       |    /* 8.7.2.5.5 Filtering process for chroma block edges */
 1014|  20.5M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1014:8): [True: 10.9k, False: 20.5M]
  |  Branch (1014:51): [True: 18.4E, False: 20.5M]
  ------------------
 1015|      0|    {
 1016|      0|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1017|      0|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1018|      0|    }
 1019|  20.5M|    else
 1020|  20.5M|    {
 1021|  20.5M|        qp_chroma_u = qp_indx_u < 0 ? qp_indx_u : (qp_indx_u > 57 ? qp_indx_u - 6 : gai4_ihevc_qp_table[qp_indx_u]);
  ------------------
  |  Branch (1021:23): [True: 24.8k, False: 20.5M]
  |  Branch (1021:52): [True: 15.1k, False: 20.5M]
  ------------------
 1022|  20.5M|        qp_chroma_v = qp_indx_v < 0 ? qp_indx_v : (qp_indx_v > 57 ? qp_indx_v - 6 : gai4_ihevc_qp_table[qp_indx_v]);
  ------------------
  |  Branch (1022:23): [True: 15.4k, False: 20.5M]
  |  Branch (1022:52): [True: 3.91k, False: 20.5M]
  ------------------
 1023|  20.5M|    }
 1024|       |
 1025|  20.5M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  20.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 15.1k, False: 20.5M]
  |  |  |  Branch (40:53): [True: 9.31k, False: 20.5M]
  |  |  ------------------
  ------------------
 1026|  20.5M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
 1027|       |
 1028|  20.5M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  20.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 13.1k, False: 20.5M]
  |  |  |  Branch (40:53): [True: 5.31k, False: 20.5M]
  |  |  ------------------
  ------------------
 1029|  20.5M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
 1030|       |
 1031|  20.5M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (1031:8): [True: 460k, False: 20.0M]
  |  Branch (1031:21): [True: 456k, False: 4.31k]
  ------------------
 1032|   456k|    {
 1033|   456k|        return;
 1034|   456k|    }
 1035|  20.0M|    src_row_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src - 4));
 1036|  20.0M|    tmp_pxl_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd - 4));
 1037|  20.0M|    src_row_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd - 4));
 1038|  20.0M|    tmp_pxl_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd - 4));
 1039|       |
 1040|  20.0M|    {
 1041|  20.0M|        LWORD64 mask_tc, mask_flag, mask;
 1042|  20.0M|        __m128i delta_vu0_16x8b, delta_vu1_16x8b;
 1043|  20.0M|        __m128i mask_tc_16x8, mask_16x8b, mask_flag_p_16x8b, mask_flag_q_16x8b;
 1044|  20.0M|        __m128i min_0_16x8b;
 1045|  20.0M|        __m128i const_16x8b;
 1046|  20.0M|        mask_flag = (((LWORD64)filter_flag_p) << 31) | (((LWORD64)filter_flag_q) << 63);
 1047|  20.0M|        mask_tc = (((LWORD64)tc_v) << 16) | ((LWORD64)tc_u);
 1048|  20.0M|        mask = 0xffff00000000ffffLL;
 1049|       |
 1050|  20.0M|        src_row_0_16x8b = _mm_unpacklo_epi64(src_row_0_16x8b, tmp_pxl_0_16x8b);
 1051|  20.0M|        src_row_2_16x8b = _mm_unpacklo_epi64(src_row_2_16x8b, tmp_pxl_1_16x8b);
 1052|       |
 1053|  20.0M|        mask_16x8b = _mm_load_si128((__m128i *)(shuffle_uv));
 1054|       |        // qv11 qu11 qv10 qu10 qv01 qu01 qv00 qu00 pv10 pu10 pv11 pu11 pv00 pu00 pv01 pu01
 1055|       |        // qv31 qu31 qv30 qu30 qv21 qu21 qv20 qu20 pv30 pu30 pv31 pu31 pv20 pu20 pv21 pu21
 1056|  20.0M|        delta_vu0_16x8b = _mm_shuffle_epi8(src_row_0_16x8b, mask_16x8b);
 1057|  20.0M|        delta_vu1_16x8b = _mm_shuffle_epi8(src_row_2_16x8b, mask_16x8b);
 1058|       |
 1059|  20.0M|        tmp_pxl_0_16x8b = _mm_unpacklo_epi64(delta_vu0_16x8b, delta_vu1_16x8b);
 1060|  20.0M|        tmp_pxl_1_16x8b = _mm_unpackhi_epi64(delta_vu0_16x8b, delta_vu1_16x8b);
 1061|       |        // pv30 pv31 pu30 pu31 pv20 pv21 pu20 pu21 pv10 pv11 pu10 pu11 pv00 pv01 pu00 pu01
 1062|       |        // qv31 qv30 qu31 qu30 qv21 qv20 qu21 qu20 qv11 qv10 qu11 qu10 qv01 qv00 qu01 qu00
 1063|  20.0M|        delta_vu0_16x8b = _mm_load_si128((__m128i *)delta0);
 1064|  20.0M|        delta_vu1_16x8b = _mm_load_si128((__m128i *)delta1);
 1065|       |
 1066|  20.0M|        delta_vu0_16x8b = _mm_maddubs_epi16(tmp_pxl_0_16x8b, delta_vu0_16x8b);
 1067|  20.0M|        delta_vu1_16x8b = _mm_maddubs_epi16(tmp_pxl_1_16x8b, delta_vu1_16x8b);
 1068|       |
 1069|       |        //generating offset 4
 1070|  20.0M|        const_16x8b = _mm_cmpeq_epi16(tmp_pxl_0_16x8b, tmp_pxl_0_16x8b);
 1071|       |        // filter flag mask and tc mask
 1072|  20.0M|        mask_tc_16x8 = _mm_loadl_epi64((__m128i *)(&mask_tc));
 1073|  20.0M|        mask_flag_q_16x8b = _mm_loadl_epi64((__m128i *)(&mask_flag));
 1074|       |
 1075|  20.0M|        mask_tc_16x8 = _mm_shuffle_epi32(mask_tc_16x8, 0x00);
 1076|  20.0M|        mask_flag_q_16x8b = _mm_srai_epi32(mask_flag_q_16x8b, 31);
 1077|       |        //-tc
 1078|  20.0M|        min_0_16x8b = _mm_sign_epi16(mask_tc_16x8, const_16x8b);
 1079|       |        //converting const 1
 1080|  20.0M|        const_16x8b = _mm_srli_epi16(const_16x8b, 15);
 1081|       |
 1082|       |        //filterp and filterq flag
 1083|  20.0M|        mask_flag_p_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x00);
 1084|  20.0M|        mask_flag_q_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x55);
 1085|       |
 1086|       |        //modified delta with a filter (1 -4 4 -1) available in 16 bit
 1087|  20.0M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, delta_vu1_16x8b);
 1088|       |        //converting const 4
 1089|  20.0M|        const_16x8b = _mm_slli_epi16(const_16x8b, 2);
 1090|       |
 1091|  20.0M|        mask_16x8b = _mm_loadl_epi64((__m128i *)(&mask));
 1092|       |        //offset addition
 1093|  20.0M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, const_16x8b);
 1094|       |        //eliminating q1
 1095|  20.0M|        tmp_pxl_1_16x8b = _mm_slli_epi16(tmp_pxl_1_16x8b, 8);
 1096|       |
 1097|  20.0M|        const_16x8b = _mm_setzero_si128();
 1098|       |        //filter after normalisation
 1099|  20.0M|        delta_vu0_16x8b = _mm_srai_epi16(delta_vu0_16x8b, 3);
 1100|  20.0M|        mask_16x8b = _mm_shuffle_epi32(mask_16x8b, 0x44);
 1101|       |
 1102|       |        //clipping MAX
 1103|  20.0M|        delta_vu0_16x8b = _mm_min_epi16(delta_vu0_16x8b, mask_tc_16x8);
 1104|       |        //getting p0 and eliminating p1
 1105|  20.0M|        tmp_pxl_0_16x8b = _mm_srli_epi16(tmp_pxl_0_16x8b, 8);
 1106|       |        //clipping MIN
 1107|  20.0M|        delta_vu0_16x8b = _mm_max_epi16(delta_vu0_16x8b, min_0_16x8b);
 1108|       |        //getting q0
 1109|  20.0M|        tmp_pxl_1_16x8b = _mm_srli_epi16(tmp_pxl_1_16x8b, 8);
 1110|       |        //masking filter flag
 1111|  20.0M|        delta_vu1_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_q_16x8b);
 1112|  20.0M|        delta_vu0_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_p_16x8b);
 1113|       |
 1114|       |        // q-delta ,p+delta
 1115|  20.0M|        tmp_pxl_1_16x8b = _mm_sub_epi16(tmp_pxl_1_16x8b, delta_vu1_16x8b);
 1116|  20.0M|        tmp_pxl_0_16x8b = _mm_add_epi16(tmp_pxl_0_16x8b, delta_vu0_16x8b);
 1117|       |        //merging q0 and p0 of respective rows
 1118|  20.0M|        delta_vu1_16x8b = _mm_unpackhi_epi32(tmp_pxl_0_16x8b, tmp_pxl_1_16x8b);
 1119|  20.0M|        delta_vu0_16x8b = _mm_unpacklo_epi32(tmp_pxl_0_16x8b, tmp_pxl_1_16x8b);
 1120|       |        // row 0 and row 1 packed , row2 and row3 packed
 1121|  20.0M|        delta_vu0_16x8b = _mm_packus_epi16(delta_vu0_16x8b, const_16x8b);
 1122|  20.0M|        delta_vu1_16x8b = _mm_packus_epi16(delta_vu1_16x8b, const_16x8b);
 1123|       |        //removing older pixel values
 1124|  20.0M|        src_row_0_16x8b = _mm_and_si128(src_row_0_16x8b, mask_16x8b);
 1125|  20.0M|        src_row_2_16x8b = _mm_and_si128(src_row_2_16x8b, mask_16x8b);
 1126|       |        //arranging modified pixels
 1127|  20.0M|        delta_vu0_16x8b = _mm_shuffle_epi32(delta_vu0_16x8b, 0xd8);
 1128|  20.0M|        delta_vu1_16x8b = _mm_shuffle_epi32(delta_vu1_16x8b, 0xd8);
 1129|  20.0M|        delta_vu0_16x8b = _mm_slli_epi64(delta_vu0_16x8b, 16);
 1130|  20.0M|        delta_vu1_16x8b = _mm_slli_epi64(delta_vu1_16x8b, 16);
 1131|       |        //plugging the modified values
 1132|  20.0M|        src_row_0_16x8b = _mm_or_si128(src_row_0_16x8b, delta_vu0_16x8b);
 1133|  20.0M|        src_row_2_16x8b = _mm_or_si128(src_row_2_16x8b, delta_vu1_16x8b);
 1134|       |
 1135|       |
 1136|       |        //geting values for row1 and row 3
 1137|  20.0M|        tmp_pxl_0_16x8b = _mm_srli_si128(src_row_0_16x8b, 8);
 1138|  20.0M|        tmp_pxl_1_16x8b = _mm_srli_si128(src_row_2_16x8b, 8);
 1139|       |
 1140|  20.0M|        _mm_storel_epi64((__m128i *)(pu1_src - 4), src_row_0_16x8b);
 1141|  20.0M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + src_strd), tmp_pxl_0_16x8b);
 1142|  20.0M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 2 * src_strd), src_row_2_16x8b);
 1143|  20.0M|        _mm_storel_epi64((__m128i *)((pu1_src - 4) + 3 * src_strd), tmp_pxl_1_16x8b);
 1144|  20.0M|    }
 1145|       |
 1146|       |
 1147|       |
 1148|  20.0M|}
ihevc_deblk_chroma_horz_ssse3:
 1160|  20.8M|{
 1161|  20.8M|    WORD32 qp_indx_u, qp_chroma_u;
 1162|  20.8M|    WORD32 qp_indx_v, qp_chroma_v;
 1163|  20.8M|    WORD32 tc_indx_u, tc_u;
 1164|  20.8M|    WORD32 tc_indx_v, tc_v;
 1165|       |
 1166|       |
 1167|  20.8M|    __m128i tmp_p0_16x8b, src_p0_16x8b, src_q0_16x8b, tmp_q0_16x8b;
 1168|       |
 1169|  20.8M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  20.8M|#define ASSERT(x) {}
  ------------------
 1170|       |
 1171|       |    /* chroma processing is done only if BS is 2             */
 1172|       |    /* this function is assumed to be called only if BS is 2 */
 1173|  20.8M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
 1174|  20.8M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
 1175|       |
 1176|       |    /* 8.7.2.5.5 Filtering process for chroma block edges */
 1177|  20.8M|    if(chroma_fmt_idc == CHROMA_FMT_IDC_YUV444 || chroma_fmt_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1177:8): [True: 18.4E, False: 20.8M]
  |  Branch (1177:51): [True: 18.4E, False: 20.8M]
  ------------------
 1178|      0|    {
 1179|      0|        qp_chroma_u = MIN(qp_indx_u, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1180|      0|        qp_chroma_v = MIN(qp_indx_v, 51);
  ------------------
  |  |   43|      0|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1181|      0|    }
 1182|  20.8M|    else
 1183|  20.8M|    {
 1184|  20.8M|        qp_chroma_u = qp_indx_u < 0 ? qp_indx_u : (qp_indx_u > 57 ? qp_indx_u - 6 : gai4_ihevc_qp_table[qp_indx_u]);
  ------------------
  |  Branch (1184:23): [True: 24.5k, False: 20.8M]
  |  Branch (1184:52): [True: 19.5k, False: 20.8M]
  ------------------
 1185|  20.8M|        qp_chroma_v = qp_indx_v < 0 ? qp_indx_v : (qp_indx_v > 57 ? qp_indx_v - 6 : gai4_ihevc_qp_table[qp_indx_v]);
  ------------------
  |  Branch (1185:23): [True: 14.2k, False: 20.8M]
  |  Branch (1185:52): [True: 3.30k, False: 20.8M]
  ------------------
 1186|  20.8M|    }
 1187|       |
 1188|  20.8M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  20.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 19.5k, False: 20.8M]
  |  |  |  Branch (40:53): [True: 7.99k, False: 20.8M]
  |  |  ------------------
  ------------------
 1189|  20.8M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
 1190|       |
 1191|  20.8M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  20.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 12.1k, False: 20.8M]
  |  |  |  Branch (40:53): [True: 5.04k, False: 20.8M]
  |  |  ------------------
  ------------------
 1192|  20.8M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
 1193|       |
 1194|  20.8M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (1194:8): [True: 542k, False: 20.3M]
  |  Branch (1194:21): [True: 537k, False: 5.02k]
  ------------------
 1195|   537k|    {
 1196|   537k|        return;
 1197|   537k|    }
 1198|  20.3M|    tmp_p0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src - 2 * src_strd));
 1199|  20.3M|    src_p0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src - src_strd));
 1200|  20.3M|    src_q0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 1201|  20.3M|    tmp_q0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1202|       |
 1203|  20.3M|    {
 1204|  20.3M|        LWORD64 mask_tc, mask_flag;
 1205|  20.3M|        __m128i delta_vu0_16x8b, delta_vu1_16x8b;
 1206|  20.3M|        __m128i mask_tc_16x8, mask_16x8b, mask_flag_p_16x8b, mask_flag_q_16x8b;
 1207|  20.3M|        __m128i min_0_16x8b;
 1208|  20.3M|        __m128i const_16x8b;
 1209|  20.3M|        mask_flag = (((LWORD64)filter_flag_p) << 31) | (((LWORD64)filter_flag_q) << 63);
 1210|  20.3M|        mask_tc = (((LWORD64)tc_v) << 16) | ((LWORD64)tc_u);
 1211|       |
 1212|  20.3M|        tmp_p0_16x8b = _mm_unpacklo_epi8(tmp_p0_16x8b, src_p0_16x8b);
 1213|  20.3M|        tmp_q0_16x8b = _mm_unpacklo_epi8(src_q0_16x8b, tmp_q0_16x8b);
 1214|       |
 1215|       |        // pv30 pv31 pu30 pu31 pv20 pv21 pu20 pu21 pv10 pv11 pu10 pu11 pv00 pv01 pu00 pu01
 1216|       |        // qv31 qv30 qu31 qu30 qv21 qv20 qu21 qu20 qv11 qv10 qu11 qu10 qv01 qv00 qu01 qu00
 1217|  20.3M|        delta_vu0_16x8b = _mm_load_si128((__m128i *)delta0);
 1218|  20.3M|        delta_vu1_16x8b = _mm_load_si128((__m128i *)delta1);
 1219|       |
 1220|  20.3M|        delta_vu0_16x8b = _mm_maddubs_epi16(tmp_p0_16x8b, delta_vu0_16x8b);
 1221|  20.3M|        delta_vu1_16x8b = _mm_maddubs_epi16(tmp_q0_16x8b, delta_vu1_16x8b);
 1222|       |
 1223|       |
 1224|       |        // filter flag mask and tc mask
 1225|  20.3M|        mask_tc_16x8 = _mm_loadl_epi64((__m128i *)(&mask_tc));
 1226|  20.3M|        mask_flag_q_16x8b = _mm_loadl_epi64((__m128i *)(&mask_flag));
 1227|       |
 1228|       |        //generating offset 4
 1229|  20.3M|        const_16x8b = _mm_cmpeq_epi16(tmp_p0_16x8b, tmp_p0_16x8b);
 1230|       |        // filter flag mask and tc mask
 1231|  20.3M|        mask_tc_16x8 = _mm_shuffle_epi32(mask_tc_16x8, 0x00);
 1232|  20.3M|        mask_flag_q_16x8b = _mm_srai_epi32(mask_flag_q_16x8b, 31);
 1233|       |        //-tc
 1234|  20.3M|        min_0_16x8b = _mm_sign_epi16(mask_tc_16x8, const_16x8b);
 1235|       |        //converting const 1
 1236|  20.3M|        const_16x8b = _mm_srli_epi16(const_16x8b, 15);
 1237|       |
 1238|       |        //filterp
 1239|  20.3M|        mask_flag_p_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x00);
 1240|       |
 1241|       |
 1242|       |        //converting const 4
 1243|  20.3M|        const_16x8b = _mm_slli_epi16(const_16x8b, 2);
 1244|       |        //modified delta with a filter (1 -4 4 -1) available in 16 bit
 1245|  20.3M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, delta_vu1_16x8b);
 1246|       |
 1247|       |        //filterq flag
 1248|  20.3M|        mask_flag_q_16x8b = _mm_shuffle_epi32(mask_flag_q_16x8b, 0x55);
 1249|       |        //offset addition
 1250|  20.3M|        delta_vu0_16x8b = _mm_add_epi16(delta_vu0_16x8b, const_16x8b);
 1251|  20.3M|        mask_16x8b = _mm_setzero_si128();
 1252|       |        //filter after normalisation
 1253|  20.3M|        delta_vu0_16x8b = _mm_srai_epi16(delta_vu0_16x8b, 3);
 1254|       |
 1255|       |        //converting p0 to 16bit
 1256|  20.3M|        src_p0_16x8b = _mm_unpacklo_epi8(src_p0_16x8b, mask_16x8b);
 1257|       |        //clipping MAX
 1258|  20.3M|        delta_vu0_16x8b = _mm_min_epi16(delta_vu0_16x8b, mask_tc_16x8);
 1259|       |        //converting q0 to 16bit
 1260|  20.3M|        src_q0_16x8b = _mm_unpacklo_epi8(src_q0_16x8b, mask_16x8b);
 1261|       |        //clipping MIN
 1262|  20.3M|        delta_vu0_16x8b = _mm_max_epi16(delta_vu0_16x8b, min_0_16x8b);
 1263|       |
 1264|       |        //masking filter flag
 1265|  20.3M|        delta_vu1_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_q_16x8b);
 1266|  20.3M|        delta_vu0_16x8b = _mm_and_si128(delta_vu0_16x8b, mask_flag_p_16x8b);
 1267|       |
 1268|       |        // q-delta ,p+delta
 1269|  20.3M|        src_q0_16x8b = _mm_sub_epi16(src_q0_16x8b, delta_vu1_16x8b);
 1270|  20.3M|        src_p0_16x8b = _mm_add_epi16(src_p0_16x8b, delta_vu0_16x8b);
 1271|       |
 1272|       |        // p0 and q0 packed
 1273|  20.3M|        src_q0_16x8b = _mm_packus_epi16(src_q0_16x8b, mask_16x8b);
 1274|  20.3M|        src_p0_16x8b = _mm_packus_epi16(src_p0_16x8b, mask_16x8b);
 1275|       |
 1276|       |
 1277|       |
 1278|  20.3M|        _mm_storel_epi64((__m128i *)(pu1_src - src_strd), src_p0_16x8b);
 1279|  20.3M|        _mm_storel_epi64((__m128i *)(pu1_src), src_q0_16x8b);
 1280|       |
 1281|  20.3M|    }
 1282|       |
 1283|       |
 1284|  20.3M|}

ihevc_inter_pred_luma_copy_w16out_sse42:
  115|  19.0M|{
  116|  19.0M|    WORD32 row, col;
  117|  19.0M|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  118|  19.0M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  19.0M|#define UNUSED(x) ((void)(x))
  ------------------
  119|  19.0M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  19.0M|#define ASSERT(x) {}
  ------------------
  120|  19.0M|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  19.0M|#define ASSERT(x) {}
  ------------------
  121|       |
  122|  19.0M|    if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (122:8): [True: 18.9M, False: 21.9k]
  ------------------
  123|  18.9M|    {
  124|  58.5M|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (124:22): [True: 39.5M, False: 18.9M]
  ------------------
  125|  39.5M|        {
  126|  85.8M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (126:26): [True: 46.2M, False: 39.5M]
  ------------------
  127|  46.2M|            {
  128|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  129|  46.2M|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  130|  46.2M|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  131|  46.2M|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  132|  46.2M|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  133|       |
  134|  46.2M|                src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  135|  46.2M|                src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  136|  46.2M|                src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  137|  46.2M|                src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  138|       |
  139|  46.2M|                src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  46.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  46.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  140|  46.2M|                src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  46.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  46.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  141|  46.2M|                src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  46.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  46.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  142|  46.2M|                src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  46.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  46.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  143|       |
  144|       |                /* storing 16 8-bit output values */
  145|  46.2M|                _mm_storeu_si128((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  146|  46.2M|                _mm_storeu_si128((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  147|  46.2M|                _mm_storeu_si128((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  148|  46.2M|                _mm_storeu_si128((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  149|       |
  150|  46.2M|                pu1_src += 8; /* pointer update */
  151|  46.2M|                pi2_dst += 8; /* pointer update */
  152|  46.2M|            } /* inner for loop ends here(8-output values in single iteration) */
  153|       |
  154|  39.5M|            pu1_src += 4 * src_strd - wd; /* pointer update */
  155|  39.5M|            pi2_dst += 4 * dst_strd - wd; /* pointer update */
  156|  39.5M|        }
  157|  18.9M|    }
  158|  21.9k|    else /* wd = multiple of 4 case */
  159|  21.9k|    {
  160|   109k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (160:22): [True: 87.8k, False: 21.9k]
  ------------------
  161|  87.8k|        {
  162|   260k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (162:26): [True: 172k, False: 87.8k]
  ------------------
  163|   172k|            {
  164|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  165|   172k|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  166|   172k|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  167|   172k|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  168|   172k|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  169|       |
  170|   172k|                src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  171|   172k|                src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  172|   172k|                src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  173|   172k|                src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  174|       |
  175|   172k|                src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   172k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   172k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  176|   172k|                src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   172k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   172k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  177|   172k|                src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   172k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   172k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  178|   172k|                src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   172k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   172k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  179|       |
  180|       |                /* storing 16 8-bit output values */
  181|   172k|                _mm_storel_epi64((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  182|   172k|                _mm_storel_epi64((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  183|   172k|                _mm_storel_epi64((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  184|   172k|                _mm_storel_epi64((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  185|       |
  186|   172k|                pu1_src += 4; /* pointer update */
  187|   172k|                pi2_dst += 4; /* pointer update */
  188|   172k|            } /* inner for loop ends here(4-output values in single iteration) */
  189|       |
  190|  87.8k|            pu1_src += 4 * src_strd - wd; /* pointer update */
  191|  87.8k|            pi2_dst += 4 * dst_strd - wd; /* pointer update */
  192|  87.8k|        }
  193|  21.9k|    }
  194|  19.0M|}
ihevc_inter_pred_chroma_copy_sse42:
  242|   313k|{
  243|   313k|    WORD32 row, col, wdx2;
  244|   313k|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  245|       |
  246|   313k|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   313k|#define ASSERT(x) {}
  ------------------
  247|   313k|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   313k|#define ASSERT(x) {}
  ------------------
  248|   313k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   313k|#define UNUSED(x) ((void)(x))
  ------------------
  249|   313k|    wdx2 = wd * 2;
  250|       |
  251|   313k|    if(0 == (ht & 3)) /* ht multiple of 4 */
  ------------------
  |  Branch (251:8): [True: 296k, False: 16.7k]
  ------------------
  252|   296k|    {
  253|   296k|        if(0 == (wdx2 & 15)) /* wdx2 multiple of 16 case */
  ------------------
  |  Branch (253:12): [True: 9.18k, False: 287k]
  ------------------
  254|  9.18k|        {
  255|  37.3k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (255:26): [True: 28.1k, False: 9.18k]
  ------------------
  256|  28.1k|            {
  257|  89.3k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (257:30): [True: 61.1k, False: 28.1k]
  ------------------
  258|  61.1k|                {
  259|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  260|  61.1k|                    src0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                /* row =0 */
  261|  61.1k|                    src1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  262|  61.1k|                    src2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  263|  61.1k|                    src3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  264|       |
  265|       |                    /* storing 16 8-bit output values */
  266|  61.1k|                    _mm_storeu_si128((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  267|  61.1k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  268|  61.1k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  269|  61.1k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  270|       |
  271|  61.1k|                    pu1_src += 16; /* pointer update */
  272|  61.1k|                    pu1_dst += 16; /* pointer update */
  273|  61.1k|                } /* inner for loop ends here(16-output values in single iteration) */
  274|       |
  275|  28.1k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  276|  28.1k|                pu1_dst += 4 * dst_strd - wdx2; /* pointer update */
  277|  28.1k|            }
  278|       |
  279|  9.18k|        }
  280|   287k|        else if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (280:17): [True: 273k, False: 14.5k]
  ------------------
  281|   273k|        {
  282|   549k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (282:26): [True: 276k, False: 273k]
  ------------------
  283|   276k|            {
  284|   556k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (284:30): [True: 280k, False: 276k]
  ------------------
  285|   280k|                {
  286|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  287|   280k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  288|   280k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  289|   280k|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  290|   280k|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  291|       |
  292|       |                    /* storing 16 8-bit output values */
  293|   280k|                    _mm_storel_epi64((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  294|   280k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  295|   280k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  296|   280k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  297|       |
  298|   280k|                    pu1_src += 8; /* pointer update */
  299|   280k|                    pu1_dst += 8; /* pointer update */
  300|   280k|                } /*  inner for loop ends here(8-output values in single iteration) */
  301|       |
  302|   276k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  303|   276k|                pu1_dst += 4 * dst_strd - wdx2; /* pointer update */
  304|   276k|            }
  305|   273k|        }
  306|  14.5k|        else /* wdx2 = multiple of 4 case */
  307|  14.5k|        {
  308|  14.5k|            WORD32 dst0, dst1, dst2, dst3;
  309|  30.4k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (309:26): [True: 15.8k, False: 14.5k]
  ------------------
  310|  15.8k|            {
  311|  33.4k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (311:30): [True: 17.6k, False: 15.8k]
  ------------------
  312|  17.6k|                {
  313|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  314|  17.6k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  315|  17.6k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  316|  17.6k|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  317|  17.6k|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  318|       |
  319|  17.6k|                    dst0 = _mm_cvtsi128_si32(src0_16x8b);
  320|  17.6k|                    dst1 = _mm_cvtsi128_si32(src1_16x8b);
  321|  17.6k|                    dst2 = _mm_cvtsi128_si32(src2_16x8b);
  322|  17.6k|                    dst3 = _mm_cvtsi128_si32(src3_16x8b);
  323|       |
  324|       |                    /* storing 4 8-bit output values */
  325|  17.6k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0; /* row =0 */
  326|  17.6k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1; /* row =1 */
  327|  17.6k|                    *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2; /* row =2 */
  328|  17.6k|                    *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3; /* row =3 */
  329|       |
  330|  17.6k|                    pu1_src += 4; /* pointer update */
  331|  17.6k|                    pu1_dst += 4; /* pointer update */
  332|  17.6k|                } /*  inner for loop ends here(4- output values in single iteration) */
  333|       |
  334|  15.8k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  335|  15.8k|                pu1_dst += 4 * dst_strd - wdx2; /* pointer update */
  336|  15.8k|            }
  337|  14.5k|        }
  338|   296k|    }
  339|  16.7k|    else /* ht multiple of 2 */
  340|  16.7k|    {
  341|  16.7k|        if(0 == (wdx2 & 15)) /* wdx2 multiple of 16 case */
  ------------------
  |  Branch (341:12): [True: 699, False: 16.0k]
  ------------------
  342|    699|        {
  343|  2.12k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (343:26): [True: 1.42k, False: 699]
  ------------------
  344|  1.42k|            {
  345|  2.84k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (345:30): [True: 1.42k, False: 1.42k]
  ------------------
  346|  1.42k|                {
  347|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  348|  1.42k|                    src0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                /* row =0 */
  349|  1.42k|                    src1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  350|       |
  351|       |                    /* storing 16 8-bit output values */
  352|  1.42k|                    _mm_storeu_si128((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  353|  1.42k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  354|       |
  355|  1.42k|                    pu1_src += 16; /* pointer update */
  356|  1.42k|                    pu1_dst += 16; /* pointer update */
  357|  1.42k|                } /* inner for loop ends here(16-output values in single iteration) */
  358|       |
  359|  1.42k|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  360|  1.42k|                pu1_dst += 2 * dst_strd - wdx2; /* pointer update */
  361|  1.42k|            }
  362|       |
  363|    699|        }
  364|  16.0k|        else if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (364:17): [True: 16.1k, False: 18.4E]
  ------------------
  365|  16.1k|        {
  366|  32.3k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (366:26): [True: 16.1k, False: 16.1k]
  ------------------
  367|  16.1k|            {
  368|  32.3k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (368:30): [True: 16.1k, False: 16.1k]
  ------------------
  369|  16.1k|                {
  370|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  371|  16.1k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  372|  16.1k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  373|       |
  374|       |                    /* storing 16 8-bit output values */
  375|  16.1k|                    _mm_storel_epi64((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  376|  16.1k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  377|       |
  378|  16.1k|                    pu1_src += 8; /* pointer update */
  379|  16.1k|                    pu1_dst += 8; /* pointer update */
  380|  16.1k|                } /*  inner for loop ends here(8-output values in single iteration) */
  381|       |
  382|  16.1k|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  383|  16.1k|                pu1_dst += 2 * dst_strd - wdx2; /* pointer update */
  384|  16.1k|            }
  385|  16.1k|        }
  386|  18.4E|        else /* wdx2 = multiple of 4 case */
  387|  18.4E|        {
  388|  18.4E|            WORD32 dst0, dst1;
  389|  18.4E|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (389:26): [True: 0, False: 18.4E]
  ------------------
  390|      0|            {
  391|      0|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (391:30): [True: 0, False: 0]
  ------------------
  392|      0|                {
  393|       |                    /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  394|      0|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  395|      0|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  396|       |
  397|      0|                    dst0 = _mm_cvtsi128_si32(src0_16x8b);
  398|      0|                    dst1 = _mm_cvtsi128_si32(src1_16x8b);
  399|       |
  400|       |
  401|       |                    /* storing 4 8-bit output values */
  402|      0|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0; /* row =0 */
  403|      0|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1; /* row =1 */
  404|       |
  405|      0|                    pu1_src += 4; /* pointer update */
  406|      0|                    pu1_dst += 4; /* pointer update */
  407|      0|                } /*  inner for loop ends here(4- output values in single iteration) */
  408|       |
  409|      0|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  410|      0|                pu1_dst += 2 * dst_strd - wdx2; /* pointer update */
  411|      0|            }
  412|  18.4E|        }
  413|  16.7k|    }
  414|   313k|}
ihevc_inter_pred_chroma_copy_w16out_sse42:
  463|  18.5M|{
  464|  18.5M|    WORD32 row, col, wdx2;
  465|  18.5M|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  466|       |
  467|  18.5M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  18.5M|#define ASSERT(x) {}
  ------------------
  468|  18.5M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  18.5M|#define ASSERT(x) {}
  ------------------
  469|  18.5M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  18.5M|#define UNUSED(x) ((void)(x))
  ------------------
  470|  18.5M|    wdx2 = wd * 2;
  471|       |
  472|  18.5M|    if(0 == (ht & 3)) /* multiple of 4 case */
  ------------------
  |  Branch (472:8): [True: 18.5M, False: 3.80k]
  ------------------
  473|  18.5M|    {
  474|  18.5M|        if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (474:12): [True: 18.5M, False: 21.2k]
  ------------------
  475|  18.5M|        {
  476|  37.8M|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (476:26): [True: 19.3M, False: 18.5M]
  ------------------
  477|  19.3M|            {
  478|  41.9M|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (478:30): [True: 22.6M, False: 19.3M]
  ------------------
  479|  22.6M|                {
  480|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  481|  22.6M|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  482|  22.6M|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  483|  22.6M|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  484|  22.6M|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  485|       |
  486|  22.6M|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  487|  22.6M|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  488|  22.6M|                    src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  489|  22.6M|                    src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  490|       |
  491|  22.6M|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  22.6M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.6M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  492|  22.6M|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  22.6M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.6M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  493|  22.6M|                    src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  22.6M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.6M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  494|  22.6M|                    src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  22.6M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  22.6M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  495|       |
  496|       |                    /* storing 16 8-bit output values */
  497|  22.6M|                    _mm_storeu_si128((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  498|  22.6M|                    _mm_storeu_si128((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  499|  22.6M|                    _mm_storeu_si128((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  500|  22.6M|                    _mm_storeu_si128((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  501|       |
  502|  22.6M|                    pu1_src += 8; /* pointer update */
  503|  22.6M|                    pi2_dst += 8; /* pointer update */
  504|  22.6M|                } /* inner for loop ends here(8-output values in single iteration) */
  505|       |
  506|  19.3M|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  507|  19.3M|                pi2_dst += 4 * dst_strd - wdx2; /* pointer update */
  508|  19.3M|            }
  509|  18.5M|        }
  510|  21.2k|        else /* wdx2 = multiple of 4 case */
  511|  21.2k|        {
  512|  64.8k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (512:26): [True: 43.5k, False: 21.2k]
  ------------------
  513|  43.5k|            {
  514|   129k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (514:30): [True: 85.5k, False: 43.5k]
  ------------------
  515|  85.5k|                {
  516|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  517|  85.5k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  518|  85.5k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  519|  85.5k|                    src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  520|  85.5k|                    src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  521|       |
  522|  85.5k|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  523|  85.5k|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  524|  85.5k|                    src2_16x8b = _mm_cvtepu8_epi16(src2_16x8b);
  525|  85.5k|                    src3_16x8b = _mm_cvtepu8_epi16(src3_16x8b);
  526|       |
  527|  85.5k|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  85.5k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  85.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  528|  85.5k|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  85.5k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  85.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  529|  85.5k|                    src2_16x8b = _mm_slli_epi16(src2_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  85.5k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  85.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  530|  85.5k|                    src3_16x8b = _mm_slli_epi16(src3_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  85.5k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  85.5k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  531|       |
  532|       |                    /* storing 16 8-bit output values */
  533|  85.5k|                    _mm_storel_epi64((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  534|  85.5k|                    _mm_storel_epi64((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  535|  85.5k|                    _mm_storel_epi64((__m128i *)(pi2_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  536|  85.5k|                    _mm_storel_epi64((__m128i *)(pi2_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  537|       |
  538|  85.5k|                    pu1_src += 4; /* pointer update */
  539|  85.5k|                    pi2_dst += 4; /* pointer update */
  540|  85.5k|                } /* inner for loop ends here(4-output values in single iteration) */
  541|       |
  542|  43.5k|                pu1_src += 4 * src_strd - wdx2; /* pointer update */
  543|  43.5k|                pi2_dst += 4 * dst_strd - wdx2; /* pointer update */
  544|  43.5k|            }
  545|  21.2k|        }
  546|  18.5M|    }
  547|  3.80k|    else  /* ht multiple of 2 case */
  548|  3.80k|    {
  549|  3.80k|        if(0 == (wdx2 & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (549:12): [True: 4.19k, False: 18.4E]
  ------------------
  550|  4.19k|        {
  551|  11.6k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (551:26): [True: 7.49k, False: 4.19k]
  ------------------
  552|  7.49k|            {
  553|  21.8k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (553:30): [True: 14.3k, False: 7.49k]
  ------------------
  554|  14.3k|                {
  555|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  556|  14.3k|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  557|  14.3k|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  558|       |
  559|  14.3k|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  560|  14.3k|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  561|       |
  562|  14.3k|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|  14.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  14.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  563|  14.3k|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  14.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  14.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  564|       |
  565|       |                    /* storing 16 8-bit output values */
  566|  14.3k|                    _mm_storeu_si128((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  567|  14.3k|                    _mm_storeu_si128((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  568|       |
  569|  14.3k|                    pu1_src += 8; /* pointer update */
  570|  14.3k|                    pi2_dst += 8; /* pointer update */
  571|  14.3k|                } /* inner for loop ends here(8-output values in single iteration) */
  572|       |
  573|  7.49k|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  574|  7.49k|                pi2_dst += 2 * dst_strd - wdx2; /* pointer update */
  575|  7.49k|            }
  576|  4.19k|        }
  577|  18.4E|        else /* wdx2 = multiple of 4 case */
  578|  18.4E|        {
  579|  18.4E|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (579:26): [True: 0, False: 18.4E]
  ------------------
  580|      0|            {
  581|      0|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (581:30): [True: 0, False: 0]
  ------------------
  582|      0|                {
  583|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  584|      0|                    src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  585|      0|                    src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  586|       |
  587|      0|                    src0_16x8b = _mm_cvtepu8_epi16(src0_16x8b);
  588|      0|                    src1_16x8b = _mm_cvtepu8_epi16(src1_16x8b);
  589|       |
  590|      0|                    src0_16x8b = _mm_slli_epi16(src0_16x8b,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|      0|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|      0|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  591|      0|                    src1_16x8b = _mm_slli_epi16(src1_16x8b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|      0|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|      0|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  592|       |
  593|       |                    /* storing 16 8-bit output values */
  594|      0|                    _mm_storel_epi64((__m128i *)(pi2_dst), src0_16x8b);                 /* row =0 */
  595|      0|                    _mm_storel_epi64((__m128i *)(pi2_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  596|       |
  597|      0|                    pu1_src += 4; /* pointer update */
  598|      0|                    pi2_dst += 4; /* pointer update */
  599|      0|                } /* inner for loop ends here(4-output values in single iteration) */
  600|       |
  601|      0|                pu1_src += 2 * src_strd - wdx2; /* pointer update */
  602|      0|                pi2_dst += 2 * dst_strd - wdx2; /* pointer update */
  603|      0|            }
  604|  18.4E|        }
  605|  3.80k|    }
  606|  18.5M|}

ihevc_inter_pred_luma_copy_ssse3:
  124|  1.92M|{
  125|       |
  126|  1.92M|    WORD32 row, col;
  127|  1.92M|    __m128i  src0_16x8b, src1_16x8b, src2_16x8b, src3_16x8b;
  128|  1.92M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  1.92M|#define UNUSED(x) ((void)(x))
  ------------------
  129|  1.92M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.92M|#define ASSERT(x) {}
  ------------------
  130|  1.92M|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.92M|#define ASSERT(x) {}
  ------------------
  131|       |
  132|       |/*  outer for loop starts from here */
  133|  1.92M|    if(0 == (wd & 15)) /* wd multiple of 16 case */
  ------------------
  |  Branch (133:8): [True: 43.3k, False: 1.87M]
  ------------------
  134|  43.3k|    {
  135|   303k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (135:22): [True: 260k, False: 43.3k]
  ------------------
  136|   260k|        {
  137|   818k|            for(col = 0; col < wd; col += 16)
  ------------------
  |  Branch (137:26): [True: 558k, False: 260k]
  ------------------
  138|   558k|            {
  139|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  140|   558k|                src0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                /* row =0 */
  141|   558k|                src1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  142|   558k|                src2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  143|   558k|                src3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  144|       |
  145|       |                /* storing 16 8-bit output values */
  146|   558k|                _mm_storeu_si128((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  147|   558k|                _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  148|   558k|                _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  149|   558k|                _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  150|       |
  151|   558k|                pu1_src += 16; /* pointer update */
  152|   558k|                pu1_dst += 16; /* pointer update */
  153|   558k|            } /* inner for loop ends here(16-output values in single iteration) */
  154|       |
  155|   260k|            pu1_src += 4 * src_strd - wd; /* pointer update */
  156|   260k|            pu1_dst += 4 * dst_strd - wd; /* pointer update */
  157|   260k|        }
  158|       |
  159|  43.3k|    }
  160|  1.87M|    else if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (160:13): [True: 1.79M, False: 87.7k]
  ------------------
  161|  1.79M|    {
  162|  5.29M|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (162:22): [True: 3.50M, False: 1.79M]
  ------------------
  163|  3.50M|        {
  164|  7.02M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (164:26): [True: 3.52M, False: 3.50M]
  ------------------
  165|  3.52M|            {
  166|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  167|  3.52M|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  168|  3.52M|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  169|  3.52M|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  170|  3.52M|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  171|       |
  172|       |                /* storing 16 8-bit output values */
  173|  3.52M|                _mm_storel_epi64((__m128i *)(pu1_dst), src0_16x8b);                 /* row =0 */
  174|  3.52M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src1_16x8b);  /* row =1 */
  175|  3.52M|                _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src2_16x8b);  /* row =2 */
  176|  3.52M|                _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src3_16x8b);  /* row =3 */
  177|       |
  178|  3.52M|                pu1_src += 8; /* pointer update */
  179|  3.52M|                pu1_dst += 8; /* pointer update */
  180|  3.52M|            } /*  inner for loop ends here(8-output values in single iteration) */
  181|       |
  182|  3.50M|            pu1_src += 4 * src_strd - wd; /* pointer update */
  183|  3.50M|            pu1_dst += 4 * dst_strd - wd; /* pointer update */
  184|  3.50M|        }
  185|  1.79M|    }
  186|  87.7k|    else /* wd = multiple of 4 case */
  187|  87.7k|    {
  188|  87.7k|        WORD32 dst0, dst1, dst2, dst3;
  189|   276k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (189:22): [True: 189k, False: 87.7k]
  ------------------
  190|   189k|        {
  191|   395k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (191:26): [True: 206k, False: 189k]
  ------------------
  192|   206k|            {
  193|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
  194|   206k|                src0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));                /* row =0 */
  195|   206k|                src1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 1 * src_strd)); /* row =1 */
  196|   206k|                src2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 2 * src_strd)); /* row =2 */
  197|   206k|                src3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + 3 * src_strd)); /* row =3 */
  198|       |
  199|   206k|                dst0 = _mm_cvtsi128_si32(src0_16x8b);
  200|   206k|                dst1 = _mm_cvtsi128_si32(src1_16x8b);
  201|   206k|                dst2 = _mm_cvtsi128_si32(src2_16x8b);
  202|   206k|                dst3 = _mm_cvtsi128_si32(src3_16x8b);
  203|       |
  204|       |                /* storing 4 8-bit output values */
  205|   206k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0; /* row =0 */
  206|   206k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1; /* row =1 */
  207|   206k|                *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2; /* row =2 */
  208|   206k|                *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3; /* row =3 */
  209|       |
  210|   206k|                pu1_src += 4; /* pointer update */
  211|   206k|                pu1_dst += 4; /* pointer update */
  212|   206k|            } /*  inner for loop ends here(4- output values in single iteration) */
  213|       |
  214|   189k|            pu1_src += 4 * src_strd - wd; /* pointer update */
  215|   189k|            pu1_dst += 4 * dst_strd - wd; /* pointer update */
  216|   189k|        }
  217|  87.7k|    }
  218|  1.92M|}
ihevc_inter_pred_luma_horz_ssse3:
  268|  1.39M|{
  269|  1.39M|    WORD32 row, col;
  270|       |
  271|       |    /* all 128 bit registers are named with a suffix mxnb, where m is the */
  272|       |    /* number of n bits packed in the register                            */
  273|  1.39M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
  274|  1.39M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
  275|  1.39M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
  276|  1.39M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b, res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b, res_temp7_8x16b, res_temp8_8x16b;
  277|  1.39M|    __m128i res_temp11_8x16b, res_temp12_8x16b, res_temp13_8x16b, res_temp14_8x16b, res_temp15_8x16b, res_temp16_8x16b, res_temp17_8x16b, res_temp18_8x16b;
  278|  1.39M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
  279|  1.39M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
  280|       |
  281|  1.39M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.39M|#define ASSERT(x) {}
  ------------------
  282|       |
  283|  1.39M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.39M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  284|  1.39M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.39M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  285|  1.39M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.39M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  286|  1.39M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.39M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  287|  1.39M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.39M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  288|  1.39M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.39M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  289|       |
  290|       |    /* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
  291|  1.39M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
  292|  1.39M|    zero_8x16b = _mm_set1_epi32(0);
  293|  1.39M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.39M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.39M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.39M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|       |
  295|  1.39M|    mask_low_32b = _mm_cmpeq_epi16(zero_8x16b, zero_8x16b);
  296|  1.39M|    mask_high_96b = _mm_srli_si128(mask_low_32b, 12);
  297|  1.39M|    mask_low_32b = _mm_slli_si128(mask_low_32b, 4);
  298|       |
  299|  1.39M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
  300|  1.39M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
  301|  1.39M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
  302|  1.39M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
  303|       |
  304|  1.39M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
  305|  1.39M|    coeff2_3_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_2_8x16b);  /* pi1_coeff[4] */
  306|       |
  307|  1.39M|    coeff4_5_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_3_8x16b);  /* pi1_coeff[4] */
  308|  1.39M|    coeff6_7_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_4_8x16b);  /* pi1_coeff[4] */
  309|       |
  310|  1.39M|    if(0 == (ht & 1)) /* ht multiple of 2 case */
  ------------------
  |  Branch (310:8): [True: 1.39M, False: 18.4E]
  ------------------
  311|  1.39M|    {
  312|       |
  313|  1.39M|        if(0 == (wd & 7)) /* wd = multiple of 8 case */
  ------------------
  |  Branch (313:12): [True: 1.35M, False: 41.5k]
  ------------------
  314|  1.35M|        {
  315|  6.84M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (315:26): [True: 5.49M, False: 1.35M]
  ------------------
  316|  5.49M|            {
  317|       |
  318|  5.49M|                int offset = 0;
  319|       |
  320|  5.49M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.49M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  321|  5.49M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.49M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  322|       |
  323|       |
  324|  11.5M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (324:30): [True: 6.05M, False: 5.49M]
  ------------------
  325|  6.05M|                {
  326|       |                    /*load 16 pixel values from row 0*/
  327|  6.05M|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));         /* row = 0 */
  328|       |
  329|       |                    /*load 16 pixel values from row 1*/
  330|  6.05M|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
  331|       |
  332|  6.05M|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
  333|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
  334|  6.05M|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  335|  6.05M|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  336|       |                                                                                           /* row = 0 */
  337|  6.05M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  338|  6.05M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  339|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  340|  6.05M|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  341|  6.05M|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  342|       |
  343|  6.05M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  344|  6.05M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  345|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  346|  6.05M|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  347|  6.05M|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  348|       |
  349|  6.05M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  350|  6.05M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  351|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  352|  6.05M|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  353|  6.05M|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  354|       |
  355|  6.05M|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  356|  6.05M|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  357|  6.05M|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  358|       |
  359|  6.05M|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  360|  6.05M|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|  6.05M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.05M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  361|  6.05M|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  362|       |
  363|  6.05M|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  364|       |
  365|  6.05M|                    src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 1);                   /* row =1 */
  366|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/                 /* row =1 */
  367|  6.05M|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  368|  6.05M|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
  369|       |                                                                                              /* row = 1 */
  370|  6.05M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  371|  6.05M|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  372|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row =1 */
  373|  6.05M|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  374|  6.05M|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
  375|       |
  376|  6.05M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  377|  6.05M|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  378|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row =1 */
  379|  6.05M|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  380|  6.05M|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
  381|       |
  382|  6.05M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  383|  6.05M|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  384|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row =1 */
  385|  6.05M|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  386|  6.05M|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
  387|       |
  388|  6.05M|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
  389|  6.05M|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
  390|  6.05M|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
  391|       |
  392|  6.05M|                    res_temp16_8x16b = _mm_adds_epi16(res_temp15_8x16b, offset_8x16b);             /* row = 1 */
  393|  6.05M|                    res_temp16_8x16b = _mm_srai_epi16(res_temp16_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 1 */
  ------------------
  |  |   41|  6.05M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.05M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  394|  6.05M|                    res_temp15_8x16b = _mm_packus_epi16(res_temp16_8x16b, res_temp16_8x16b);       /* row = 1 */
  395|       |
  396|       |                    /* to store the 1st 4 pixels res. */
  397|  6.05M|                    _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp15_8x16b);
  398|       |
  399|  6.05M|                    offset += 8; /* To pointer updates*/
  400|  6.05M|                }
  401|  5.49M|                pu1_src += 2 * src_strd;  /* pointer updates*/
  402|  5.49M|                pu1_dst += 2 * dst_strd;  /* pointer updates*/
  403|  5.49M|            }
  404|  1.35M|        }
  405|  41.5k|        else /* wd = multiple of 4 case */
  406|  41.5k|        {
  407|   227k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (407:26): [True: 185k, False: 41.5k]
  ------------------
  408|   185k|            {
  409|   185k|                int offset = 0;
  410|       |
  411|   185k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   185k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  412|   185k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   185k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  413|       |
  414|       |
  415|   409k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (415:30): [True: 223k, False: 185k]
  ------------------
  416|   223k|                {
  417|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
  418|   223k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
  419|   223k|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
  420|       |
  421|   223k|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
  422|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
  423|   223k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  424|   223k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  425|       |                                                                                           /* row = 0 */
  426|   223k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  427|   223k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  428|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  429|   223k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  430|   223k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  431|       |
  432|   223k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  433|   223k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  434|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  435|   223k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  436|   223k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  437|       |
  438|   223k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  439|   223k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  440|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  441|   223k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  442|   223k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  443|       |
  444|   223k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  445|   223k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  446|   223k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  447|       |
  448|   223k|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  449|   223k|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|   223k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   223k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  450|   223k|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  451|       |
  452|   223k|                    res_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + offset));
  453|   223k|                    res_temp8_8x16b =  _mm_and_si128(res_temp7_8x16b, mask_low_32b);
  454|   223k|                    res_temp7_8x16b =  _mm_and_si128(res_temp5_8x16b, mask_high_96b);
  455|   223k|                    res_temp5_8x16b = _mm_or_si128(res_temp7_8x16b, res_temp8_8x16b);
  456|       |
  457|   223k|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  458|       |
  459|   223k|                    src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 1);                   /* row = 1 */
  460|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/                 /* row = 1 */
  461|   223k|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  462|   223k|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
  463|       |                                                                                              /* row = 1 */
  464|   223k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  465|   223k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  466|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
  467|   223k|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  468|   223k|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
  469|       |
  470|   223k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  471|   223k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  472|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
  473|   223k|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  474|   223k|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
  475|       |
  476|   223k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  477|   223k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  478|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
  479|   223k|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  480|   223k|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
  481|       |
  482|   223k|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
  483|   223k|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
  484|   223k|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
  485|       |
  486|   223k|                    res_temp16_8x16b = _mm_adds_epi16(res_temp15_8x16b, offset_8x16b);             /* row = 1 */
  487|   223k|                    res_temp16_8x16b = _mm_srai_epi16(res_temp16_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 1 */
  ------------------
  |  |   41|   223k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   223k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  488|   223k|                    res_temp15_8x16b = _mm_packus_epi16(res_temp16_8x16b, res_temp16_8x16b);       /* row = 1 */
  489|       |
  490|   223k|                    res_temp17_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd + offset));
  491|   223k|                    res_temp18_8x16b =  _mm_and_si128(res_temp17_8x16b, mask_low_32b);
  492|   223k|                    res_temp17_8x16b =  _mm_and_si128(res_temp15_8x16b, mask_high_96b);
  493|   223k|                    res_temp15_8x16b = _mm_or_si128(res_temp17_8x16b, res_temp18_8x16b);
  494|       |
  495|       |                    /* to store the 1st 4 pixels res. */
  496|   223k|                    _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp15_8x16b);
  497|       |
  498|   223k|                    offset += 4; /* To pointer updates*/
  499|   223k|                }
  500|   185k|                pu1_src += 2 * src_strd;  /* Pointer update */
  501|   185k|                pu1_dst += 2 * dst_strd;  /* Pointer update */
  502|   185k|            }
  503|  41.5k|        }
  504|  1.39M|    }
  505|  18.4E|    else /* odd ht */
  506|  18.4E|    {
  507|  18.4E|        if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (507:12): [True: 0, False: 18.4E]
  ------------------
  508|      0|        {
  509|      0|            for(row = 0; row < ht; row++)
  ------------------
  |  Branch (509:26): [True: 0, False: 0]
  ------------------
  510|      0|            {
  511|      0|                int offset = 0;
  512|       |
  513|       |
  514|      0|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|      0|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  515|      0|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|      0|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  516|       |
  517|       |
  518|      0|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (518:30): [True: 0, False: 0]
  ------------------
  519|      0|                {
  520|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
  521|      0|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));  /* row = 0 */
  522|       |
  523|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
  524|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
  525|      0|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  526|      0|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  527|       |                                                                                           /* row = 0 */
  528|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  529|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  530|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  531|      0|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  532|      0|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  533|       |
  534|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  535|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  536|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  537|      0|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  538|      0|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  539|       |
  540|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  541|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  542|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  543|      0|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  544|      0|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  545|       |
  546|      0|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  547|      0|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  548|      0|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  549|       |
  550|      0|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  551|      0|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|      0|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|      0|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  552|      0|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  553|       |
  554|       |                    /* to store the 1st 4 pixels res. */
  555|      0|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  556|       |
  557|      0|                    offset += 8; /* To pointer updates*/
  558|      0|                }
  559|      0|                pu1_src += src_strd;    /* pointer updates*/
  560|      0|                pu1_dst += dst_strd;    /* pointer updates*/
  561|      0|            }
  562|      0|        }
  563|  18.4E|        else  /* wd = multiple of 4 case */
  564|  18.4E|        {
  565|  18.4E|            for(row = 0; row < (ht - 1); row += 2)
  ------------------
  |  Branch (565:26): [True: 0, False: 18.4E]
  ------------------
  566|      0|            {
  567|      0|                int offset = 0;
  568|       |
  569|      0|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|      0|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  570|      0|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|      0|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  571|       |
  572|       |
  573|      0|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (573:30): [True: 0, False: 0]
  ------------------
  574|      0|                {
  575|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
  576|      0|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
  577|      0|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
  578|       |
  579|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
  580|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
  581|      0|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  582|      0|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  583|       |                                                                                           /* row = 0 */
  584|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  585|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  586|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  587|      0|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  588|      0|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  589|       |
  590|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  591|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  592|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  593|      0|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  594|      0|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  595|       |
  596|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  597|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  598|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  599|      0|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  600|      0|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  601|       |
  602|      0|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  603|      0|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  604|      0|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  605|       |
  606|      0|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  607|      0|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|      0|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|      0|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  608|      0|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  609|       |
  610|      0|                    res_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + offset));
  611|      0|                    res_temp8_8x16b =  _mm_and_si128(res_temp7_8x16b, mask_low_32b);
  612|      0|                    res_temp7_8x16b =  _mm_and_si128(res_temp5_8x16b, mask_high_96b);
  613|      0|                    res_temp5_8x16b = _mm_or_si128(res_temp7_8x16b, res_temp8_8x16b);
  614|       |
  615|      0|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  616|       |
  617|      0|                    src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 1);                   /* row = 1 */
  618|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/                 /* row = 1 */
  619|      0|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  620|      0|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
  621|       |                                                                                              /* row = 1 */
  622|      0|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  623|      0|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  624|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
  625|      0|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  626|      0|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
  627|       |
  628|      0|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  629|      0|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  630|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
  631|      0|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  632|      0|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
  633|       |
  634|      0|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
  635|      0|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
  636|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
  637|      0|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
  638|      0|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
  639|       |
  640|      0|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
  641|      0|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
  642|      0|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
  643|       |
  644|      0|                    res_temp16_8x16b = _mm_adds_epi16(res_temp15_8x16b, offset_8x16b);             /* row = 1 */
  645|      0|                    res_temp16_8x16b = _mm_srai_epi16(res_temp16_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 1 */
  ------------------
  |  |   41|      0|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|      0|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  646|      0|                    res_temp15_8x16b = _mm_packus_epi16(res_temp16_8x16b, res_temp16_8x16b);       /* row = 1 */
  647|       |
  648|      0|                    res_temp17_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd + offset));
  649|      0|                    res_temp18_8x16b =  _mm_and_si128(res_temp17_8x16b, mask_low_32b);
  650|      0|                    res_temp17_8x16b =  _mm_and_si128(res_temp15_8x16b, mask_high_96b);
  651|      0|                    res_temp15_8x16b = _mm_or_si128(res_temp17_8x16b, res_temp18_8x16b);
  652|       |
  653|       |                    /* to store the 1st 4 pixels res. */
  654|      0|                    _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp15_8x16b);
  655|       |
  656|      0|                    offset += 4; /* To pointer updates*/
  657|      0|                }
  658|      0|                pu1_src += 2 * src_strd;  /* Pointer update */
  659|      0|                pu1_dst += 2 * dst_strd;  /* Pointer update */
  660|      0|            }
  661|  18.4E|            { /* last repeat at outside the loop */
  662|  18.4E|                int offset = 0;
  663|  18.4E|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (663:30): [True: 0, False: 18.4E]
  ------------------
  664|      0|                {
  665|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
  666|      0|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));  /* row = 0 */
  667|       |
  668|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
  669|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
  670|      0|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  671|      0|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
  672|       |                                                                                           /* row = 0 */
  673|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  674|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  675|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  676|      0|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  677|      0|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
  678|       |
  679|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  680|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  681|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  682|      0|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  683|      0|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
  684|       |
  685|      0|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
  686|      0|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
  687|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
  688|      0|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
  689|      0|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
  690|       |
  691|      0|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  692|      0|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
  693|      0|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
  694|       |
  695|      0|                    res_temp6_8x16b = _mm_adds_epi16(res_temp5_8x16b, offset_8x16b);             /* row = 0 */
  696|      0|                    res_temp6_8x16b = _mm_srai_epi16(res_temp6_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|      0|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|      0|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  697|      0|                    res_temp5_8x16b = _mm_packus_epi16(res_temp6_8x16b, res_temp6_8x16b);        /* row = 0 */
  698|       |
  699|      0|                    res_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + offset));
  700|      0|                    res_temp8_8x16b =  _mm_and_si128(res_temp7_8x16b, mask_low_32b);
  701|      0|                    res_temp7_8x16b =  _mm_and_si128(res_temp5_8x16b, mask_high_96b);
  702|      0|                    res_temp5_8x16b = _mm_or_si128(res_temp7_8x16b, res_temp8_8x16b);
  703|       |
  704|       |                    /* to store the 1st 4 pixels res. */
  705|      0|                    _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp5_8x16b);
  706|       |
  707|      0|                    offset += 4; /* To pointer updates*/
  708|      0|                }
  709|  18.4E|            }
  710|  18.4E|        }
  711|  18.4E|    }
  712|  1.39M|}
ihevc_inter_pred_luma_vert_ssse3:
  761|  1.34M|{
  762|  1.34M|    WORD32 row, col;
  763|  1.34M|    UWORD8 *pu1_src_copy;
  764|  1.34M|    UWORD8 *pu1_dst_copy;
  765|  1.34M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
  766|  1.34M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
  767|  1.34M|    __m128i s2_0_16x8b, s2_1_16x8b, s2_2_16x8b, s2_3_16x8b, s2_4_16x8b, s2_5_16x8b, s2_6_16x8b, s2_7_16x8b, s2_8_16x8b, s2_9_16x8b, s2_10_16x8b;
  768|  1.34M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
  769|  1.34M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
  770|  1.34M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b, s17_8x16b, s18_8x16b, s19_8x16b;
  771|  1.34M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b, s27_8x16b, s28_8x16b, s29_8x16b;
  772|  1.34M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b, s37_8x16b, s38_8x16b, s39_8x16b;
  773|       |
  774|  1.34M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
  775|  1.34M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
  776|       |
  777|  1.34M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  778|  1.34M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  779|  1.34M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  780|  1.34M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  781|  1.34M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  782|  1.34M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  783|  1.34M|    PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  784|  1.34M|    PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  785|       |
  786|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
  787|  1.34M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
  788|       |
  789|  1.34M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
  790|  1.34M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
  791|  1.34M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
  792|  1.34M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
  793|       |
  794|  1.34M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
  795|  1.34M|    coeff2_3_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_2_8x16b);  /* pi1_coeff[4] */
  796|       |
  797|  1.34M|    coeff4_5_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_3_8x16b);  /* pi1_coeff[4] */
  798|  1.34M|    coeff6_7_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_4_8x16b);  /* pi1_coeff[4] */
  799|       |
  800|       |/*  seting  values in register */
  801|  1.34M|    zero_8x16b = _mm_setzero_si128(); /* for saturated clipping */
  802|  1.34M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.34M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.34M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.34M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  1.34M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
  804|  1.34M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
  805|       |
  806|       |/*  outer for loop starts from here */
  807|  1.34M|    if(wd % 8 == 0)
  ------------------
  |  Branch (807:8): [True: 1.30M, False: 39.1k]
  ------------------
  808|  1.30M|    { /* wd = multiple of 8 case */
  809|       |
  810|  1.30M|        pu1_src_copy = pu1_src;
  811|  1.30M|        pu1_dst_copy = pu1_dst;
  812|       |
  813|  2.64M|        for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (813:22): [True: 1.34M, False: 1.30M]
  ------------------
  814|  1.34M|        {
  815|       |
  816|  1.34M|            pu1_src = pu1_src_copy + col;
  817|  1.34M|            pu1_dst = pu1_dst_copy + col;
  818|       |
  819|  1.34M|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  820|  1.34M|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  821|  1.34M|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  822|  1.34M|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.34M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  823|       |
  824|       |            /*load 8 pixel values.*/
  825|  1.34M|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
  826|       |
  827|       |            /*load 8 pixel values*/
  828|  1.34M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
  829|       |
  830|  1.34M|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
  831|       |
  832|  1.34M|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
  833|       |
  834|       |            /*load 8 pixel values*/
  835|  1.34M|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
  836|       |
  837|       |            /*load 8 pixel values*/
  838|  1.34M|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
  839|       |
  840|  1.34M|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
  841|       |
  842|  1.34M|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
  843|       |
  844|       |            /*load 8 pixel values*/
  845|  1.34M|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
  846|       |
  847|       |            /*load 8 pixel values*/
  848|  1.34M|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
  849|       |
  850|  1.34M|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
  851|       |
  852|  1.34M|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
  853|       |
  854|       |            /*load 8 pixel values*/
  855|  1.34M|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
  856|       |
  857|       |            /*load 8 pixel values*/
  858|  1.34M|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
  859|       |
  860|  1.34M|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
  861|       |
  862|  1.34M|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
  863|       |
  864|  1.34M|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
  865|  1.34M|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
  866|  1.34M|            s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
  867|       |
  868|  1.34M|            s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
  869|       |
  870|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
  871|  1.34M|            s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.34M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.34M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  872|       |
  873|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  874|  1.34M|            s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
  875|       |
  876|       |            /* store 8 8-bit output values  */
  877|       |            /* Store the output pixels of row 0*/
  878|  1.34M|            _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
  879|       |
  880|       |            /* ROW 2*/
  881|  1.34M|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
  882|  1.34M|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
  883|  1.34M|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
  884|       |
  885|       |            /*load 8 pixel values*/
  886|  1.34M|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
  887|       |
  888|       |            /*load 8 pixel values*/
  889|  1.34M|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
  890|       |
  891|  1.34M|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
  892|       |
  893|  1.34M|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
  894|       |
  895|  1.34M|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
  896|  1.34M|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
  897|  1.34M|            s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
  898|       |
  899|  1.34M|            s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
  900|       |
  901|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
  902|  1.34M|            s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.34M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.34M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  903|       |
  904|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  905|  1.34M|            s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
  906|       |
  907|       |            /* store 8 8-bit output values  */
  908|       |            /* Store the output pixels of row 2*/
  909|  1.34M|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
  910|       |
  911|       |
  912|       |            /*ROW 1*/
  913|  1.34M|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
  914|       |
  915|  1.34M|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
  916|       |
  917|  1.34M|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
  918|       |
  919|  1.34M|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
  920|       |
  921|  1.34M|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
  922|       |
  923|  1.34M|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
  924|       |
  925|  1.34M|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
  926|       |
  927|  1.34M|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
  928|       |
  929|  1.34M|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
  930|  1.34M|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
  931|  1.34M|            s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
  932|       |
  933|  1.34M|            s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
  934|       |
  935|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
  936|  1.34M|            s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.34M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.34M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  937|       |
  938|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  939|  1.34M|            s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
  940|       |
  941|       |            /* store 8 8-bit output values  */
  942|       |            /* Store the output pixels of row 1*/
  943|  1.34M|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd)), s19_8x16b);
  944|       |
  945|       |
  946|       |            /* ROW 3*/
  947|  1.34M|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
  948|  1.34M|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
  949|  1.34M|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
  950|       |
  951|       |            /*load 8 pixel values*/
  952|  1.34M|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
  953|       |
  954|  1.34M|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
  955|       |
  956|  1.34M|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
  957|       |
  958|  1.34M|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
  959|  1.34M|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
  960|  1.34M|            s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
  961|       |
  962|  1.34M|            s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
  963|       |
  964|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
  965|  1.34M|            s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.34M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.34M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  966|       |
  967|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
  968|  1.34M|            s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
  969|       |
  970|       |            /* store 8 8-bit output values  */
  971|       |            /* Store the output pixels of row 2*/
  972|  1.34M|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
  973|       |
  974|  1.34M|            pu1_src += (8 * src_strd);
  975|  1.34M|            pu1_dst += (4 * dst_strd);
  976|       |
  977|  3.10M|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (977:26): [True: 1.75M, False: 1.34M]
  ------------------
  978|  1.75M|            {
  979|  1.75M|                PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.75M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  980|  1.75M|                PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.75M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  981|  1.75M|                PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.75M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  982|  1.75M|                PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.75M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  983|       |
  984|       |
  985|  1.75M|                s3_0_16x8b = s3_2_16x8b;
  986|  1.75M|                s3_1_16x8b = s3_3_16x8b;
  987|  1.75M|                s3_2_16x8b = s3_4_16x8b;
  988|       |
  989|  1.75M|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
  990|  1.75M|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
  991|  1.75M|                s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
  992|       |
  993|       |                /*load 8 pixel values from (cur_row + 4)th row*/
  994|  1.75M|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
  995|       |
  996|  1.75M|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
  997|  1.75M|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
  998|       |
  999|  1.75M|                s4_0_16x8b = s4_2_16x8b;
 1000|  1.75M|                s4_1_16x8b = s4_3_16x8b;
 1001|  1.75M|                s4_2_16x8b = s4_4_16x8b;
 1002|       |
 1003|  1.75M|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 1004|  1.75M|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 1005|  1.75M|                s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 1006|       |
 1007|  1.75M|                s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
 1008|       |
 1009|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1010|  1.75M|                s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.75M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1011|       |
 1012|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1013|  1.75M|                s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 1014|       |
 1015|       |                /* store 8 8-bit output values  */
 1016|       |                /* Store the output pixels of row 4*/
 1017|  1.75M|                _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 1018|       |
 1019|       |                /* row + 2*/
 1020|  1.75M|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 1021|  1.75M|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 1022|  1.75M|                s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 1023|       |
 1024|       |                /*load 8 pixel values from (cur_row + 5)th row*/
 1025|  1.75M|                s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1026|       |
 1027|       |                /*load 8 pixel values from (cur_row + 6)th row*/
 1028|  1.75M|                s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 1029|       |
 1030|       |                /*unpacking (cur_row + 5)th row and (cur_row + 6)th row*/
 1031|  1.75M|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 1032|       |
 1033|  1.75M|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 1034|       |
 1035|  1.75M|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 1036|  1.75M|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 1037|  1.75M|                s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 1038|       |
 1039|  1.75M|                s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
 1040|       |
 1041|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1042|  1.75M|                s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.75M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1043|       |
 1044|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1045|  1.75M|                s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 1046|       |
 1047|       |                /* store 8 8-bit output values  */
 1048|       |                /* Store the output pixels of (cur_row+2)*/
 1049|  1.75M|                _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
 1050|       |
 1051|       |
 1052|       |                /*row + 1*/
 1053|  1.75M|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 1054|  1.75M|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 1055|  1.75M|                s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 1056|       |
 1057|       |                /*unpacking (cur_row + 4)th row and (cur_row + 5)th row*/
 1058|  1.75M|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 1059|  1.75M|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 1060|       |
 1061|  1.75M|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 1062|  1.75M|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 1063|  1.75M|                s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 1064|       |
 1065|  1.75M|                s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
 1066|       |
 1067|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1068|  1.75M|                s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.75M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1069|       |
 1070|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1071|  1.75M|                s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 1072|       |
 1073|       |                /* store 8 8-bit output values  */
 1074|       |                /* Store the output pixels of (cur_row + 1)*/
 1075|  1.75M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s19_8x16b);
 1076|       |
 1077|       |
 1078|       |                /* row + 3*/
 1079|  1.75M|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 1080|  1.75M|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 1081|  1.75M|                s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 1082|       |
 1083|       |                /*load 8 pixel values from (cur_row + 7)th row*/
 1084|  1.75M|                s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 1085|       |
 1086|       |                /*unpacking (cur_row + 6)th row and (cur_row + 7)th row*/
 1087|  1.75M|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 1088|       |
 1089|  1.75M|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 1090|       |
 1091|  1.75M|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 1092|  1.75M|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 1093|  1.75M|                s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 1094|       |
 1095|  1.75M|                s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
 1096|       |
 1097|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1098|  1.75M|                s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  1.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  1.75M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1099|       |
 1100|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1101|  1.75M|                s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 1102|       |
 1103|       |                /* store 8 8-bit output values  */
 1104|       |                /* Store the output pixels of (cur_row+3)*/
 1105|  1.75M|                _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
 1106|       |
 1107|  1.75M|                s2_10_16x8b = s2_3_16x8b;
 1108|       |
 1109|  1.75M|                pu1_src += 4 * src_strd; /* pointer update */
 1110|  1.75M|                pu1_dst += 4 * dst_strd; /* pointer update */
 1111|  1.75M|            }
 1112|  1.34M|        }
 1113|  1.30M|    }
 1114|  39.1k|    else /* wd = multiple of 8 case */
 1115|  39.1k|    {
 1116|       |
 1117|  39.1k|        pu1_src_copy = pu1_src;
 1118|  39.1k|        pu1_dst_copy = pu1_dst;
 1119|       |
 1120|  83.8k|        for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1120:22): [True: 44.7k, False: 39.1k]
  ------------------
 1121|  44.7k|        {
 1122|       |
 1123|  44.7k|            pu1_src = pu1_src_copy + col;
 1124|  44.7k|            pu1_dst = pu1_dst_copy + col;
 1125|       |
 1126|  44.7k|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  44.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1127|  44.7k|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  44.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1128|  44.7k|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  44.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1129|  44.7k|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  44.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1130|       |
 1131|       |
 1132|       |            /*load 8 pixel values */
 1133|  44.7k|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
 1134|       |
 1135|       |            /*load 8 pixel values */
 1136|  44.7k|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
 1137|       |
 1138|  44.7k|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 1139|       |
 1140|  44.7k|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 1141|       |
 1142|       |            /*load 8 pixel values */
 1143|  44.7k|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 1144|       |
 1145|       |            /*load 8 pixel values */
 1146|  44.7k|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 1147|       |
 1148|  44.7k|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 1149|       |
 1150|  44.7k|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 1151|       |
 1152|       |            /*load 8 pixel values */
 1153|  44.7k|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 1154|       |
 1155|       |            /*load 8 pixel values */
 1156|  44.7k|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 1157|       |
 1158|  44.7k|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
 1159|       |
 1160|  44.7k|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 1161|       |
 1162|       |            /*load 8 pixel values */
 1163|  44.7k|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 1164|       |
 1165|       |            /*load 8 pixel values */
 1166|  44.7k|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
 1167|       |
 1168|  44.7k|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
 1169|       |
 1170|  44.7k|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 1171|       |
 1172|  44.7k|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 1173|  44.7k|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 1174|  44.7k|            s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 1175|       |
 1176|  44.7k|            s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
 1177|       |
 1178|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1179|  44.7k|            s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1180|       |
 1181|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1182|  44.7k|            s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 1183|  44.7k|            s5_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 1184|  44.7k|            s6_8x16b =  _mm_and_si128(s5_8x16b, mask_low_32b);
 1185|  44.7k|            s7_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 1186|  44.7k|            s8_8x16b = _mm_or_si128(s6_8x16b, s7_8x16b);
 1187|       |            /* store 8 8-bit output values  */
 1188|       |            /* Store the output pixels of row 0*/
 1189|  44.7k|            _mm_storel_epi64((__m128i *)(pu1_dst), s8_8x16b);
 1190|       |
 1191|       |            /* ROW 2*/
 1192|  44.7k|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 1193|  44.7k|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 1194|  44.7k|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 1195|       |
 1196|       |            /*load 8 pixel values */
 1197|  44.7k|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
 1198|       |
 1199|       |            /*load 8 pixel values */
 1200|  44.7k|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
 1201|       |
 1202|  44.7k|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
 1203|       |
 1204|  44.7k|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 1205|       |
 1206|  44.7k|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 1207|  44.7k|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 1208|  44.7k|            s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 1209|       |
 1210|  44.7k|            s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
 1211|       |
 1212|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1213|  44.7k|            s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1214|       |
 1215|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1216|  44.7k|            s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 1217|  44.7k|            s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 1218|  44.7k|            s26_8x16b =  _mm_and_si128(s25_8x16b, mask_low_32b);
 1219|  44.7k|            s27_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 1220|  44.7k|            s28_8x16b = _mm_or_si128(s26_8x16b, s27_8x16b);
 1221|       |            /* store 8 8-bit output values  */
 1222|       |            /* Store the output pixels of row 2*/
 1223|  44.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s28_8x16b);
 1224|       |
 1225|       |
 1226|       |            /*ROW 1*/
 1227|  44.7k|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 1228|       |
 1229|  44.7k|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 1230|       |
 1231|  44.7k|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
 1232|       |
 1233|  44.7k|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 1234|       |
 1235|  44.7k|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
 1236|       |
 1237|  44.7k|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 1238|       |
 1239|  44.7k|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
 1240|       |
 1241|  44.7k|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 1242|       |
 1243|  44.7k|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 1244|  44.7k|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 1245|  44.7k|            s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 1246|       |
 1247|  44.7k|            s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
 1248|       |
 1249|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1250|  44.7k|            s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1251|       |
 1252|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1253|  44.7k|            s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 1254|  44.7k|            s15_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 1255|  44.7k|            s16_8x16b =  _mm_and_si128(s15_8x16b, mask_low_32b);
 1256|  44.7k|            s17_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 1257|  44.7k|            s18_8x16b = _mm_or_si128(s16_8x16b, s17_8x16b);
 1258|       |            /* store 8 8-bit output values  */
 1259|       |            /* Store the output pixels of row 1*/
 1260|  44.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd)), s18_8x16b);
 1261|       |
 1262|       |
 1263|       |            /* ROW 3*/
 1264|  44.7k|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 1265|  44.7k|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 1266|  44.7k|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 1267|       |
 1268|       |            /*load 8 pixel values */
 1269|  44.7k|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
 1270|       |
 1271|  44.7k|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
 1272|       |
 1273|  44.7k|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 1274|       |
 1275|  44.7k|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 1276|  44.7k|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 1277|  44.7k|            s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 1278|       |
 1279|  44.7k|            s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
 1280|       |
 1281|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1282|  44.7k|            s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  44.7k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  44.7k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1283|       |
 1284|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 1285|  44.7k|            s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 1286|       |
 1287|  44.7k|            s35_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 1288|  44.7k|            s36_8x16b =  _mm_and_si128(s35_8x16b, mask_low_32b);
 1289|  44.7k|            s37_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 1290|  44.7k|            s38_8x16b = _mm_or_si128(s36_8x16b, s37_8x16b);
 1291|       |
 1292|       |            /* store 8 8-bit output values  */
 1293|       |            /* Store the output pixels of row 2*/
 1294|  44.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s38_8x16b);
 1295|       |
 1296|  44.7k|            pu1_src += (8 * src_strd);
 1297|  44.7k|            pu1_dst += (4 * dst_strd);
 1298|       |
 1299|   104k|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (1299:26): [True: 60.0k, False: 44.7k]
  ------------------
 1300|  60.0k|            {
 1301|       |
 1302|  60.0k|                PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  60.0k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1303|  60.0k|                PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  60.0k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1304|  60.0k|                PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  60.0k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1305|  60.0k|                PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  60.0k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1306|       |
 1307|       |
 1308|  60.0k|                s3_0_16x8b = s3_2_16x8b;
 1309|  60.0k|                s3_1_16x8b = s3_3_16x8b;
 1310|  60.0k|                s3_2_16x8b = s3_4_16x8b;
 1311|       |
 1312|  60.0k|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 1313|  60.0k|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 1314|  60.0k|                s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 1315|       |
 1316|       |                /*load 16 pixel values from (cur_row + 4)th row*/
 1317|  60.0k|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 1318|       |
 1319|  60.0k|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
 1320|  60.0k|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 1321|       |
 1322|  60.0k|                s4_0_16x8b = s4_2_16x8b;
 1323|  60.0k|                s4_1_16x8b = s4_3_16x8b;
 1324|  60.0k|                s4_2_16x8b = s4_4_16x8b;
 1325|       |
 1326|  60.0k|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 1327|  60.0k|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 1328|  60.0k|                s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 1329|       |
 1330|  60.0k|                s7_8x16b = _mm_add_epi16(s6_8x16b, offset_8x16b);
 1331|       |
 1332|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1333|  60.0k|                s8_8x16b = _mm_srai_epi16(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  60.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  60.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1334|       |
 1335|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1336|  60.0k|                s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 1337|       |
 1338|  60.0k|                s5_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 1339|  60.0k|                s6_8x16b =  _mm_and_si128(s5_8x16b, mask_low_32b);
 1340|  60.0k|                s7_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 1341|  60.0k|                s8_8x16b = _mm_or_si128(s6_8x16b, s7_8x16b);
 1342|       |
 1343|       |                /* store 8 8-bit output values  */
 1344|       |                /* Store the output pixels of row 4*/
 1345|  60.0k|                _mm_storel_epi64((__m128i *)(pu1_dst), s8_8x16b);
 1346|       |
 1347|       |                /* row + 2*/
 1348|  60.0k|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 1349|  60.0k|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 1350|  60.0k|                s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 1351|       |
 1352|       |                /*load 16 pixel values from (cur_row + 5)th row*/
 1353|  60.0k|                s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1354|       |
 1355|       |                /*load 16 pixel values from (cur_row + 6)th row*/
 1356|  60.0k|                s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 1357|       |
 1358|       |                /*unpacking (cur_row + 5)th row and (cur_row + 6)th row*/
 1359|  60.0k|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 1360|       |
 1361|  60.0k|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 1362|       |
 1363|  60.0k|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 1364|  60.0k|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 1365|  60.0k|                s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 1366|       |
 1367|  60.0k|                s27_8x16b = _mm_add_epi16(s26_8x16b, offset_8x16b);
 1368|       |
 1369|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1370|  60.0k|                s28_8x16b = _mm_srai_epi16(s27_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  60.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  60.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1371|       |
 1372|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1373|  60.0k|                s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 1374|       |
 1375|  60.0k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 1376|  60.0k|                s26_8x16b =  _mm_and_si128(s25_8x16b, mask_low_32b);
 1377|  60.0k|                s27_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 1378|  60.0k|                s28_8x16b = _mm_or_si128(s26_8x16b, s27_8x16b);
 1379|       |
 1380|       |                /* store 8 8-bit output values  */
 1381|       |                /* Store the output pixels of (cur_row+2)*/
 1382|  60.0k|                _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s28_8x16b);
 1383|       |
 1384|       |
 1385|       |                /*row + 1*/
 1386|  60.0k|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 1387|  60.0k|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 1388|  60.0k|                s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 1389|       |
 1390|       |                /*unpacking (cur_row + 4)th row and (cur_row + 5)th row*/
 1391|  60.0k|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 1392|  60.0k|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 1393|       |
 1394|  60.0k|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 1395|  60.0k|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 1396|  60.0k|                s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 1397|       |
 1398|  60.0k|                s17_8x16b = _mm_add_epi16(s16_8x16b, offset_8x16b);
 1399|       |
 1400|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1401|  60.0k|                s18_8x16b = _mm_srai_epi16(s17_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  60.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  60.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1402|       |
 1403|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1404|  60.0k|                s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 1405|       |
 1406|  60.0k|                s15_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 1407|  60.0k|                s16_8x16b =  _mm_and_si128(s15_8x16b, mask_low_32b);
 1408|  60.0k|                s17_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 1409|  60.0k|                s18_8x16b = _mm_or_si128(s16_8x16b, s17_8x16b);
 1410|       |
 1411|       |                /* store 8 8-bit output values  */
 1412|       |                /* Store the output pixels of (cur_row + 1)*/
 1413|  60.0k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s18_8x16b);
 1414|       |
 1415|       |
 1416|       |                /* row + 3*/
 1417|  60.0k|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 1418|  60.0k|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 1419|  60.0k|                s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 1420|       |
 1421|       |                /*load 16 pixel values from (cur_row + 7)th row*/
 1422|  60.0k|                s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 1423|       |
 1424|       |                /*unpacking (cur_row + 6)th row and (cur_row + 7)th row*/
 1425|  60.0k|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 1426|       |
 1427|  60.0k|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 1428|       |
 1429|  60.0k|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 1430|  60.0k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 1431|  60.0k|                s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 1432|       |
 1433|  60.0k|                s37_8x16b = _mm_add_epi16(s36_8x16b, offset_8x16b);
 1434|       |
 1435|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 1436|  60.0k|                s38_8x16b = _mm_srai_epi16(s37_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  60.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  60.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1437|       |
 1438|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 1439|  60.0k|                s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 1440|       |
 1441|  60.0k|                s35_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 1442|  60.0k|                s36_8x16b =  _mm_and_si128(s35_8x16b, mask_low_32b);
 1443|  60.0k|                s37_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 1444|  60.0k|                s38_8x16b = _mm_or_si128(s36_8x16b, s37_8x16b);
 1445|       |
 1446|       |                /* store 8 8-bit output values  */
 1447|       |                /* Store the output pixels of (cur_row+3)*/
 1448|  60.0k|                _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s38_8x16b);
 1449|       |
 1450|  60.0k|                s2_10_16x8b = s2_3_16x8b;
 1451|       |
 1452|  60.0k|                pu1_src += 4 * src_strd; /* pointer update */
 1453|  60.0k|                pu1_dst += 4 * dst_strd; /* pointer update */
 1454|  60.0k|            }
 1455|  44.7k|        }
 1456|  39.1k|    }
 1457|  1.34M|}
ihevc_inter_pred_luma_copy_w16out_ssse3:
 1507|  47.2M|{
 1508|  47.2M|    WORD32 row, col;
 1509|  47.2M|    __m128i  s3, zero_8x16b;
 1510|       |
 1511|  47.2M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  47.2M|#define ASSERT(x) {}
  ------------------
 1512|  47.2M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  47.2M|#define ASSERT(x) {}
  ------------------
 1513|  47.2M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  47.2M|#define UNUSED(x) ((void)(x))
  ------------------
 1514|  47.2M|    zero_8x16b = _mm_setzero_si128();
 1515|       |/*  outer for loop starts from here */
 1516|  47.2M|    if(wd % 8 == 0) /* wd = multiple of 8 case */
  ------------------
  |  Branch (1516:8): [True: 47.1M, False: 27.6k]
  ------------------
 1517|  47.1M|    {
 1518|   238M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1518:22): [True: 191M, False: 47.1M]
  ------------------
 1519|   191M|        {
 1520|   191M|            int offset = 0;
 1521|   398M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1521:26): [True: 206M, False: 191M]
  ------------------
 1522|   206M|            {
 1523|       |/* row =0 */
 1524|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 1525|   206M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 1526|   206M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1527|       |
 1528|   206M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   206M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   206M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1529|       |
 1530|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1531|   206M|                _mm_store_si128((__m128i *)(pi2_dst + offset), s3);
 1532|       |
 1533|       |/* row =1 */
 1534|       |                /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 1535|   206M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col] */
 1536|   206M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1537|       |
 1538|   206M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   206M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   206M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1539|       |
 1540|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1541|   206M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd + offset), s3);
 1542|       |
 1543|   206M|                offset += 8; /* To pointer update */
 1544|   206M|            } /* inner for loop ends here(8-output values in single iteration) */
 1545|       |
 1546|   191M|            pu1_src += 2 * src_strd; /* pointer update */
 1547|   191M|            pi2_dst += 2 * dst_strd; /* pointer update */
 1548|   191M|        }
 1549|  47.1M|    }
 1550|  27.6k|    else /* wd = multiple of 4 case */
 1551|  27.6k|    {
 1552|   243k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1552:22): [True: 215k, False: 27.6k]
  ------------------
 1553|   215k|        {
 1554|   215k|            int offset = 0;
 1555|   628k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1555:26): [True: 413k, False: 215k]
  ------------------
 1556|   413k|            {
 1557|       |/* row =0 */
 1558|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 1559|   413k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 1560|   413k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1561|       |
 1562|   413k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   413k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   413k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1563|       |
 1564|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1565|   413k|                _mm_storel_epi64((__m128i *)(pi2_dst + offset), s3);
 1566|       |
 1567|       |/* row =1 */
 1568|       |                /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 1569|   413k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col] */
 1570|   413k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 1571|       |
 1572|   413k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH */
  ------------------
  |  |   41|   413k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   413k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1573|       |
 1574|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 1575|   413k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), s3);
 1576|   413k|                offset += 4; /* To pointer update */
 1577|   413k|            } /* inner for loop ends here(4-output values in single iteration) */
 1578|       |
 1579|   215k|            pu1_src += 2 * src_strd; /* pointer update */
 1580|   215k|            pi2_dst += 2 * dst_strd; /* pointer update */
 1581|   215k|        }
 1582|  27.6k|    }
 1583|       |
 1584|  47.2M|}
ihevc_inter_pred_luma_horz_w16out_ssse3:
 1633|  8.55M|{
 1634|  8.55M|    WORD32 row, col;
 1635|       |
 1636|       |    /* all 128 bit registers are named with a suffix mxnb, where m is the */
 1637|       |    /* number of n bits packed in the register                            */
 1638|       |
 1639|  8.55M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
 1640|  8.55M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
 1641|  8.55M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b, res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b;
 1642|  8.55M|    __m128i res_temp11_8x16b, res_temp12_8x16b, res_temp13_8x16b, res_temp14_8x16b, res_temp15_8x16b, res_temp16_8x16b;
 1643|  8.55M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 1644|  8.55M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
 1645|       |
 1646|  8.55M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  8.55M|#define ASSERT(x) {}
  ------------------
 1647|       |
 1648|  8.55M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  8.55M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1649|  8.55M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  8.55M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1650|  8.55M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  8.55M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1651|  8.55M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  8.55M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1652|  8.55M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  8.55M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1653|  8.55M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  8.55M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1654|       |
 1655|       |    /* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 1656|  8.55M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 1657|       |
 1658|       |
 1659|  8.55M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 1660|  8.55M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 1661|  8.55M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
 1662|  8.55M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
 1663|       |
 1664|  8.55M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 1665|  8.55M|    coeff2_3_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 1666|       |
 1667|  8.55M|    coeff4_5_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_3_8x16b);  /* pi1_coeff[4] */
 1668|  8.55M|    coeff6_7_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_4_8x16b);  /* pi1_coeff[4] */
 1669|       |
 1670|  8.55M|    if(0 == (ht & 1)) /* ht multiple of 2 case */
  ------------------
  |  Branch (1670:8): [True: 2.73M, False: 5.82M]
  ------------------
 1671|  2.73M|    {
 1672|       |
 1673|  2.73M|        if(0 == (wd & 7)) /* wd = multiple of 8 case */
  ------------------
  |  Branch (1673:12): [True: 2.72M, False: 12.4k]
  ------------------
 1674|  2.72M|        {
 1675|  14.1M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1675:26): [True: 11.4M, False: 2.72M]
  ------------------
 1676|  11.4M|            {
 1677|       |
 1678|  11.4M|                int offset = 0;
 1679|       |
 1680|  11.4M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  11.4M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1681|  11.4M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  11.4M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1682|       |
 1683|       |
 1684|       |
 1685|  25.0M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1685:30): [True: 13.6M, False: 11.4M]
  ------------------
 1686|  13.6M|                {
 1687|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1688|  13.6M|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
 1689|  13.6M|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
 1690|       |
 1691|  13.6M|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
 1692|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
 1693|  13.6M|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1694|  13.6M|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1695|       |                    /* row = 0 */
 1696|  13.6M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1697|  13.6M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1698|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1699|  13.6M|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1700|  13.6M|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1701|       |
 1702|  13.6M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1703|  13.6M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1704|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1705|  13.6M|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1706|  13.6M|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1707|       |
 1708|  13.6M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1709|  13.6M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1710|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1711|  13.6M|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1712|  13.6M|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1713|       |
 1714|  13.6M|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1715|  13.6M|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1716|  13.6M|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1717|       |
 1718|  13.6M|                    src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 1);                   /* row = 1 */
 1719|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/                 /* row = 1 */
 1720|  13.6M|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1721|  13.6M|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
 1722|       |                                                                                              /* row = 1 */
 1723|  13.6M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1724|  13.6M|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1725|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1726|  13.6M|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1727|  13.6M|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
 1728|       |
 1729|  13.6M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1730|  13.6M|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1731|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1732|  13.6M|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1733|  13.6M|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
 1734|       |
 1735|  13.6M|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1736|  13.6M|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1737|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1738|  13.6M|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1739|  13.6M|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
 1740|       |
 1741|  13.6M|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 1742|  13.6M|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
 1743|  13.6M|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
 1744|       |
 1745|       |                    /* to store the 1st 4 pixels res. */
 1746|  13.6M|                    _mm_store_si128((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1747|  13.6M|                    _mm_store_si128((__m128i *)(pi2_dst + dst_strd + offset), res_temp15_8x16b);
 1748|       |
 1749|  13.6M|                    offset += 8; /* To pointer updates*/
 1750|  13.6M|                }
 1751|  11.4M|                pu1_src += 2 * src_strd;  /* pointer updates*/
 1752|  11.4M|                pi2_dst += 2 * dst_strd;  /* pointer updates*/
 1753|  11.4M|            }
 1754|  2.72M|        }
 1755|  12.4k|        else /* wd = multiple of 4 case */
 1756|  12.4k|        {
 1757|   101k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1757:26): [True: 88.6k, False: 12.4k]
  ------------------
 1758|  88.6k|            {
 1759|  88.6k|                int offset = 0;
 1760|       |
 1761|  88.6k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  88.6k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1762|  88.6k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  88.6k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1763|       |
 1764|       |
 1765|   257k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1765:30): [True: 169k, False: 88.6k]
  ------------------
 1766|   169k|                {
 1767|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1768|   169k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
 1769|   169k|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
 1770|       |
 1771|   169k|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
 1772|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
 1773|   169k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1774|   169k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1775|       |                    /* row = 0 */
 1776|   169k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1777|   169k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1778|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1779|   169k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1780|   169k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1781|       |
 1782|   169k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1783|   169k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1784|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1785|   169k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1786|   169k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1787|       |
 1788|   169k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1789|   169k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1790|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1791|   169k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1792|   169k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1793|       |
 1794|   169k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1795|   169k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1796|   169k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1797|       |
 1798|   169k|                    src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 1);                   /* row = 1 */
 1799|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/                 /* row = 1 */
 1800|   169k|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1801|   169k|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
 1802|       |                                                                                              /* row = 1 */
 1803|   169k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1804|   169k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1805|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1806|   169k|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1807|   169k|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
 1808|       |
 1809|   169k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1810|   169k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1811|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1812|   169k|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1813|   169k|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
 1814|       |
 1815|   169k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1816|   169k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1817|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1818|   169k|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1819|   169k|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
 1820|       |
 1821|   169k|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 1822|   169k|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
 1823|   169k|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
 1824|       |
 1825|       |                    /* to store the 1st 4 pixels res. */
 1826|   169k|                    _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1827|   169k|                    _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), res_temp15_8x16b);
 1828|       |
 1829|   169k|                    offset += 4; /* To pointer updates*/
 1830|   169k|                }
 1831|  88.6k|                pu1_src += 2 * src_strd;  /* Pointer update */
 1832|  88.6k|                pi2_dst += 2 * dst_strd;  /* Pointer update */
 1833|  88.6k|            }
 1834|  12.4k|        }
 1835|  2.73M|    }
 1836|  5.82M|    else /* odd ht */
 1837|  5.82M|    {
 1838|  5.82M|        if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (1838:12): [True: 5.74M, False: 80.7k]
  ------------------
 1839|  5.74M|        {
 1840|  93.2M|            for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1840:26): [True: 87.4M, False: 5.74M]
  ------------------
 1841|  87.4M|            {
 1842|  87.4M|                int offset = 0;
 1843|       |
 1844|  87.4M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  87.4M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1845|       |
 1846|       |
 1847|   186M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1847:30): [True: 98.7M, False: 87.4M]
  ------------------
 1848|  98.7M|                {
 1849|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1850|  98.7M|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));  /* row = 0 */
 1851|       |
 1852|  98.7M|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
 1853|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
 1854|  98.7M|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1855|  98.7M|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1856|       |                    /* row = 0 */
 1857|  98.7M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1858|  98.7M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1859|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1860|  98.7M|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1861|  98.7M|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1862|       |
 1863|  98.7M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1864|  98.7M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1865|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1866|  98.7M|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1867|  98.7M|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1868|       |
 1869|  98.7M|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1870|  98.7M|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1871|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1872|  98.7M|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1873|  98.7M|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1874|       |
 1875|  98.7M|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1876|  98.7M|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1877|  98.7M|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1878|       |
 1879|       |                    /* to store the 1st 4 pixels res. */
 1880|  98.7M|                    _mm_store_si128((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1881|       |
 1882|  98.7M|                    offset += 8; /* To pointer updates*/
 1883|  98.7M|                }
 1884|  87.4M|                pu1_src += src_strd;    /* pointer updates*/
 1885|  87.4M|                pi2_dst += dst_strd;    /* pointer updates*/
 1886|  87.4M|            }
 1887|  5.74M|        }
 1888|  80.7k|        else  /* wd = multiple of 4 case */
 1889|  80.7k|        {
 1890|   713k|            for(row = 0; row < (ht - 1); row += 2)
  ------------------
  |  Branch (1890:26): [True: 632k, False: 80.7k]
  ------------------
 1891|   632k|            {
 1892|   632k|                int offset = 0;
 1893|       |
 1894|       |
 1895|   632k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   632k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1896|   632k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   632k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 1897|       |
 1898|       |
 1899|  1.45M|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1899:30): [True: 826k, False: 632k]
  ------------------
 1900|   826k|                {
 1901|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1902|   826k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));             /* row = 0 */
 1903|   826k|                    src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd - 3 + offset)); /* row = 1 */
 1904|       |
 1905|   826k|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
 1906|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
 1907|   826k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1908|   826k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1909|       |                                                                                           /* row = 0 */
 1910|   826k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1911|   826k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1912|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1913|   826k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1914|   826k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1915|       |
 1916|   826k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1917|   826k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1918|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1919|   826k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1920|   826k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1921|       |
 1922|   826k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1923|   826k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1924|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1925|   826k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1926|   826k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1927|       |
 1928|   826k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1929|   826k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 1930|   826k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 1931|       |
 1932|   826k|                    src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 1);                   /* row = 1 */
 1933|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/                 /* row = 1 */
 1934|   826k|                    src_temp13_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1935|   826k|                    res_temp11_8x16b = _mm_maddubs_epi16(src_temp13_16x8b, coeff0_1_8x16b);   /* row = 1 */
 1936|       |                                                                                              /* row = 1 */
 1937|   826k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1938|   826k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1939|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1940|   826k|                    src_temp14_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1941|   826k|                    res_temp12_8x16b = _mm_maddubs_epi16(src_temp14_16x8b, coeff2_3_8x16b);   /* row = 1 */
 1942|       |
 1943|   826k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1944|   826k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1945|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1946|   826k|                    src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1947|   826k|                    res_temp13_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff4_5_8x16b);   /* row = 1 */
 1948|       |
 1949|   826k|                    src_temp11_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);                   /* row = 1 */
 1950|   826k|                    src_temp12_16x8b = _mm_srli_si128(src_temp12_16x8b, 2);                   /* row = 1 */
 1951|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/                  /* row = 1 */
 1952|   826k|                    src_temp16_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b); /* row = 1 */
 1953|   826k|                    res_temp14_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff6_7_8x16b);   /* row = 1 */
 1954|       |
 1955|   826k|                    res_temp15_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 1956|   826k|                    res_temp16_8x16b = _mm_add_epi16(res_temp13_8x16b, res_temp14_8x16b);
 1957|   826k|                    res_temp15_8x16b = _mm_add_epi16(res_temp15_8x16b, res_temp16_8x16b);
 1958|       |
 1959|       |                    /* to store the 1st 4 pixels res. */
 1960|   826k|                    _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 1961|   826k|                    _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), res_temp15_8x16b);
 1962|       |
 1963|   826k|                    offset += 4; /* To pointer updates*/
 1964|   826k|                }
 1965|   632k|                pu1_src += 2 * src_strd;  /* Pointer update */
 1966|   632k|                pi2_dst += 2 * dst_strd;  /* Pointer update */
 1967|   632k|            }
 1968|  80.7k|            { /* last repeat at outside the loop */
 1969|  80.7k|                int offset = 0;
 1970|   179k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1970:30): [True: 98.5k, False: 80.7k]
  ------------------
 1971|  98.5k|                {
 1972|       |                    /*load 16 pixel values from 12:-3 pos. relative to cur. pos.*/
 1973|  98.5k|                    src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 3 + offset));  /* row = 0 */
 1974|       |
 1975|  98.5k|                    src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);                  /* row = 0 */
 1976|       |                    /* pix. |5:-2|4:-3| to do two dot-products at same time*/              /* row = 0 */
 1977|  98.5k|                    src_temp3_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1978|  98.5k|                    res_temp1_8x16b = _mm_maddubs_epi16(src_temp3_16x8b, coeff0_1_8x16b);  /* row = 0 */
 1979|       |                                                                                           /* row = 0 */
 1980|  98.5k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1981|  98.5k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1982|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1983|  98.5k|                    src_temp4_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1984|  98.5k|                    res_temp2_8x16b = _mm_maddubs_epi16(src_temp4_16x8b, coeff2_3_8x16b);  /* row = 0 */
 1985|       |
 1986|  98.5k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1987|  98.5k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1988|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1989|  98.5k|                    src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1990|  98.5k|                    res_temp3_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff4_5_8x16b);  /* row = 0 */
 1991|       |
 1992|  98.5k|                    src_temp1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);                  /* row = 0 */
 1993|  98.5k|                    src_temp2_16x8b = _mm_srli_si128(src_temp2_16x8b, 2);                  /* row = 0 */
 1994|       |                    /* pix. |7:0|6:-1| to do two dot-products at same time*/               /* row = 0 */
 1995|  98.5k|                    src_temp6_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b); /* row = 0 */
 1996|  98.5k|                    res_temp4_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff6_7_8x16b);  /* row = 0 */
 1997|       |
 1998|  98.5k|                    res_temp5_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 1999|  98.5k|                    res_temp6_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp4_8x16b);
 2000|  98.5k|                    res_temp5_8x16b = _mm_add_epi16(res_temp5_8x16b, res_temp6_8x16b);
 2001|       |
 2002|       |                    /* to store the 1st 4 pixels res. */
 2003|  98.5k|                    _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp5_8x16b);
 2004|       |
 2005|  98.5k|                    offset += 4; /* To pointer updates*/
 2006|  98.5k|                }
 2007|  80.7k|            }
 2008|  80.7k|        }
 2009|  5.82M|    }
 2010|  8.55M|}
ihevc_inter_pred_luma_vert_w16out_ssse3:
 2059|  4.22M|{
 2060|  4.22M|    WORD32 row, col;
 2061|  4.22M|    UWORD8 *pu1_src_copy;
 2062|  4.22M|    WORD16 *pi2_dst_copy;
 2063|  4.22M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 2064|  4.22M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b;
 2065|  4.22M|    __m128i s2_0_16x8b, s2_1_16x8b, s2_2_16x8b, s2_3_16x8b, s2_4_16x8b, s2_5_16x8b, s2_6_16x8b, s2_7_16x8b, s2_8_16x8b, s2_9_16x8b, s2_10_16x8b;
 2066|  4.22M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
 2067|  4.22M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
 2068|  4.22M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b;
 2069|  4.22M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b;
 2070|  4.22M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b;
 2071|       |
 2072|       |
 2073|  4.22M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b, control_mask_3_8x16b, control_mask_4_8x16b;
 2074|       |
 2075|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 2076|  4.22M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 2077|       |
 2078|  4.22M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 2079|  4.22M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 2080|  4.22M|    control_mask_3_8x16b = _mm_set1_epi32(0x05040504); /* Control Mask register */
 2081|  4.22M|    control_mask_4_8x16b = _mm_set1_epi32(0x07060706); /* Control Mask register */
 2082|       |
 2083|  4.22M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 2084|  4.22M|    coeff2_3_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 2085|       |
 2086|  4.22M|    coeff4_5_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_3_8x16b);  /* pi1_coeff[4] */
 2087|  4.22M|    coeff6_7_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_4_8x16b);  /* pi1_coeff[4] */
 2088|       |
 2089|       |
 2090|       |/*  outer for loop starts from here */
 2091|  4.22M|    if((wd % 8) == 0)
  ------------------
  |  Branch (2091:8): [True: 4.21M, False: 11.3k]
  ------------------
 2092|  4.21M|    { /* wd = multiple of 8 case */
 2093|       |
 2094|  4.21M|        pu1_src_copy = pu1_src;
 2095|  4.21M|        pi2_dst_copy = pi2_dst;
 2096|       |
 2097|  8.56M|        for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (2097:22): [True: 4.35M, False: 4.21M]
  ------------------
 2098|  4.35M|        {
 2099|       |
 2100|  4.35M|            pu1_src = pu1_src_copy + col;
 2101|  4.35M|            pi2_dst = pi2_dst_copy + col;
 2102|       |
 2103|  4.35M|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.35M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2104|  4.35M|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.35M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2105|  4.35M|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.35M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2106|  4.35M|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  4.35M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2107|       |
 2108|       |            /*load 8 pixel values */
 2109|  4.35M|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
 2110|       |
 2111|       |            /*load 8 pixel values */
 2112|  4.35M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
 2113|       |
 2114|  4.35M|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2115|       |
 2116|  4.35M|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2117|       |
 2118|       |            /*load 8 pixel values */
 2119|  4.35M|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 2120|       |
 2121|       |            /*load 8 pixel values */
 2122|  4.35M|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 2123|       |
 2124|  4.35M|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2125|       |
 2126|  4.35M|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2127|       |
 2128|       |            /*load 8 pixel values */
 2129|  4.35M|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 2130|       |
 2131|       |            /*load 8 pixel values */
 2132|  4.35M|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 2133|       |
 2134|  4.35M|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
 2135|       |
 2136|  4.35M|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2137|       |
 2138|       |            /*load 8 pixel values */
 2139|  4.35M|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 2140|       |
 2141|       |            /*load 8 pixel values */
 2142|  4.35M|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
 2143|       |
 2144|  4.35M|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
 2145|       |
 2146|  4.35M|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2147|       |
 2148|  4.35M|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2149|  4.35M|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2150|  4.35M|            s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 2151|       |
 2152|       |            /* store 8 8-bit output values  */
 2153|       |            /* Store the output pixels of row 0*/
 2154|  4.35M|            _mm_store_si128((__m128i *)(pi2_dst), s6_8x16b);
 2155|       |
 2156|       |            /* ROW 2*/
 2157|  4.35M|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2158|  4.35M|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2159|  4.35M|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2160|       |
 2161|       |            /*load 8 pixel values */
 2162|  4.35M|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
 2163|       |
 2164|       |            /*load 8 pixel values */
 2165|  4.35M|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
 2166|       |
 2167|  4.35M|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
 2168|       |
 2169|  4.35M|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2170|       |
 2171|  4.35M|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2172|  4.35M|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2173|  4.35M|            s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 2174|       |
 2175|       |            /* store 8 8-bit output values  */
 2176|       |            /* Store the output pixels of row 2*/
 2177|  4.35M|            _mm_store_si128((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2178|       |
 2179|       |
 2180|       |            /*ROW 1*/
 2181|  4.35M|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2182|       |
 2183|  4.35M|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2184|       |
 2185|  4.35M|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
 2186|       |
 2187|  4.35M|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2188|       |
 2189|  4.35M|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
 2190|       |
 2191|  4.35M|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2192|       |
 2193|  4.35M|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
 2194|       |
 2195|  4.35M|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2196|       |
 2197|  4.35M|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2198|  4.35M|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2199|  4.35M|            s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 2200|       |
 2201|       |
 2202|       |            /* store 8 8-bit output values  */
 2203|       |            /* Store the output pixels of row 1*/
 2204|  4.35M|            _mm_store_si128((__m128i *)(pi2_dst + (dst_strd)), s16_8x16b);
 2205|       |
 2206|       |
 2207|       |            /* ROW 3*/
 2208|  4.35M|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2209|  4.35M|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2210|  4.35M|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2211|       |
 2212|       |            /*load 8 pixel values */
 2213|  4.35M|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
 2214|       |
 2215|  4.35M|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
 2216|       |
 2217|  4.35M|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2218|       |
 2219|  4.35M|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2220|  4.35M|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2221|  4.35M|            s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 2222|       |
 2223|       |
 2224|       |            /* store 8 8-bit output values  */
 2225|       |            /* Store the output pixels of row 2*/
 2226|  4.35M|            _mm_store_si128((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2227|       |
 2228|  4.35M|            pu1_src += (8 * src_strd);
 2229|  4.35M|            pi2_dst += (4 * dst_strd);
 2230|       |
 2231|  10.0M|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (2231:26): [True: 5.64M, False: 4.35M]
  ------------------
 2232|  5.64M|            {
 2233|       |
 2234|  5.64M|                PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.64M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2235|  5.64M|                PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.64M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2236|  5.64M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.64M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2237|  5.64M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.64M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2238|       |
 2239|  5.64M|                s3_0_16x8b = s3_2_16x8b;
 2240|  5.64M|                s3_1_16x8b = s3_3_16x8b;
 2241|  5.64M|                s3_2_16x8b = s3_4_16x8b;
 2242|       |
 2243|  5.64M|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2244|  5.64M|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2245|  5.64M|                s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2246|       |
 2247|       |                /*load 8 pixel values from (cur_row + 4)th row*/
 2248|  5.64M|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2249|       |
 2250|  5.64M|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
 2251|  5.64M|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2252|       |
 2253|  5.64M|                s4_0_16x8b = s4_2_16x8b;
 2254|  5.64M|                s4_1_16x8b = s4_3_16x8b;
 2255|  5.64M|                s4_2_16x8b = s4_4_16x8b;
 2256|       |
 2257|  5.64M|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2258|  5.64M|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2259|  5.64M|                s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 2260|       |
 2261|       |                /* store 8 8-bit output values  */
 2262|       |                /* Store the output pixels of row 4*/
 2263|  5.64M|                _mm_store_si128((__m128i *)(pi2_dst), s6_8x16b);
 2264|       |
 2265|       |                /* row + 2*/
 2266|  5.64M|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2267|  5.64M|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2268|  5.64M|                s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2269|       |
 2270|       |                /*load 8 pixel values from (cur_row + 5)th row*/
 2271|  5.64M|                s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 2272|       |
 2273|       |                /*load 8 pixel values from (cur_row + 6)th row*/
 2274|  5.64M|                s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 2275|       |
 2276|       |                /*unpacking (cur_row + 5)th row and (cur_row + 6)th row*/
 2277|  5.64M|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2278|       |
 2279|  5.64M|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2280|       |
 2281|  5.64M|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2282|  5.64M|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2283|  5.64M|                s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 2284|       |
 2285|       |                /* store 8 8-bit output values  */
 2286|       |                /* Store the output pixels of (cur_row+2)*/
 2287|  5.64M|                _mm_store_si128((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2288|       |
 2289|       |
 2290|       |                /*row + 1*/
 2291|  5.64M|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2292|  5.64M|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2293|  5.64M|                s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2294|       |
 2295|       |                /*unpacking (cur_row + 4)th row and (cur_row + 5)th row*/
 2296|  5.64M|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2297|  5.64M|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2298|       |
 2299|  5.64M|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2300|  5.64M|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2301|  5.64M|                s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 2302|       |
 2303|       |
 2304|       |                /* store 8 8-bit output values  */
 2305|       |                /* Store the output pixels of (cur_row + 1)*/
 2306|  5.64M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s16_8x16b);
 2307|       |
 2308|       |
 2309|       |                /* row + 3*/
 2310|  5.64M|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2311|  5.64M|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2312|  5.64M|                s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2313|       |
 2314|       |                /*load 8 pixel values from (cur_row + 7)th row*/
 2315|  5.64M|                s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 2316|       |
 2317|       |                /*unpacking (cur_row + 6)th row and (cur_row + 7)th row*/
 2318|  5.64M|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2319|       |
 2320|  5.64M|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2321|       |
 2322|  5.64M|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2323|  5.64M|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2324|  5.64M|                s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 2325|       |
 2326|       |                /* store 8 8-bit output values  */
 2327|       |                /* Store the output pixels of (cur_row+3)*/
 2328|  5.64M|                _mm_store_si128((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2329|       |
 2330|  5.64M|                s2_10_16x8b = s2_3_16x8b;
 2331|       |
 2332|       |
 2333|  5.64M|                pu1_src += 4 * src_strd; /* pointer update */
 2334|  5.64M|                pi2_dst += 4 * dst_strd; /* pointer update */
 2335|  5.64M|            }
 2336|  4.35M|        }
 2337|  4.21M|    }
 2338|  11.3k|    else /* wd = multiple of 8 case */
 2339|  11.3k|    {
 2340|       |
 2341|  11.3k|        pu1_src_copy = pu1_src;
 2342|  11.3k|        pi2_dst_copy = pi2_dst;
 2343|       |
 2344|  23.8k|        for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (2344:22): [True: 12.5k, False: 11.3k]
  ------------------
 2345|  12.5k|        {
 2346|       |
 2347|  12.5k|            pu1_src = pu1_src_copy + col;
 2348|  12.5k|            pi2_dst = pi2_dst_copy + col;
 2349|       |
 2350|  12.5k|            PREFETCH((char const *)(pu1_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.5k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2351|  12.5k|            PREFETCH((char const *)(pu1_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.5k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2352|  12.5k|            PREFETCH((char const *)(pu1_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.5k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2353|  12.5k|            PREFETCH((char const *)(pu1_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.5k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2354|       |
 2355|       |            /*load 8 pixel values */
 2356|  12.5k|            s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-3 * src_strd)));
 2357|       |
 2358|       |            /*load 8 pixel values */
 2359|  12.5k|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-2 * src_strd)));
 2360|       |
 2361|  12.5k|            s3_0_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2362|       |
 2363|  12.5k|            s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2364|       |
 2365|       |            /*load 8 pixel values */
 2366|  12.5k|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 2367|       |
 2368|       |            /*load 8 pixel values */
 2369|  12.5k|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 2370|       |
 2371|  12.5k|            s3_1_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2372|       |
 2373|  12.5k|            s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2374|       |
 2375|       |            /*load 8 pixel values */
 2376|  12.5k|            s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 2377|       |
 2378|       |            /*load 8 pixel values */
 2379|  12.5k|            s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 2380|       |
 2381|  12.5k|            s3_2_16x8b = _mm_unpacklo_epi8(s2_4_16x8b, s2_5_16x8b);
 2382|       |
 2383|  12.5k|            s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2384|       |
 2385|       |            /*load 8 pixel values */
 2386|  12.5k|            s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 2387|       |
 2388|       |            /*load 8 pixel values */
 2389|  12.5k|            s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (4 * src_strd)));
 2390|       |
 2391|  12.5k|            s3_3_16x8b = _mm_unpacklo_epi8(s2_6_16x8b, s2_7_16x8b);
 2392|       |
 2393|  12.5k|            s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2394|       |
 2395|  12.5k|            s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2396|  12.5k|            s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2397|  12.5k|            s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 2398|       |
 2399|       |            /* store 8 8-bit output values  */
 2400|       |            /* Store the output pixels of row 0*/
 2401|  12.5k|            _mm_storel_epi64((__m128i *)(pi2_dst), s6_8x16b);
 2402|       |
 2403|       |            /* ROW 2*/
 2404|  12.5k|            s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2405|  12.5k|            s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2406|  12.5k|            s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2407|       |
 2408|       |            /*load 8 pixel values */
 2409|  12.5k|            s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (5 * src_strd)));
 2410|       |
 2411|       |            /*load 8 pixel values */
 2412|  12.5k|            s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (6 * src_strd)));
 2413|       |
 2414|  12.5k|            s3_4_16x8b = _mm_unpacklo_epi8(s2_8_16x8b, s2_9_16x8b);
 2415|       |
 2416|  12.5k|            s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2417|       |
 2418|  12.5k|            s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2419|  12.5k|            s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2420|  12.5k|            s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 2421|       |
 2422|       |            /* store 8 8-bit output values  */
 2423|       |            /* Store the output pixels of row 2*/
 2424|  12.5k|            _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2425|       |
 2426|       |
 2427|       |            /*ROW 1*/
 2428|  12.5k|            s4_0_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2429|       |
 2430|  12.5k|            s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2431|       |
 2432|  12.5k|            s4_1_16x8b = _mm_unpacklo_epi8(s2_3_16x8b, s2_4_16x8b);
 2433|       |
 2434|  12.5k|            s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2435|       |
 2436|  12.5k|            s4_2_16x8b = _mm_unpacklo_epi8(s2_5_16x8b, s2_6_16x8b);
 2437|       |
 2438|  12.5k|            s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2439|       |
 2440|  12.5k|            s4_3_16x8b = _mm_unpacklo_epi8(s2_7_16x8b, s2_8_16x8b);
 2441|       |
 2442|  12.5k|            s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2443|       |
 2444|  12.5k|            s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2445|  12.5k|            s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2446|  12.5k|            s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 2447|       |
 2448|       |
 2449|       |            /* store 8 8-bit output values  */
 2450|       |            /* Store the output pixels of row 1*/
 2451|  12.5k|            _mm_storel_epi64((__m128i *)(pi2_dst + (dst_strd)), s16_8x16b);
 2452|       |
 2453|       |
 2454|       |            /* ROW 3*/
 2455|  12.5k|            s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2456|  12.5k|            s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2457|  12.5k|            s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2458|       |
 2459|       |            /*load 8 pixel values */
 2460|  12.5k|            s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (7 * src_strd)));
 2461|       |
 2462|  12.5k|            s4_4_16x8b = _mm_unpacklo_epi8(s2_9_16x8b, s2_10_16x8b);
 2463|       |
 2464|  12.5k|            s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2465|       |
 2466|  12.5k|            s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2467|  12.5k|            s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2468|  12.5k|            s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 2469|       |
 2470|       |            /* store 8 8-bit output values  */
 2471|       |            /* Store the output pixels of row 2*/
 2472|  12.5k|            _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2473|       |
 2474|  12.5k|            pu1_src += (8 * src_strd);
 2475|  12.5k|            pi2_dst += (4 * dst_strd);
 2476|       |
 2477|  44.2k|            for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (2477:26): [True: 31.7k, False: 12.5k]
  ------------------
 2478|  31.7k|            {
 2479|       |
 2480|  31.7k|                PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2481|  31.7k|                PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2482|  31.7k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2483|  31.7k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  31.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 2484|       |
 2485|  31.7k|                s3_0_16x8b = s3_2_16x8b;
 2486|  31.7k|                s3_1_16x8b = s3_3_16x8b;
 2487|  31.7k|                s3_2_16x8b = s3_4_16x8b;
 2488|       |
 2489|  31.7k|                s0_8x16b = _mm_maddubs_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2490|  31.7k|                s1_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2491|  31.7k|                s2_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2492|       |
 2493|       |                /*load 8 pixel values from (cur_row + 4)th row*/
 2494|  31.7k|                s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2495|       |
 2496|  31.7k|                s3_3_16x8b = _mm_unpacklo_epi8(s2_10_16x8b, s2_0_16x8b);
 2497|  31.7k|                s3_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2498|       |
 2499|  31.7k|                s4_0_16x8b = s4_2_16x8b;
 2500|  31.7k|                s4_1_16x8b = s4_3_16x8b;
 2501|  31.7k|                s4_2_16x8b = s4_4_16x8b;
 2502|       |
 2503|  31.7k|                s4_8x16b = _mm_add_epi16(s0_8x16b, s1_8x16b);
 2504|  31.7k|                s5_8x16b = _mm_add_epi16(s2_8x16b, s3_8x16b);
 2505|  31.7k|                s6_8x16b = _mm_add_epi16(s4_8x16b, s5_8x16b);
 2506|       |
 2507|       |                /* store 8 8-bit output values  */
 2508|       |                /* Store the output pixels of row 4*/
 2509|  31.7k|                _mm_storel_epi64((__m128i *)(pi2_dst), s6_8x16b);
 2510|       |
 2511|       |                /* row + 2*/
 2512|  31.7k|                s20_8x16b = _mm_maddubs_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2513|  31.7k|                s21_8x16b = _mm_maddubs_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2514|  31.7k|                s22_8x16b = _mm_maddubs_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2515|       |
 2516|       |                /*load 8 pixel values from (cur_row + 5)th row*/
 2517|  31.7k|                s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 2518|       |
 2519|       |                /*load 8 pixel values from (cur_row + 6)th row*/
 2520|  31.7k|                s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 2521|       |
 2522|       |                /*unpacking (cur_row + 5)th row and (cur_row + 6)th row*/
 2523|  31.7k|                s3_4_16x8b = _mm_unpacklo_epi8(s2_1_16x8b, s2_2_16x8b);
 2524|       |
 2525|  31.7k|                s23_8x16b = _mm_maddubs_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2526|       |
 2527|  31.7k|                s24_8x16b = _mm_add_epi16(s20_8x16b, s21_8x16b);
 2528|  31.7k|                s25_8x16b = _mm_add_epi16(s22_8x16b, s23_8x16b);
 2529|  31.7k|                s26_8x16b = _mm_add_epi16(s24_8x16b, s25_8x16b);
 2530|       |
 2531|       |                /* store 8 8-bit output values  */
 2532|       |                /* Store the output pixels of (cur_row+2)*/
 2533|  31.7k|                _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s26_8x16b);
 2534|       |
 2535|       |
 2536|       |                /*row + 1*/
 2537|  31.7k|                s10_8x16b = _mm_maddubs_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2538|  31.7k|                s11_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2539|  31.7k|                s12_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2540|       |
 2541|       |                /*unpacking (cur_row + 4)th row and (cur_row + 5)th row*/
 2542|  31.7k|                s4_3_16x8b = _mm_unpacklo_epi8(s2_0_16x8b, s2_1_16x8b);
 2543|  31.7k|                s13_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2544|       |
 2545|  31.7k|                s14_8x16b = _mm_add_epi16(s10_8x16b, s11_8x16b);
 2546|  31.7k|                s15_8x16b = _mm_add_epi16(s12_8x16b, s13_8x16b);
 2547|  31.7k|                s16_8x16b = _mm_add_epi16(s14_8x16b, s15_8x16b);
 2548|       |
 2549|       |                /* store 8 8-bit output values  */
 2550|       |                /* Store the output pixels of (cur_row + 1)*/
 2551|  31.7k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s16_8x16b);
 2552|       |
 2553|       |
 2554|       |                /* row + 3*/
 2555|  31.7k|                s30_8x16b = _mm_maddubs_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2556|  31.7k|                s31_8x16b = _mm_maddubs_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2557|  31.7k|                s32_8x16b = _mm_maddubs_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2558|       |
 2559|       |                /*load 8 pixel values from (cur_row + 7)th row*/
 2560|  31.7k|                s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 2561|       |
 2562|       |                /*unpacking (cur_row + 6)th row and (cur_row + 7)th row*/
 2563|  31.7k|                s4_4_16x8b = _mm_unpacklo_epi8(s2_2_16x8b, s2_3_16x8b);
 2564|       |
 2565|  31.7k|                s33_8x16b = _mm_maddubs_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2566|       |
 2567|  31.7k|                s34_8x16b = _mm_add_epi16(s30_8x16b, s31_8x16b);
 2568|  31.7k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s33_8x16b);
 2569|  31.7k|                s36_8x16b = _mm_add_epi16(s34_8x16b, s35_8x16b);
 2570|       |
 2571|       |                /* store 8 8-bit output values  */
 2572|       |                /* Store the output pixels of (cur_row+3)*/
 2573|  31.7k|                _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s36_8x16b);
 2574|       |
 2575|  31.7k|                s2_10_16x8b = s2_3_16x8b;
 2576|       |
 2577|  31.7k|                pu1_src += 4 * src_strd; /* pointer update */
 2578|  31.7k|                pi2_dst += 4 * dst_strd; /* pointer update */
 2579|  31.7k|            }
 2580|  12.5k|        }
 2581|  11.3k|    }
 2582|  4.22M|}
ihevc_inter_pred_luma_vert_w16inp_ssse3:
 2632|  2.01M|{
 2633|  2.01M|    WORD32 row, col;
 2634|  2.01M|    WORD16 *pi2_src_copy;
 2635|  2.01M|    UWORD8 *pu1_dst_copy;
 2636|  2.01M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 2637|  2.01M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b, s8_8x16b, s9_8x16b;
 2638|  2.01M|    __m128i s2_0_16x8b, s2_1_16x8b, s2_2_16x8b, s2_3_16x8b, s2_4_16x8b, s2_5_16x8b, s2_6_16x8b, s2_7_16x8b, s2_8_16x8b, s2_9_16x8b, s2_10_16x8b;
 2639|  2.01M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
 2640|  2.01M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
 2641|  2.01M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b, s18_8x16b, s19_8x16b;
 2642|  2.01M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b, s28_8x16b, s29_8x16b;
 2643|  2.01M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b, s38_8x16b, s39_8x16b;
 2644|       |
 2645|  2.01M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b, sign_reg;
 2646|       |
 2647|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 2648|  2.01M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 2649|       |
 2650|  2.01M|    zero_8x16b = _mm_setzero_si128();
 2651|  2.01M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 2652|  2.01M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 2653|       |
 2654|  2.01M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 2655|  2.01M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 2656|       |
 2657|  2.01M|    coeff4_5_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(2, 2, 2, 2));  /* pi1_coeff[4] */
 2658|  2.01M|    coeff6_7_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(3, 3, 3, 3));  /* pi1_coeff[4] */
 2659|       |
 2660|       |
 2661|       |/* seting values in register */
 2662|  2.01M|    offset_8x16b = _mm_set1_epi32(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  2.01M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  2.01M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  2.01M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2663|  2.01M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
 2664|  2.01M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
 2665|       |
 2666|       |
 2667|  2.01M|    pi2_src_copy = pi2_src;
 2668|  2.01M|    pu1_dst_copy = pu1_dst;
 2669|       |
 2670|       |/*  outer for loop starts from here */
 2671|  6.12M|    for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (2671:18): [True: 4.10M, False: 2.01M]
  ------------------
 2672|  4.10M|    {
 2673|       |
 2674|  4.10M|        pi2_src = pi2_src_copy + col;
 2675|  4.10M|        pu1_dst = pu1_dst_copy + col;
 2676|       |
 2677|       |        /*load 4 pixel values */
 2678|  4.10M|        s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-3 * src_strd)));
 2679|       |
 2680|       |        /*load 4 pixel values */
 2681|  4.10M|        s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-2 * src_strd)));
 2682|       |
 2683|  4.10M|        s3_0_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 2684|       |
 2685|  4.10M|        s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2686|       |
 2687|       |        /*load 4 pixel values */
 2688|  4.10M|        s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 2689|       |
 2690|       |        /*load 4 pixel values */
 2691|  4.10M|        s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 2692|       |
 2693|  4.10M|        s3_1_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 2694|       |
 2695|  4.10M|        s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2696|       |
 2697|       |        /*load 4 pixel values */
 2698|  4.10M|        s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 2699|       |
 2700|       |        /*load 4 pixel values */
 2701|  4.10M|        s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 2702|       |
 2703|  4.10M|        s3_2_16x8b = _mm_unpacklo_epi16(s2_4_16x8b, s2_5_16x8b);
 2704|       |
 2705|  4.10M|        s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2706|       |
 2707|       |        /*load 4 pixel values */
 2708|  4.10M|        s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 2709|       |
 2710|       |        /*load 4 pixel values */
 2711|  4.10M|        s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (4 * src_strd)));
 2712|       |
 2713|  4.10M|        s3_3_16x8b = _mm_unpacklo_epi16(s2_6_16x8b, s2_7_16x8b);
 2714|       |
 2715|  4.10M|        s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2716|       |
 2717|  4.10M|        s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 2718|  4.10M|        s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 2719|  4.10M|        s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 2720|       |
 2721|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2722|  4.10M|        s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2723|       |
 2724|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2725|  4.10M|        s9_8x16b = _mm_add_epi32(s8_8x16b, offset_8x16b);
 2726|       |
 2727|       |        /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2728|  4.10M|        s8_8x16b = _mm_srai_epi32(s9_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2729|       |
 2730|  4.10M|        s8_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 2731|       |
 2732|       |
 2733|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2734|  4.10M|        s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 2735|       |
 2736|  4.10M|        s4_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 2737|  4.10M|        s5_8x16b =  _mm_and_si128(s4_8x16b, mask_low_32b);
 2738|  4.10M|        s6_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 2739|  4.10M|        s9_8x16b = _mm_or_si128(s5_8x16b, s6_8x16b);
 2740|       |
 2741|       |        /* store 8 8-bit output values  */
 2742|       |        /* Store the output pixels of row 0*/
 2743|  4.10M|        _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 2744|       |
 2745|       |        /* ROW 2*/
 2746|  4.10M|        s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2747|  4.10M|        s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2748|  4.10M|        s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2749|       |
 2750|       |        /*load 4 pixel values */
 2751|  4.10M|        s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (5 * src_strd)));
 2752|       |
 2753|       |        /*load 4 pixel values */
 2754|  4.10M|        s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (6 * src_strd)));
 2755|       |
 2756|  4.10M|        s3_4_16x8b = _mm_unpacklo_epi16(s2_8_16x8b, s2_9_16x8b);
 2757|       |
 2758|  4.10M|        s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2759|       |
 2760|  4.10M|        s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 2761|  4.10M|        s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 2762|  4.10M|        s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 2763|       |
 2764|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2765|  4.10M|        s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2766|       |
 2767|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2768|  4.10M|        s29_8x16b = _mm_add_epi32(s28_8x16b, offset_8x16b);
 2769|       |
 2770|       |        /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2771|  4.10M|        s28_8x16b = _mm_srai_epi32(s29_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2772|       |
 2773|  4.10M|        s28_8x16b = _mm_packs_epi32(s28_8x16b, zero_8x16b);
 2774|       |
 2775|       |
 2776|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2777|  4.10M|        s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 2778|       |
 2779|  4.10M|        s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 2780|  4.10M|        s25_8x16b =  _mm_and_si128(s24_8x16b, mask_low_32b);
 2781|  4.10M|        s26_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 2782|  4.10M|        s29_8x16b = _mm_or_si128(s25_8x16b, s26_8x16b);
 2783|       |
 2784|       |        /* store 8 8-bit output values  */
 2785|       |        /* Store the output pixels of row 2*/
 2786|  4.10M|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
 2787|       |
 2788|       |
 2789|       |        /*ROW 1*/
 2790|  4.10M|        s4_0_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 2791|       |
 2792|  4.10M|        s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2793|       |
 2794|  4.10M|        s4_1_16x8b = _mm_unpacklo_epi16(s2_3_16x8b, s2_4_16x8b);
 2795|       |
 2796|  4.10M|        s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2797|       |
 2798|  4.10M|        s4_2_16x8b = _mm_unpacklo_epi16(s2_5_16x8b, s2_6_16x8b);
 2799|       |
 2800|  4.10M|        s12_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2801|       |
 2802|  4.10M|        s4_3_16x8b = _mm_unpacklo_epi16(s2_7_16x8b, s2_8_16x8b);
 2803|       |
 2804|  4.10M|        s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2805|       |
 2806|  4.10M|        s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 2807|  4.10M|        s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 2808|  4.10M|        s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 2809|       |
 2810|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2811|  4.10M|        s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2812|       |
 2813|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2814|  4.10M|        s19_8x16b = _mm_add_epi32(s18_8x16b, offset_8x16b);
 2815|       |
 2816|       |        /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2817|  4.10M|        s18_8x16b = _mm_srai_epi32(s19_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2818|       |
 2819|  4.10M|        s18_8x16b = _mm_packs_epi32(s18_8x16b, zero_8x16b);
 2820|       |
 2821|       |
 2822|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2823|  4.10M|        s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 2824|       |
 2825|  4.10M|        s14_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (dst_strd)));
 2826|  4.10M|        s15_8x16b =  _mm_and_si128(s14_8x16b, mask_low_32b);
 2827|  4.10M|        s16_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 2828|  4.10M|        s19_8x16b = _mm_or_si128(s15_8x16b, s16_8x16b);
 2829|       |
 2830|       |        /* store 8 8-bit output values  */
 2831|       |        /* Store the output pixels of row 1*/
 2832|  4.10M|        _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd)), s19_8x16b);
 2833|       |
 2834|       |
 2835|       |        /* ROW 3*/
 2836|  4.10M|        s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 2837|  4.10M|        s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 2838|  4.10M|        s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 2839|       |
 2840|       |        /*load 4 pixel values */
 2841|  4.10M|        s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (7 * src_strd)));
 2842|       |
 2843|  4.10M|        s4_4_16x8b = _mm_unpacklo_epi16(s2_9_16x8b, s2_10_16x8b);
 2844|       |
 2845|  4.10M|        s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 2846|       |
 2847|  4.10M|        s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 2848|  4.10M|        s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 2849|  4.10M|        s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 2850|       |
 2851|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2852|  4.10M|        s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2853|       |
 2854|       |
 2855|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2856|  4.10M|        s39_8x16b = _mm_add_epi32(s38_8x16b, offset_8x16b);
 2857|       |
 2858|       |        /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2859|  4.10M|        s38_8x16b = _mm_srai_epi32(s39_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.10M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.10M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2860|       |
 2861|  4.10M|        s38_8x16b = _mm_packs_epi32(s38_8x16b, zero_8x16b);
 2862|       |
 2863|       |
 2864|       |        /* i2_tmp = CLIP_U8(i2_tmp);*/
 2865|  4.10M|        s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 2866|       |
 2867|  4.10M|        s34_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 2868|  4.10M|        s35_8x16b =  _mm_and_si128(s34_8x16b, mask_low_32b);
 2869|  4.10M|        s36_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 2870|  4.10M|        s39_8x16b = _mm_or_si128(s35_8x16b, s36_8x16b);
 2871|       |
 2872|       |        /* store 8 8-bit output values  */
 2873|       |        /* Store the output pixels of row 2*/
 2874|  4.10M|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
 2875|       |
 2876|  4.10M|        pi2_src += (8 * src_strd);
 2877|  4.10M|        pu1_dst += (4 * dst_strd);
 2878|       |
 2879|  9.05M|        for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (2879:22): [True: 4.94M, False: 4.10M]
  ------------------
 2880|  4.94M|        {
 2881|       |
 2882|  4.94M|            s3_0_16x8b = s3_2_16x8b;
 2883|  4.94M|            s3_1_16x8b = s3_3_16x8b;
 2884|  4.94M|            s3_2_16x8b = s3_4_16x8b;
 2885|       |
 2886|  4.94M|            s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 2887|  4.94M|            s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 2888|  4.94M|            s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 2889|       |
 2890|       |            /*load 4 pixel values from (cur_row + 4)th row*/
 2891|  4.94M|            s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src));
 2892|       |
 2893|  4.94M|            s3_3_16x8b = _mm_unpacklo_epi16(s2_10_16x8b, s2_0_16x8b);
 2894|  4.94M|            s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 2895|       |
 2896|  4.94M|            s4_0_16x8b = s4_2_16x8b;
 2897|  4.94M|            s4_1_16x8b = s4_3_16x8b;
 2898|  4.94M|            s4_2_16x8b = s4_4_16x8b;
 2899|       |
 2900|  4.94M|            s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 2901|  4.94M|            s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 2902|  4.94M|            s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 2903|       |
 2904|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2905|  4.94M|            s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2906|       |
 2907|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2908|  4.94M|            s9_8x16b = _mm_add_epi32(s8_8x16b, offset_8x16b);
 2909|       |
 2910|       |            /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2911|  4.94M|            s8_8x16b = _mm_srai_epi32(s9_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2912|       |
 2913|  4.94M|            s8_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 2914|       |
 2915|       |
 2916|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 2917|  4.94M|            s9_8x16b = _mm_packus_epi16(s8_8x16b, zero_8x16b);
 2918|       |
 2919|  4.94M|            s4_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 2920|  4.94M|            s5_8x16b =  _mm_and_si128(s4_8x16b, mask_low_32b);
 2921|  4.94M|            s6_8x16b =  _mm_and_si128(s9_8x16b, mask_high_96b);
 2922|  4.94M|            s9_8x16b = _mm_or_si128(s5_8x16b, s6_8x16b);
 2923|       |
 2924|       |            /* store 8 8-bit output values  */
 2925|       |            /* Store the output pixels of row 4*/
 2926|  4.94M|            _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 2927|       |
 2928|       |/* row + 2*/
 2929|  4.94M|            s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 2930|  4.94M|            s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 2931|  4.94M|            s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 2932|       |
 2933|       |            /*load 4 pixel values from (cur_row + 5)th row*/
 2934|  4.94M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + src_strd));
 2935|       |
 2936|       |            /*load 4 pixel values from (cur_row + 6)th row*/
 2937|  4.94M|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 2938|       |
 2939|       |            /*unpacking (cur_row + 5)th row and (cur_row + 6)th row*/
 2940|  4.94M|            s3_4_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 2941|       |
 2942|  4.94M|            s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 2943|       |
 2944|  4.94M|            s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 2945|  4.94M|            s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 2946|  4.94M|            s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 2947|       |
 2948|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2949|  4.94M|            s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2950|       |
 2951|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2952|  4.94M|            s29_8x16b = _mm_add_epi32(s28_8x16b, offset_8x16b);
 2953|       |
 2954|       |            /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2955|  4.94M|            s28_8x16b = _mm_srai_epi32(s29_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2956|       |
 2957|  4.94M|            s28_8x16b = _mm_packs_epi32(s28_8x16b, zero_8x16b);
 2958|       |
 2959|       |
 2960|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 2961|  4.94M|            s29_8x16b = _mm_packus_epi16(s28_8x16b, zero_8x16b);
 2962|       |
 2963|  4.94M|            s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (2 * dst_strd)));
 2964|  4.94M|            s25_8x16b =  _mm_and_si128(s24_8x16b, mask_low_32b);
 2965|  4.94M|            s26_8x16b =  _mm_and_si128(s29_8x16b, mask_high_96b);
 2966|  4.94M|            s29_8x16b = _mm_or_si128(s25_8x16b, s26_8x16b);
 2967|       |
 2968|       |            /* store 8 8-bit output values  */
 2969|       |            /* Store the output pixels of (cur_row+2)*/
 2970|  4.94M|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), s29_8x16b);
 2971|       |
 2972|       |
 2973|       |/*row + 1*/
 2974|  4.94M|            s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 2975|  4.94M|            s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 2976|  4.94M|            s12_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff4_5_8x16b);
 2977|       |
 2978|       |            /*unpacking (cur_row + 4)th row and (cur_row + 5)th row*/
 2979|  4.94M|            s4_3_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 2980|  4.94M|            s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 2981|       |
 2982|  4.94M|            s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 2983|  4.94M|            s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 2984|  4.94M|            s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 2985|       |
 2986|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2987|  4.94M|            s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2988|       |
 2989|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 2990|  4.94M|            s19_8x16b = _mm_add_epi32(s18_8x16b, offset_8x16b);
 2991|       |
 2992|       |            /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 2993|  4.94M|            s18_8x16b = _mm_srai_epi32(s19_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2994|       |
 2995|  4.94M|            s18_8x16b = _mm_packs_epi32(s18_8x16b, zero_8x16b);
 2996|       |
 2997|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 2998|  4.94M|            s19_8x16b = _mm_packus_epi16(s18_8x16b, zero_8x16b);
 2999|       |
 3000|  4.94M|            s14_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 3001|  4.94M|            s15_8x16b =  _mm_and_si128(s14_8x16b, mask_low_32b);
 3002|  4.94M|            s16_8x16b =  _mm_and_si128(s19_8x16b, mask_high_96b);
 3003|  4.94M|            s19_8x16b = _mm_or_si128(s15_8x16b, s16_8x16b);
 3004|       |
 3005|       |            /* store 8 8-bit output values  */
 3006|       |            /* Store the output pixels of (cur_row + 1)*/
 3007|  4.94M|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s19_8x16b);
 3008|       |
 3009|       |
 3010|       |/* row + 3*/
 3011|  4.94M|            s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 3012|  4.94M|            s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 3013|  4.94M|            s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 3014|       |
 3015|       |            /*load 4 pixel values from (cur_row + 7)th row*/
 3016|  4.94M|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 3017|       |
 3018|       |            /*unpacking (cur_row + 6)th row and (cur_row + 7)th row*/
 3019|  4.94M|            s4_4_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 3020|       |
 3021|  4.94M|            s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 3022|       |
 3023|  4.94M|            s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 3024|  4.94M|            s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 3025|  4.94M|            s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 3026|       |
 3027|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3028|  4.94M|            s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3029|       |
 3030|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3031|  4.94M|            s39_8x16b = _mm_add_epi32(s38_8x16b, offset_8x16b);
 3032|       |
 3033|       |            /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3034|  4.94M|            s38_8x16b = _mm_srai_epi32(s39_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  4.94M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  4.94M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3035|       |
 3036|  4.94M|            s38_8x16b = _mm_packs_epi32(s38_8x16b, zero_8x16b);
 3037|       |
 3038|       |
 3039|       |            /* i2_tmp = CLIP_U8(i2_tmp);*/
 3040|  4.94M|            s39_8x16b = _mm_packus_epi16(s38_8x16b, zero_8x16b);
 3041|       |
 3042|  4.94M|            s34_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + (3 * dst_strd)));
 3043|  4.94M|            s35_8x16b =  _mm_and_si128(s34_8x16b, mask_low_32b);
 3044|  4.94M|            s36_8x16b =  _mm_and_si128(s39_8x16b, mask_high_96b);
 3045|  4.94M|            s39_8x16b = _mm_or_si128(s35_8x16b, s36_8x16b);
 3046|       |
 3047|       |            /* store 8 8-bit output values  */
 3048|       |            /* Store the output pixels of (cur_row+3)*/
 3049|  4.94M|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), s39_8x16b);
 3050|       |
 3051|  4.94M|            s2_10_16x8b = s2_3_16x8b;
 3052|       |
 3053|  4.94M|            pi2_src += 4 * src_strd; /* pointer update */
 3054|  4.94M|            pu1_dst += 4 * dst_strd; /* pointer update */
 3055|  4.94M|        }
 3056|  4.10M|    }
 3057|       |
 3058|  2.01M|}
ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3:
 3109|  3.88M|{
 3110|  3.88M|    WORD32 row, col;
 3111|  3.88M|    WORD16 *pi2_src_copy;
 3112|  3.88M|    WORD16 *pi2_dst_copy;
 3113|  3.88M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b, coeff6_7_8x16b;
 3114|  3.88M|    __m128i s0_8x16b, s1_8x16b, s2_8x16b, s3_8x16b, s4_8x16b, s5_8x16b, s6_8x16b, s8_8x16b, s9_8x16b;
 3115|  3.88M|    __m128i s2_0_16x8b, s2_1_16x8b, s2_2_16x8b, s2_3_16x8b, s2_4_16x8b, s2_5_16x8b, s2_6_16x8b, s2_7_16x8b, s2_8_16x8b, s2_9_16x8b, s2_10_16x8b;
 3116|  3.88M|    __m128i s3_0_16x8b, s3_1_16x8b, s3_2_16x8b, s3_3_16x8b, s3_4_16x8b;
 3117|  3.88M|    __m128i s4_0_16x8b, s4_1_16x8b, s4_2_16x8b, s4_3_16x8b, s4_4_16x8b;
 3118|  3.88M|    __m128i s10_8x16b, s11_8x16b, s12_8x16b, s13_8x16b, s14_8x16b, s15_8x16b, s16_8x16b, s18_8x16b, s19_8x16b;
 3119|  3.88M|    __m128i s20_8x16b, s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b, s26_8x16b, s28_8x16b, s29_8x16b;
 3120|  3.88M|    __m128i s30_8x16b, s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b, s36_8x16b, s38_8x16b, s39_8x16b;
 3121|       |
 3122|  3.88M|    __m128i zero_8x16b, offset_8x16b, sign_reg;
 3123|       |
 3124|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 3125|  3.88M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 3126|       |
 3127|  3.88M|    zero_8x16b = _mm_setzero_si128();
 3128|  3.88M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 3129|  3.88M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 3130|       |
 3131|  3.88M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 3132|  3.88M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 3133|       |
 3134|  3.88M|    coeff4_5_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(2, 2, 2, 2));  /* pi1_coeff[4] */
 3135|  3.88M|    coeff6_7_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(3, 3, 3, 3));  /* pi1_coeff[4] */
 3136|       |
 3137|       |
 3138|       |/* seting values in register */
 3139|  3.88M|    offset_8x16b = _mm_set1_epi32(OFFSET14); /* for offset addition */
  ------------------
  |  |   43|  3.88M|#define OFFSET14 (1 << (14 - 1))
  ------------------
 3140|       |
 3141|  3.88M|    pi2_src_copy = pi2_src;
 3142|  3.88M|    pi2_dst_copy = pi2_dst;
 3143|       |
 3144|       |/*  outer for loop starts from here */
 3145|  12.0M|    for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (3145:18): [True: 8.17M, False: 3.88M]
  ------------------
 3146|  8.17M|    {
 3147|       |
 3148|  8.17M|        pi2_src = pi2_src_copy + col;
 3149|  8.17M|        pi2_dst = pi2_dst_copy + col;
 3150|       |
 3151|       |        /*load 4 pixel values*/
 3152|  8.17M|        s2_0_16x8b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-3 * src_strd)));
 3153|       |
 3154|       |        /*load 4 pixel values*/
 3155|  8.17M|        s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-2 * src_strd)));
 3156|       |
 3157|  8.17M|        s3_0_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 3158|       |
 3159|  8.17M|        s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 3160|       |
 3161|       |        /*load 4 pixel values*/
 3162|  8.17M|        s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 3163|       |
 3164|       |        /*load 4 pixel values*/
 3165|  8.17M|        s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 3166|       |
 3167|  8.17M|        s3_1_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 3168|       |
 3169|  8.17M|        s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 3170|       |
 3171|       |        /*load 4 pixel values*/
 3172|  8.17M|        s2_4_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 3173|       |
 3174|       |        /*load 4 pixel values*/
 3175|  8.17M|        s2_5_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 3176|       |
 3177|  8.17M|        s3_2_16x8b = _mm_unpacklo_epi16(s2_4_16x8b, s2_5_16x8b);
 3178|       |
 3179|  8.17M|        s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 3180|       |
 3181|       |        /*load 4 pixel values*/
 3182|  8.17M|        s2_6_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 3183|       |
 3184|       |        /*load 4 pixel values*/
 3185|  8.17M|        s2_7_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (4 * src_strd)));
 3186|       |
 3187|  8.17M|        s3_3_16x8b = _mm_unpacklo_epi16(s2_6_16x8b, s2_7_16x8b);
 3188|       |
 3189|  8.17M|        s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 3190|       |
 3191|  8.17M|        s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 3192|  8.17M|        s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 3193|  8.17M|        s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 3194|       |
 3195|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3196|  8.17M|        s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  8.17M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  8.17M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3197|       |
 3198|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3199|  8.17M|        s9_8x16b = _mm_sub_epi32(s8_8x16b, offset_8x16b);
 3200|       |
 3201|  8.17M|        s8_8x16b = _mm_packs_epi32(s9_8x16b, zero_8x16b);
 3202|       |
 3203|       |        /* store 8 8-bit output values  */
 3204|       |        /* Store the output pixels of row 0*/
 3205|  8.17M|        _mm_storel_epi64((__m128i *)(pi2_dst), s8_8x16b);
 3206|       |
 3207|       |        /* ROW 2*/
 3208|  8.17M|        s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 3209|  8.17M|        s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 3210|  8.17M|        s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 3211|       |
 3212|       |        /*load 4 pixel values*/
 3213|  8.17M|        s2_8_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (5 * src_strd)));
 3214|       |
 3215|       |        /*load 4 pixel values*/
 3216|  8.17M|        s2_9_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (6 * src_strd)));
 3217|       |
 3218|  8.17M|        s3_4_16x8b = _mm_unpacklo_epi16(s2_8_16x8b, s2_9_16x8b);
 3219|       |
 3220|  8.17M|        s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 3221|       |
 3222|  8.17M|        s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 3223|  8.17M|        s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 3224|  8.17M|        s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 3225|       |
 3226|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3227|  8.17M|        s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  8.17M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  8.17M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3228|       |
 3229|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3230|  8.17M|        s29_8x16b = _mm_sub_epi32(s28_8x16b, offset_8x16b);
 3231|       |
 3232|  8.17M|        s28_8x16b = _mm_packs_epi32(s29_8x16b, zero_8x16b);
 3233|       |
 3234|       |        /* store 8 8-bit output values  */
 3235|       |        /* Store the output pixels of row 2*/
 3236|  8.17M|        _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s28_8x16b);
 3237|       |
 3238|       |
 3239|       |        /*ROW 1*/
 3240|  8.17M|        s4_0_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 3241|       |
 3242|  8.17M|        s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 3243|       |
 3244|  8.17M|        s4_1_16x8b = _mm_unpacklo_epi16(s2_3_16x8b, s2_4_16x8b);
 3245|       |
 3246|  8.17M|        s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 3247|       |
 3248|  8.17M|        s4_2_16x8b = _mm_unpacklo_epi16(s2_5_16x8b, s2_6_16x8b);
 3249|       |
 3250|  8.17M|        s12_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff4_5_8x16b);
 3251|       |
 3252|  8.17M|        s4_3_16x8b = _mm_unpacklo_epi16(s2_7_16x8b, s2_8_16x8b);
 3253|       |
 3254|  8.17M|        s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 3255|       |
 3256|  8.17M|        s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 3257|  8.17M|        s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 3258|  8.17M|        s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 3259|       |
 3260|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3261|  8.17M|        s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  8.17M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  8.17M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3262|       |
 3263|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3264|  8.17M|        s19_8x16b = _mm_sub_epi32(s18_8x16b, offset_8x16b);
 3265|       |
 3266|  8.17M|        s18_8x16b = _mm_packs_epi32(s19_8x16b, zero_8x16b);
 3267|       |
 3268|       |        /* store 8 8-bit output values  */
 3269|       |        /* Store the output pixels of row 1*/
 3270|  8.17M|        _mm_storel_epi64((__m128i *)(pi2_dst + (dst_strd)), s18_8x16b);
 3271|       |
 3272|       |
 3273|       |        /* ROW 3*/
 3274|  8.17M|        s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 3275|  8.17M|        s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 3276|  8.17M|        s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 3277|       |
 3278|       |        /*load 4 pixel values*/
 3279|  8.17M|        s2_10_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (7 * src_strd)));
 3280|       |
 3281|  8.17M|        s4_4_16x8b = _mm_unpacklo_epi16(s2_9_16x8b, s2_10_16x8b);
 3282|       |
 3283|  8.17M|        s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 3284|       |
 3285|  8.17M|        s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 3286|  8.17M|        s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 3287|  8.17M|        s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 3288|       |
 3289|       |        /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3290|  8.17M|        s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  8.17M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  8.17M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3291|       |
 3292|       |
 3293|       |        /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3294|  8.17M|        s39_8x16b = _mm_sub_epi32(s38_8x16b, offset_8x16b);
 3295|       |
 3296|  8.17M|        s38_8x16b = _mm_packs_epi32(s39_8x16b, zero_8x16b);
 3297|       |
 3298|       |        /* store 8 8-bit output values  */
 3299|       |        /* Store the output pixels of row 2*/
 3300|  8.17M|        _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s38_8x16b);
 3301|       |
 3302|  8.17M|        pi2_src += (8 * src_strd);
 3303|  8.17M|        pi2_dst += (4 * dst_strd);
 3304|       |
 3305|  20.1M|        for(row = 4; row < ht; row += 4)
  ------------------
  |  Branch (3305:22): [True: 12.0M, False: 8.17M]
  ------------------
 3306|  12.0M|        {
 3307|       |
 3308|  12.0M|            s3_0_16x8b = s3_2_16x8b;
 3309|  12.0M|            s3_1_16x8b = s3_3_16x8b;
 3310|  12.0M|            s3_2_16x8b = s3_4_16x8b;
 3311|       |
 3312|  12.0M|            s0_8x16b = _mm_madd_epi16(s3_0_16x8b, coeff0_1_8x16b);
 3313|  12.0M|            s1_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff2_3_8x16b);
 3314|  12.0M|            s2_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff4_5_8x16b);
 3315|       |
 3316|       |            /*load 4 pixel values from (cur_row + 4)th row*/
 3317|  12.0M|            s2_0_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src));
 3318|       |
 3319|  12.0M|            s3_3_16x8b = _mm_unpacklo_epi16(s2_10_16x8b, s2_0_16x8b);
 3320|  12.0M|            s3_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff6_7_8x16b);
 3321|       |
 3322|  12.0M|            s4_0_16x8b = s4_2_16x8b;
 3323|  12.0M|            s4_1_16x8b = s4_3_16x8b;
 3324|  12.0M|            s4_2_16x8b = s4_4_16x8b;
 3325|       |
 3326|  12.0M|            s4_8x16b = _mm_add_epi32(s0_8x16b, s1_8x16b);
 3327|  12.0M|            s5_8x16b = _mm_add_epi32(s2_8x16b, s3_8x16b);
 3328|  12.0M|            s6_8x16b = _mm_add_epi32(s4_8x16b, s5_8x16b);
 3329|       |
 3330|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3331|  12.0M|            s8_8x16b = _mm_srai_epi32(s6_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  12.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  12.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3332|       |
 3333|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3334|  12.0M|            s9_8x16b = _mm_sub_epi32(s8_8x16b, offset_8x16b);
 3335|       |
 3336|  12.0M|            s8_8x16b = _mm_packs_epi32(s9_8x16b, zero_8x16b);
 3337|       |
 3338|       |            /* store 8 8-bit output values  */
 3339|       |            /* Store the output pixels of row 4*/
 3340|  12.0M|            _mm_storel_epi64((__m128i *)(pi2_dst), s8_8x16b);
 3341|       |
 3342|       |/* row + 2*/
 3343|  12.0M|            s20_8x16b = _mm_madd_epi16(s3_1_16x8b, coeff0_1_8x16b);
 3344|  12.0M|            s21_8x16b = _mm_madd_epi16(s3_2_16x8b, coeff2_3_8x16b);
 3345|  12.0M|            s22_8x16b = _mm_madd_epi16(s3_3_16x8b, coeff4_5_8x16b);
 3346|       |
 3347|       |            /*load 4 pixel values from (cur_row + 5)th row*/
 3348|  12.0M|            s2_1_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + src_strd));
 3349|       |
 3350|       |            /*load 4 pixel values from (cur_row + 6)th row*/
 3351|  12.0M|            s2_2_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 3352|       |
 3353|       |            /*unpacking (cur_row + 5)th row and (cur_row + 6)th row*/
 3354|  12.0M|            s3_4_16x8b = _mm_unpacklo_epi16(s2_1_16x8b, s2_2_16x8b);
 3355|       |
 3356|  12.0M|            s23_8x16b = _mm_madd_epi16(s3_4_16x8b, coeff6_7_8x16b);
 3357|       |
 3358|  12.0M|            s24_8x16b = _mm_add_epi32(s20_8x16b, s21_8x16b);
 3359|  12.0M|            s25_8x16b = _mm_add_epi32(s22_8x16b, s23_8x16b);
 3360|  12.0M|            s26_8x16b = _mm_add_epi32(s24_8x16b, s25_8x16b);
 3361|       |
 3362|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3363|  12.0M|            s28_8x16b = _mm_srai_epi32(s26_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  12.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  12.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3364|       |
 3365|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3366|  12.0M|            s29_8x16b = _mm_sub_epi32(s28_8x16b, offset_8x16b);
 3367|       |
 3368|  12.0M|            s28_8x16b = _mm_packs_epi32(s29_8x16b, zero_8x16b);
 3369|       |
 3370|       |            /* store 8 8-bit output values  */
 3371|       |            /* Store the output pixels of (cur_row+2)*/
 3372|  12.0M|            _mm_storel_epi64((__m128i *)(pi2_dst + (2 * dst_strd)), s28_8x16b);
 3373|       |
 3374|       |
 3375|       |/*row + 1*/
 3376|  12.0M|            s10_8x16b = _mm_madd_epi16(s4_0_16x8b, coeff0_1_8x16b);
 3377|  12.0M|            s11_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff2_3_8x16b);
 3378|  12.0M|            s12_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff4_5_8x16b);
 3379|       |
 3380|       |            /*unpacking (cur_row + 4)th row and (cur_row + 5)th row*/
 3381|  12.0M|            s4_3_16x8b = _mm_unpacklo_epi16(s2_0_16x8b, s2_1_16x8b);
 3382|  12.0M|            s13_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff6_7_8x16b);
 3383|       |
 3384|  12.0M|            s14_8x16b = _mm_add_epi32(s10_8x16b, s11_8x16b);
 3385|  12.0M|            s15_8x16b = _mm_add_epi32(s12_8x16b, s13_8x16b);
 3386|  12.0M|            s16_8x16b = _mm_add_epi32(s14_8x16b, s15_8x16b);
 3387|       |
 3388|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3389|  12.0M|            s18_8x16b = _mm_srai_epi32(s16_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  12.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  12.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3390|       |
 3391|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3392|  12.0M|            s19_8x16b = _mm_sub_epi32(s18_8x16b, offset_8x16b);
 3393|       |
 3394|  12.0M|            s18_8x16b = _mm_packs_epi32(s19_8x16b, zero_8x16b);
 3395|       |
 3396|       |            /* store 8 8-bit output values  */
 3397|       |            /* Store the output pixels of (cur_row + 1)*/
 3398|  12.0M|            _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s18_8x16b);
 3399|       |
 3400|       |
 3401|       |/* row + 3*/
 3402|  12.0M|            s30_8x16b = _mm_madd_epi16(s4_1_16x8b, coeff0_1_8x16b);
 3403|  12.0M|            s31_8x16b = _mm_madd_epi16(s4_2_16x8b, coeff2_3_8x16b);
 3404|  12.0M|            s32_8x16b = _mm_madd_epi16(s4_3_16x8b, coeff4_5_8x16b);
 3405|       |
 3406|       |            /*load 4 pixel values from (cur_row + 7)th row*/
 3407|  12.0M|            s2_3_16x8b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 3408|       |
 3409|       |            /*unpacking (cur_row + 6)th row and (cur_row + 7)th row*/
 3410|  12.0M|            s4_4_16x8b = _mm_unpacklo_epi16(s2_2_16x8b, s2_3_16x8b);
 3411|       |
 3412|  12.0M|            s33_8x16b = _mm_madd_epi16(s4_4_16x8b, coeff6_7_8x16b);
 3413|       |
 3414|  12.0M|            s34_8x16b = _mm_add_epi32(s30_8x16b, s31_8x16b);
 3415|  12.0M|            s35_8x16b = _mm_add_epi32(s32_8x16b, s33_8x16b);
 3416|  12.0M|            s36_8x16b = _mm_add_epi32(s34_8x16b, s35_8x16b);
 3417|       |
 3418|       |            /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3419|  12.0M|            s38_8x16b = _mm_srai_epi32(s36_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  12.0M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  12.0M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3420|       |
 3421|       |            /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 3422|  12.0M|            s39_8x16b = _mm_sub_epi32(s38_8x16b, offset_8x16b);
 3423|       |
 3424|  12.0M|            s38_8x16b = _mm_packs_epi32(s39_8x16b, zero_8x16b);
 3425|       |
 3426|       |            /* store 8 8-bit output values  */
 3427|       |            /* Store the output pixels of (cur_row+3)*/
 3428|  12.0M|            _mm_storel_epi64((__m128i *)(pi2_dst + (3 * dst_strd)), s38_8x16b);
 3429|       |
 3430|  12.0M|            s2_10_16x8b = s2_3_16x8b;
 3431|       |
 3432|  12.0M|            pi2_src += 4 * src_strd; /* pointer update */
 3433|  12.0M|            pi2_dst += 4 * dst_strd; /* pointer update */
 3434|  12.0M|        }
 3435|  8.17M|    }
 3436|       |
 3437|  3.88M|}
ihevc_inter_pred_chroma_copy_ssse3:
 3485|   761k|{
 3486|   761k|    WORD32 row, col;
 3487|   761k|    __m128i  s3, mask_4x32b;
 3488|   761k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   761k|#define UNUSED(x) ((void)(x))
  ------------------
 3489|   761k|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   761k|#define ASSERT(x) {}
  ------------------
 3490|   761k|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   761k|#define ASSERT(x) {}
  ------------------
 3491|       |
 3492|   761k|    mask_4x32b = _mm_set_epi32(0, 0, 0, 0x80808080); /* Mask register */
 3493|       |
 3494|       |/*  for loop starts from here */
 3495|   761k|    if(wd % 8 == 0)
  ------------------
  |  Branch (3495:8): [True: 29.5k, False: 732k]
  ------------------
 3496|  29.5k|    {
 3497|   212k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3497:22): [True: 183k, False: 29.5k]
  ------------------
 3498|   183k|        {
 3499|   183k|            int offset = 0;
 3500|   583k|            for(col = 0; col < 2 * wd; col += 16)
  ------------------
  |  Branch (3500:26): [True: 400k, False: 183k]
  ------------------
 3501|   400k|            {
 3502|       |/* row =0 */
 3503|       |
 3504|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 3505|   400k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]; */
 3506|       |                /* storing 16 8-bit output values */
 3507|   400k|                _mm_storeu_si128((__m128i *)(pu1_dst + offset), s3); /* pu1_dst[col] = pu1_src[col]; */
 3508|       |
 3509|       |/* row =1 */
 3510|       |                /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 3511|   400k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col]; */
 3512|       |                /* storing 8 8-bit output values */
 3513|   400k|                _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd + offset), s3); /* pu1_dst[col] = pu1_src[col]*/
 3514|       |
 3515|   400k|                offset += 16; /*To pointer update */
 3516|   400k|            } /*  inner for loop ends here(16-output values in single iteration) */
 3517|       |
 3518|   183k|            pu1_src += 2 * src_strd; /* pointer update */
 3519|   183k|            pu1_dst += 2 * dst_strd; /* pointer update */
 3520|   183k|        }
 3521|  29.5k|    }
 3522|   732k|    else if(wd % 4 == 0)
  ------------------
  |  Branch (3522:13): [True: 686k, False: 45.9k]
  ------------------
 3523|   686k|    {
 3524|  2.01M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3524:22): [True: 1.33M, False: 686k]
  ------------------
 3525|  1.33M|        {
 3526|  1.33M|            int offset = 0;
 3527|  2.67M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (3527:26): [True: 1.33M, False: 1.33M]
  ------------------
 3528|  1.33M|            {
 3529|       |/* row =0  */
 3530|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 3531|  1.33M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]; */
 3532|       |                /* storing 8 8-bit output values */
 3533|  1.33M|                _mm_storel_epi64((__m128i *)(pu1_dst + offset), s3); /* pu1_dst[col] = pu1_src[col]; */
 3534|       |/* row =1 */
 3535|       |                /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 3536|  1.33M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset)); /* pu1_src[col]; */
 3537|       |                /* storing 8 8-bit output values */
 3538|  1.33M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), s3); /* pu1_dst[col] = pu1_src[col]; */
 3539|       |
 3540|  1.33M|                offset += 8; /* To pointer update */
 3541|  1.33M|            } /* inner for loop ends here(8-output values in single iteration) */
 3542|       |
 3543|  1.33M|            pu1_src += 2 * src_strd;  /* pointer update */
 3544|  1.33M|            pu1_dst += 2 * dst_strd;  /* pointer update */
 3545|  1.33M|        }
 3546|   686k|    }
 3547|  45.9k|    else
 3548|  45.9k|    {
 3549|   147k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3549:22): [True: 101k, False: 45.9k]
  ------------------
 3550|   101k|        {
 3551|   101k|            int offset = 0;
 3552|   212k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (3552:26): [True: 111k, False: 101k]
  ------------------
 3553|   111k|            {
 3554|       |/* row =0 */
 3555|   111k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 3556|       |                /* storing four 8-bit output values */
 3557|   111k|                _mm_maskmoveu_si128(s3, mask_4x32b, (char *)(pu1_dst + offset)); /* pu1_dst[col] = pu1_src[col]; */
 3558|       |/* row =1 */
 3559|       |                /* pu1_src[col] */
 3560|   111k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 3561|       |
 3562|       |                /* storing four 8-bit output values */
 3563|   111k|                _mm_maskmoveu_si128(s3, mask_4x32b, (char *)(pu1_dst + dst_strd + offset)); /* pu1_dst[col] = pu1_src[col]; */
 3564|       |
 3565|   111k|                offset += 4; /* To pointer update */
 3566|   111k|            } /*  inner for loop ends here(4-output values in single iteration) */
 3567|       |
 3568|   101k|            pu1_src += 2 * src_strd; /* pointer increment */
 3569|   101k|            pu1_dst += 2 * dst_strd; /* pointer increment */
 3570|   101k|        }
 3571|  45.9k|    }
 3572|   761k|}
ihevc_inter_pred_chroma_horz_ssse3:
 3620|  1.22M|{
 3621|  1.22M|    WORD32 row, col;
 3622|       |
 3623|  1.22M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, control_mask_1_8x16b, control_mask_2_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
 3624|  1.22M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
 3625|  1.22M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
 3626|  1.22M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b, res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b, res_temp7_8x16b;
 3627|  1.22M|    __m128i res_temp11_8x16b, res_temp12_8x16b, res_temp13_8x16b, res_temp14_8x16b, res_temp15_8x16b, res_temp16_8x16b, res_temp17_8x16b;
 3628|       |
 3629|  1.22M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.22M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3630|  1.22M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.22M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3631|  1.22M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.22M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3632|  1.22M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.22M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3633|  1.22M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.22M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3634|  1.22M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.22M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3635|       |
 3636|  1.22M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.22M|#define ASSERT(x) {}
  ------------------
 3637|       |
 3638|       |/* loading four 8-bit coefficients  */
 3639|  1.22M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 3640|       |
 3641|  1.22M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.22M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.22M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.22M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3642|  1.22M|    mask_low_32b = _mm_cmpeq_epi16(offset_8x16b, offset_8x16b);
 3643|  1.22M|    mask_high_96b = _mm_srli_si128(mask_low_32b, 12);
 3644|  1.22M|    mask_low_32b = _mm_slli_si128(mask_low_32b, 4);
 3645|       |
 3646|  1.22M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 3647|  1.22M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 3648|       |
 3649|  1.22M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 3650|  1.22M|    coeff2_3_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 3651|       |
 3652|       |/*  outer for loop starts from here */
 3653|  1.22M|    if(wd % 2 == 0 && wd % 4 != 0)
  ------------------
  |  Branch (3653:8): [True: 1.22M, False: 18.4E]
  |  Branch (3653:23): [True: 57.1k, False: 1.16M]
  ------------------
 3654|  57.1k|    {
 3655|       |
 3656|   180k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3656:22): [True: 123k, False: 57.1k]
  ------------------
 3657|   123k|        {
 3658|   123k|            int offset = 0;
 3659|       |
 3660|   123k|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   123k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3661|   123k|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   123k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3662|       |
 3663|       |
 3664|   266k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (3664:26): [True: 142k, False: 123k]
  ------------------
 3665|   142k|            {
 3666|       |
 3667|       |
 3668|       |                /*load 16 pixel values from row 0*/
 3669|   142k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + offset)); /* pu1_src[col + (i-1) * 2]*/
 3670|       |
 3671|       |                /*load 16 pixel values from row 1*/
 3672|   142k|                src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + src_strd + offset)); /* pu1_src[col + (i-1) * 2]*/
 3673|       |
 3674|       |                /*Derive the source pixels for processing the 2nd pixel*/
 3675|   142k|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3676|       |
 3677|   142k|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 3678|       |
 3679|       |                /*Derive the source pixels for processing the 3rd pixel*/
 3680|   142k|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 3681|       |
 3682|       |                /*Derive the source pixels for processing the 4th pixel*/
 3683|   142k|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 3684|       |
 3685|   142k|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 3686|       |
 3687|       |                /*Derive the source pixels for processing the 2nd pixel*/
 3688|   142k|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 3689|       |
 3690|   142k|                src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b);
 3691|       |
 3692|       |                /*Derive the source pixels for processing the 3rd pixel*/
 3693|   142k|                src_temp13_16x8b = _mm_srli_si128(src_temp11_16x8b, 4);
 3694|       |                /*Derive the source pixels for processing the 4th pixel*/
 3695|   142k|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 3696|       |
 3697|   142k|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 3698|       |
 3699|   142k|                res_temp1_8x16b = _mm_unpacklo_epi64(src_temp5_16x8b, src_temp15_16x8b);
 3700|   142k|                res_temp2_8x16b = _mm_unpacklo_epi64(src_temp6_16x8b, src_temp16_16x8b);
 3701|   142k|                res_temp11_8x16b = _mm_maddubs_epi16(res_temp1_8x16b, coeff0_1_8x16b);
 3702|   142k|                res_temp12_8x16b = _mm_maddubs_epi16(res_temp2_8x16b, coeff2_3_8x16b);
 3703|       |
 3704|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 3705|   142k|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 3706|       |
 3707|   142k|                res_temp14_8x16b = _mm_adds_epi16(res_temp13_8x16b, offset_8x16b);             /* row = 0 */
 3708|   142k|                res_temp15_8x16b = _mm_srai_epi16(res_temp14_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|   142k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   142k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3709|   142k|                res_temp13_8x16b = _mm_packus_epi16(res_temp15_8x16b, res_temp15_8x16b);       /* row = 0 */
 3710|       |
 3711|   142k|                res_temp3_8x16b = _mm_srli_si128(res_temp13_8x16b, 4);
 3712|       |
 3713|   142k|                res_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + offset));
 3714|   142k|                res_temp5_8x16b =  _mm_and_si128(res_temp4_8x16b, mask_low_32b);
 3715|   142k|                res_temp6_8x16b =  _mm_and_si128(res_temp13_8x16b, mask_high_96b);
 3716|   142k|                res_temp7_8x16b = _mm_or_si128(res_temp5_8x16b, res_temp6_8x16b);
 3717|       |
 3718|       |                /* store 4 16-bit values */
 3719|   142k|                _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp7_8x16b); /* pu1_dst[col] = i2_tmp_u  */
 3720|       |
 3721|   142k|                res_temp14_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd + offset));
 3722|   142k|                res_temp15_8x16b =  _mm_and_si128(res_temp14_8x16b, mask_low_32b);
 3723|   142k|                res_temp16_8x16b =  _mm_and_si128(res_temp3_8x16b, mask_high_96b);
 3724|   142k|                res_temp17_8x16b = _mm_or_si128(res_temp15_8x16b, res_temp16_8x16b);
 3725|       |
 3726|       |                /* store 4 16-bit values */
 3727|   142k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp17_8x16b); /* pu1_dst[col] = i2_tmp_u  */
 3728|       |
 3729|       |
 3730|   142k|                offset += 4; /* To pointer update*/
 3731|       |
 3732|   142k|            } /* inner loop ends here(8- output values in single iteration)*/
 3733|       |
 3734|   123k|            pu1_src += 2 * src_strd; /*pointer update*/
 3735|   123k|            pu1_dst += 2 * dst_strd; /*pointer update*/
 3736|   123k|        }
 3737|  57.1k|    }
 3738|  1.16M|    else
 3739|  1.16M|    {
 3740|       |
 3741|  3.52M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3741:22): [True: 2.36M, False: 1.16M]
  ------------------
 3742|  2.36M|        {
 3743|  2.36M|            int offset = 0;
 3744|       |
 3745|  2.36M|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.36M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3746|  2.36M|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.36M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3747|       |
 3748|       |
 3749|  4.97M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (3749:26): [True: 2.61M, False: 2.36M]
  ------------------
 3750|  2.61M|            {
 3751|       |
 3752|       |                /*load 16 pixel values from row 0*/
 3753|  2.61M|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + offset)); /* pu1_src[col + (i-1) * 2]*/
 3754|       |
 3755|       |                /*load 16 pixel values from row 1*/
 3756|  2.61M|                src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + src_strd + offset)); /* pu1_src[col + (i-1) * 2]*/
 3757|       |
 3758|       |                /*Derive the source pixels for processing the 2nd pixel*/
 3759|  2.61M|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3760|       |
 3761|  2.61M|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 3762|       |
 3763|       |                /*Derive the source pixels for processing the 3rd pixel*/
 3764|  2.61M|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 3765|       |
 3766|       |                /*Derive the source pixels for processing the 4th pixel*/
 3767|  2.61M|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 3768|       |
 3769|  2.61M|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 3770|       |
 3771|  2.61M|                res_temp1_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff0_1_8x16b);
 3772|  2.61M|                res_temp2_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff2_3_8x16b);
 3773|       |
 3774|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 3775|  2.61M|                res_temp3_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 3776|       |
 3777|  2.61M|                res_temp4_8x16b = _mm_adds_epi16(res_temp3_8x16b, offset_8x16b);             /* row = 0 */
 3778|  2.61M|                res_temp5_8x16b = _mm_srai_epi16(res_temp4_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|  2.61M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.61M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3779|  2.61M|                res_temp6_8x16b = _mm_packus_epi16(res_temp5_8x16b, res_temp5_8x16b);        /* row = 0 */
 3780|       |
 3781|       |                /* store 4 16-bit values */
 3782|  2.61M|                _mm_storel_epi64((__m128i *)(pu1_dst + offset), res_temp6_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 3783|       |
 3784|       |                /*Derive the source pixels for processing the 2nd pixel of row 1*/
 3785|  2.61M|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 3786|       |
 3787|  2.61M|                src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b);
 3788|       |
 3789|       |                /*Derive the source pixels for processing the 3rd pixel of row 1*/
 3790|  2.61M|                src_temp13_16x8b = _mm_srli_si128(src_temp11_16x8b, 4);
 3791|       |
 3792|       |                /*Derive the source pixels for processing the 4th pixel of row 1*/
 3793|  2.61M|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 3794|       |
 3795|  2.61M|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 3796|       |
 3797|  2.61M|                res_temp11_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff0_1_8x16b);
 3798|  2.61M|                res_temp12_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff2_3_8x16b);
 3799|       |
 3800|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 3801|  2.61M|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 3802|       |
 3803|  2.61M|                res_temp14_8x16b = _mm_adds_epi16(res_temp13_8x16b, offset_8x16b);             /* row = 0 */
 3804|  2.61M|                res_temp15_8x16b = _mm_srai_epi16(res_temp14_8x16b, SHIFT_14_MINUS_BIT_DEPTH); /* row = 0 */
  ------------------
  |  |   41|  2.61M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.61M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3805|  2.61M|                res_temp16_8x16b = _mm_packus_epi16(res_temp15_8x16b, res_temp15_8x16b);       /* row = 0 */
 3806|       |
 3807|       |                /* store 4 16-bit values */
 3808|  2.61M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + offset), res_temp16_8x16b); /* pu1_dst[col] = i2_tmp_u  */
 3809|       |
 3810|       |
 3811|  2.61M|                offset += 8; /* To pointer update*/
 3812|       |
 3813|  2.61M|            } /* inner loop ends here(8- output values in single iteration)*/
 3814|       |
 3815|  2.36M|            pu1_src += 2 * src_strd; /*pointer update*/
 3816|  2.36M|            pu1_dst += 2 * dst_strd; /*pointer update*/
 3817|  2.36M|        }
 3818|  1.16M|    }
 3819|  1.22M|}
ihevc_inter_pred_chroma_vert_ssse3:
 3868|  1.40M|{
 3869|  1.40M|    WORD32 row, col;
 3870|  1.40M|    UWORD8 *pu1_src_copy;
 3871|  1.40M|    UWORD8 *pu1_dst_copy;
 3872|  1.40M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 3873|  1.40M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
 3874|  1.40M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b;
 3875|  1.40M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 3876|  1.40M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b;
 3877|  1.40M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 3878|  1.40M|    __m128i s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b;
 3879|       |
 3880|  1.40M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.40M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3881|  1.40M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.40M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3882|  1.40M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.40M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3883|  1.40M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.40M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3884|  1.40M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.40M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3885|  1.40M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  1.40M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3886|       |
 3887|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 3888|  1.40M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 3889|       |
 3890|  1.40M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 3891|  1.40M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 3892|       |
 3893|  1.40M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 3894|  1.40M|    coeff2_3_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 3895|       |
 3896|       |
 3897|       |/*  seting  values in register */
 3898|  1.40M|    zero_8x16b = _mm_setzero_si128(); /* for saturated clipping */
 3899|  1.40M|    offset_8x16b = _mm_set1_epi16(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  1.40M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.40M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  1.40M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3900|  1.40M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
 3901|  1.40M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
 3902|       |
 3903|       |/*  outer for loop starts from here */
 3904|  1.40M|    if(wd % 8 == 0)
  ------------------
  |  Branch (3904:8): [True: 17.7k, False: 1.38M]
  ------------------
 3905|  17.7k|    { /* wd = multiple of 8 case */
 3906|       |
 3907|  17.7k|        pu1_src_copy = pu1_src;
 3908|  17.7k|        pu1_dst_copy = pu1_dst;
 3909|       |
 3910|  45.7k|        for(col = 0; col < 2 * wd; col += 16)
  ------------------
  |  Branch (3910:22): [True: 28.0k, False: 17.7k]
  ------------------
 3911|  28.0k|        {
 3912|       |
 3913|  28.0k|            pu1_src = pu1_src_copy + col;
 3914|  28.0k|            pu1_dst = pu1_dst_copy + col;
 3915|       |
 3916|       |
 3917|   246k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (3917:26): [True: 218k, False: 28.0k]
  ------------------
 3918|   218k|            {
 3919|       |
 3920|   218k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   218k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3921|   218k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   218k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 3922|       |
 3923|       |
 3924|       |                /*load 8 pixel values from -751:-768 pos. relative to cur. pos.*/
 3925|   218k|                s21_8x16b  = _mm_loadu_si128((__m128i *)(pu1_src + (-1 * src_strd)));
 3926|       |
 3927|       |                /*load 8 pixel values from -495:-512 pos. relative to cur. pos.*/
 3928|   218k|                s22_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (0 * src_strd)));
 3929|       |
 3930|       |
 3931|       |                /*load 8 pixel values from -239:-256 pos. relative to cur. pos.*/
 3932|   218k|                s23_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (1 * src_strd)));
 3933|       |
 3934|       |                /*load 8 pixel values from 15:0 pos. relative to cur. pos.*/
 3935|   218k|                s24_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (2 * src_strd)));
 3936|       |
 3937|   218k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 3938|       |
 3939|   218k|                s31_8x16b = _mm_unpackhi_epi8(s21_8x16b, s22_8x16b);
 3940|       |
 3941|   218k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 3942|       |
 3943|   218k|                s33_8x16b = _mm_unpackhi_epi8(s23_8x16b, s24_8x16b);
 3944|       |
 3945|   218k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 3946|       |
 3947|   218k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 3948|       |
 3949|   218k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 3950|       |
 3951|   218k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 3952|       |
 3953|   218k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 3954|       |
 3955|   218k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s34_8x16b);
 3956|       |
 3957|   218k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 3958|       |
 3959|   218k|                s31_8x16b = _mm_add_epi16(s35_8x16b, offset_8x16b);
 3960|       |
 3961|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 3962|   218k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   218k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   218k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3963|       |
 3964|   218k|                s32_8x16b = _mm_srai_epi16(s31_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   218k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   218k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3965|       |
 3966|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 3967|   218k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 3968|       |
 3969|   218k|                s33_8x16b =  _mm_packus_epi16(s32_8x16b, zero_8x16b);
 3970|       |
 3971|   218k|                s7_8x16b = _mm_unpacklo_epi64(s7_8x16b, s33_8x16b);
 3972|       |/* store 8 8-bit output values  */
 3973|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 3974|   218k|                _mm_storeu_si128((__m128i *)(pu1_dst), s7_8x16b);
 3975|       |
 3976|       |
 3977|   218k|                s25_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (3 * src_strd)));
 3978|       |
 3979|   218k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 3980|       |
 3981|   218k|                s31_8x16b = _mm_unpackhi_epi8(s22_8x16b, s23_8x16b);
 3982|       |
 3983|   218k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 3984|       |
 3985|   218k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 3986|       |
 3987|   218k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 3988|       |
 3989|   218k|                s33_8x16b = _mm_unpackhi_epi8(s24_8x16b, s25_8x16b);
 3990|       |
 3991|   218k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 3992|       |
 3993|   218k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 3994|       |
 3995|   218k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 3996|       |
 3997|   218k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s34_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 3998|       |
 3999|   218k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4000|       |
 4001|   218k|                s31_8x16b = _mm_add_epi16(s35_8x16b, offset_8x16b);
 4002|       |
 4003|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4004|   218k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   218k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   218k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4005|       |
 4006|   218k|                s32_8x16b = _mm_srai_epi16(s31_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   218k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   218k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4007|       |
 4008|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4009|   218k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4010|       |
 4011|   218k|                s33_8x16b =  _mm_packus_epi16(s32_8x16b, zero_8x16b);
 4012|       |
 4013|   218k|                s7_8x16b = _mm_unpacklo_epi64(s7_8x16b, s33_8x16b);
 4014|       |/* store 8 8-bit output values  */
 4015|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 4016|   218k|                _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), s7_8x16b);
 4017|       |
 4018|   218k|                pu1_src += 2 * src_strd;
 4019|   218k|                pu1_dst += 2 * dst_strd;
 4020|       |
 4021|       |
 4022|   218k|            } /* inner for loop ends here(8-output values in single iteration) */
 4023|       |
 4024|  28.0k|        }
 4025|  17.7k|    }
 4026|  1.38M|    else if(wd % 4 == 0)
  ------------------
  |  Branch (4026:13): [True: 1.35M, False: 33.5k]
  ------------------
 4027|  1.35M|    { /* wd = multiple of 8 case */
 4028|       |
 4029|  4.03M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4029:22): [True: 2.68M, False: 1.35M]
  ------------------
 4030|  2.68M|        {
 4031|  2.68M|            pu1_src_copy = pu1_src;
 4032|  2.68M|            pu1_dst_copy = pu1_dst;
 4033|  5.36M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4033:26): [True: 2.68M, False: 2.68M]
  ------------------
 4034|  2.68M|            {
 4035|       |
 4036|  2.68M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.68M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4037|  2.68M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  2.68M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4038|       |
 4039|       |
 4040|       |                /*load 8 pixel values from -751:-768 pos. relative to cur. pos.*/
 4041|  2.68M|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 4042|       |
 4043|       |                /*load 8 pixel values from -495:-512 pos. relative to cur. pos.*/
 4044|  2.68M|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4045|       |
 4046|  2.68M|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4047|       |
 4048|  2.68M|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4049|       |
 4050|       |                /*load 8 pixel values from -239:-256 pos. relative to cur. pos.*/
 4051|  2.68M|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 4052|       |
 4053|       |                /*load 8 pixel values from 15:0 pos. relative to cur. pos.*/
 4054|  2.68M|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4055|       |
 4056|  2.68M|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4057|       |
 4058|  2.68M|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4059|       |
 4060|  2.68M|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4061|       |
 4062|  2.68M|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4063|       |
 4064|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4065|  2.68M|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.68M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.68M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4066|       |
 4067|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4068|  2.68M|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4069|       |
 4070|       |/* store 8 8-bit output values  */
 4071|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 4072|  2.68M|                _mm_storel_epi64((__m128i *)(pu1_dst), s7_8x16b);
 4073|       |
 4074|  2.68M|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4075|       |
 4076|  2.68M|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4077|  2.68M|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4078|       |
 4079|  2.68M|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4080|  2.68M|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4081|       |
 4082|  2.68M|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4083|       |
 4084|  2.68M|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4085|       |
 4086|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4087|  2.68M|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  2.68M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  2.68M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4088|       |
 4089|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4090|  2.68M|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4091|       |
 4092|       |/* store 8 8-bit output values  */
 4093|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 4094|  2.68M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s7_8x16b);
 4095|       |
 4096|  2.68M|                pu1_src += 8;    /* To pointer update */
 4097|  2.68M|                pu1_dst += 8;
 4098|       |
 4099|  2.68M|            } /* inner for loop ends here(8-output values in single iteration) */
 4100|       |
 4101|  2.68M|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4102|  2.68M|            pu1_dst = pu1_dst_copy + 2 * dst_strd; /* pointer update */
 4103|  2.68M|        }
 4104|  1.35M|    }
 4105|       |
 4106|  33.5k|    else
 4107|  33.5k|    { /* wd = multiple of 4 case */
 4108|       |
 4109|  98.8k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4109:22): [True: 65.2k, False: 33.5k]
  ------------------
 4110|  65.2k|        {
 4111|  65.2k|            pu1_src_copy = pu1_src;
 4112|  65.2k|            pu1_dst_copy = pu1_dst;
 4113|   140k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4113:26): [True: 75.0k, False: 65.2k]
  ------------------
 4114|  75.0k|            {
 4115|       |
 4116|  75.0k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  75.0k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4117|  75.0k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  75.0k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4118|       |
 4119|       |
 4120|       |                /*load 8 pixel values from -751:-768 pos. relative to cur. pos.*/
 4121|  75.0k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 4122|       |
 4123|       |                /*load 8 pixel values from -495:-512 pos. relative to cur. pos.*/
 4124|  75.0k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4125|       |
 4126|  75.0k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4127|       |
 4128|  75.0k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4129|       |
 4130|       |                /*load 8 pixel values from -239:-256 pos. relative to cur. pos.*/
 4131|  75.0k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 4132|       |
 4133|       |                /*load 8 pixel values from 15:0 pos. relative to cur. pos.*/
 4134|  75.0k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4135|       |
 4136|  75.0k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4137|       |
 4138|  75.0k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4139|       |
 4140|  75.0k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4141|       |
 4142|  75.0k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4143|       |
 4144|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4145|  75.0k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  75.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  75.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4146|       |
 4147|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4148|  75.0k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4149|       |
 4150|  75.0k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 4151|  75.0k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 4152|  75.0k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 4153|  75.0k|                s9_8x16b = _mm_or_si128(s5_8x16b, s6_8x16b);
 4154|       |
 4155|       |/* store 8 8-bit output values  */
 4156|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 4157|  75.0k|                _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 4158|       |
 4159|  75.0k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4160|       |
 4161|  75.0k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4162|  75.0k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4163|       |
 4164|  75.0k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4165|  75.0k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4166|       |
 4167|  75.0k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4168|       |
 4169|  75.0k|                s5_8x16b = _mm_add_epi16(s8_8x16b, offset_8x16b);
 4170|       |
 4171|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 4172|  75.0k|                s6_8x16b = _mm_srai_epi16(s5_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  75.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  75.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4173|       |
 4174|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 4175|  75.0k|                s7_8x16b = _mm_packus_epi16(s6_8x16b, zero_8x16b);
 4176|       |
 4177|  75.0k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 4178|  75.0k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 4179|  75.0k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 4180|  75.0k|                s9_8x16b = _mm_or_si128(s5_8x16b, s6_8x16b);
 4181|       |
 4182|       |/* store 8 8-bit output values  */
 4183|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 4184|  75.0k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s9_8x16b);
 4185|       |
 4186|  75.0k|                pu1_src += 4;   /* To pointer update */
 4187|  75.0k|                pu1_dst += 4;
 4188|  75.0k|            } /* inner for loop ends here(8-output values in single iteration) */
 4189|       |
 4190|  65.2k|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4191|  65.2k|            pu1_dst = pu1_dst_copy + 2 * dst_strd; /* pointer update */
 4192|  65.2k|        }
 4193|  33.5k|    }
 4194|  1.40M|}
ihevc_inter_pred_chroma_copy_w16out_ssse3:
 4243|  41.3M|{
 4244|  41.3M|    WORD32 row, col;
 4245|  41.3M|    __m128i  s3, zero_8x16b;
 4246|       |
 4247|  41.3M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  41.3M|#define ASSERT(x) {}
  ------------------
 4248|  41.3M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  41.3M|#define ASSERT(x) {}
  ------------------
 4249|       |
 4250|  41.3M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  41.3M|#define UNUSED(x) ((void)(x))
  ------------------
 4251|  41.3M|    zero_8x16b = _mm_setzero_si128();
 4252|       |/*  outer for loop starts from here */
 4253|  41.3M|    if(wd == 2) /* for wd =2 */
  ------------------
  |  Branch (4253:8): [True: 16.2k, False: 41.3M]
  ------------------
 4254|  16.2k|    {
 4255|  73.4k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4255:22): [True: 57.1k, False: 16.2k]
  ------------------
 4256|  57.1k|        {
 4257|  57.1k|            int offset = 0;
 4258|   114k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4258:26): [True: 57.1k, False: 57.1k]
  ------------------
 4259|  57.1k|            {
 4260|       |/* row =0 */
 4261|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 4262|  57.1k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 4263|  57.1k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4264|       |
 4265|  57.1k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  57.1k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  57.1k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4266|       |
 4267|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4268|  57.1k|                _mm_storel_epi64((__m128i *)(pi2_dst + offset), s3);
 4269|       |
 4270|       |/* row =1 */
 4271|       |                /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 4272|  57.1k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4273|  57.1k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4274|       |
 4275|  57.1k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  57.1k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  57.1k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4276|       |
 4277|  57.1k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4278|  57.1k|                offset += 4; /* To pointer update */
 4279|  57.1k|            } /* inner for loop ends here */
 4280|       |
 4281|  57.1k|            pu1_src += 2 * src_strd; /* pointer update */
 4282|  57.1k|            pi2_dst += 2 * dst_strd; /* pointer update */
 4283|  57.1k|        }
 4284|  16.2k|    }
 4285|  41.3M|    else if(wd % 2 == 0 && wd % 4 != 0)
  ------------------
  |  Branch (4285:13): [True: 41.3M, False: 12.2k]
  |  Branch (4285:28): [True: 12.2k, False: 41.2M]
  ------------------
 4286|  12.2k|    {
 4287|  61.3k|        for(row = 0; row < ht / 2; row++)
  ------------------
  |  Branch (4287:22): [True: 49.0k, False: 12.2k]
  ------------------
 4288|  49.0k|        {
 4289|  49.0k|            int offset = 0;
 4290|  49.0k|            int count = (2 * wd) / 8;
 4291|  98.1k|            for(col = 0; col < count; col++)
  ------------------
  |  Branch (4291:26): [True: 49.0k, False: 49.0k]
  ------------------
 4292|  49.0k|            {
 4293|       |/* row =0 */
 4294|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 4295|  49.0k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]*/
 4296|  49.0k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4297|       |
 4298|       |                /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4299|  49.0k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  49.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  49.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4300|       |
 4301|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 4302|  49.0k|                _mm_storeu_si128((__m128i *)(pi2_dst + offset), s3);
 4303|       |
 4304|       |                /*row=1*/       /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 4305|  49.0k|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4306|  49.0k|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4307|       |
 4308|  49.0k|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  49.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  49.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4309|  49.0k|                _mm_storeu_si128((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4310|       |
 4311|  49.0k|                offset += 8; /* To pointer update*/
 4312|  49.0k|            } /*  inner for loop ends here(8-output values in single iteration) */
 4313|       |
 4314|       |/* finding last four values */
 4315|  49.0k|            s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col] */
 4316|  49.0k|            s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4317|       |
 4318|  49.0k|            s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  49.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  49.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4319|       |
 4320|       |            /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4321|  49.0k|            _mm_storel_epi64((__m128i *)(pi2_dst + offset), s3);
 4322|       |
 4323|       |            /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 4324|  49.0k|            s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4325|  49.0k|            s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4326|       |
 4327|  49.0k|            s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  49.0k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  49.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4328|  49.0k|            _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4329|       |
 4330|  49.0k|            pu1_src += 2 * src_strd; /* pointer update */
 4331|  49.0k|            pi2_dst += 2 * dst_strd;
 4332|  49.0k|        }
 4333|  12.2k|    }
 4334|  41.3M|    else
 4335|  41.3M|    {
 4336|   125M|        for(row = 0; row < ht / 2; row++)
  ------------------
  |  Branch (4336:22): [True: 84.2M, False: 41.3M]
  ------------------
 4337|  84.2M|        {
 4338|  84.2M|            int offset = 0;
 4339|   175M|            for(col = 0; col < 2 * wd / 8; col++)
  ------------------
  |  Branch (4339:26): [True: 91.2M, False: 84.2M]
  ------------------
 4340|  91.2M|            {
 4341|       |/* row =0 */
 4342|       |                /*load 16 pixel values from 15:0 pos. relative to cur. pos.*/
 4343|  91.2M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + offset)); /* pu1_src[col]*/
 4344|  91.2M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4345|       |
 4346|       |                /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
 4347|  91.2M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  91.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  91.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4348|       |
 4349|       |                /* pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH); */
 4350|  91.2M|                _mm_storeu_si128((__m128i *)(pi2_dst + offset), s3);
 4351|       |
 4352|       |                /*row=1*/       /*load 16 pixel values from 271:256 pos. relative to cur. pos.*/
 4353|  91.2M|                s3 = _mm_loadu_si128((__m128i *)(pu1_src + src_strd + offset));
 4354|  91.2M|                s3 = _mm_unpacklo_epi8(s3, zero_8x16b);
 4355|       |
 4356|  91.2M|                s3 = _mm_slli_epi16(s3,  SHIFT_14_MINUS_BIT_DEPTH); /* (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH) */
  ------------------
  |  |   41|  91.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  91.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4357|  91.2M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd + offset), s3);
 4358|       |
 4359|  91.2M|                offset += 8; /* To pointer update*/
 4360|  91.2M|            } /*  inner for loop ends here(8-output values in single iteration) */
 4361|       |
 4362|  84.2M|            pu1_src += 2 * src_strd; /* pointer update */
 4363|  84.2M|            pi2_dst += 2 * dst_strd;
 4364|  84.2M|        }
 4365|  41.3M|    }
 4366|  41.3M|}
ihevc_inter_pred_chroma_horz_w16out_ssse3:
 4415|  12.6M|{
 4416|  12.6M|    WORD32 row, col;
 4417|       |
 4418|  12.6M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b, control_mask_1_8x16b, control_mask_2_8x16b, all_zero;
 4419|  12.6M|    __m128i src_temp1_16x8b, src_temp2_16x8b, src_temp3_16x8b, src_temp4_16x8b, src_temp5_16x8b, src_temp6_16x8b;
 4420|  12.6M|    __m128i src_temp11_16x8b, src_temp12_16x8b, src_temp13_16x8b, src_temp14_16x8b, src_temp15_16x8b, src_temp16_16x8b;
 4421|  12.6M|    __m128i res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b;
 4422|  12.6M|    __m128i res_temp11_8x16b, res_temp12_8x16b, res_temp13_8x16b;
 4423|       |
 4424|  12.6M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4425|  12.6M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4426|  12.6M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4427|  12.6M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4428|  12.6M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4429|  12.6M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.6M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4430|       |
 4431|  12.6M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  12.6M|#define ASSERT(x) {}
  ------------------
 4432|       |
 4433|       |/* loading four 8-bit coefficients and convert 8-bit into 16-bit */
 4434|  12.6M|    src_temp1_16x8b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 4435|       |
 4436|  12.6M|    all_zero = _mm_setzero_si128();
 4437|       |
 4438|  12.6M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 4439|  12.6M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 4440|       |
 4441|  12.6M|    coeff0_1_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 4442|  12.6M|    coeff2_3_8x16b = _mm_shuffle_epi8(src_temp1_16x8b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 4443|       |
 4444|       |/*  outer for loop starts from here */
 4445|  12.6M|    if(wd % 2 == 0 && wd % 4 != 0)
  ------------------
  |  Branch (4445:8): [True: 12.6M, False: 18.4E]
  |  Branch (4445:23): [True: 117k, False: 12.5M]
  ------------------
 4446|   117k|    {
 4447|   117k|        int offset = 0;
 4448|   521k|        for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (4448:23): [True: 403k, False: 117k]
  ------------------
 4449|   403k|        {
 4450|   403k|            offset = 0;
 4451|   403k|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   403k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4452|   403k|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   403k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4453|       |
 4454|       |
 4455|   957k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4455:26): [True: 554k, False: 403k]
  ------------------
 4456|   554k|            {
 4457|       |
 4458|       |                /*load 16 pixel values of row 0*/
 4459|   554k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + offset)); /* pu1_src[col + (i-1) * 2]*/
 4460|       |
 4461|       |                /*load 16 pixel values of row 1*/
 4462|   554k|                src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + src_strd + offset)); /* pu1_src[col + (i-1) * 2]*/
 4463|       |
 4464|       |                /*Derive the source pixels for processing the 2nd pixel of row 0*/
 4465|   554k|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4466|       |
 4467|   554k|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 4468|       |
 4469|       |                /*Derive the source pixels for processing the 3rd pixel of row 0*/
 4470|   554k|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 4471|       |
 4472|       |                /*Derive the source pixels for processing the 4th pixel of row 0*/
 4473|   554k|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4474|       |
 4475|   554k|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4476|       |
 4477|       |                /*Derive the source pixels for processing the 2nd pixel of row 1*/
 4478|   554k|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 4479|       |
 4480|   554k|                src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b);
 4481|       |
 4482|       |                /*Derive the source pixels for processing the 3rd pixel of row 1*/
 4483|   554k|                src_temp13_16x8b = _mm_srli_si128(src_temp11_16x8b, 4);
 4484|       |
 4485|       |                /*Derive the source pixels for processing the 4th pixel of row 1*/
 4486|   554k|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 4487|       |
 4488|   554k|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 4489|       |
 4490|   554k|                res_temp1_8x16b = _mm_unpacklo_epi64(src_temp5_16x8b, src_temp15_16x8b);
 4491|   554k|                res_temp2_8x16b = _mm_unpacklo_epi64(src_temp6_16x8b, src_temp16_16x8b);
 4492|   554k|                res_temp11_8x16b = _mm_maddubs_epi16(res_temp1_8x16b, coeff0_1_8x16b);
 4493|   554k|                res_temp12_8x16b = _mm_maddubs_epi16(res_temp2_8x16b, coeff2_3_8x16b);
 4494|       |
 4495|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 4496|   554k|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 4497|       |
 4498|   554k|                res_temp3_8x16b = _mm_srli_si128(res_temp13_8x16b, 8);
 4499|       |
 4500|       |                /* store 4 16-bit values */
 4501|   554k|                _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp13_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4502|       |
 4503|       |
 4504|       |
 4505|       |                /* store 4 16-bit values */
 4506|   554k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd + offset), res_temp3_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4507|       |
 4508|       |
 4509|   554k|                offset += 4; /* To pointer update*/
 4510|       |
 4511|   554k|            } /* inner loop ends here(8- output values in single iteration)*/
 4512|       |
 4513|   403k|            pu1_src += 2 * src_strd; /*pointer update*/
 4514|   403k|            pi2_dst += 2 * dst_strd; /*pointer update*/
 4515|   403k|        }
 4516|       |
 4517|       |        /*Epilogue to handle ht= odd case*/
 4518|   117k|        if(row)
  ------------------
  |  Branch (4518:12): [True: 106k, False: 11.7k]
  ------------------
 4519|   106k|        {
 4520|   106k|            offset = 0;
 4521|   234k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4521:26): [True: 128k, False: 106k]
  ------------------
 4522|   128k|            {
 4523|       |
 4524|       |                /*load 16 pixel values of row 0*/
 4525|   128k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + offset)); /* pu1_src[col + (i-1) * 2]*/
 4526|       |
 4527|       |                /*Derive the source pixels for processing the 2nd pixel of row 0*/
 4528|   128k|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4529|       |
 4530|   128k|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 4531|       |
 4532|       |                /*Derive the source pixels for processing the 3rd pixel of row 0*/
 4533|   128k|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 4534|       |
 4535|       |                /*Derive the source pixels for processing the 4th pixel of row 0*/
 4536|   128k|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4537|       |
 4538|   128k|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4539|       |
 4540|   128k|                res_temp1_8x16b = _mm_unpacklo_epi64(src_temp5_16x8b, all_zero);
 4541|   128k|                res_temp2_8x16b = _mm_unpacklo_epi64(src_temp6_16x8b, all_zero);
 4542|   128k|                res_temp11_8x16b = _mm_maddubs_epi16(res_temp1_8x16b, coeff0_1_8x16b);
 4543|   128k|                res_temp12_8x16b = _mm_maddubs_epi16(res_temp2_8x16b, coeff2_3_8x16b);
 4544|       |
 4545|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 4546|   128k|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 4547|       |
 4548|       |                //res_temp3_8x16b = _mm_srli_si128 (res_temp13_8x16b, 8);
 4549|       |
 4550|       |                /* store 4 16-bit values */
 4551|   128k|                _mm_storel_epi64((__m128i *)(pi2_dst + offset), res_temp13_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4552|       |
 4553|   128k|                offset += 4; /* To pointer update*/
 4554|       |
 4555|   128k|            }
 4556|   106k|        }
 4557|       |
 4558|   117k|    }
 4559|  12.5M|    else
 4560|  12.5M|    {
 4561|  12.5M|        int offset = 0;
 4562|       |
 4563|  46.4M|        for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (4563:23): [True: 33.9M, False: 12.5M]
  ------------------
 4564|  33.9M|        {
 4565|  33.9M|            offset = 0;
 4566|  33.9M|            PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  33.9M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4567|  33.9M|            PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  33.9M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4568|       |
 4569|       |
 4570|  72.2M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4570:26): [True: 38.3M, False: 33.9M]
  ------------------
 4571|  38.3M|            {
 4572|       |
 4573|       |                /*load 16 pixel values of row 0*/
 4574|  38.3M|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + offset)); /* pu1_src[col + (i-1) * 2]*/
 4575|       |
 4576|       |                /*load 16 pixel values of row 1*/
 4577|  38.3M|                src_temp11_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + src_strd + offset)); /* pu1_src[col + (i-1) * 2]*/
 4578|       |
 4579|       |                /*Derive the source pixels for processing the 2nd pixel of row 0*/
 4580|  38.3M|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4581|       |
 4582|  38.3M|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 4583|       |
 4584|       |                /*Derive the source pixels for processing the 3rd pixel of row 0*/
 4585|  38.3M|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 4586|       |
 4587|       |                /*Derive the source pixels for processing the 4th pixel of row 0*/
 4588|  38.3M|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4589|       |
 4590|  38.3M|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4591|       |
 4592|  38.3M|                res_temp1_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff0_1_8x16b);
 4593|  38.3M|                res_temp2_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff2_3_8x16b);
 4594|       |
 4595|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 4596|  38.3M|                res_temp3_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 4597|       |
 4598|       |                /* store 8 16-bit values */
 4599|  38.3M|                _mm_storeu_si128((__m128i *)(pi2_dst + offset), res_temp3_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4600|       |
 4601|       |                /*Derive the source pixels for processing the 2nd pixel of row 1*/
 4602|  38.3M|                src_temp12_16x8b = _mm_srli_si128(src_temp11_16x8b, 2);
 4603|       |
 4604|  38.3M|                src_temp15_16x8b = _mm_unpacklo_epi8(src_temp11_16x8b, src_temp12_16x8b);
 4605|       |
 4606|       |                /*Derive the source pixels for processing the 3rd pixel of row 1*/
 4607|  38.3M|                src_temp13_16x8b = _mm_srli_si128(src_temp11_16x8b, 4);
 4608|       |
 4609|       |                /*Derive the source pixels for processing the 4th pixel of row 1*/
 4610|  38.3M|                src_temp14_16x8b = _mm_srli_si128(src_temp11_16x8b, 6);
 4611|       |
 4612|  38.3M|                src_temp16_16x8b = _mm_unpacklo_epi8(src_temp13_16x8b, src_temp14_16x8b);
 4613|       |
 4614|  38.3M|                res_temp11_8x16b = _mm_maddubs_epi16(src_temp15_16x8b, coeff0_1_8x16b);
 4615|  38.3M|                res_temp12_8x16b = _mm_maddubs_epi16(src_temp16_16x8b, coeff2_3_8x16b);
 4616|       |
 4617|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 4618|  38.3M|                res_temp13_8x16b = _mm_add_epi16(res_temp11_8x16b, res_temp12_8x16b);
 4619|       |
 4620|       |                /* store 8 16-bit values */
 4621|  38.3M|                _mm_storeu_si128((__m128i *)(pi2_dst + dst_strd + offset), res_temp13_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4622|       |
 4623|       |
 4624|  38.3M|                offset += 8; /* To pointer update*/
 4625|       |
 4626|  38.3M|            } /* inner loop ends here(8- output values in single iteration)*/
 4627|       |
 4628|  33.9M|            pu1_src += 2 * src_strd; /*pointer update*/
 4629|  33.9M|            pi2_dst += 2 * dst_strd; /*pointer update*/
 4630|  33.9M|        }
 4631|       |
 4632|       |        /*Epilogue to take care of odd ht*/
 4633|  12.5M|        if(row)
  ------------------
  |  Branch (4633:12): [True: 7.94M, False: 4.59M]
  ------------------
 4634|  7.94M|        {
 4635|  7.94M|            offset = 0;
 4636|  16.2M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4636:26): [True: 8.30M, False: 7.94M]
  ------------------
 4637|  8.30M|            {
 4638|       |
 4639|       |                /*load 16 pixel values of row 0*/
 4640|  8.30M|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src - 2 + offset)); /* pu1_src[col + (i-1) * 2]*/
 4641|       |
 4642|       |                /*Derive the source pixels for processing the 2nd pixel of row 0*/
 4643|  8.30M|                src_temp2_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 4644|       |
 4645|  8.30M|                src_temp5_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, src_temp2_16x8b);
 4646|       |
 4647|       |                /*Derive the source pixels for processing the 3rd pixel of row 0*/
 4648|  8.30M|                src_temp3_16x8b = _mm_srli_si128(src_temp1_16x8b, 4);
 4649|       |
 4650|       |                /*Derive the source pixels for processing the 4th pixel of row 0*/
 4651|  8.30M|                src_temp4_16x8b = _mm_srli_si128(src_temp1_16x8b, 6);
 4652|       |
 4653|  8.30M|                src_temp6_16x8b = _mm_unpacklo_epi8(src_temp3_16x8b, src_temp4_16x8b);
 4654|       |
 4655|  8.30M|                res_temp1_8x16b = _mm_maddubs_epi16(src_temp5_16x8b, coeff0_1_8x16b);
 4656|  8.30M|                res_temp2_8x16b = _mm_maddubs_epi16(src_temp6_16x8b, coeff2_3_8x16b);
 4657|       |
 4658|       |                /* i4_tmp += pi1_coeff[i] * pi2_src[col + (i-1) * 2] */
 4659|  8.30M|                res_temp3_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
 4660|       |
 4661|       |                /* store 8 16-bit values */
 4662|  8.30M|                _mm_storeu_si128((__m128i *)(pi2_dst + offset), res_temp3_8x16b); /* pi2_dst[col] = i2_tmp_u  */
 4663|       |
 4664|  8.30M|                offset += 8; /* To pointer update*/
 4665|       |
 4666|  8.30M|            }
 4667|  7.94M|        }
 4668|       |
 4669|  12.5M|    }
 4670|  12.6M|}
ihevc_inter_pred_chroma_vert_w16out_ssse3:
 4719|  5.77M|{
 4720|  5.77M|    WORD32 row, col;
 4721|  5.77M|    UWORD8 *pu1_src_copy;
 4722|  5.77M|    WORD16 *pi2_dst_copy;
 4723|  5.77M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 4724|  5.77M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s8_8x16b;
 4725|  5.77M|    __m128i control_mask_1_8x16b, control_mask_2_8x16b;
 4726|  5.77M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 4727|  5.77M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 4728|  5.77M|    __m128i s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b;
 4729|       |
 4730|       |
 4731|  5.77M|    PREFETCH((char const *)(pu1_src + (0 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.77M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4732|  5.77M|    PREFETCH((char const *)(pu1_src + (1 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.77M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4733|  5.77M|    PREFETCH((char const *)(pu1_src + (2 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.77M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4734|  5.77M|    PREFETCH((char const *)(pu1_src + (3 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.77M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4735|  5.77M|    PREFETCH((char const *)(pu1_src + (4 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.77M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4736|  5.77M|    PREFETCH((char const *)(pu1_src + (5 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  5.77M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4737|       |
 4738|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 4739|  5.77M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 4740|       |
 4741|  5.77M|    control_mask_1_8x16b = _mm_set1_epi32(0x01000100); /* Control Mask register */
 4742|  5.77M|    control_mask_2_8x16b = _mm_set1_epi32(0x03020302); /* Control Mask register */
 4743|       |
 4744|  5.77M|    coeff0_1_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_1_8x16b);  /* pi1_coeff[4] */
 4745|  5.77M|    coeff2_3_8x16b = _mm_shuffle_epi8(s4_8x16b, control_mask_2_8x16b);  /* pi1_coeff[4] */
 4746|       |
 4747|       |
 4748|       |
 4749|       |/*  outer for loop starts from here */
 4750|  5.77M|    if(wd % 8 == 0)
  ------------------
  |  Branch (4750:8): [True: 55.7k, False: 5.72M]
  ------------------
 4751|  55.7k|    { /* wd = multiple of 8 case */
 4752|       |
 4753|  55.7k|        pu1_src_copy = pu1_src;
 4754|  55.7k|        pi2_dst_copy = pi2_dst;
 4755|       |
 4756|   152k|        for(col = 0; col < 2 * wd; col += 16)
  ------------------
  |  Branch (4756:22): [True: 96.4k, False: 55.7k]
  ------------------
 4757|  96.4k|        {
 4758|       |
 4759|  96.4k|            pu1_src = pu1_src_copy + col;
 4760|  96.4k|            pi2_dst = pi2_dst_copy + col;
 4761|       |
 4762|       |
 4763|   898k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4763:26): [True: 802k, False: 96.4k]
  ------------------
 4764|   802k|            {
 4765|       |
 4766|   802k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   802k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4767|   802k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   802k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4768|       |
 4769|       |
 4770|       |                /*load 16 pixel values */
 4771|   802k|                s21_8x16b  = _mm_loadu_si128((__m128i *)(pu1_src + (-1 * src_strd)));
 4772|       |
 4773|       |                /*load 16 pixel values */
 4774|   802k|                s22_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (0 * src_strd)));
 4775|       |
 4776|       |
 4777|       |                /*load 16 pixel values */
 4778|   802k|                s23_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (1 * src_strd)));
 4779|       |
 4780|       |                /*load 16 pixel values */
 4781|   802k|                s24_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (2 * src_strd)));
 4782|       |
 4783|   802k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4784|       |
 4785|   802k|                s31_8x16b = _mm_unpackhi_epi8(s21_8x16b, s22_8x16b);
 4786|       |
 4787|   802k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4788|       |
 4789|   802k|                s33_8x16b = _mm_unpackhi_epi8(s23_8x16b, s24_8x16b);
 4790|       |
 4791|   802k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4792|       |
 4793|   802k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 4794|       |
 4795|   802k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4796|       |
 4797|   802k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 4798|       |
 4799|   802k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4800|       |
 4801|   802k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s34_8x16b);
 4802|       |
 4803|       |/* store 8 8-bit output values  */
 4804|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 4805|   802k|                _mm_storeu_si128((__m128i *)(pi2_dst), s8_8x16b);
 4806|       |
 4807|   802k|                _mm_storeu_si128((__m128i *)(pi2_dst + 8), s35_8x16b);
 4808|       |
 4809|       |
 4810|   802k|                s25_8x16b = _mm_loadu_si128((__m128i *)(pu1_src + (3 * src_strd)));
 4811|       |
 4812|   802k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4813|       |
 4814|   802k|                s31_8x16b = _mm_unpackhi_epi8(s22_8x16b, s23_8x16b);
 4815|       |
 4816|   802k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4817|       |
 4818|   802k|                s32_8x16b = _mm_maddubs_epi16(s31_8x16b, coeff0_1_8x16b);
 4819|       |
 4820|   802k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4821|       |
 4822|   802k|                s33_8x16b = _mm_unpackhi_epi8(s24_8x16b, s25_8x16b);
 4823|       |
 4824|   802k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4825|       |
 4826|   802k|                s34_8x16b = _mm_maddubs_epi16(s33_8x16b, coeff2_3_8x16b);
 4827|       |
 4828|   802k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4829|       |
 4830|   802k|                s35_8x16b = _mm_add_epi16(s32_8x16b, s34_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4831|       |
 4832|       |/* store 8 8-bit output values  */
 4833|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 4834|   802k|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s8_8x16b);
 4835|       |
 4836|   802k|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd + 8), s35_8x16b);
 4837|       |
 4838|       |
 4839|   802k|                pu1_src += 2 * src_strd;
 4840|   802k|                pi2_dst += 2 * dst_strd;
 4841|       |
 4842|       |
 4843|   802k|            } /* inner for loop ends here(8-output values in single iteration) */
 4844|       |
 4845|  96.4k|        }
 4846|  55.7k|    }
 4847|       |
 4848|  5.72M|    else if(wd % 4 == 0)
  ------------------
  |  Branch (4848:13): [True: 5.71M, False: 10.2k]
  ------------------
 4849|  5.71M|    { /* wd = multiple of 8 case */
 4850|       |
 4851|  17.1M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4851:22): [True: 11.4M, False: 5.71M]
  ------------------
 4852|  11.4M|        {
 4853|       |
 4854|  11.4M|            pu1_src_copy = pu1_src;
 4855|  11.4M|            pi2_dst_copy = pi2_dst;
 4856|       |
 4857|  22.9M|            for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (4857:26): [True: 11.4M, False: 11.4M]
  ------------------
 4858|  11.4M|            {
 4859|       |
 4860|  11.4M|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  11.4M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4861|  11.4M|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  11.4M|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4862|       |
 4863|       |
 4864|       |                /*load 8 pixel values */
 4865|  11.4M|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 4866|       |
 4867|       |                /*load 8 pixel values */
 4868|  11.4M|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4869|       |
 4870|  11.4M|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4871|       |
 4872|  11.4M|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4873|       |
 4874|       |                /*load 8 pixel values */
 4875|  11.4M|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 4876|       |
 4877|       |                /*load 8 pixel values */
 4878|  11.4M|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4879|       |
 4880|  11.4M|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4881|       |
 4882|  11.4M|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4883|       |
 4884|  11.4M|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4885|       |
 4886|  11.4M|                _mm_storeu_si128((__m128i *)(pi2_dst), s8_8x16b);
 4887|       |
 4888|  11.4M|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4889|       |
 4890|  11.4M|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4891|  11.4M|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4892|       |
 4893|  11.4M|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4894|  11.4M|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4895|       |
 4896|  11.4M|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4897|       |
 4898|  11.4M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s8_8x16b);
 4899|       |
 4900|  11.4M|                pu1_src += 8;    /* To pointer update */
 4901|  11.4M|                pi2_dst += 8;
 4902|       |
 4903|  11.4M|            } /* inner for loop ends here(8-output values in single iteration) */
 4904|       |
 4905|  11.4M|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4906|  11.4M|            pi2_dst = pi2_dst_copy + 2 * dst_strd; /* pointer update */
 4907|  11.4M|        }
 4908|  5.71M|    }
 4909|       |
 4910|  10.2k|    else
 4911|  10.2k|    { /* wd = multiple of 4 case */
 4912|       |
 4913|  30.1k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (4913:22): [True: 19.9k, False: 10.2k]
  ------------------
 4914|  19.9k|        {
 4915|  19.9k|            pu1_src_copy = pu1_src;
 4916|  19.9k|            pi2_dst_copy = pi2_dst;
 4917|  55.2k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (4917:26): [True: 35.2k, False: 19.9k]
  ------------------
 4918|  35.2k|            {
 4919|       |
 4920|  35.2k|                PREFETCH((char const *)(pu1_src + (6 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  35.2k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4921|  35.2k|                PREFETCH((char const *)(pu1_src + (7 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  35.2k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
 4922|       |
 4923|       |
 4924|       |                /*load 8 pixel values */
 4925|  35.2k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pu1_src + (-1 * src_strd)));
 4926|       |
 4927|       |                /*load 8 pixel values */
 4928|  35.2k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (0 * src_strd)));
 4929|       |
 4930|  35.2k|                s5_8x16b = _mm_unpacklo_epi8(s21_8x16b, s22_8x16b);
 4931|       |
 4932|  35.2k|                s11_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4933|       |
 4934|       |                /*load 8 pixel values */
 4935|  35.2k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (1 * src_strd)));
 4936|       |
 4937|       |                /*load 8 pixel values */
 4938|  35.2k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (2 * src_strd)));
 4939|       |
 4940|  35.2k|                s6_8x16b = _mm_unpacklo_epi8(s23_8x16b, s24_8x16b);
 4941|       |
 4942|  35.2k|                s12_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4943|       |
 4944|  35.2k|                s8_8x16b = _mm_add_epi16(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4945|       |
 4946|       |
 4947|       |/* store 8 8-bit output values  */
 4948|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 4949|  35.2k|                _mm_storel_epi64((__m128i *)(pi2_dst), s8_8x16b);
 4950|       |
 4951|  35.2k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src + (3 * src_strd)));
 4952|       |
 4953|  35.2k|                s5_8x16b = _mm_unpacklo_epi8(s22_8x16b, s23_8x16b);
 4954|  35.2k|                s15_8x16b = _mm_maddubs_epi16(s5_8x16b, coeff0_1_8x16b);
 4955|       |
 4956|  35.2k|                s6_8x16b = _mm_unpacklo_epi8(s24_8x16b, s25_8x16b);
 4957|  35.2k|                s16_8x16b = _mm_maddubs_epi16(s6_8x16b, coeff2_3_8x16b);
 4958|       |
 4959|  35.2k|                s8_8x16b = _mm_add_epi16(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 4960|       |
 4961|       |
 4962|       |/* store 8 8-bit output values  */
 4963|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 4964|  35.2k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s8_8x16b);
 4965|       |
 4966|  35.2k|                pu1_src += 4;   /* To pointer update */
 4967|  35.2k|                pi2_dst += 4;
 4968|  35.2k|            } /* inner for loop ends here(8-output values in single iteration) */
 4969|       |
 4970|  19.9k|            pu1_src = pu1_src_copy + 2 * src_strd; /* pointer update */
 4971|  19.9k|            pi2_dst = pi2_dst_copy + 2 * dst_strd; /* pointer update */
 4972|  19.9k|        }
 4973|  10.2k|    }
 4974|  5.77M|}
ihevc_inter_pred_chroma_vert_w16inp_ssse3:
 5023|  2.82M|{
 5024|  2.82M|    WORD32 row, col;
 5025|  2.82M|    WORD16 *pi2_src_copy;
 5026|  2.82M|    UWORD8 *pu1_dst_copy;
 5027|  2.82M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 5028|  2.82M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
 5029|  2.82M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 5030|  2.82M|    __m128i zero_8x16b, offset_8x16b, mask_low_32b, mask_high_96b, sign_reg;
 5031|  2.82M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 5032|  2.82M|    __m128i s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b;
 5033|       |
 5034|       |
 5035|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 5036|  2.82M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 5037|       |
 5038|  2.82M|    zero_8x16b = _mm_setzero_si128();
 5039|  2.82M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 5040|  2.82M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 5041|       |
 5042|  2.82M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 5043|  2.82M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 5044|       |
 5045|       |/*  seting  values in register */
 5046|  2.82M|    offset_8x16b = _mm_set1_epi32(OFFSET_14_MINUS_BIT_DEPTH); /* for offset addition */
  ------------------
  |  |   42|  2.82M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  2.82M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  272|  2.82M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5047|  2.82M|    mask_low_32b = _mm_set_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000);
 5048|  2.82M|    mask_high_96b = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF);
 5049|       |
 5050|       |/*  outer for loop starts from here */
 5051|  2.82M|    if(wd % 4 == 0)
  ------------------
  |  Branch (5051:8): [True: 2.73M, False: 88.0k]
  ------------------
 5052|  2.73M|    { /* wd = multiple of 8 case */
 5053|       |
 5054|  2.73M|        pi2_src_copy = pi2_src;
 5055|  2.73M|        pu1_dst_copy = pu1_dst;
 5056|       |
 5057|  5.55M|        for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (5057:22): [True: 2.81M, False: 2.73M]
  ------------------
 5058|  2.81M|        {
 5059|       |
 5060|  2.81M|            pi2_src = pi2_src_copy + col;
 5061|  2.81M|            pu1_dst = pu1_dst_copy + col;
 5062|       |
 5063|       |
 5064|  8.96M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5064:26): [True: 6.14M, False: 2.81M]
  ------------------
 5065|  6.14M|            {
 5066|       |
 5067|       |                /*load 16 pixel values */
 5068|  6.14M|                s21_8x16b  = _mm_load_si128((__m128i *)(pi2_src + (-1 * src_strd)));
 5069|       |
 5070|       |                /*load 16 pixel values */
 5071|  6.14M|                s22_8x16b = _mm_load_si128((__m128i *)(pi2_src + (0 * src_strd)));
 5072|       |
 5073|       |
 5074|       |                /*load 16 pixel values */
 5075|  6.14M|                s23_8x16b = _mm_load_si128((__m128i *)(pi2_src + (1 * src_strd)));
 5076|       |
 5077|       |                /*load 16 pixel values */
 5078|  6.14M|                s24_8x16b = _mm_load_si128((__m128i *)(pi2_src + (2 * src_strd)));
 5079|       |
 5080|  6.14M|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5081|       |
 5082|  6.14M|                s31_8x16b = _mm_unpackhi_epi16(s21_8x16b, s22_8x16b);
 5083|       |
 5084|  6.14M|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5085|       |
 5086|  6.14M|                s33_8x16b = _mm_unpackhi_epi16(s23_8x16b, s24_8x16b);
 5087|       |
 5088|  6.14M|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5089|       |
 5090|  6.14M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5091|       |
 5092|  6.14M|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5093|       |
 5094|  6.14M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5095|       |
 5096|  6.14M|                s8_8x16b = _mm_add_epi32(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5097|       |
 5098|  6.14M|                s35_8x16b = _mm_add_epi32(s32_8x16b, s34_8x16b);
 5099|       |
 5100|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5101|  6.14M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5102|       |
 5103|  6.14M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5104|       |
 5105|       |
 5106|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5107|  6.14M|                s7_8x16b = _mm_add_epi32(s6_8x16b, offset_8x16b);
 5108|       |
 5109|       |                /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5110|  6.14M|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5111|       |
 5112|  6.14M|                s9_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 5113|       |
 5114|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5115|  6.14M|                s33_8x16b = _mm_add_epi32(s32_8x16b, offset_8x16b);
 5116|       |
 5117|       |                /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5118|  6.14M|                s34_8x16b = _mm_srai_epi32(s33_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5119|       |
 5120|  6.14M|                s35_8x16b = _mm_packs_epi32(s34_8x16b, zero_8x16b);
 5121|       |
 5122|       |
 5123|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5124|  6.14M|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5125|       |
 5126|  6.14M|                s33_8x16b =  _mm_packus_epi16(s35_8x16b, zero_8x16b);
 5127|       |
 5128|  6.14M|                s7_8x16b = _mm_unpacklo_epi32(s7_8x16b, s33_8x16b);
 5129|       |/* store 8 8-bit output values  */
 5130|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 5131|  6.14M|                _mm_storel_epi64((__m128i *)(pu1_dst), s7_8x16b);
 5132|       |
 5133|       |
 5134|  6.14M|                s25_8x16b = _mm_load_si128((__m128i *)(pi2_src + (3 * src_strd)));
 5135|       |
 5136|  6.14M|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5137|       |
 5138|  6.14M|                s31_8x16b = _mm_unpackhi_epi16(s22_8x16b, s23_8x16b);
 5139|       |
 5140|  6.14M|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5141|       |
 5142|  6.14M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5143|       |
 5144|  6.14M|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5145|       |
 5146|  6.14M|                s33_8x16b = _mm_unpackhi_epi16(s24_8x16b, s25_8x16b);
 5147|       |
 5148|  6.14M|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5149|       |
 5150|  6.14M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5151|       |
 5152|  6.14M|                s8_8x16b = _mm_add_epi32(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5153|       |
 5154|  6.14M|                s35_8x16b = _mm_add_epi32(s32_8x16b, s34_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5155|       |
 5156|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5157|  6.14M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5158|       |
 5159|  6.14M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5160|       |
 5161|       |
 5162|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5163|  6.14M|                s7_8x16b = _mm_add_epi32(s6_8x16b, offset_8x16b);
 5164|       |
 5165|       |                /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5166|  6.14M|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5167|       |
 5168|  6.14M|                s9_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 5169|       |
 5170|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5171|  6.14M|                s33_8x16b = _mm_add_epi32(s32_8x16b, offset_8x16b);
 5172|       |
 5173|       |                /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5174|  6.14M|                s34_8x16b = _mm_srai_epi32(s33_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.14M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  6.14M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5175|       |
 5176|  6.14M|                s35_8x16b = _mm_packs_epi32(s34_8x16b, zero_8x16b);
 5177|       |
 5178|       |
 5179|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5180|  6.14M|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5181|       |
 5182|  6.14M|                s33_8x16b =  _mm_packus_epi16(s35_8x16b, zero_8x16b);
 5183|       |
 5184|  6.14M|                s7_8x16b = _mm_unpacklo_epi32(s7_8x16b, s33_8x16b);
 5185|       |/* store 8 8-bit output values  */
 5186|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 5187|  6.14M|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s7_8x16b);
 5188|       |
 5189|  6.14M|                pi2_src += 2 * src_strd;
 5190|  6.14M|                pu1_dst += 2 * dst_strd;
 5191|       |
 5192|       |
 5193|  6.14M|            } /* inner for loop ends here(8-output values in single iteration) */
 5194|       |
 5195|  2.81M|        }
 5196|  2.73M|    }
 5197|  88.0k|    else
 5198|  88.0k|    { /* wd = multiple of 4 case */
 5199|       |
 5200|   286k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5200:22): [True: 198k, False: 88.0k]
  ------------------
 5201|   198k|        {
 5202|   198k|            pi2_src_copy = pi2_src;
 5203|   198k|            pu1_dst_copy = pu1_dst;
 5204|   430k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (5204:26): [True: 232k, False: 198k]
  ------------------
 5205|   232k|            {
 5206|       |
 5207|       |                /*load 8 pixel values  */
 5208|   232k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 5209|       |
 5210|       |                /*load 8 pixel values */
 5211|   232k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 5212|       |
 5213|   232k|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5214|       |
 5215|   232k|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5216|       |
 5217|       |                /*load 8 pixel values */
 5218|   232k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 5219|       |
 5220|       |                /*load 8 pixel values */
 5221|   232k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 5222|       |
 5223|   232k|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5224|       |
 5225|   232k|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5226|       |
 5227|   232k|                s8_8x16b = _mm_add_epi32(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5228|       |
 5229|       |
 5230|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5231|   232k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   232k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   232k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5232|       |
 5233|       |
 5234|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5235|   232k|                s7_8x16b = _mm_add_epi32(s6_8x16b, offset_8x16b);
 5236|       |
 5237|       |                /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5238|   232k|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   232k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   232k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5239|       |
 5240|   232k|                s9_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 5241|       |
 5242|       |
 5243|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5244|   232k|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5245|       |
 5246|   232k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst));
 5247|   232k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 5248|   232k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 5249|   232k|                s9_8x16b = _mm_or_si128(s5_8x16b, s6_8x16b);
 5250|       |
 5251|       |/* store 8 8-bit output values  */
 5252|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 5253|   232k|                _mm_storel_epi64((__m128i *)(pu1_dst), s9_8x16b);
 5254|       |
 5255|   232k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 5256|       |
 5257|   232k|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5258|   232k|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5259|       |
 5260|   232k|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5261|   232k|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5262|       |
 5263|   232k|                s8_8x16b = _mm_add_epi32(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5264|       |
 5265|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5266|   232k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   232k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   232k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5267|       |
 5268|       |                /* (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) */
 5269|   232k|                s7_8x16b = _mm_add_epi32(s6_8x16b, offset_8x16b);
 5270|       |
 5271|       |                /* i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5272|   232k|                s8_8x16b = _mm_srai_epi32(s7_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   232k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   232k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5273|       |
 5274|   232k|                s9_8x16b = _mm_packs_epi32(s8_8x16b, zero_8x16b);
 5275|       |
 5276|       |                /* i2_tmp = CLIP_U8(i2_tmp);*/
 5277|   232k|                s7_8x16b = _mm_packus_epi16(s9_8x16b, zero_8x16b);
 5278|       |
 5279|   232k|                s9_8x16b = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
 5280|   232k|                s5_8x16b =  _mm_and_si128(s9_8x16b, mask_low_32b);
 5281|   232k|                s6_8x16b =  _mm_and_si128(s7_8x16b, mask_high_96b);
 5282|   232k|                s9_8x16b = _mm_or_si128(s5_8x16b, s6_8x16b);
 5283|       |
 5284|       |/* store 8 8-bit output values  */
 5285|       |                /* pu1_dst[col] = (UWORD8)i2_tmp; */
 5286|   232k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), s9_8x16b);
 5287|       |
 5288|   232k|                pi2_src += 4;   /* To pointer update */
 5289|   232k|                pu1_dst += 4;
 5290|   232k|            } /* inner for loop ends here(8-output values in single iteration) */
 5291|       |
 5292|   198k|            pi2_src = pi2_src_copy + 2 * src_strd; /* pointer update */
 5293|   198k|            pu1_dst = pu1_dst_copy + 2 * dst_strd; /* pointer update */
 5294|   198k|        }
 5295|  88.0k|    }
 5296|       |
 5297|  2.82M|}
ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3:
 5348|  5.16M|{
 5349|  5.16M|    WORD32 row, col;
 5350|  5.16M|    WORD16 *pi2_src_copy;
 5351|  5.16M|    WORD16 *pi2_dst_copy;
 5352|  5.16M|    __m128i coeff0_1_8x16b, coeff2_3_8x16b;
 5353|  5.16M|    __m128i s4_8x16b, s5_8x16b, s6_8x16b, s7_8x16b, s8_8x16b, s9_8x16b;
 5354|  5.16M|    __m128i s11_8x16b, s12_8x16b, s15_8x16b, s16_8x16b;
 5355|  5.16M|    __m128i zero_8x16b, sign_reg;
 5356|  5.16M|    __m128i s21_8x16b, s22_8x16b, s23_8x16b, s24_8x16b, s25_8x16b;
 5357|  5.16M|    __m128i s31_8x16b, s32_8x16b, s33_8x16b, s34_8x16b, s35_8x16b;
 5358|       |
 5359|       |
 5360|       |/* load 8 8-bit coefficients and convert 8-bit into 16-bit  */
 5361|  5.16M|    s4_8x16b = _mm_loadl_epi64((__m128i *)pi1_coeff);
 5362|       |
 5363|  5.16M|    zero_8x16b = _mm_setzero_si128();
 5364|  5.16M|    sign_reg =  _mm_cmpgt_epi8(zero_8x16b, s4_8x16b);
 5365|  5.16M|    s5_8x16b  = _mm_unpacklo_epi8(s4_8x16b, sign_reg);
 5366|       |
 5367|  5.16M|    coeff0_1_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(0, 0, 0, 0));  /* pi1_coeff[4] */
 5368|  5.16M|    coeff2_3_8x16b = _mm_shuffle_epi32(s5_8x16b, _MM_SHUFFLE(1, 1, 1, 1));  /* pi1_coeff[4] */
 5369|       |
 5370|       |
 5371|       |/*  outer for loop starts from here */
 5372|  5.16M|    if(wd % 4 == 0)
  ------------------
  |  Branch (5372:8): [True: 5.16M, False: 8.11k]
  ------------------
 5373|  5.16M|    { /* wd = multiple of 8 case */
 5374|       |
 5375|  5.16M|        pi2_src_copy = pi2_src;
 5376|  5.16M|        pi2_dst_copy = pi2_dst;
 5377|       |
 5378|  10.6M|        for(col = 0; col < 2 * wd; col += 8)
  ------------------
  |  Branch (5378:22): [True: 5.49M, False: 5.16M]
  ------------------
 5379|  5.49M|        {
 5380|       |
 5381|  5.49M|            pi2_src = pi2_src_copy + col;
 5382|  5.49M|            pi2_dst = pi2_dst_copy + col;
 5383|       |
 5384|       |
 5385|  18.9M|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5385:26): [True: 13.4M, False: 5.49M]
  ------------------
 5386|  13.4M|            {
 5387|       |
 5388|       |                /*load 16 pixel values */
 5389|  13.4M|                s21_8x16b  = _mm_load_si128((__m128i *)(pi2_src + (-1 * src_strd)));
 5390|       |
 5391|       |                /*load 16 pixel values */
 5392|  13.4M|                s22_8x16b = _mm_load_si128((__m128i *)(pi2_src + (0 * src_strd)));
 5393|       |
 5394|       |
 5395|       |                /*load 16 pixel values */
 5396|  13.4M|                s23_8x16b = _mm_load_si128((__m128i *)(pi2_src + (1 * src_strd)));
 5397|       |
 5398|       |                /*load 16 pixel values */
 5399|  13.4M|                s24_8x16b = _mm_load_si128((__m128i *)(pi2_src + (2 * src_strd)));
 5400|       |
 5401|  13.4M|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5402|       |
 5403|  13.4M|                s31_8x16b = _mm_unpackhi_epi16(s21_8x16b, s22_8x16b);
 5404|       |
 5405|  13.4M|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5406|       |
 5407|  13.4M|                s33_8x16b = _mm_unpackhi_epi16(s23_8x16b, s24_8x16b);
 5408|       |
 5409|  13.4M|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5410|       |
 5411|  13.4M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5412|       |
 5413|  13.4M|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5414|       |
 5415|  13.4M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5416|       |
 5417|  13.4M|                s8_8x16b = _mm_add_epi32(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5418|       |
 5419|  13.4M|                s35_8x16b = _mm_add_epi32(s32_8x16b, s34_8x16b);
 5420|       |
 5421|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5422|  13.4M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5423|       |
 5424|  13.4M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5425|       |
 5426|  13.4M|                s9_8x16b = _mm_packs_epi32(s6_8x16b, zero_8x16b);
 5427|       |
 5428|  13.4M|                s35_8x16b = _mm_packs_epi32(s32_8x16b, zero_8x16b);
 5429|       |
 5430|  13.4M|                s7_8x16b = _mm_unpacklo_epi64(s9_8x16b, s35_8x16b);
 5431|       |/* store 8 8-bit output values  */
 5432|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 5433|  13.4M|                _mm_store_si128((__m128i *)(pi2_dst), s7_8x16b);
 5434|       |
 5435|       |
 5436|  13.4M|                s25_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + (3 * src_strd)));
 5437|       |
 5438|  13.4M|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5439|       |
 5440|  13.4M|                s31_8x16b = _mm_unpackhi_epi16(s22_8x16b, s23_8x16b);
 5441|       |
 5442|  13.4M|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5443|       |
 5444|  13.4M|                s32_8x16b = _mm_madd_epi16(s31_8x16b, coeff0_1_8x16b);
 5445|       |
 5446|  13.4M|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5447|       |
 5448|  13.4M|                s33_8x16b = _mm_unpackhi_epi16(s24_8x16b, s25_8x16b);
 5449|       |
 5450|  13.4M|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5451|       |
 5452|  13.4M|                s34_8x16b = _mm_madd_epi16(s33_8x16b, coeff2_3_8x16b);
 5453|       |
 5454|  13.4M|                s8_8x16b = _mm_add_epi32(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5455|       |
 5456|  13.4M|                s35_8x16b = _mm_add_epi32(s32_8x16b, s34_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5457|       |
 5458|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5459|  13.4M|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5460|       |
 5461|  13.4M|                s32_8x16b = _mm_srai_epi32(s35_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  13.4M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  13.4M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5462|       |
 5463|  13.4M|                s9_8x16b = _mm_packs_epi32(s6_8x16b, zero_8x16b);
 5464|       |
 5465|  13.4M|                s35_8x16b = _mm_packs_epi32(s32_8x16b, zero_8x16b);
 5466|       |
 5467|  13.4M|                s7_8x16b = _mm_unpacklo_epi64(s9_8x16b, s35_8x16b);
 5468|       |/* store 8 8-bit output values  */
 5469|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 5470|  13.4M|                _mm_store_si128((__m128i *)(pi2_dst + dst_strd), s7_8x16b);
 5471|       |
 5472|  13.4M|                pi2_src += 2 * src_strd;
 5473|  13.4M|                pi2_dst += 2 * dst_strd;
 5474|       |
 5475|       |
 5476|  13.4M|            } /* inner for loop ends here(8-output values in single iteration) */
 5477|       |
 5478|  5.49M|        }
 5479|  5.16M|    }
 5480|  8.11k|    else
 5481|  8.11k|    { /* wd = multiple of 4 case */
 5482|       |
 5483|  65.6k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (5483:22): [True: 57.5k, False: 8.11k]
  ------------------
 5484|  57.5k|        {
 5485|  57.5k|            pi2_src_copy = pi2_src;
 5486|  57.5k|            pi2_dst_copy = pi2_dst;
 5487|   171k|            for(col = 0; col < 2 * wd; col += 4)
  ------------------
  |  Branch (5487:26): [True: 113k, False: 57.5k]
  ------------------
 5488|   113k|            {
 5489|       |
 5490|       |                /*load 4 pixel values */
 5491|   113k|                s21_8x16b  = _mm_loadl_epi64((__m128i *)(pi2_src + (-1 * src_strd)));
 5492|       |
 5493|       |                /*load 4 pixel values */
 5494|   113k|                s22_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (0 * src_strd)));
 5495|       |
 5496|   113k|                s5_8x16b = _mm_unpacklo_epi16(s21_8x16b, s22_8x16b);
 5497|       |
 5498|   113k|                s11_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5499|       |
 5500|       |                /*load 4 pixel values */
 5501|   113k|                s23_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (1 * src_strd)));
 5502|       |
 5503|       |                /*load 4 pixel values */
 5504|   113k|                s24_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (2 * src_strd)));
 5505|       |
 5506|   113k|                s6_8x16b = _mm_unpacklo_epi16(s23_8x16b, s24_8x16b);
 5507|       |
 5508|   113k|                s12_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5509|       |
 5510|   113k|                s8_8x16b = _mm_add_epi32(s11_8x16b, s12_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5511|       |
 5512|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5513|   113k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   113k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   113k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5514|       |
 5515|   113k|                s9_8x16b = _mm_packs_epi32(s6_8x16b, zero_8x16b);
 5516|       |
 5517|       |/* store 8 8-bit output values  */
 5518|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 5519|   113k|                _mm_storel_epi64((__m128i *)(pi2_dst), s9_8x16b);
 5520|       |
 5521|   113k|                s25_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + (3 * src_strd)));
 5522|       |
 5523|   113k|                s5_8x16b = _mm_unpacklo_epi16(s22_8x16b, s23_8x16b);
 5524|   113k|                s15_8x16b = _mm_madd_epi16(s5_8x16b, coeff0_1_8x16b);
 5525|       |
 5526|   113k|                s6_8x16b = _mm_unpacklo_epi16(s24_8x16b, s25_8x16b);
 5527|   113k|                s16_8x16b = _mm_madd_epi16(s6_8x16b, coeff2_3_8x16b);
 5528|       |
 5529|   113k|                s8_8x16b = _mm_add_epi32(s15_8x16b, s16_8x16b); /* (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) */
 5530|       |
 5531|       |                /*(i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH */
 5532|   113k|                s6_8x16b = _mm_srai_epi32(s8_8x16b,  SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   113k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|   113k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 5533|       |
 5534|   113k|                s9_8x16b = _mm_packs_epi32(s6_8x16b, zero_8x16b);
 5535|       |
 5536|       |/* store 8 8-bit output values  */
 5537|       |                /* pi2_dst[col] = (UWORD8)i2_tmp; */
 5538|   113k|                _mm_storel_epi64((__m128i *)(pi2_dst + dst_strd), s9_8x16b);
 5539|       |
 5540|   113k|                pi2_src += 4;   /* To pointer update */
 5541|   113k|                pi2_dst += 4;
 5542|   113k|            } /* inner for loop ends here(8-output values in single iteration) */
 5543|       |
 5544|  57.5k|            pi2_src = pi2_src_copy + 2 * src_strd; /* pointer update */
 5545|  57.5k|            pi2_dst = pi2_dst_copy + 2 * dst_strd; /* pointer update */
 5546|  57.5k|        }
 5547|  8.11k|    }
 5548|       |
 5549|  5.16M|}

ihevc_intra_pred_ref_filtering_sse42:
  112|   551k|{
  113|   551k|    WORD32 filter_flag;
  114|   551k|    WORD32 i; /* Generic indexing variable */
  115|   551k|    WORD32 four_nt = 4 * nt;
  116|   551k|    UWORD8 au1_flt[(4 * MAX_CU_SIZE) + 1];
  117|   551k|    WORD32 bi_linear_int_flag = 0;
  118|   551k|    WORD32 abs_cond_left_flag = 0;
  119|   551k|    WORD32 abs_cond_top_flag = 0;
  120|   551k|    WORD32 dc_val = 1 << (BIT_DEPTH - 5);
  ------------------
  |  |   66|   551k|#define BIT_DEPTH 8
  ------------------
  121|   551k|    __m128i src_temp1, src_temp2, src_temp3, src_temp7;
  122|   551k|    __m128i src_temp4, src_temp5, src_temp6, src_temp8;
  123|       |
  124|   551k|    WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3);
  125|   551k|    WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1;
  126|   551k|    filter_flag = intra_smoothing_disabled ?
  ------------------
  |  Branch (126:19): [True: 6.33k, False: 545k]
  ------------------
  127|   545k|                    0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)));
  128|   551k|    if(0 == filter_flag)
  ------------------
  |  Branch (128:8): [True: 355k, False: 196k]
  ------------------
  129|   355k|    {
  130|   355k|        if(pu1_src == pu1_dst)
  ------------------
  |  Branch (130:12): [True: 355k, False: 18.4E]
  ------------------
  131|   355k|        {
  132|   355k|            return;
  133|   355k|        }
  134|  18.4E|        else
  135|  18.4E|        {
  136|  18.4E|            if(nt == 4)
  ------------------
  |  Branch (136:16): [True: 0, False: 18.4E]
  ------------------
  137|      0|            {
  138|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  139|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  140|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  141|       |
  142|      0|            }
  143|       |
  144|  18.4E|            else if(nt == 8)
  ------------------
  |  Branch (144:21): [True: 0, False: 18.4E]
  ------------------
  145|      0|            {
  146|       |
  147|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  148|      0|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_src + 16));
  149|       |
  150|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  151|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  152|       |
  153|       |
  154|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  155|      0|            }
  156|  18.4E|            else if(nt == 16)
  ------------------
  |  Branch (156:21): [True: 0, False: 18.4E]
  ------------------
  157|      0|            {
  158|       |
  159|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  160|      0|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_src + 16));
  161|      0|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_src + 32));
  162|      0|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_src + 48));
  163|       |
  164|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  165|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  166|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  167|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  168|       |
  169|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  170|      0|            }
  171|  18.4E|            else if(nt == 32)
  ------------------
  |  Branch (171:21): [True: 0, False: 18.4E]
  ------------------
  172|      0|            {
  173|       |
  174|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  175|      0|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_src + 16));
  176|      0|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_src + 32));
  177|      0|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_src + 48));
  178|       |
  179|      0|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_src + 64));
  180|      0|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_src + 80));
  181|      0|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_src + 96));
  182|      0|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_src + 112));
  183|       |
  184|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  185|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  186|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  187|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  188|       |
  189|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 64), src_temp5);
  190|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 80), src_temp6);
  191|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 96), src_temp7);
  192|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 112), src_temp8);
  193|       |
  194|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  195|      0|            }
  196|       |
  197|  18.4E|        }
  198|   355k|    }
  199|       |
  200|   196k|    else
  201|   196k|    {
  202|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  203|   196k|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (203:12): [True: 46.6k, False: 149k]
  |  Branch (203:57): [True: 26.9k, False: 19.6k]
  ------------------
  204|  26.9k|        {
  205|       |            /* Strong Intra Filtering */
  206|  26.9k|            abs_cond_top_flag = (abs(pu1_src[2 * nt] + pu1_src[4 * nt]
  207|  26.9k|                                     - (2 * pu1_src[3 * nt]))) < dc_val;
  208|  26.9k|            abs_cond_left_flag = (abs(pu1_src[2 * nt] + pu1_src[0]
  209|  26.9k|                                      - (2 * pu1_src[nt]))) < dc_val;
  210|       |
  211|  26.9k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (211:35): [True: 23.4k, False: 3.48k]
  ------------------
  212|  23.4k|                            && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (212:32): [True: 22.0k, False: 1.39k]
  ------------------
  213|  26.9k|        }
  214|       |        /* Extremities Untouched*/
  215|   196k|        au1_flt[0] = pu1_src[0];
  216|   196k|        au1_flt[4 * nt] = pu1_src[4 * nt];
  217|       |
  218|       |        /* Strong filtering of reference samples */
  219|   196k|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (219:12): [True: 22.0k, False: 174k]
  ------------------
  220|  22.0k|        {
  221|  22.0k|            au1_flt[2 * nt] = pu1_src[2 * nt];
  222|       |
  223|  1.41M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (223:24): [True: 1.38M, False: 22.0k]
  ------------------
  224|  1.38M|                au1_flt[i] = (((2 * nt) - i) * pu1_src[0] + i * pu1_src[2 * nt] + 32) >> 6;
  225|       |
  226|  1.41M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (226:24): [True: 1.39M, False: 22.0k]
  ------------------
  227|  1.39M|                au1_flt[i + (2 * nt)] = (((2 * nt) - i) * pu1_src[2 * nt] + i * pu1_src[4 * nt] + 32) >> 6;
  228|  22.0k|        }
  229|   174k|        else
  230|   174k|        {
  231|   174k|            __m128i const_value_8x16;
  232|       |
  233|   174k|            const_value_8x16 = _mm_set1_epi16(2);
  234|       |
  235|   174k|            au1_flt[0] = pu1_src[0];
  236|   174k|            au1_flt[4 * nt] = pu1_src[4 * nt];
  237|       |
  238|       |            /* Perform bilinear filtering of Reference Samples */
  239|  1.26M|            for(i = 0; i < (four_nt); i += 16)
  ------------------
  |  Branch (239:24): [True: 1.09M, False: 174k]
  ------------------
  240|  1.09M|            {
  241|  1.09M|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src + i));
  242|  1.09M|                src_temp2 = _mm_srli_si128(src_temp1, 1);
  243|  1.09M|                src_temp3 = _mm_srli_si128(src_temp2, 1);
  244|       |
  245|  1.09M|                src_temp1 =  _mm_cvtepu8_epi16(src_temp1);
  246|  1.09M|                src_temp2 =  _mm_cvtepu8_epi16(src_temp2);
  247|  1.09M|                src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  248|       |
  249|  1.09M|                src_temp2 = _mm_slli_epi16(src_temp2,  1);
  250|       |
  251|  1.09M|                src_temp1 = _mm_add_epi16(src_temp1, src_temp2);
  252|  1.09M|                src_temp1 = _mm_add_epi16(src_temp1, src_temp3);
  253|  1.09M|                src_temp1 = _mm_add_epi16(src_temp1, const_value_8x16);
  254|       |
  255|  1.09M|                src_temp1 = _mm_srai_epi16(src_temp1,  2);
  256|       |
  257|  1.09M|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_src + 8 + i));
  258|  1.09M|                src_temp5 = _mm_srli_si128(src_temp4, 1);
  259|  1.09M|                src_temp6 = _mm_srli_si128(src_temp5, 1);
  260|       |
  261|  1.09M|                src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  262|  1.09M|                src_temp5 =  _mm_cvtepu8_epi16(src_temp5);
  263|  1.09M|                src_temp6 =  _mm_cvtepu8_epi16(src_temp6);
  264|       |
  265|  1.09M|                src_temp5 = _mm_slli_epi16(src_temp5,  1);
  266|       |
  267|  1.09M|                src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  268|  1.09M|                src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  269|  1.09M|                src_temp4 = _mm_add_epi16(src_temp4, const_value_8x16);
  270|       |
  271|  1.09M|                src_temp4 = _mm_srai_epi16(src_temp4,  2);
  272|       |
  273|       |                /* converting 16 bit to 8 bit */
  274|  1.09M|                src_temp1 = _mm_packus_epi16(src_temp1, src_temp4);
  275|       |
  276|  1.09M|                _mm_storeu_si128((__m128i *)(au1_flt + 1 + i), src_temp1);
  277|  1.09M|            }
  278|   174k|            au1_flt[4 * nt] = pu1_src[4 * nt];
  279|   174k|        }
  280|       |
  281|   196k|        if(nt == 4)
  ------------------
  |  Branch (281:12): [True: 0, False: 196k]
  ------------------
  282|      0|        {
  283|      0|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  284|      0|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  285|      0|            pu1_dst[four_nt] = au1_flt[four_nt];
  286|      0|        }
  287|   196k|        else if(nt == 8)
  ------------------
  |  Branch (287:17): [True: 21.1k, False: 175k]
  ------------------
  288|  21.1k|        {
  289|       |
  290|  21.1k|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  291|  21.1k|            src_temp2 = _mm_loadu_si128((__m128i *)(au1_flt + 16));
  292|       |
  293|  21.1k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  294|  21.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  295|       |
  296|  21.1k|            pu1_dst[four_nt] = au1_flt[four_nt];
  297|  21.1k|        }
  298|   175k|        else if(nt == 16)
  ------------------
  |  Branch (298:17): [True: 46.5k, False: 128k]
  ------------------
  299|  46.5k|        {
  300|       |
  301|  46.5k|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  302|  46.5k|            src_temp2 = _mm_loadu_si128((__m128i *)(au1_flt + 16));
  303|  46.5k|            src_temp3 = _mm_loadu_si128((__m128i *)(au1_flt + 32));
  304|  46.5k|            src_temp4 = _mm_loadu_si128((__m128i *)(au1_flt + 48));
  305|       |
  306|  46.5k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  307|  46.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  308|  46.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  309|  46.5k|            _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  310|       |
  311|  46.5k|            pu1_dst[four_nt] = au1_flt[four_nt];
  312|  46.5k|        }
  313|       |
  314|   128k|        else if(nt == 32)
  ------------------
  |  Branch (314:17): [True: 130k, False: 18.4E]
  ------------------
  315|   130k|        {
  316|       |
  317|   130k|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  318|   130k|            src_temp2 = _mm_loadu_si128((__m128i *)(au1_flt + 16));
  319|   130k|            src_temp3 = _mm_loadu_si128((__m128i *)(au1_flt + 32));
  320|   130k|            src_temp4 = _mm_loadu_si128((__m128i *)(au1_flt + 48));
  321|       |
  322|   130k|            src_temp5 = _mm_loadu_si128((__m128i *)(au1_flt + 64));
  323|   130k|            src_temp6 = _mm_loadu_si128((__m128i *)(au1_flt + 80));
  324|   130k|            src_temp7 = _mm_loadu_si128((__m128i *)(au1_flt + 96));
  325|   130k|            src_temp8 = _mm_loadu_si128((__m128i *)(au1_flt + 112));
  326|       |
  327|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  328|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  329|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  330|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  331|       |
  332|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 64), src_temp5);
  333|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 80), src_temp6);
  334|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 96), src_temp7);
  335|   130k|            _mm_storeu_si128((__m128i *)(pu1_dst + 112), src_temp8);
  336|       |
  337|   130k|            pu1_dst[four_nt] = au1_flt[four_nt];
  338|   130k|        }
  339|       |
  340|   196k|    }
  341|   551k|}
ihevc_intra_pred_luma_dc_sse42:
  388|  54.0k|{
  389|       |
  390|  54.0k|    WORD32 acc_dc;
  391|  54.0k|    WORD32 dc_val, two_dc_val, three_dc_val;
  392|  54.0k|    WORD32 row;
  393|  54.0k|    WORD32 log2nt = 5;
  394|  54.0k|    WORD32 two_nt, three_nt;
  395|  54.0k|    __m128i src_temp1, src_temp7, src_temp3, src_temp4, src_temp5, src_temp6;
  396|  54.0k|    __m128i src_temp8, src_temp9, src_temp10, src_temp2;
  397|  54.0k|    __m128i m_zero = _mm_set1_epi32(0);
  398|  54.0k|    __m128i sm = _mm_loadu_si128((__m128i *)&IHEVCE_SHUFFLEMASK5[0]);
  399|  54.0k|    UNUSED(src_strd);
  ------------------
  |  |   38|  54.0k|#define UNUSED(x) ((void)(x))
  ------------------
  400|  54.0k|    UNUSED(mode);
  ------------------
  |  |   38|  54.0k|#define UNUSED(x) ((void)(x))
  ------------------
  401|       |
  402|       |
  403|  54.0k|    switch(nt)
  404|  54.0k|    {
  405|  11.1k|        case 32:
  ------------------
  |  Branch (405:9): [True: 11.1k, False: 42.9k]
  ------------------
  406|  11.1k|            log2nt = 5;
  407|  11.1k|            break;
  408|  5.57k|        case 16:
  ------------------
  |  Branch (408:9): [True: 5.57k, False: 48.5k]
  ------------------
  409|  5.57k|            log2nt = 4;
  410|  5.57k|            break;
  411|  10.9k|        case 8:
  ------------------
  |  Branch (411:9): [True: 10.9k, False: 43.1k]
  ------------------
  412|  10.9k|            log2nt = 3;
  413|  10.9k|            break;
  414|  26.4k|        case 4:
  ------------------
  |  Branch (414:9): [True: 26.4k, False: 27.6k]
  ------------------
  415|  26.4k|            log2nt = 2;
  416|  26.4k|            break;
  417|      0|        default:
  ------------------
  |  Branch (417:9): [True: 0, False: 54.0k]
  ------------------
  418|      0|            break;
  419|  54.0k|    }
  420|  54.0k|    two_nt = 2 * nt;
  421|  54.0k|    three_nt = 3 * nt;
  422|       |
  423|  54.0k|    acc_dc = 0;
  424|       |    /* Calculate DC value for the transform block */
  425|       |
  426|       |
  427|       |
  428|  54.0k|    if(nt == 32)
  ------------------
  |  Branch (428:8): [True: 11.1k, False: 42.9k]
  ------------------
  429|  11.1k|    {
  430|  11.1k|        __m128i temp;
  431|  11.1k|        WORD32 itr_count;
  432|       |
  433|  11.1k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
  434|  11.1k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 16));
  435|  11.1k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 32));
  436|  11.1k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 48));
  437|       |
  438|  11.1k|        src_temp3 = _mm_sad_epu8(src_temp3, m_zero);
  439|  11.1k|        src_temp4 = _mm_sad_epu8(src_temp4, m_zero);
  440|  11.1k|        src_temp7 = _mm_sad_epu8(src_temp7, m_zero);
  441|  11.1k|        src_temp8 = _mm_sad_epu8(src_temp8, m_zero);
  442|       |
  443|  11.1k|        src_temp4 = _mm_add_epi16(src_temp3, src_temp4);
  444|  11.1k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  445|  11.1k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  446|       |
  447|  11.1k|        src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
  448|  11.1k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  449|       |
  450|  11.1k|        acc_dc = _mm_cvtsi128_si32(src_temp4);
  451|       |
  452|  11.1k|        acc_dc += pu1_ref[three_nt];
  453|  11.1k|        acc_dc -= pu1_ref[two_nt];
  454|       |
  455|       |        /* computing acc_dc value */
  456|  11.1k|        dc_val = (acc_dc + nt) >> (log2nt + 1);
  457|       |
  458|  11.1k|        two_dc_val = 2 * dc_val;
  459|  11.1k|        three_dc_val = 3 * dc_val;
  460|       |
  461|  11.1k|        temp = _mm_set1_epi8(dc_val);
  462|       |
  463|  33.4k|        for(itr_count = 0; itr_count < 2; itr_count++)
  ------------------
  |  Branch (463:28): [True: 22.2k, False: 11.1k]
  ------------------
  464|  22.2k|        {
  465|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  466|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp);
  467|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp);
  468|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp);
  469|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp);
  470|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp);
  471|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp);
  472|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp);
  473|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp);
  474|       |
  475|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp);
  476|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp);
  477|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp);
  478|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp);
  479|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp);
  480|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp);
  481|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp);
  482|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp);
  483|       |
  484|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp);
  485|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp);
  486|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp);
  487|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp);
  488|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp);
  489|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp);
  490|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp);
  491|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp);
  492|       |
  493|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp);
  494|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp);
  495|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp);
  496|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp);
  497|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp);
  498|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp);
  499|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp);
  500|  22.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp);
  501|       |
  502|  22.2k|            pu1_dst += 16 * dst_strd;
  503|  22.2k|        }
  504|  11.1k|    }
  505|       |
  506|  42.9k|    else
  507|       |
  508|  42.9k|    {
  509|  42.9k|        __m128i  zero_8x16b;
  510|  42.9k|        __m128i sm1 = _mm_loadu_si128((__m128i *)&IHEVCE_SHUFFLEMASK4[0]);
  511|       |
  512|       |        /* DC filtering for the first top row and first left column */
  513|       |
  514|  42.9k|        zero_8x16b = _mm_set1_epi16(0);
  515|       |
  516|  42.9k|        if(nt == 4) /* nt multiple of 4*/
  ------------------
  |  Branch (516:12): [True: 26.4k, False: 16.5k]
  ------------------
  517|  26.4k|        {
  518|  26.4k|            WORD32 temp1, temp2, temp3;
  519|       |
  520|  26.4k|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
  521|  26.4k|            src_temp2 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  522|       |
  523|  26.4k|            src_temp4 =  _mm_cvtepu8_epi16(src_temp3);
  524|  26.4k|            src_temp2 =  _mm_cvtepu8_epi16(src_temp2);
  525|       |
  526|  26.4k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  527|  26.4k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  528|  26.4k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  529|       |
  530|  26.4k|            acc_dc = _mm_cvtsi128_si32(src_temp4);
  531|  26.4k|            acc_dc += pu1_ref[three_nt];
  532|  26.4k|            acc_dc -= pu1_ref[two_nt];
  533|       |
  534|       |/* computing acc_dc value */
  535|       |
  536|  26.4k|            dc_val = (acc_dc + nt) >> (log2nt + 1);
  537|       |
  538|  26.4k|            three_dc_val = 3 * dc_val;
  539|       |
  540|       |            /* loding 8-bit 16 pixel */
  541|  26.4k|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
  542|  26.4k|            two_dc_val = 2 * dc_val;
  543|       |
  544|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
  545|  26.4k|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
  546|       |
  547|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2 */
  548|  26.4k|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
  549|       |
  550|  26.4k|            src_temp2 = _mm_packus_epi16(src_temp2, zero_8x16b);
  551|       |
  552|  26.4k|            temp1 = _mm_cvtsi128_si32(src_temp2);
  553|       |
  554|  26.4k|            *(WORD32 *)(&pu1_dst[0]) = temp1;
  555|       |
  556|       |            /*  retore  first value*/
  557|  26.4k|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  558|  26.4k|                            >> 2);
  559|       |
  560|   105k|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (560:26): [True: 79.3k, False: 26.4k]
  ------------------
  561|  79.3k|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  562|  79.3k|                                >> 2;
  563|       |
  564|  26.4k|            src_temp2 = _mm_insert_epi8(src_temp2, dc_val, 0);
  565|       |
  566|  26.4k|            src_temp2 =  _mm_shuffle_epi8(src_temp2, sm1);
  567|  26.4k|            src_temp3 =  _mm_shuffle_epi8(src_temp2, sm1);
  568|  26.4k|            src_temp4 =  _mm_shuffle_epi8(src_temp2, sm1);
  569|       |
  570|  26.4k|            src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[(1 * dst_strd) + 0], 0);
  571|  26.4k|            src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[(2 * dst_strd) + 0], 0);
  572|  26.4k|            src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[(3 * dst_strd) + 0], 0);
  573|       |
  574|  26.4k|            temp1 = _mm_cvtsi128_si32(src_temp2);
  575|  26.4k|            temp2 = _mm_cvtsi128_si32(src_temp3);
  576|  26.4k|            temp3 = _mm_cvtsi128_si32(src_temp4);
  577|       |
  578|  26.4k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp1;
  579|  26.4k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp2;
  580|  26.4k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp3;
  581|       |
  582|  26.4k|        }
  583|  16.5k|        else if(nt == 8) /* if nt%8==0*/
  ------------------
  |  Branch (583:17): [True: 10.9k, False: 5.57k]
  ------------------
  584|  10.9k|        {
  585|       |
  586|  10.9k|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
  587|       |
  588|  10.9k|            src_temp4 = _mm_sad_epu8(src_temp3, m_zero);
  589|  10.9k|            src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
  590|  10.9k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  591|       |
  592|  10.9k|            acc_dc = _mm_cvtsi128_si32(src_temp4);
  593|       |
  594|  10.9k|            acc_dc += pu1_ref[three_nt];
  595|  10.9k|            acc_dc -= pu1_ref[two_nt];
  596|       |
  597|       |            /* computing acc_dc value */
  598|       |
  599|  10.9k|            dc_val = (acc_dc + nt) >> (log2nt + 1);
  600|       |
  601|  10.9k|            three_dc_val = 3 * dc_val;
  602|  10.9k|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
  603|  10.9k|            two_dc_val = 2 * dc_val;
  604|       |
  605|       |            /* loding 8-bit 16 pixel */
  606|  10.9k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  607|  10.9k|            src_temp2 =  _mm_cvtepu8_epi16(src_temp2);
  608|       |
  609|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
  610|  10.9k|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
  611|       |
  612|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2)>>2 */
  613|  10.9k|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
  614|  10.9k|            src_temp2 = _mm_packus_epi16(src_temp2, zero_8x16b);
  615|       |
  616|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_temp2);
  617|       |
  618|       |            /*  retore  first value*/
  619|  10.9k|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  620|  10.9k|                            >> 2);
  621|       |
  622|  87.5k|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (622:26): [True: 76.6k, False: 10.9k]
  ------------------
  623|  76.6k|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  624|  76.6k|                                >> 2;
  625|       |
  626|       |            /* Fill the remaining rows with DC value*/
  627|       |
  628|  10.9k|            src_temp1 = _mm_set1_epi8(dc_val);
  629|  10.9k|            src_temp2 = _mm_set1_epi8(dc_val);
  630|  10.9k|            src_temp3 = _mm_set1_epi8(dc_val);
  631|  10.9k|            src_temp4 = _mm_set1_epi8(dc_val);
  632|  10.9k|            src_temp5 = _mm_set1_epi8(dc_val);
  633|  10.9k|            src_temp6 = _mm_set1_epi8(dc_val);
  634|  10.9k|            src_temp7 = _mm_set1_epi8(dc_val);
  635|       |
  636|  10.9k|            src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((1) * dst_strd)], 0);
  637|  10.9k|            src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[((2) * dst_strd)], 0);
  638|  10.9k|            src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[((3) * dst_strd)], 0);
  639|  10.9k|            src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[((4) * dst_strd)], 0);
  640|  10.9k|            src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[((5) * dst_strd)], 0);
  641|  10.9k|            src_temp6 = _mm_insert_epi8(src_temp6, pu1_dst[((6) * dst_strd)], 0);
  642|  10.9k|            src_temp7 = _mm_insert_epi8(src_temp7, pu1_dst[((7) * dst_strd)], 0);
  643|       |
  644|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
  645|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
  646|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
  647|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
  648|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
  649|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
  650|  10.9k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
  651|       |
  652|  10.9k|        }
  653|  5.57k|        else if(nt == 16) /* if nt%8==0*/
  ------------------
  |  Branch (653:17): [True: 5.57k, False: 18.4E]
  ------------------
  654|  5.57k|        {
  655|       |
  656|  5.57k|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
  657|  5.57k|            src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 16));
  658|       |
  659|  5.57k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  660|  5.57k|            src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 8));
  661|       |
  662|  5.57k|            src_temp3 = _mm_sad_epu8(src_temp3, m_zero);
  663|  5.57k|            src_temp4 = _mm_sad_epu8(src_temp4, m_zero);
  664|       |
  665|  5.57k|            src_temp2 =  _mm_cvtepu8_epi16(src_temp2);
  666|  5.57k|            src_temp10 =  _mm_cvtepu8_epi16(src_temp10);
  667|       |
  668|  5.57k|            src_temp4 = _mm_add_epi16(src_temp3, src_temp4);
  669|  5.57k|            src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
  670|  5.57k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  671|       |
  672|  5.57k|            acc_dc = _mm_cvtsi128_si32(src_temp4);
  673|       |
  674|  5.57k|            acc_dc += pu1_ref[three_nt];
  675|  5.57k|            acc_dc -= pu1_ref[two_nt];
  676|       |
  677|       |            /* computing acc_dc value */
  678|       |
  679|  5.57k|            dc_val = (acc_dc + nt) >> (log2nt + 1);
  680|       |
  681|  5.57k|            three_dc_val = 3 * dc_val;
  682|  5.57k|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
  683|  5.57k|            two_dc_val = 2 * dc_val;
  684|       |
  685|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
  686|  5.57k|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
  687|  5.57k|            src_temp10 = _mm_add_epi16(src_temp10, src_temp1);
  688|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2)>>2 */
  689|  5.57k|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
  690|  5.57k|            src_temp10 = _mm_srli_epi16(src_temp10, 2);
  691|       |
  692|  5.57k|            src_temp2 = _mm_packus_epi16(src_temp2, src_temp10);
  693|       |
  694|  5.57k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp2);
  695|       |
  696|       |            /*  retore  first value*/
  697|  5.57k|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  698|  5.57k|                            >> 2);
  699|       |
  700|  89.2k|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (700:26): [True: 83.6k, False: 5.57k]
  ------------------
  701|  83.6k|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  702|  83.6k|                                >> 2;
  703|       |            /* Fill the remaining rows with DC value*/
  704|  5.57k|            src_temp1 =  _mm_set1_epi8(dc_val);
  705|  5.57k|            src_temp2 =  _mm_set1_epi8(dc_val);
  706|  5.57k|            src_temp3 =  _mm_set1_epi8(dc_val);
  707|  5.57k|            src_temp4 =  _mm_set1_epi8(dc_val);
  708|  5.57k|            src_temp5 =  _mm_set1_epi8(dc_val);
  709|  5.57k|            src_temp6 =  _mm_set1_epi8(dc_val);
  710|  5.57k|            src_temp7 =  _mm_set1_epi8(dc_val);
  711|       |
  712|  16.7k|            for(row = 1; row < nt; row += 8)
  ------------------
  |  Branch (712:26): [True: 11.1k, False: 5.57k]
  ------------------
  713|  11.1k|            {
  714|       |
  715|  11.1k|                src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((1) * dst_strd)], 0);
  716|  11.1k|                src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[((2) * dst_strd)], 0);
  717|  11.1k|                src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[((3) * dst_strd)], 0);
  718|  11.1k|                src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[((4) * dst_strd)], 0);
  719|  11.1k|                src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[((5) * dst_strd)], 0);
  720|  11.1k|                src_temp6 = _mm_insert_epi8(src_temp6, pu1_dst[((6) * dst_strd)], 0);
  721|  11.1k|                src_temp7 = _mm_insert_epi8(src_temp7, pu1_dst[((7) * dst_strd)], 0);
  722|       |
  723|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
  724|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
  725|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
  726|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
  727|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
  728|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
  729|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
  730|       |
  731|  11.1k|                src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((8) * dst_strd)], 0);
  732|  11.1k|                src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[((9) * dst_strd)], 0);
  733|  11.1k|                src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[((10) * dst_strd)], 0);
  734|  11.1k|                src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[((11) * dst_strd)], 0);
  735|  11.1k|                src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[((12) * dst_strd)], 0);
  736|  11.1k|                src_temp6 = _mm_insert_epi8(src_temp6, pu1_dst[((13) * dst_strd)], 0);
  737|  11.1k|                src_temp7 = _mm_insert_epi8(src_temp7, pu1_dst[((14) * dst_strd)], 0);
  738|       |
  739|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), src_temp1);
  740|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), src_temp2);
  741|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), src_temp3);
  742|       |
  743|  11.1k|                src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((15) * dst_strd)], 0);
  744|       |
  745|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), src_temp4);
  746|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), src_temp5);
  747|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), src_temp6);
  748|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), src_temp7);
  749|       |
  750|  11.1k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), src_temp1);
  751|       |
  752|  11.1k|            }
  753|       |
  754|  5.57k|        }
  755|  18.4E|        else if(nt == 32) /* if nt%8==0*/
  ------------------
  |  Branch (755:17): [True: 0, False: 18.4E]
  ------------------
  756|      0|        {
  757|       |
  758|      0|            __m128i src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16, src_temp17;
  759|       |
  760|      0|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
  761|      0|            src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 16));
  762|      0|            src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 32));
  763|      0|            src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 48));
  764|       |
  765|       |            /* loding 8-bit 16 pixel */
  766|      0|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  767|      0|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 8));
  768|      0|            src_temp9 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 16));
  769|      0|            src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 24));
  770|       |
  771|      0|            src_temp3 = _mm_sad_epu8(src_temp3, m_zero);
  772|      0|            src_temp4 = _mm_sad_epu8(src_temp4, m_zero);
  773|      0|            src_temp7 = _mm_sad_epu8(src_temp7, m_zero);
  774|      0|            src_temp8 = _mm_sad_epu8(src_temp8, m_zero);
  775|       |
  776|      0|            src_temp2 =  _mm_cvtepu8_epi16(src_temp2);
  777|      0|            src_temp6 =  _mm_cvtepu8_epi16(src_temp6);
  778|      0|            src_temp9 =  _mm_cvtepu8_epi16(src_temp9);
  779|      0|            src_temp10 =  _mm_cvtepu8_epi16(src_temp10);
  780|       |
  781|      0|            src_temp4 = _mm_add_epi16(src_temp3, src_temp4);
  782|      0|            src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  783|      0|            src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  784|       |
  785|      0|            src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
  786|      0|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  787|       |
  788|      0|            acc_dc = _mm_cvtsi128_si32(src_temp4);
  789|       |
  790|      0|            acc_dc += pu1_ref[three_nt];
  791|      0|            acc_dc -= pu1_ref[two_nt];
  792|       |
  793|       |            /* computing acc_dc value */
  794|       |
  795|      0|            dc_val = (acc_dc + nt) >> (log2nt + 1);
  796|       |
  797|      0|            three_dc_val = 3 * dc_val;
  798|      0|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
  799|      0|            two_dc_val = 2 * dc_val;
  800|       |
  801|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
  802|      0|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
  803|      0|            src_temp2 = _mm_add_epi16(src_temp6, src_temp1);
  804|      0|            src_temp2 = _mm_add_epi16(src_temp9, src_temp1);
  805|      0|            src_temp2 = _mm_add_epi16(src_temp10, src_temp1);
  806|       |
  807|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2)>>2 */
  808|      0|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
  809|      0|            src_temp6 = _mm_srli_epi16(src_temp6, 2);
  810|      0|            src_temp9 = _mm_srli_epi16(src_temp9, 2);
  811|      0|            src_temp10 = _mm_srli_epi16(src_temp10, 2);
  812|       |
  813|      0|            src_temp2 = _mm_packus_epi16(src_temp2, src_temp6);
  814|      0|            src_temp10 = _mm_packus_epi16(src_temp9, src_temp10);
  815|       |
  816|      0|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp2);
  817|      0|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp10);
  818|       |
  819|       |            /*  retore  first value*/
  820|      0|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  821|      0|                            >> 2);
  822|       |
  823|      0|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (823:26): [True: 0, False: 0]
  ------------------
  824|      0|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  825|      0|                                >> 2;
  826|       |            /* Fill the remaining rows with DC value*/
  827|      0|            src_temp1 = _mm_insert_epi8(src_temp1, dc_val, 0);
  828|       |
  829|      0|            src_temp2 =  src_temp1;
  830|      0|            src_temp3 = src_temp1;
  831|      0|            src_temp4 =  src_temp1;
  832|      0|            src_temp5 =  src_temp1;
  833|      0|            src_temp6 =  src_temp1;
  834|      0|            src_temp7 =  src_temp1;
  835|       |
  836|      0|            src_temp12 = src_temp1;
  837|      0|            src_temp13 = src_temp1;
  838|      0|            src_temp14 = src_temp1;
  839|      0|            src_temp15 = src_temp1;
  840|      0|            src_temp16 = src_temp1;
  841|      0|            src_temp17 = src_temp1;
  842|      0|            src_temp11 = src_temp1;
  843|       |
  844|      0|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (844:26): [True: 0, False: 0]
  ------------------
  845|      0|            {
  846|      0|                src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((1) * dst_strd)], 0);
  847|      0|                src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[((2) * dst_strd)], 0);
  848|      0|                src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[((3) * dst_strd)], 0);
  849|      0|                src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[((4) * dst_strd)], 0);
  850|      0|                src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[((5) * dst_strd)], 0);
  851|      0|                src_temp6 = _mm_insert_epi8(src_temp6, pu1_dst[((6) * dst_strd)], 0);
  852|      0|                src_temp7 = _mm_insert_epi8(src_temp7, pu1_dst[((7) * dst_strd)], 0);
  853|       |
  854|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd)), src_temp1);
  855|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd) + 16), src_temp11);
  856|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp2);
  857|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 16), src_temp12);
  858|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp3);
  859|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 16), src_temp13);
  860|       |
  861|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp4);
  862|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 16), src_temp14);
  863|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp5);
  864|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd) + 16), src_temp15);
  865|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp6);
  866|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd) + 16), src_temp16);
  867|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp7);
  868|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd) + 16), src_temp17);
  869|       |
  870|       |
  871|      0|            }
  872|       |
  873|      0|        }
  874|  42.9k|    }
  875|  54.0k|}
ihevc_intra_pred_luma_horz_sse42:
  920|  18.8k|{
  921|       |
  922|  18.8k|    WORD32 row;
  923|  18.8k|    WORD32 two_nt;
  924|  18.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  18.8k|#define UNUSED(x) ((void)(x))
  ------------------
  925|       |
  926|  18.8k|    two_nt = 2 * nt;
  927|       |
  928|       |
  929|  18.8k|    if(nt == 32)
  ------------------
  |  Branch (929:8): [True: 3.09k, False: 15.7k]
  ------------------
  930|  3.09k|    {
  931|  3.09k|        __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
  932|  3.09k|        __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
  933|  3.09k|        __m128i sm = _mm_loadu_si128((__m128i *)&IHEVCE_SHUFFLEMASK4[0]);
  934|       |
  935|  9.28k|        for(row = 0; row < nt; row += 16)
  ------------------
  |  Branch (935:22): [True: 6.18k, False: 3.09k]
  ------------------
  936|  6.18k|        {
  937|  6.18k|            {
  938|  6.18k|                src_temp1 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 1 - row - 15));
  939|       |
  940|  6.18k|                src_temp2 =  _mm_srli_si128(src_temp1, 1);
  941|  6.18k|                src_temp3 =  _mm_srli_si128(src_temp1, 2);
  942|  6.18k|                src_temp4 =  _mm_srli_si128(src_temp1, 3);
  943|  6.18k|                src_temp5 =  _mm_srli_si128(src_temp1, 4);
  944|  6.18k|                src_temp6 =  _mm_srli_si128(src_temp1, 5);
  945|  6.18k|                src_temp7 =  _mm_srli_si128(src_temp1, 6);
  946|  6.18k|                src_temp8 =  _mm_srli_si128(src_temp1, 7);
  947|       |
  948|  6.18k|                src_temp9 =  _mm_srli_si128(src_temp1, 8);
  949|  6.18k|                src_temp10 =  _mm_srli_si128(src_temp1, 9);
  950|  6.18k|                src_temp11 =  _mm_srli_si128(src_temp1, 10);
  951|  6.18k|                src_temp12 =  _mm_srli_si128(src_temp1, 11);
  952|  6.18k|                src_temp13 =  _mm_srli_si128(src_temp1, 12);
  953|  6.18k|                src_temp14 =  _mm_srli_si128(src_temp1, 13);
  954|  6.18k|                src_temp15 =  _mm_srli_si128(src_temp1, 14);
  955|  6.18k|                src_temp16 =  _mm_srli_si128(src_temp1, 15);
  956|       |
  957|  6.18k|                src_temp8 =  _mm_shuffle_epi8(src_temp8, sm);
  958|  6.18k|                src_temp7 =  _mm_shuffle_epi8(src_temp7, sm);
  959|  6.18k|                src_temp6 =  _mm_shuffle_epi8(src_temp6, sm);
  960|  6.18k|                src_temp5 =  _mm_shuffle_epi8(src_temp5, sm);
  961|  6.18k|                src_temp4 =  _mm_shuffle_epi8(src_temp4, sm);
  962|  6.18k|                src_temp3 =  _mm_shuffle_epi8(src_temp3, sm);
  963|  6.18k|                src_temp2 =  _mm_shuffle_epi8(src_temp2, sm);
  964|  6.18k|                src_temp1 =  _mm_shuffle_epi8(src_temp1, sm);
  965|       |
  966|  6.18k|                src_temp16 =  _mm_shuffle_epi8(src_temp16, sm);
  967|  6.18k|                src_temp15 =  _mm_shuffle_epi8(src_temp15, sm);
  968|  6.18k|                src_temp14 =  _mm_shuffle_epi8(src_temp14, sm);
  969|  6.18k|                src_temp13 =  _mm_shuffle_epi8(src_temp13, sm);
  970|  6.18k|                src_temp12 =  _mm_shuffle_epi8(src_temp12, sm);
  971|  6.18k|                src_temp11 =  _mm_shuffle_epi8(src_temp11, sm);
  972|  6.18k|                src_temp10 =  _mm_shuffle_epi8(src_temp10, sm);
  973|  6.18k|                src_temp9 =  _mm_shuffle_epi8(src_temp9, sm);
  974|       |
  975|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), src_temp16);
  976|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp15);
  977|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp14);
  978|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp13);
  979|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp12);
  980|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp11);
  981|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp10);
  982|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 7) * dst_strd)), src_temp9);
  983|       |
  984|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 8) * dst_strd)), src_temp8);
  985|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 9) * dst_strd)), src_temp7);
  986|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 10) * dst_strd)), src_temp6);
  987|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 11) * dst_strd)), src_temp5);
  988|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 12) * dst_strd)), src_temp4);
  989|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 13) * dst_strd)), src_temp3);
  990|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 14) * dst_strd)), src_temp2);
  991|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 15) * dst_strd)), src_temp1);
  992|       |
  993|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 0) * dst_strd)), src_temp16);
  994|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 1) * dst_strd)), src_temp15);
  995|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 2) * dst_strd)), src_temp14);
  996|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 3) * dst_strd)), src_temp13);
  997|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 4) * dst_strd)), src_temp12);
  998|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 5) * dst_strd)), src_temp11);
  999|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 6) * dst_strd)), src_temp10);
 1000|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 7) * dst_strd)), src_temp9);
 1001|       |
 1002|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 8) * dst_strd)), src_temp8);
 1003|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 9) * dst_strd)), src_temp7);
 1004|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 10) * dst_strd)), src_temp6);
 1005|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 11) * dst_strd)), src_temp5);
 1006|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 12) * dst_strd)), src_temp4);
 1007|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 13) * dst_strd)), src_temp3);
 1008|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 14) * dst_strd)), src_temp2);
 1009|  6.18k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 15) * dst_strd)), src_temp1);
 1010|       |
 1011|  6.18k|            }
 1012|       |
 1013|  6.18k|        }
 1014|       |
 1015|  3.09k|    }
 1016|  15.7k|    else
 1017|       |
 1018|  15.7k|    {
 1019|  15.7k|        __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6;
 1020|  15.7k|        __m128i src_temp10, zero_8x16b, src_temp7;
 1021|       |
 1022|       |        /* DC filtering for the first top row and first left column */
 1023|       |
 1024|  15.7k|        if (!disable_boundary_filter)
  ------------------
  |  Branch (1024:13): [True: 15.2k, False: 490]
  ------------------
 1025|  15.2k|        {
 1026|  15.2k|            zero_8x16b = _mm_set1_epi16(0);
 1027|       |
 1028|       |            /*Filtering done for the 1st row */
 1029|       |
 1030|  15.2k|            src_temp2 =  _mm_set1_epi16(pu1_ref[two_nt - 1]);
 1031|  15.2k|            src_temp10 =  _mm_set1_epi16(pu1_ref[two_nt]);
 1032|       |
 1033|       |            /*  loding 8-bit 16 pixels */
 1034|  15.2k|            src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1035|       |
 1036|  15.2k|            src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
 1037|       |
 1038|       |            /*(pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt])*/
 1039|  15.2k|            src_temp3 = _mm_sub_epi16(src_temp4, src_temp10);
 1040|       |
 1041|       |            /* ((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1)*/
 1042|  15.2k|            src_temp3 = _mm_srai_epi16(src_temp3, 1);
 1043|       |
 1044|       |            /* pu1_ref[two_nt - 1]+((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1)*/
 1045|  15.2k|            src_temp3 = _mm_add_epi16(src_temp2, src_temp3);
 1046|  15.2k|        }
 1047|       |
 1048|  15.7k|        if(nt == 4)
  ------------------
  |  Branch (1048:12): [True: 9.99k, False: 5.74k]
  ------------------
 1049|  9.99k|        {
 1050|  9.99k|            int temp1, temp2, temp3;
 1051|  9.99k|            if (disable_boundary_filter)
  ------------------
  |  Branch (1051:17): [True: 217, False: 9.77k]
  ------------------
 1052|    217|            {
 1053|    217|                src_temp3 = _mm_set1_epi8(pu1_ref[two_nt - 1]);
 1054|    217|                temp1 = _mm_cvtsi128_si32(src_temp3);
 1055|    217|            }
 1056|  9.77k|            else
 1057|  9.77k|            {
 1058|  9.77k|                src_temp3 = _mm_packus_epi16(src_temp3, zero_8x16b);
 1059|  9.77k|                temp1 = _mm_cvtsi128_si32(src_temp3);
 1060|  9.77k|            }
 1061|       |
 1062|  9.99k|            *(WORD32 *)(&pu1_dst[0]) = temp1;
 1063|       |
 1064|  9.99k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 2]);
 1065|  9.99k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 3]);
 1066|  9.99k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 4]);
 1067|       |
 1068|  9.99k|            temp1 = _mm_cvtsi128_si32(src_temp2);
 1069|  9.99k|            temp2 = _mm_cvtsi128_si32(src_temp3);
 1070|  9.99k|            temp3 = _mm_cvtsi128_si32(src_temp4);
 1071|       |
 1072|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1073|  9.99k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp1;
 1074|  9.99k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp2;
 1075|  9.99k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp3;
 1076|       |
 1077|  9.99k|        }
 1078|  5.74k|        else if(nt == 8)
  ------------------
  |  Branch (1078:17): [True: 4.02k, False: 1.72k]
  ------------------
 1079|  4.02k|        {
 1080|  4.02k|            if (disable_boundary_filter)
  ------------------
  |  Branch (1080:17): [True: 196, False: 3.83k]
  ------------------
 1081|    196|            {
 1082|    196|                src_temp10 = _mm_set1_epi8(pu1_ref[two_nt - 1]);
 1083|    196|            }
 1084|  3.83k|            else
 1085|  3.83k|            {
 1086|  3.83k|                src_temp10 = _mm_packus_epi16(src_temp3, zero_8x16b);
 1087|  3.83k|            }
 1088|       |
 1089|  4.02k|            src_temp1 =  _mm_set1_epi8(pu1_ref[two_nt - 2]);
 1090|  4.02k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 3]);
 1091|  4.02k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 4]);
 1092|  4.02k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 5]);
 1093|  4.02k|            src_temp5 =  _mm_set1_epi8(pu1_ref[two_nt - 6]);
 1094|  4.02k|            src_temp6 =  _mm_set1_epi8(pu1_ref[two_nt - 7]);
 1095|  4.02k|            src_temp7 =  _mm_set1_epi8(pu1_ref[two_nt - 8]);
 1096|       |
 1097|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_temp10);
 1098|       |
 1099|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1100|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
 1101|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp2);
 1102|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp3);
 1103|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp4);
 1104|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp5);
 1105|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp6);
 1106|  4.02k|            _mm_storel_epi64((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp7);
 1107|       |
 1108|  4.02k|        }
 1109|  1.72k|        else if(nt == 16)
  ------------------
  |  Branch (1109:17): [True: 1.72k, False: 18.4E]
  ------------------
 1110|  1.72k|        {
 1111|  1.72k|            if(disable_boundary_filter)
  ------------------
  |  Branch (1111:16): [True: 78, False: 1.64k]
  ------------------
 1112|     78|            {
 1113|     78|                src_temp3 = _mm_set1_epi8(pu1_ref[two_nt - 1]);
 1114|     78|            }
 1115|  1.64k|            else
 1116|  1.64k|            {
 1117|  1.64k|                src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 8));
 1118|  1.64k|                src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
 1119|       |
 1120|  1.64k|                src_temp10 = _mm_sub_epi16(src_temp4, src_temp10);
 1121|  1.64k|                src_temp10 = _mm_srai_epi16(src_temp10, 1);
 1122|  1.64k|                src_temp10 = _mm_add_epi16(src_temp2, src_temp10);
 1123|       |
 1124|  1.64k|                src_temp3 = _mm_packus_epi16(src_temp3, src_temp10);
 1125|  1.64k|            }
 1126|       |
 1127|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp3);
 1128|       |
 1129|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1130|  1.72k|            src_temp1 =  _mm_set1_epi8(pu1_ref[two_nt - 2]);
 1131|  1.72k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 3]);
 1132|  1.72k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 4]);
 1133|  1.72k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 5]);
 1134|  1.72k|            src_temp5 =  _mm_set1_epi8(pu1_ref[two_nt - 6]);
 1135|  1.72k|            src_temp6 =  _mm_set1_epi8(pu1_ref[two_nt - 7]);
 1136|  1.72k|            src_temp7 =  _mm_set1_epi8(pu1_ref[two_nt - 8]);
 1137|  1.72k|            src_temp10 =  _mm_set1_epi8(pu1_ref[two_nt - 9]);
 1138|       |
 1139|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
 1140|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
 1141|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
 1142|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
 1143|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
 1144|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
 1145|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
 1146|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), src_temp10);
 1147|       |
 1148|  1.72k|            src_temp1 =  _mm_set1_epi8(pu1_ref[two_nt - 10]);
 1149|  1.72k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 11]);
 1150|  1.72k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 12]);
 1151|  1.72k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 13]);
 1152|  1.72k|            src_temp5 =  _mm_set1_epi8(pu1_ref[two_nt - 14]);
 1153|  1.72k|            src_temp6 =  _mm_set1_epi8(pu1_ref[two_nt - 15]);
 1154|  1.72k|            src_temp7 =  _mm_set1_epi8(pu1_ref[two_nt - 16]);
 1155|       |
 1156|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), src_temp1);
 1157|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), src_temp2);
 1158|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), src_temp3);
 1159|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), src_temp4);
 1160|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), src_temp5);
 1161|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), src_temp6);
 1162|  1.72k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), src_temp7);
 1163|       |
 1164|  1.72k|        }
 1165|  15.7k|    }
 1166|  18.8k|}
ihevc_intra_pred_luma_ver_sse42:
 1212|  41.1k|{
 1213|  41.1k|    WORD32 row;
 1214|  41.1k|    WORD16 s2_predpixel;
 1215|  41.1k|    WORD32 two_nt = 2 * nt;
 1216|  41.1k|    __m128i src_temp0, src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7;
 1217|       |
 1218|  41.1k|    UNUSED(src_strd);
  ------------------
  |  |   38|  41.1k|#define UNUSED(x) ((void)(x))
  ------------------
 1219|       |
 1220|  41.1k|    if(nt == 32)
  ------------------
  |  Branch (1220:8): [True: 14.1k, False: 27.0k]
  ------------------
 1221|  14.1k|    {
 1222|  14.1k|        __m128i temp1, temp2;
 1223|  14.1k|        WORD32 itr_count;
 1224|       |
 1225|  14.1k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1226|  14.1k|        temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 16));
 1227|       |
 1228|  42.3k|        for(itr_count = 0; itr_count < 2; itr_count++)
  ------------------
  |  Branch (1228:28): [True: 28.2k, False: 14.1k]
  ------------------
 1229|  28.2k|        {
 1230|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
 1231|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp1);
 1232|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp1);
 1233|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp1);
 1234|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp1);
 1235|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp1);
 1236|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp1);
 1237|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp1);
 1238|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp1);
 1239|       |
 1240|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp2);
 1241|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp2);
 1242|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp2);
 1243|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp2);
 1244|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp2);
 1245|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp2);
 1246|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp2);
 1247|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp2);
 1248|       |
 1249|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp1);
 1250|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp1);
 1251|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp1);
 1252|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp1);
 1253|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp1);
 1254|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp1);
 1255|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp1);
 1256|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp1);
 1257|       |
 1258|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp2);
 1259|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp2);
 1260|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp2);
 1261|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp2);
 1262|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp2);
 1263|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp2);
 1264|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp2);
 1265|  28.2k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp2);
 1266|       |
 1267|  28.2k|            pu1_dst += 16 * dst_strd;
 1268|  28.2k|        }
 1269|  14.1k|    }
 1270|       |
 1271|  27.0k|    else
 1272|       |
 1273|  27.0k|    {
 1274|       |        /*Filtering done for the 1st column */
 1275|  27.0k|        if (disable_boundary_filter)
  ------------------
  |  Branch (1275:13): [True: 900, False: 26.1k]
  ------------------
 1276|    900|        {
 1277|  5.33k|            for(row = nt - 1; row >= 0; row--)
  ------------------
  |  Branch (1277:31): [True: 4.43k, False: 900]
  ------------------
 1278|  4.43k|            {
 1279|  4.43k|                pu1_dst[row * dst_strd] = pu1_ref[two_nt + 1];
 1280|  4.43k|            }
 1281|    900|        }
 1282|  26.1k|        else
 1283|  26.1k|        {
 1284|   214k|            for(row = nt - 1; row >= 0; row--)
  ------------------
  |  Branch (1284:31): [True: 188k, False: 26.1k]
  ------------------
 1285|   188k|            {
 1286|   188k|                s2_predpixel = pu1_ref[two_nt + 1]
 1287|   188k|                                + ((pu1_ref[two_nt - 1 - row] - pu1_ref[two_nt]) >> 1);
 1288|   188k|                pu1_dst[row * dst_strd] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|   188k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   188k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.89k, False: 185k]
  |  |  |  |  |  Branch (40:53): [True: 1.60k, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1289|   188k|            }
 1290|  26.1k|        }
 1291|       |
 1292|       |        /* Replication to next columns*/
 1293|       |
 1294|  27.0k|        if(nt == 4)
  ------------------
  |  Branch (1294:12): [True: 15.4k, False: 11.5k]
  ------------------
 1295|  15.4k|        {
 1296|  15.4k|            int temp1, temp2, temp3, temp4;
 1297|       |
 1298|  15.4k|            src_temp2 =   _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1299|  15.4k|            src_temp3 =  src_temp2;
 1300|  15.4k|            src_temp4 =  src_temp2;
 1301|  15.4k|            src_temp5 =  src_temp2;
 1302|       |
 1303|  15.4k|            src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[(0 * dst_strd)], 0);
 1304|  15.4k|            src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[(1 * dst_strd)], 0);
 1305|  15.4k|            src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[(2 * dst_strd)], 0);
 1306|  15.4k|            src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[(3 * dst_strd)], 0);
 1307|       |
 1308|  15.4k|            temp1 = _mm_cvtsi128_si32(src_temp2);
 1309|  15.4k|            temp2 = _mm_cvtsi128_si32(src_temp3);
 1310|  15.4k|            temp3 = _mm_cvtsi128_si32(src_temp4);
 1311|  15.4k|            temp4 = _mm_cvtsi128_si32(src_temp5);
 1312|       |
 1313|       |            /* loding 4-bit 8 pixels values */
 1314|  15.4k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp1;
 1315|  15.4k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp2;
 1316|  15.4k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp3;
 1317|  15.4k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp4;
 1318|       |
 1319|  15.4k|        }
 1320|  11.5k|        else if(nt == 8)
  ------------------
  |  Branch (1320:17): [True: 6.76k, False: 4.82k]
  ------------------
 1321|  6.76k|        {
 1322|       |
 1323|  6.76k|            src_temp0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1324|  6.76k|            src_temp1 = src_temp0;
 1325|  6.76k|            src_temp2 = src_temp0;
 1326|  6.76k|            src_temp3 = src_temp0;
 1327|  6.76k|            src_temp4 = src_temp0;
 1328|  6.76k|            src_temp5 = src_temp0;
 1329|  6.76k|            src_temp6 = src_temp0;
 1330|  6.76k|            src_temp7 = src_temp0;
 1331|       |
 1332|  6.76k|            src_temp0 = _mm_insert_epi8(src_temp0, pu1_dst[((0) * dst_strd)], 0);
 1333|  6.76k|            src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((1) * dst_strd)], 0);
 1334|  6.76k|            src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[((2) * dst_strd)], 0);
 1335|  6.76k|            src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[((3) * dst_strd)], 0);
 1336|  6.76k|            src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[((4) * dst_strd)], 0);
 1337|  6.76k|            src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[((5) * dst_strd)], 0);
 1338|  6.76k|            src_temp6 = _mm_insert_epi8(src_temp6, pu1_dst[((6) * dst_strd)], 0);
 1339|  6.76k|            src_temp7 = _mm_insert_epi8(src_temp7, pu1_dst[((7) * dst_strd)], 0);
 1340|       |
 1341|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((0) * dst_strd)), src_temp0);
 1342|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
 1343|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
 1344|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
 1345|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
 1346|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
 1347|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
 1348|  6.76k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
 1349|       |
 1350|       |
 1351|  6.76k|        }
 1352|  4.82k|        else if(nt == 16)
  ------------------
  |  Branch (1352:17): [True: 4.82k, False: 18.4E]
  ------------------
 1353|  4.82k|        {
 1354|  14.4k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1354:26): [True: 9.65k, False: 4.82k]
  ------------------
 1355|  9.65k|            {
 1356|       |
 1357|  9.65k|                src_temp0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1358|  9.65k|                src_temp1 = src_temp0;
 1359|  9.65k|                src_temp2 = src_temp0;
 1360|  9.65k|                src_temp3 = src_temp0;
 1361|  9.65k|                src_temp4 = src_temp0;
 1362|  9.65k|                src_temp5 = src_temp0;
 1363|  9.65k|                src_temp6 = src_temp0;
 1364|  9.65k|                src_temp7 = src_temp0;
 1365|       |
 1366|  9.65k|                src_temp0 = _mm_insert_epi8(src_temp0, pu1_dst[((row + 0) * dst_strd)], 0);
 1367|  9.65k|                src_temp1 = _mm_insert_epi8(src_temp1, pu1_dst[((row + 1) * dst_strd)], 0);
 1368|  9.65k|                src_temp2 = _mm_insert_epi8(src_temp2, pu1_dst[((row + 2) * dst_strd)], 0);
 1369|  9.65k|                src_temp3 = _mm_insert_epi8(src_temp3, pu1_dst[((row + 3) * dst_strd)], 0);
 1370|  9.65k|                src_temp4 = _mm_insert_epi8(src_temp4, pu1_dst[((row + 4) * dst_strd)], 0);
 1371|  9.65k|                src_temp5 = _mm_insert_epi8(src_temp5, pu1_dst[((row + 5) * dst_strd)], 0);
 1372|  9.65k|                src_temp6 = _mm_insert_epi8(src_temp6, pu1_dst[((row + 6) * dst_strd)], 0);
 1373|  9.65k|                src_temp7 = _mm_insert_epi8(src_temp7, pu1_dst[((row + 7) * dst_strd)], 0);
 1374|       |
 1375|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), src_temp0);
 1376|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp1);
 1377|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp2);
 1378|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp3);
 1379|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp4);
 1380|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp5);
 1381|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp6);
 1382|  9.65k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 7) * dst_strd)), src_temp7);
 1383|       |
 1384|  9.65k|            }
 1385|       |
 1386|  4.82k|        }
 1387|       |
 1388|       |
 1389|  27.0k|    }
 1390|  41.1k|}
ihevc_intra_pred_luma_mode_3_to_9_sse42:
 1437|  68.4k|{
 1438|  68.4k|    WORD32 row, col;
 1439|  68.4k|    WORD32 two_nt = 2 * nt;
 1440|  68.4k|    WORD32 intra_pred_ang;
 1441|       |
 1442|       |
 1443|  68.4k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1444|  68.4k|    __m128i fract_4x32b, intra_pred_ang_4x32b;
 1445|  68.4k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm3;
 1446|  68.4k|    UNUSED(src_strd);
  ------------------
  |  |   38|  68.4k|#define UNUSED(x) ((void)(x))
  ------------------
 1447|       |
 1448|       |
 1449|       |    /* Intra Pred Angle according to the mode */
 1450|  68.4k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1451|       |
 1452|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1453|       |    /* samples dependent on distance to obtain destination sample */
 1454|       |
 1455|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1456|       |    /* samples dependent on distance to obtain destination sample */
 1457|       |
 1458|  68.4k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1459|  68.4k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1460|  68.4k|    const_temp3_4x32b = _mm_set1_epi32(32);
 1461|  68.4k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1462|       |
 1463|  68.4k|    two_nt_4x32b = _mm_set1_epi32(two_nt - nt);
 1464|       |
 1465|       |
 1466|  68.4k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 1467|       |
 1468|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1469|  68.4k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1470|       |
 1471|  68.4k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1472|       |
 1473|  68.4k|    if(nt == 4)
  ------------------
  |  Branch (1473:8): [True: 23.1k, False: 45.2k]
  ------------------
 1474|  23.1k|    {
 1475|       |
 1476|  23.1k|        WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 1477|  23.1k|        int temp11, temp21, temp31, temp41;
 1478|       |        // WORD8  ai1_fract_temp_val[16], ai1_row_temp_val[16];
 1479|       |
 1480|  23.1k|        __m128i fract1_8x16b, fract2_8x16b;
 1481|  23.1k|        __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1482|       |
 1483|  23.1k|        __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1484|  23.1k|        __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b; //, src_temp8_8x16b;
 1485|  23.1k|        __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 1486|       |
 1487|       |        /* pos = ((row + 1) * intra_pred_ang); */
 1488|  23.1k|        res_temp5_4x32b  = _mm_mullo_epi32(row_4x32b, intra_pred_ang_4x32b);
 1489|       |
 1490|       |        /* idx = pos >> 5; */
 1491|  23.1k|        fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1492|       |
 1493|       |        /* fract = pos & (31); */
 1494|  23.1k|        ref_main_idx_4x32b = _mm_sub_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 1495|       |
 1496|       |        /*(32 - fract) */
 1497|  23.1k|        row_4x32b = _mm_sub_epi32(const_temp3_4x32b, fract_4x32b);
 1498|       |
 1499|  23.1k|        fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 1500|  23.1k|        fract2_8x16b = _mm_slli_epi16(row_4x32b, 8);
 1501|       |
 1502|  23.1k|        fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 1503|  23.1k|        row_4x32b = _mm_or_si128(row_4x32b, fract2_8x16b); /*(32 - fract) */
 1504|       |
 1505|  23.1k|        fract2_8x16b = _mm_unpackhi_epi8(row_4x32b, fract_4x32b);
 1506|  23.1k|        fract1_8x16b = _mm_unpacklo_epi8(row_4x32b, fract_4x32b);
 1507|       |
 1508|  23.1k|        temp1_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 1509|  23.1k|        temp2_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 1510|  23.1k|        temp3_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 1511|  23.1k|        temp4_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 1512|       |
 1513|  23.1k|        ref_main_temp0 = _mm_srli_si128(ref_main_idx_4x32b, 4);  /* next 32 bit values */
 1514|  23.1k|        ref_main_temp1 = _mm_srli_si128(ref_main_idx_4x32b, 8);  /* next 32 bit values */
 1515|  23.1k|        ref_main_temp2 = _mm_srli_si128(ref_main_idx_4x32b, 12); /* next 32 bit values */
 1516|  23.1k|        ref_main_idx1  = _mm_cvtsi128_si32(ref_main_idx_4x32b);    /* col=0*/
 1517|  23.1k|        ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* col=1*/
 1518|  23.1k|        ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* col=2*/
 1519|  23.1k|        ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* col=3*/
 1520|       |
 1521|       |        /* loding 8-bit 16 pixels */
 1522|  23.1k|        src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1 - 1)); /* col=0*/
 1523|  23.1k|        src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2 - 1)); /* col=1*/
 1524|  23.1k|        src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3 - 1)); /* col=2*/
 1525|  23.1k|        src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4 - 1)); /* col=3*/
 1526|       |
 1527|  23.1k|        src_temp1_8x16b =  _mm_shuffle_epi8(src_temp1_8x16b, sm3); /* col=0*/
 1528|  23.1k|        src_temp2_8x16b =  _mm_shuffle_epi8(src_temp2_8x16b, sm3); /* col=1*/
 1529|  23.1k|        src_temp3_8x16b =  _mm_shuffle_epi8(src_temp3_8x16b, sm3); /* col=2*/
 1530|  23.1k|        src_temp4_8x16b =  _mm_shuffle_epi8(src_temp4_8x16b, sm3); /* col=3*/
 1531|       |
 1532|       |        /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1533|  23.1k|        src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1534|  23.1k|        src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1535|  23.1k|        src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1536|  23.1k|        src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1537|       |
 1538|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1539|  23.1k|        src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1540|  23.1k|        src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1541|  23.1k|        src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1542|  23.1k|        src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1543|       |
 1544|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1545|  23.1k|        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1546|  23.1k|        src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1547|  23.1k|        src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1548|  23.1k|        src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1549|       |
 1550|       |        /* converting 16 bit to 8 bit */
 1551|  23.1k|        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 1552|  23.1k|        src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 1553|       |
 1554|       |
 1555|  23.1k|        src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 1556|  23.1k|        src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 1557|       |
 1558|  23.1k|        src_temp3_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1559|  23.1k|        src_temp2_8x16b = _mm_srli_si128(src_temp3_8x16b, 4);
 1560|  23.1k|        src_temp1_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 1561|  23.1k|        src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 12);
 1562|       |
 1563|  23.1k|        temp11 = _mm_cvtsi128_si32(src_temp7_8x16b);
 1564|  23.1k|        temp21 = _mm_cvtsi128_si32(src_temp1_8x16b);
 1565|  23.1k|        temp31 = _mm_cvtsi128_si32(src_temp2_8x16b);
 1566|  23.1k|        temp41 = _mm_cvtsi128_si32(src_temp3_8x16b);
 1567|       |
 1568|       |        /* loding 4-bit 8 pixels values */
 1569|  23.1k|        *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 1570|  23.1k|        *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 1571|  23.1k|        *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 1572|  23.1k|        *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 1573|       |
 1574|  23.1k|    }
 1575|       |
 1576|  45.2k|    else if(nt == 16 || nt == 32)
  ------------------
  |  Branch (1576:13): [True: 7.79k, False: 37.4k]
  |  Branch (1576:25): [True: 26.3k, False: 11.1k]
  ------------------
 1577|  34.1k|    {
 1578|  34.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1579|  34.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1580|  34.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1581|  34.1k|        const_temp4_4x32b = _mm_set1_epi16(8);
 1582|  34.1k|        const_temp3_4x32b = _mm_set1_epi16(32);
 1583|  34.1k|        two_nt_4x32b = _mm_set1_epi16(two_nt);
 1584|       |
 1585|   154k|        for(col = 0; col < nt; col += 8)
  ------------------
  |  Branch (1585:22): [True: 120k, False: 34.1k]
  ------------------
 1586|   120k|        {
 1587|   120k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1588|   120k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 1589|       |            //WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 1590|       |
 1591|   120k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 1592|       |
 1593|   120k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1594|   120k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 1595|       |
 1596|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1597|   120k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1598|       |
 1599|       |            /* idx = pos >> 5; */
 1600|   120k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1601|       |
 1602|       |            /*(32 - fract) */
 1603|   120k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1604|       |
 1605|   120k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 1606|   120k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 1607|       |
 1608|   120k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 1609|   120k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 1610|       |
 1611|       |
 1612|   120k|            fract8_8x16b = _mm_unpackhi_epi8(fract2_8x16b, fract_4x32b);
 1613|   120k|            fract_4x32b = _mm_unpacklo_epi8(fract2_8x16b, fract_4x32b);
 1614|       |
 1615|   120k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 1616|   120k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 1617|   120k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 1618|   120k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 1619|       |
 1620|   120k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 1621|   120k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 1622|   120k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 1623|   120k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 1624|       |
 1625|       |            /* fract = pos & (31); */
 1626|   120k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 1627|       |
 1628|   120k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1629|       |
 1630|   120k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1631|   120k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1632|   120k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1633|   120k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1634|       |
 1635|   120k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 1636|   120k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 1637|   120k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 1638|   120k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 1639|       |
 1640|   570k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1640:26): [True: 449k, False: 120k]
  ------------------
 1641|   449k|            {
 1642|   449k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1643|   449k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1644|       |
 1645|       |
 1646|   449k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 1647|   449k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 1648|       |
 1649|       |                /* loding 8-bit 16 pixels */
 1650|   449k|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 1 - (8 + row))); /* col=0*/
 1651|   449k|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 1 - (8 + row))); /* col=1*/
 1652|   449k|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 1 - (8 + row))); /* col=2*/
 1653|   449k|                src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 1 - (8 + row))); /* col=3*/
 1654|       |
 1655|       |                /* loding 8-bit 16 pixels */
 1656|   449k|                src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - 1 - (8 + row))); /* col=5*/
 1657|   449k|                src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - 1 - (8 + row))); /* col=6*/
 1658|   449k|                src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - 1 - (8 + row))); /* col=7*/
 1659|   449k|                src_temp14_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - 1 - (8 + row))); /* col=8*/
 1660|       |
 1661|   449k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp1_8x16b, sm3); /* col=0*/
 1662|   449k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp2_8x16b, sm3); /* col=1*/
 1663|   449k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp3_8x16b, sm3); /* col=2*/
 1664|   449k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp4_8x16b, sm3); /* col=3*/
 1665|       |
 1666|   449k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp11_8x16b, sm3); /* col=0*/
 1667|   449k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp12_8x16b, sm3); /* col=1*/
 1668|   449k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp13_8x16b, sm3); /* col=2*/
 1669|   449k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp14_8x16b, sm3); /* col=3*/
 1670|       |
 1671|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1672|   449k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1673|   449k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1674|   449k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1675|   449k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1676|       |
 1677|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1678|   449k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 1679|   449k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 1680|   449k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 1681|   449k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 1682|       |
 1683|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1684|   449k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1685|   449k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1686|   449k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1687|   449k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1688|       |
 1689|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1690|   449k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1691|   449k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1692|   449k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1693|   449k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1694|       |
 1695|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1696|   449k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 1697|   449k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 1698|   449k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 1699|   449k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 1700|       |
 1701|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1702|   449k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 1703|   449k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 1704|   449k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 1705|   449k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 1706|       |
 1707|       |                /* converting 16 bit to 8 bit */
 1708|   449k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 1709|   449k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 1710|       |
 1711|       |                /* converting 16 bit to 8 bit */
 1712|   449k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 1713|   449k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 1714|       |
 1715|   449k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 1716|   449k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 1717|       |
 1718|   449k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 1719|   449k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 1720|       |
 1721|   449k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1722|   449k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1723|       |
 1724|   449k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1725|   449k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1726|       |
 1727|   449k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 1728|   449k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 1729|       |
 1730|   449k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 1731|   449k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 1732|       |
 1733|   449k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 1734|   449k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 1735|       |
 1736|   449k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 1737|   449k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 1738|       |
 1739|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 7))), src_temp1_8x16b);          /* row=7*/
 1740|       |
 1741|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 6))), src_temp5_8x16b);       /* row=6*/
 1742|       |
 1743|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 5))), src_temp2_8x16b);       /* row=5*/
 1744|       |
 1745|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 4))), src_temp6_8x16b);       /* row=4*/
 1746|       |
 1747|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp3_8x16b);       /* row=3*/
 1748|       |
 1749|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp7_8x16b);       /* row=2*/
 1750|       |
 1751|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp4_8x16b);       /* row=1*/
 1752|       |
 1753|   449k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 0))), src_temp8_8x16b);       /* row=0*/
 1754|       |
 1755|   449k|            }
 1756|   120k|        }
 1757|  34.1k|    }
 1758|  11.1k|    else
 1759|  11.1k|    {
 1760|  11.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1761|  11.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1762|  11.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1763|  11.1k|        const_temp4_4x32b = _mm_set1_epi16(8);
 1764|  11.1k|        const_temp3_4x32b = _mm_set1_epi16(32);
 1765|  11.1k|        two_nt_4x32b = _mm_set1_epi16(two_nt - nt);
 1766|  11.1k|        {
 1767|  11.1k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1768|  11.1k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 1769|       |
 1770|  11.1k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 1771|       |
 1772|  11.1k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1773|  11.1k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 1774|       |
 1775|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1776|  11.1k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1777|       |
 1778|       |            /* idx = pos >> 5; */
 1779|  11.1k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1780|       |
 1781|       |            /* fract = pos & (31); */
 1782|  11.1k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 1783|       |
 1784|       |            /*(32 - fract) */
 1785|  11.1k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1786|       |
 1787|  11.1k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 1788|  11.1k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 1789|       |
 1790|  11.1k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 1791|  11.1k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 1792|       |
 1793|       |
 1794|  11.1k|            fract8_8x16b = _mm_unpackhi_epi8(fract2_8x16b, fract_4x32b);
 1795|  11.1k|            fract_4x32b = _mm_unpacklo_epi8(fract2_8x16b, fract_4x32b);
 1796|       |
 1797|  11.1k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 1798|  11.1k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 1799|  11.1k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 1800|  11.1k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 1801|       |
 1802|  11.1k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 1803|  11.1k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 1804|  11.1k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 1805|  11.1k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 1806|       |
 1807|  11.1k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1808|  11.1k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1809|  11.1k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1810|  11.1k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1811|       |
 1812|  11.1k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 1813|  11.1k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 1814|  11.1k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 1815|  11.1k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 1816|       |
 1817|  11.1k|            {
 1818|  11.1k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1819|  11.1k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1820|       |
 1821|  11.1k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 1822|  11.1k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 1823|       |
 1824|       |                /* loding 8-bit 16 pixels */
 1825|  11.1k|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 1)); /* col=0*/
 1826|  11.1k|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 1)); /* col=1*/
 1827|  11.1k|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 1)); /* col=2*/
 1828|  11.1k|                src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 1)); /* col=3*/
 1829|       |
 1830|       |                /* loding 8-bit 16 pixels */
 1831|  11.1k|                src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - 1)); /* col=5*/
 1832|  11.1k|                src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - 1)); /* col=6*/
 1833|  11.1k|                src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - 1)); /* col=7*/
 1834|  11.1k|                src_temp14_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - 1)); /* col=8*/
 1835|       |
 1836|  11.1k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp1_8x16b, sm3); /* col=0*/
 1837|  11.1k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp2_8x16b, sm3); /* col=1*/
 1838|  11.1k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp3_8x16b, sm3); /* col=2*/
 1839|  11.1k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp4_8x16b, sm3); /* col=3*/
 1840|       |
 1841|  11.1k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp11_8x16b, sm3); /* col=0*/
 1842|  11.1k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp12_8x16b, sm3); /* col=1*/
 1843|  11.1k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp13_8x16b, sm3); /* col=2*/
 1844|  11.1k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp14_8x16b, sm3); /* col=3*/
 1845|       |
 1846|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1847|  11.1k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1848|  11.1k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1849|  11.1k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1850|  11.1k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1851|       |
 1852|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1853|  11.1k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 1854|  11.1k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 1855|  11.1k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 1856|  11.1k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 1857|       |
 1858|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1859|  11.1k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1860|  11.1k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1861|  11.1k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1862|  11.1k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1863|       |
 1864|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1865|  11.1k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1866|  11.1k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1867|  11.1k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1868|  11.1k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1869|       |
 1870|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1871|  11.1k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 1872|  11.1k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 1873|  11.1k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 1874|  11.1k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 1875|       |
 1876|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1877|  11.1k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 1878|  11.1k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 1879|  11.1k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 1880|  11.1k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 1881|       |
 1882|       |                /* converting 16 bit to 8 bit */
 1883|  11.1k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 1884|  11.1k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 1885|       |
 1886|       |                /* converting 16 bit to 8 bit */
 1887|  11.1k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 1888|  11.1k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 1889|       |
 1890|  11.1k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 1891|  11.1k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 1892|       |
 1893|  11.1k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 1894|  11.1k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 1895|       |
 1896|  11.1k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1897|  11.1k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1898|       |
 1899|  11.1k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1900|  11.1k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1901|       |
 1902|  11.1k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 1903|  11.1k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 1904|       |
 1905|  11.1k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 1906|  11.1k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 1907|       |
 1908|  11.1k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 1909|  11.1k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 1910|       |
 1911|  11.1k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 1912|  11.1k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 1913|       |
 1914|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst), src_temp8_8x16b);       /* row=0*/
 1915|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 1)), src_temp4_8x16b);       /* row=1*/
 1916|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 2)), src_temp7_8x16b);       /* row=2*/
 1917|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 3)), src_temp3_8x16b);       /* row=3*/
 1918|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 4)), src_temp6_8x16b);       /* row=4*/
 1919|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 5)), src_temp2_8x16b);       /* row=5*/
 1920|       |
 1921|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 6)), src_temp5_8x16b);       /* row=6*/
 1922|  11.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 7)), src_temp1_8x16b);          /* row=7*/
 1923|       |
 1924|  11.1k|            }
 1925|  11.1k|        }
 1926|  11.1k|    }
 1927|       |
 1928|  68.4k|}
ihevc_intra_pred_luma_mode_11_to_17_sse42:
 1974|  56.1k|{
 1975|       |
 1976|       |    /* This function and ihevc_intra_pred_luma_mode_19_to_25 are same except*/
 1977|       |    /* for ref main & side samples assignment,can be combined for */
 1978|       |    /* optimzation*/
 1979|       |
 1980|  56.1k|    WORD32 row, col, k;
 1981|  56.1k|    WORD32 two_nt;
 1982|  56.1k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1983|  56.1k|    WORD32 ref_idx;
 1984|       |
 1985|  56.1k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1986|  56.1k|    __m128i fract_4x32b,  intra_pred_ang_4x32b;
 1987|  56.1k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm3;
 1988|       |
 1989|       |
 1990|  56.1k|    UWORD8 ref_tmp[2 * MAX_CU_SIZE + 2] = {0};
 1991|  56.1k|    UWORD8 *ref_main;
 1992|  56.1k|    UWORD8 *ref_temp;
 1993|  56.1k|    UNUSED(src_strd);
  ------------------
  |  |   38|  56.1k|#define UNUSED(x) ((void)(x))
  ------------------
 1994|       |
 1995|  56.1k|    inv_ang_sum = 128;
 1996|  56.1k|    two_nt    = 2 * nt;
 1997|  56.1k|    ref_temp = ref_tmp + 1;
 1998|  56.1k|    ref_main = ref_temp + nt - 1;
 1999|  56.1k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 2000|       |
 2001|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 2002|       |    /* samples dependent on distance to obtain destination sample */
 2003|  56.1k|    const_temp_4x32b  = _mm_set1_epi16(16);
 2004|  56.1k|    const_temp2_4x32b = _mm_set1_epi32(31);
 2005|  56.1k|    const_temp3_4x32b = _mm_set1_epi32(32);
 2006|  56.1k|    const_temp4_4x32b = _mm_set1_epi32(4);
 2007|       |
 2008|  56.1k|    two_nt_4x32b = _mm_set1_epi32(1);
 2009|       |
 2010|       |
 2011|  56.1k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 2012|       |
 2013|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2014|  56.1k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 2015|       |
 2016|  56.1k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 2017|       |
 2018|  56.1k|    if(nt == 4)
  ------------------
  |  Branch (2018:8): [True: 25.2k, False: 30.9k]
  ------------------
 2019|  25.2k|    {
 2020|       |
 2021|  25.2k|        WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2022|  25.2k|        int temp11, temp21, temp31, temp41;
 2023|       |//        WORD8  ai1_fract_temp_val[16], ai1_row_temp_val[16];
 2024|       |
 2025|  25.2k|        __m128i fract1_8x16b, fract2_8x16b;
 2026|  25.2k|        __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2027|       |
 2028|  25.2k|        __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2029|  25.2k|        __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2030|  25.2k|        __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 2031|       |
 2032|       |        /* Intermediate reference samples for negative angle modes */
 2033|       |        /* This have to be removed during optimization*/
 2034|       |        /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 2035|  25.2k|        inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 2036|       |
 2037|  25.2k|        ref_main = ref_temp + nt - 1;
 2038|   151k|        for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (2038:20): [True: 126k, False: 25.2k]
  ------------------
 2039|   126k|            ref_temp[k + nt - 1] = pu1_ref[two_nt - k];
 2040|       |
 2041|  25.2k|        ref_main = ref_temp + nt - 1;
 2042|  25.2k|        ref_idx = (nt * intra_pred_ang) >> 5;
 2043|       |
 2044|       |        /* SIMD Optimization can be done using look-up table for the loop */
 2045|       |        /* For negative angled derive the main reference samples from side */
 2046|       |        /*  reference samples refer to section 8.4.4.2.6 */
 2047|  60.0k|        for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (2047:21): [True: 34.8k, False: 25.2k]
  ------------------
 2048|  34.8k|        {
 2049|  34.8k|            inv_ang_sum += inv_ang;
 2050|  34.8k|            ref_main[k] = pu1_ref[two_nt + (inv_ang_sum >> 8)];
 2051|  34.8k|        }
 2052|       |
 2053|       |
 2054|       |        /* pos = ((row + 1) * intra_pred_ang); */
 2055|  25.2k|        res_temp5_4x32b  = _mm_mullo_epi32(row_4x32b, intra_pred_ang_4x32b);
 2056|       |
 2057|       |        /* idx = pos >> 5; */
 2058|  25.2k|        fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2059|       |
 2060|       |        /* fract = pos & (31); */
 2061|  25.2k|        ref_main_idx_4x32b = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2062|       |
 2063|       |        /*(32 - fract) */
 2064|  25.2k|        row_4x32b = _mm_sub_epi32(const_temp3_4x32b, fract_4x32b);
 2065|       |
 2066|  25.2k|        fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2067|  25.2k|        fract2_8x16b = _mm_slli_epi16(row_4x32b, 8);
 2068|       |
 2069|  25.2k|        fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2070|  25.2k|        row_4x32b = _mm_or_si128(row_4x32b, fract2_8x16b); /*(32 - fract) */
 2071|       |
 2072|  25.2k|        fract2_8x16b = _mm_unpackhi_epi8(fract_4x32b, row_4x32b);
 2073|  25.2k|        fract1_8x16b = _mm_unpacklo_epi8(fract_4x32b, row_4x32b);
 2074|       |
 2075|  25.2k|        temp1_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 2076|  25.2k|        temp2_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 2077|  25.2k|        temp3_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 2078|  25.2k|        temp4_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 2079|       |
 2080|  25.2k|        ref_main_temp0 = _mm_srli_si128(ref_main_idx_4x32b, 4);  /* next 32 bit values */
 2081|  25.2k|        ref_main_temp1 = _mm_srli_si128(ref_main_idx_4x32b, 8);  /* next 32 bit values */
 2082|  25.2k|        ref_main_temp2 = _mm_srli_si128(ref_main_idx_4x32b, 12); /* next 32 bit values */
 2083|  25.2k|        ref_main_idx1  = _mm_cvtsi128_si32(ref_main_idx_4x32b);    /* col=0*/
 2084|  25.2k|        ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* col=1*/
 2085|  25.2k|        ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* col=2*/
 2086|  25.2k|        ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* col=3*/
 2087|       |
 2088|       |        /* loding 8-bit 16 pixels */
 2089|  25.2k|        src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1)); /* col=0*/
 2090|  25.2k|        src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2)); /* col=1*/
 2091|  25.2k|        src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3)); /* col=2*/
 2092|  25.2k|        src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4)); /* col=3*/
 2093|       |
 2094|  25.2k|        src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 2095|  25.2k|        src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 2096|  25.2k|        src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 2097|  25.2k|        src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 2098|       |
 2099|       |        /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2100|  25.2k|        src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2101|  25.2k|        src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2102|  25.2k|        src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2103|  25.2k|        src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2104|       |
 2105|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2106|  25.2k|        src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2107|  25.2k|        src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2108|  25.2k|        src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2109|  25.2k|        src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2110|       |
 2111|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2112|  25.2k|        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2113|  25.2k|        src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2114|  25.2k|        src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2115|  25.2k|        src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2116|       |
 2117|       |        /* converting 16 bit to 8 bit */
 2118|  25.2k|        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2119|  25.2k|        src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2120|       |
 2121|       |
 2122|  25.2k|        src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2123|  25.2k|        src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2124|       |
 2125|  25.2k|        src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2126|  25.2k|        src_temp1_8x16b = _mm_srli_si128(src_temp7_8x16b, 4);
 2127|  25.2k|        src_temp2_8x16b = _mm_srli_si128(src_temp7_8x16b, 8);
 2128|  25.2k|        src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 12);
 2129|       |
 2130|  25.2k|        temp11 = _mm_cvtsi128_si32(src_temp7_8x16b);
 2131|  25.2k|        temp21 = _mm_cvtsi128_si32(src_temp1_8x16b);
 2132|  25.2k|        temp31 = _mm_cvtsi128_si32(src_temp2_8x16b);
 2133|  25.2k|        temp41 = _mm_cvtsi128_si32(src_temp3_8x16b);
 2134|       |
 2135|       |        /* loding 8-bit 4 pixels values */
 2136|  25.2k|        *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 2137|  25.2k|        *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 2138|  25.2k|        *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 2139|  25.2k|        *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 2140|  25.2k|    }
 2141|       |
 2142|  30.9k|    else if(nt == 32)
  ------------------
  |  Branch (2142:13): [True: 15.8k, False: 15.0k]
  ------------------
 2143|  15.8k|    {
 2144|       |
 2145|       |
 2146|  15.8k|        __m128i temp1, temp2, temp3, temp11, temp12;
 2147|  15.8k|        __m128i src_values0, src_values1;
 2148|       |        /* Intermediate reference samples for negative angle modes */
 2149|       |
 2150|  15.8k|        ref_temp[two_nt - 1] = pu1_ref[two_nt - nt];
 2151|  15.8k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + nt + 1));
 2152|  15.8k|        temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + nt + 17));
 2153|  15.8k|        temp2 = _mm_loadu_si128((__m128i *)IHEVCE_SHUFFLEMASKY3);
 2154|       |
 2155|       |        /* For negative angled derive the main reference samples from side */
 2156|       |
 2157|  15.8k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1)); /*nt-(nt+15)*/
 2158|  15.8k|        src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 17)); /*(nt+16)-(two_nt-1)*/
 2159|       |
 2160|  15.8k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode]));
 2161|  15.8k|        temp12 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode] + 16));
 2162|       |
 2163|  15.8k|        src_values0 = _mm_shuffle_epi8(src_values0, temp2);
 2164|  15.8k|        src_values1 = _mm_shuffle_epi8(src_values1, temp2);
 2165|  15.8k|        src_values0 = _mm_shuffle_epi8(src_values0, temp12);
 2166|  15.8k|        src_values1 = _mm_shuffle_epi8(src_values1, temp11);
 2167|       |
 2168|  15.8k|        temp1 = _mm_shuffle_epi8(temp1, temp2);
 2169|  15.8k|        temp3 = _mm_shuffle_epi8(temp3, temp2);
 2170|       |
 2171|  15.8k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp3);
 2172|  15.8k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1 + 16), temp1);
 2173|  15.8k|        _mm_storeu_si128((__m128i *)(ref_main - 16), src_values0);
 2174|  15.8k|        _mm_storeu_si128((__m128i *)(ref_main - nt + inv_angle_shuffle[17 - mode][0]), src_values1);
 2175|       |
 2176|       |
 2177|  15.8k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2178|  15.8k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2179|  15.8k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2180|  15.8k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2181|  15.8k|        const_temp3_4x32b = _mm_set1_epi16(32);
 2182|  15.8k|        two_nt_4x32b = _mm_set1_epi16(1);
 2183|       |
 2184|  79.3k|        for(col = 0; col < nt; col += 8)
  ------------------
  |  Branch (2184:22): [True: 63.4k, False: 15.8k]
  ------------------
 2185|  63.4k|        {
 2186|  63.4k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2187|  63.4k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2188|       |            // WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 2189|       |
 2190|  63.4k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 2191|       |
 2192|  63.4k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2193|  63.4k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2194|       |
 2195|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2196|  63.4k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2197|       |
 2198|       |            /* idx = pos >> 5; */
 2199|  63.4k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2200|       |
 2201|       |            /* fract = pos & (31); */
 2202|  63.4k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2203|       |
 2204|  63.4k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 2205|       |            /*(32 - fract) */
 2206|  63.4k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2207|       |
 2208|  63.4k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2209|  63.4k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 2210|       |
 2211|  63.4k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2212|  63.4k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 2213|       |
 2214|       |
 2215|  63.4k|            fract8_8x16b = _mm_unpackhi_epi8(fract_4x32b, fract2_8x16b);
 2216|  63.4k|            fract_4x32b = _mm_unpacklo_epi8(fract_4x32b, fract2_8x16b);
 2217|       |
 2218|  63.4k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 2219|  63.4k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 2220|  63.4k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 2221|  63.4k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 2222|       |
 2223|  63.4k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 2224|  63.4k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 2225|  63.4k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 2226|  63.4k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 2227|       |
 2228|  63.4k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2229|  63.4k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2230|  63.4k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2231|  63.4k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2232|       |
 2233|  63.4k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2234|  63.4k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2235|  63.4k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2236|  63.4k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 2237|       |
 2238|   317k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2238:26): [True: 253k, False: 63.4k]
  ------------------
 2239|   253k|            {
 2240|   253k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2241|   253k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2242|       |
 2243|       |
 2244|   253k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2245|   253k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2246|       |
 2247|       |                /* loding 8-bit 16 pixels */
 2248|   253k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row)); /* col=0*/
 2249|   253k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row)); /* col=1*/
 2250|   253k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row)); /* col=2*/
 2251|   253k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row)); /* col=3*/
 2252|       |
 2253|   253k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 1); /* col=0*/
 2254|   253k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 1); /* col=1*/
 2255|   253k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 1); /* col=2*/
 2256|   253k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 1); /* col=3*/
 2257|       |
 2258|       |                /* loding 8-bit 16 pixels */
 2259|   253k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row)); /* col=5*/
 2260|   253k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row)); /* col=6*/
 2261|   253k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row)); /* col=7*/
 2262|   253k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row)); /* col=8*/
 2263|       |
 2264|   253k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 2265|   253k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 2266|   253k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 2267|   253k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 2268|       |
 2269|   253k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp15_8x16b, sm3); /* col=0*/
 2270|   253k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp16_8x16b, sm3); /* col=1*/
 2271|   253k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp17_8x16b, sm3); /* col=2*/
 2272|   253k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp18_8x16b, sm3); /* col=3*/
 2273|       |
 2274|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2275|   253k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2276|   253k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2277|   253k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2278|   253k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2279|       |
 2280|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2281|   253k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2282|   253k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2283|   253k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2284|   253k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 2285|       |
 2286|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2287|   253k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2288|   253k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2289|   253k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2290|   253k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2291|       |
 2292|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2293|   253k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2294|   253k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2295|   253k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2296|   253k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2297|       |
 2298|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2299|   253k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2300|   253k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2301|   253k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2302|   253k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 2303|       |
 2304|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2305|   253k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2306|   253k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2307|   253k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2308|   253k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2309|       |
 2310|       |                /* converting 16 bit to 8 bit */
 2311|   253k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2312|   253k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2313|       |
 2314|       |                /* converting 16 bit to 8 bit */
 2315|   253k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 2316|   253k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 2317|       |
 2318|   253k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2319|   253k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2320|       |
 2321|   253k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2322|   253k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2323|       |
 2324|   253k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2325|   253k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2326|       |
 2327|   253k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2328|   253k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2329|       |
 2330|       |
 2331|   253k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2332|   253k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2333|       |
 2334|   253k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2335|   253k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2336|       |
 2337|   253k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 2338|   253k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 2339|   253k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 2340|   253k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 2341|       |
 2342|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * row)), src_temp1_8x16b);          /* row=0*/
 2343|       |
 2344|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp5_8x16b);       /* row=1*/
 2345|       |
 2346|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp2_8x16b);       /* row=2*/
 2347|       |
 2348|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp6_8x16b);       /* row=4*/
 2349|       |
 2350|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 4))), src_temp3_8x16b);       /* row=5*/
 2351|       |
 2352|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 5))), src_temp7_8x16b);       /* row=6*/
 2353|       |
 2354|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 6))), src_temp4_8x16b);       /* row=7*/
 2355|       |
 2356|   253k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 7))), src_temp8_8x16b);       /* row=8*/
 2357|       |
 2358|   253k|            }
 2359|  63.4k|        }
 2360|  15.8k|    }
 2361|  15.0k|    else if(nt == 16)
  ------------------
  |  Branch (2361:13): [True: 6.37k, False: 8.65k]
  ------------------
 2362|  6.37k|    {
 2363|       |
 2364|  6.37k|        __m128i temp1, temp2, temp11, src_values0;
 2365|       |        /* Intermediate reference samples for negative angle modes */
 2366|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 2367|  6.37k|        ref_temp[two_nt - 1] = pu1_ref[two_nt - nt];
 2368|  6.37k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + nt + 1));
 2369|  6.37k|        temp2 = _mm_loadu_si128((__m128i *)IHEVCE_SHUFFLEMASKY3);
 2370|  6.37k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1)); /*nt-(nt+15)*/
 2371|       |
 2372|  6.37k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode] + 16));
 2373|       |
 2374|  6.37k|        src_values0 = _mm_shuffle_epi8(src_values0, temp2);
 2375|  6.37k|        temp1 = _mm_shuffle_epi8(temp1, temp2);
 2376|  6.37k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 2377|       |
 2378|  6.37k|        _mm_storeu_si128((__m128i *)(ref_main - nt), src_values0);
 2379|  6.37k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp1);
 2380|       |
 2381|  6.37k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2382|  6.37k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2383|  6.37k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2384|  6.37k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2385|  6.37k|        const_temp3_4x32b = _mm_set1_epi16(32);
 2386|  6.37k|        two_nt_4x32b = _mm_set1_epi16(1);
 2387|       |
 2388|  19.1k|        for(col = 0; col < nt; col += 8)
  ------------------
  |  Branch (2388:22): [True: 12.7k, False: 6.37k]
  ------------------
 2389|  12.7k|        {
 2390|  12.7k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2391|  12.7k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2392|       |            // WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 2393|       |
 2394|  12.7k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 2395|       |
 2396|  12.7k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2397|  12.7k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2398|       |
 2399|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2400|  12.7k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2401|       |
 2402|       |            /* idx = pos >> 5; */
 2403|  12.7k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2404|       |
 2405|       |            /* fract = pos & (31); */
 2406|  12.7k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2407|       |
 2408|  12.7k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 2409|       |            /*(32 - fract) */
 2410|  12.7k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2411|       |
 2412|  12.7k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2413|  12.7k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 2414|       |
 2415|  12.7k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2416|  12.7k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 2417|       |
 2418|       |
 2419|  12.7k|            fract8_8x16b = _mm_unpackhi_epi8(fract_4x32b, fract2_8x16b);
 2420|  12.7k|            fract_4x32b = _mm_unpacklo_epi8(fract_4x32b, fract2_8x16b);
 2421|       |
 2422|  12.7k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 2423|  12.7k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 2424|  12.7k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 2425|  12.7k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 2426|       |
 2427|  12.7k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 2428|  12.7k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 2429|  12.7k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 2430|  12.7k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 2431|       |
 2432|  12.7k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2433|  12.7k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2434|  12.7k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2435|  12.7k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2436|       |
 2437|  12.7k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2438|  12.7k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2439|  12.7k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2440|  12.7k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 2441|       |
 2442|  38.2k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2442:26): [True: 25.4k, False: 12.7k]
  ------------------
 2443|  25.4k|            {
 2444|  25.4k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2445|  25.4k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2446|       |
 2447|       |
 2448|  25.4k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2449|  25.4k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2450|       |
 2451|       |                /* loding 8-bit 16 pixels */
 2452|  25.4k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row)); /* col=0*/
 2453|  25.4k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row)); /* col=1*/
 2454|  25.4k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row)); /* col=2*/
 2455|  25.4k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row)); /* col=3*/
 2456|       |
 2457|  25.4k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 1); /* col=0*/
 2458|  25.4k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 1); /* col=1*/
 2459|  25.4k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 1); /* col=2*/
 2460|  25.4k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 1); /* col=3*/
 2461|       |
 2462|       |                /* loding 8-bit 16 pixels */
 2463|  25.4k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row)); /* col=5*/
 2464|  25.4k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row)); /* col=6*/
 2465|  25.4k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row)); /* col=7*/
 2466|  25.4k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row)); /* col=8*/
 2467|       |
 2468|  25.4k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 2469|  25.4k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 2470|  25.4k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 2471|  25.4k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 2472|       |
 2473|  25.4k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp15_8x16b, sm3); /* col=0*/
 2474|  25.4k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp16_8x16b, sm3); /* col=1*/
 2475|  25.4k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp17_8x16b, sm3); /* col=2*/
 2476|  25.4k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp18_8x16b, sm3); /* col=3*/
 2477|       |
 2478|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2479|  25.4k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2480|  25.4k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2481|  25.4k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2482|  25.4k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2483|       |
 2484|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2485|  25.4k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2486|  25.4k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2487|  25.4k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2488|  25.4k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 2489|       |
 2490|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2491|  25.4k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2492|  25.4k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2493|  25.4k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2494|  25.4k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2495|       |
 2496|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2497|  25.4k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2498|  25.4k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2499|  25.4k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2500|  25.4k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2501|       |
 2502|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2503|  25.4k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2504|  25.4k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2505|  25.4k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2506|  25.4k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 2507|       |
 2508|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2509|  25.4k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2510|  25.4k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2511|  25.4k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2512|  25.4k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2513|       |
 2514|       |                /* converting 16 bit to 8 bit */
 2515|  25.4k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2516|  25.4k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2517|       |
 2518|       |                /* converting 16 bit to 8 bit */
 2519|  25.4k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 2520|  25.4k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 2521|       |
 2522|  25.4k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2523|  25.4k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2524|       |
 2525|  25.4k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2526|  25.4k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2527|       |
 2528|  25.4k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2529|  25.4k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2530|       |
 2531|  25.4k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2532|  25.4k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2533|       |
 2534|       |
 2535|  25.4k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2536|  25.4k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2537|       |
 2538|  25.4k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2539|  25.4k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2540|       |
 2541|  25.4k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 2542|  25.4k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 2543|  25.4k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 2544|  25.4k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 2545|       |
 2546|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * row)), src_temp1_8x16b);          /* row=0*/
 2547|       |
 2548|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp5_8x16b);       /* row=1*/
 2549|       |
 2550|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp2_8x16b);       /* row=2*/
 2551|       |
 2552|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp6_8x16b);       /* row=4*/
 2553|       |
 2554|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 4))), src_temp3_8x16b);       /* row=5*/
 2555|       |
 2556|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 5))), src_temp7_8x16b);       /* row=6*/
 2557|       |
 2558|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 6))), src_temp4_8x16b);       /* row=7*/
 2559|       |
 2560|  25.4k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 7))), src_temp8_8x16b);       /* row=8*/
 2561|       |
 2562|  25.4k|            }
 2563|  12.7k|        }
 2564|  6.37k|    }
 2565|  8.65k|    else
 2566|  8.65k|    {
 2567|       |
 2568|       |
 2569|  8.65k|        __m128i temp1, temp2, temp11, src_values0;
 2570|       |        /* Intermediate reference samples for negative angle modes */
 2571|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 2572|  8.65k|        ref_temp[two_nt - 1] = pu1_ref[nt];
 2573|  8.65k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 1));
 2574|       |
 2575|       |        /* For negative angled derive the main reference samples from side */
 2576|       |
 2577|  8.65k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1)); /*nt-(nt+15)*/
 2578|  8.65k|        temp2 = _mm_loadu_si128((__m128i *)IHEVCE_SHUFFLEMASKY3);
 2579|  8.65k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode] + 16));
 2580|       |
 2581|  8.65k|        src_values0 = _mm_shuffle_epi8(src_values0, temp2);
 2582|  8.65k|        temp1 = _mm_shuffle_epi8(temp1, temp2);
 2583|  8.65k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 2584|  8.65k|        src_values0 = _mm_srli_si128(src_values0, 8);
 2585|       |
 2586|  8.65k|        _mm_storel_epi64((__m128i *)(ref_temp + nt - 1), temp1);
 2587|  8.65k|        _mm_storel_epi64((__m128i *)(ref_main - nt), src_values0);
 2588|       |
 2589|       |
 2590|  8.65k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2591|  8.65k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2592|  8.65k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2593|  8.65k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2594|  8.65k|        const_temp3_4x32b = _mm_set1_epi16(32);
 2595|  8.65k|        two_nt_4x32b = _mm_set1_epi16(1);
 2596|       |
 2597|  8.65k|        {
 2598|  8.65k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2599|  8.65k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2600|       |            //WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 2601|       |
 2602|  8.65k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 2603|       |
 2604|  8.65k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2605|  8.65k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2606|       |
 2607|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2608|  8.65k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2609|       |
 2610|       |            /* idx = pos >> 5; */
 2611|  8.65k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2612|       |
 2613|       |            /* fract = pos & (31); */
 2614|  8.65k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2615|       |
 2616|       |            /*(32 - fract) */
 2617|  8.65k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2618|       |
 2619|  8.65k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2620|  8.65k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 2621|       |
 2622|  8.65k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2623|  8.65k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 2624|       |
 2625|  8.65k|            fract8_8x16b = _mm_unpackhi_epi8(fract_4x32b, fract2_8x16b);
 2626|  8.65k|            fract_4x32b = _mm_unpacklo_epi8(fract_4x32b, fract2_8x16b);
 2627|       |
 2628|  8.65k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 2629|  8.65k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 2630|  8.65k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 2631|  8.65k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 2632|       |
 2633|  8.65k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 2634|  8.65k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 2635|  8.65k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 2636|  8.65k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 2637|       |
 2638|  8.65k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2639|  8.65k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2640|  8.65k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2641|  8.65k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2642|       |
 2643|  8.65k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2644|  8.65k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2645|  8.65k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2646|  8.65k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 2647|       |
 2648|  8.65k|            {
 2649|  8.65k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2650|  8.65k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2651|       |
 2652|  8.65k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2653|  8.65k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2654|       |
 2655|       |                /* loding 8-bit 16 pixels */
 2656|  8.65k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1)); /* col=0*/
 2657|  8.65k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2)); /* col=1*/
 2658|  8.65k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3)); /* col=2*/
 2659|  8.65k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4)); /* col=3*/
 2660|       |
 2661|       |                /* loding 8-bit 16 pixels */
 2662|  8.65k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5)); /* col=5*/
 2663|  8.65k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6)); /* col=6*/
 2664|  8.65k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7)); /* col=7*/
 2665|  8.65k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8)); /* col=8*/
 2666|       |
 2667|  8.65k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 2668|  8.65k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 2669|  8.65k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 2670|  8.65k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 2671|       |
 2672|  8.65k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp15_8x16b, sm3); /* col=0*/
 2673|  8.65k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp16_8x16b, sm3); /* col=1*/
 2674|  8.65k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp17_8x16b, sm3); /* col=2*/
 2675|  8.65k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp18_8x16b, sm3); /* col=3*/
 2676|       |
 2677|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2678|  8.65k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2679|  8.65k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2680|  8.65k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2681|  8.65k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2682|       |
 2683|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2684|  8.65k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2685|  8.65k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2686|  8.65k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2687|  8.65k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 2688|       |
 2689|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2690|  8.65k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2691|  8.65k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2692|  8.65k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2693|  8.65k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2694|       |
 2695|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2696|  8.65k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* row=0*/
 2697|  8.65k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* row=1*/
 2698|  8.65k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* row=2*/
 2699|  8.65k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* row=3*/
 2700|       |
 2701|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2702|  8.65k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2703|  8.65k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2704|  8.65k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2705|  8.65k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 2706|       |
 2707|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2708|  8.65k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2709|  8.65k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2710|  8.65k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2711|  8.65k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2712|       |
 2713|       |                /* converting 16 bit to 8 bit */
 2714|  8.65k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2715|  8.65k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2716|       |
 2717|       |                /* converting 16 bit to 8 bit */
 2718|  8.65k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=4*/
 2719|  8.65k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=5*/
 2720|       |
 2721|  8.65k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2722|  8.65k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2723|       |
 2724|  8.65k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2725|  8.65k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2726|       |
 2727|  8.65k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2728|  8.65k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2729|       |
 2730|  8.65k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2731|  8.65k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2732|       |
 2733|       |
 2734|  8.65k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2735|  8.65k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2736|       |
 2737|  8.65k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2738|  8.65k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2739|       |
 2740|  8.65k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 2741|  8.65k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 2742|  8.65k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 2743|  8.65k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 2744|       |
 2745|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp1_8x16b);       /* row=0*/
 2746|       |
 2747|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp5_8x16b);       /* row=1*/
 2748|       |
 2749|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp2_8x16b);       /* row=2*/
 2750|       |
 2751|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp6_8x16b);       /* row=3*/
 2752|       |
 2753|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (4))), src_temp3_8x16b);       /* row=4*/
 2754|       |
 2755|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (5))), src_temp7_8x16b);       /* row=5*/
 2756|       |
 2757|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (6))), src_temp4_8x16b);       /* row=6*/
 2758|       |
 2759|  8.65k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (7))), src_temp8_8x16b);       /* row=7*/
 2760|       |
 2761|  8.65k|            }
 2762|  8.65k|        }
 2763|  8.65k|    }
 2764|       |
 2765|  56.1k|}
ihevc_intra_pred_luma_mode_19_to_25_sse42:
 2813|  80.9k|{
 2814|       |
 2815|  80.9k|    WORD32 row, k;
 2816|  80.9k|    WORD32 two_nt, intra_pred_ang;
 2817|  80.9k|    WORD32 inv_ang, inv_ang_sum;
 2818|       |    //WORD32 ref_main_idx, pos, fract, idx;
 2819|  80.9k|    WORD32 ref_idx;
 2820|  80.9k|    UWORD8 ref_tmp[(2 * MAX_CU_SIZE) + 2] = {0};
 2821|  80.9k|    UWORD8 *ref_main, *ref_temp;
 2822|       |
 2823|  80.9k|    __m128i  /*fract_8x16b,*/ const_temp_8x16b, sm3;
 2824|  80.9k|    __m128i temp1, temp2, temp3, temp4;
 2825|  80.9k|    __m128i temp11, temp12, temp13, temp14;
 2826|  80.9k|    UNUSED(src_strd);
  ------------------
  |  |   38|  80.9k|#define UNUSED(x) ((void)(x))
  ------------------
 2827|       |
 2828|  80.9k|    two_nt = 2 * nt;
 2829|  80.9k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 2830|  80.9k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 12];
 2831|       |
 2832|       |    /* Intermediate reference samples for negative angle modes */
 2833|       |    /* This have to be removed during optimization*/
 2834|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 2835|  80.9k|    ref_temp = ref_tmp + 1;
 2836|  80.9k|    ref_main = ref_temp + nt - 1;
 2837|       |
 2838|       |
 2839|  80.9k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 2840|       |
 2841|       |
 2842|       |
 2843|  80.9k|    const_temp_8x16b = _mm_set1_epi16(16);
 2844|       |
 2845|  80.9k|    if(nt == 32)
  ------------------
  |  Branch (2845:8): [True: 14.5k, False: 66.4k]
  ------------------
 2846|  14.5k|    {
 2847|       |
 2848|  14.5k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 2849|  14.5k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 2850|  14.5k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2851|       |
 2852|  14.5k|        __m128i src_values0, src_values1, src_values2, src_values3;
 2853|  14.5k|        __m128i  src_values4, src_values5, src_values6, src_values7;
 2854|  14.5k|        WORD32 col = 0;
 2855|       |
 2856|       |        /* Intermediate reference samples for negative angle modes */
 2857|       |        /* This have to be removed during optimization*/
 2858|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 2859|  14.5k|        ref_temp[two_nt - 1] = pu1_ref[two_nt + nt];
 2860|  14.5k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt));
 2861|  14.5k|        temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 16));
 2862|       |
 2863|       |        /* SIMD Optimization can be done using look-up table for the loop */
 2864|       |        /* For negative angled derive the main reference samples from side */
 2865|       |        /*  reference samples refer to section 8.4.4.2.6 */
 2866|  14.5k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - nt)); /*nt-(nt+15)*/
 2867|  14.5k|        src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 16)); /*(nt+16)-(two_nt-1)*/
 2868|       |
 2869|  14.5k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19]));
 2870|  14.5k|        temp12 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19] + 16));
 2871|       |
 2872|  14.5k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 2873|  14.5k|        src_values1 = _mm_shuffle_epi8(src_values1, temp12);
 2874|       |
 2875|  14.5k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp1);
 2876|  14.5k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1 + 16), temp3);
 2877|  14.5k|        _mm_storeu_si128((__m128i *)(ref_main - 16), src_values1);
 2878|  14.5k|        _mm_storeu_si128((__m128i *)(ref_main - nt + inv_angle_shuffle[mode - 19][0]), src_values0);
 2879|       |
 2880|  14.5k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2881|  14.5k|        const_temp3_4x32b = _mm_set1_epi16(32);
 2882|  14.5k|        const_temp8_4x32b = _mm_set1_epi16(8);
 2883|       |
 2884|  14.5k|        two_nt_4x32b = _mm_set1_epi16(1);
 2885|       |
 2886|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2887|  14.5k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2888|       |
 2889|  14.5k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2890|       |
 2891|  72.4k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2891:22): [True: 57.9k, False: 14.5k]
  ------------------
 2892|  57.9k|        {
 2893|       |
 2894|  57.9k|            WORD16 ref_main_idx[9];
 2895|       |
 2896|  57.9k|            __m128i res_temp5_4x32b;
 2897|  57.9k|            __m128i fract1_8x16b, fract2_8x16b;
 2898|       |
 2899|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2900|  57.9k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2901|       |
 2902|       |            /* fract = pos & (31); */
 2903|  57.9k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2904|       |
 2905|       |            /* idx = pos >> 5; */
 2906|  57.9k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2907|       |
 2908|       |            /*(32 - fract) */
 2909|  57.9k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 2910|       |
 2911|  57.9k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 2912|  57.9k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 2913|       |
 2914|  57.9k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 2915|  57.9k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 2916|       |
 2917|  57.9k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 2918|  57.9k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 2919|       |
 2920|  57.9k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 2921|  57.9k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 2922|  57.9k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 2923|  57.9k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 2924|       |
 2925|  57.9k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 2926|  57.9k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 2927|  57.9k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 2928|  57.9k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 2929|       |
 2930|  57.9k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 2931|  57.9k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 2932|   173k|            for(col = 0; col < nt; col += 16)
  ------------------
  |  Branch (2932:26): [True: 115k, False: 57.9k]
  ------------------
 2933|   115k|            {
 2934|   115k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0] + col));
 2935|   115k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1] + col));
 2936|   115k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2] + col));
 2937|   115k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3] + col));
 2938|   115k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0] + 8 + col));
 2939|   115k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1] + 8 + col));
 2940|   115k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2] + 8 + col));
 2941|   115k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3] + 8 + col));
 2942|       |
 2943|   115k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 2944|   115k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 2945|   115k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 2946|   115k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 2947|   115k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 2948|   115k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 2949|   115k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 2950|   115k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 2951|       |
 2952|       |
 2953|   115k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 2954|   115k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 2955|   115k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 2956|   115k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 2957|   115k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 2958|   115k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 2959|   115k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 2960|   115k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 2961|       |
 2962|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2963|   115k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2964|   115k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2965|   115k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2966|   115k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2967|   115k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 2968|   115k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 2969|   115k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 2970|   115k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 2971|       |
 2972|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2973|   115k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 2974|   115k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 2975|   115k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 2976|   115k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 2977|   115k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 2978|   115k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 2979|   115k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 2980|   115k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 2981|       |
 2982|       |                /* converting 16 bit to 8 bit */
 2983|   115k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 2984|   115k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 2985|   115k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 2986|   115k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 2987|       |
 2988|       |                /* loading 8-bit 8 pixels values */
 2989|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (0) * dst_strd), src_values0);       /* row=0*/
 2990|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (1) * dst_strd), src_values1);   /* row=1*/
 2991|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (2) * dst_strd), src_values2);   /* row=2*/
 2992|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (3) * dst_strd), src_values3);   /* row=3*/
 2993|       |
 2994|       |
 2995|   115k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4] + col));
 2996|   115k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5] + col));
 2997|   115k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6] + col));
 2998|   115k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7] + col));
 2999|   115k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4] + 8 + col));
 3000|   115k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5] + 8 + col));
 3001|   115k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6] + 8 + col));
 3002|   115k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7] + 8 + col));
 3003|       |
 3004|   115k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3005|   115k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3006|   115k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3007|   115k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3008|   115k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3009|   115k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3010|   115k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3011|   115k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3012|       |
 3013|       |
 3014|   115k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 3015|   115k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 3016|   115k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 3017|   115k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 3018|   115k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 3019|   115k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 3020|   115k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 3021|   115k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 3022|       |
 3023|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3024|   115k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3025|   115k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3026|   115k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3027|   115k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3028|   115k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3029|   115k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3030|   115k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3031|   115k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3032|       |
 3033|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3034|   115k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3035|   115k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3036|   115k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3037|   115k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3038|   115k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3039|   115k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3040|   115k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3041|   115k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3042|       |
 3043|       |                /* converting 16 bit to 8 bit */
 3044|   115k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3045|   115k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3046|   115k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3047|   115k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3048|       |
 3049|       |                /* loading 8-bit 8 pixels values */
 3050|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (4) * dst_strd), src_values0);   /* row=4*/
 3051|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (5) * dst_strd), src_values1);   /* row=5*/
 3052|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (6) * dst_strd), src_values2);   /* row=6*/
 3053|   115k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (7) * dst_strd), src_values3);   /* row=7*/
 3054|       |
 3055|   115k|            }
 3056|  57.9k|            pu1_dst += 8 * dst_strd;
 3057|  57.9k|        }
 3058|       |
 3059|  14.5k|    }
 3060|  66.4k|    else if(nt == 16) /* for nt = 16 case */
  ------------------
  |  Branch (3060:13): [True: 7.77k, False: 58.6k]
  ------------------
 3061|  7.77k|    {
 3062|       |
 3063|  7.77k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 3064|  7.77k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3065|  7.77k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3066|  7.77k|        __m128i src_values0, src_values1, src_values2, src_values3;
 3067|  7.77k|        __m128i  src_values4, src_values5, src_values6, src_values7;
 3068|       |
 3069|       |
 3070|       |        /* Intermediate reference samples for negative angle modes */
 3071|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3072|  7.77k|        ref_temp[two_nt - 1] = pu1_ref[two_nt + nt];
 3073|  7.77k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt));
 3074|       |
 3075|  7.77k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - nt)); /*nt-(nt+15)*/
 3076|       |
 3077|  7.77k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19] + 16));
 3078|       |
 3079|  7.77k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 3080|       |
 3081|  7.77k|        _mm_storeu_si128((__m128i *)(ref_main - nt), src_values0);
 3082|  7.77k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp1);
 3083|       |
 3084|  7.77k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3085|  7.77k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3086|  7.77k|        const_temp8_4x32b = _mm_set1_epi16(8);
 3087|       |
 3088|  7.77k|        two_nt_4x32b = _mm_set1_epi16(1);
 3089|       |
 3090|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3091|  7.77k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3092|       |
 3093|  7.77k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3094|       |
 3095|  23.3k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (3095:22): [True: 15.5k, False: 7.77k]
  ------------------
 3096|  15.5k|        {
 3097|       |
 3098|  15.5k|            WORD16 ref_main_idx[9];
 3099|       |
 3100|  15.5k|            __m128i res_temp5_4x32b;
 3101|  15.5k|            __m128i fract1_8x16b, fract2_8x16b;
 3102|       |
 3103|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3104|  15.5k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3105|       |
 3106|       |            /* fract = pos & (31); */
 3107|  15.5k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3108|       |
 3109|       |            /* idx = pos >> 5; */
 3110|  15.5k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3111|       |
 3112|       |            /*(32 - fract) */
 3113|  15.5k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 3114|       |
 3115|  15.5k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 3116|  15.5k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 3117|       |
 3118|  15.5k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 3119|  15.5k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 3120|       |
 3121|  15.5k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 3122|  15.5k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 3123|       |
 3124|  15.5k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 3125|  15.5k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 3126|  15.5k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 3127|  15.5k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 3128|       |
 3129|  15.5k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 3130|  15.5k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 3131|  15.5k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 3132|  15.5k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 3133|       |
 3134|  15.5k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 3135|  15.5k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 3136|       |
 3137|  15.5k|            {
 3138|  15.5k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0]));
 3139|  15.5k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1]));
 3140|  15.5k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2]));
 3141|  15.5k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3]));
 3142|  15.5k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0] + 8));
 3143|  15.5k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1] + 8));
 3144|  15.5k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2] + 8));
 3145|  15.5k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3] + 8));
 3146|       |
 3147|  15.5k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3148|  15.5k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3149|  15.5k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3150|  15.5k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3151|  15.5k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3152|  15.5k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3153|  15.5k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3154|  15.5k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3155|       |
 3156|       |
 3157|  15.5k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 3158|  15.5k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 3159|  15.5k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 3160|  15.5k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 3161|  15.5k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 3162|  15.5k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 3163|  15.5k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 3164|  15.5k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 3165|       |
 3166|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3167|  15.5k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3168|  15.5k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3169|  15.5k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3170|  15.5k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3171|  15.5k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3172|  15.5k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3173|  15.5k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3174|  15.5k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3175|       |
 3176|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3177|  15.5k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3178|  15.5k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3179|  15.5k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3180|  15.5k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3181|  15.5k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3182|  15.5k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3183|  15.5k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3184|  15.5k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3185|       |
 3186|       |                /* converting 16 bit to 8 bit */
 3187|  15.5k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3188|  15.5k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3189|  15.5k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3190|  15.5k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3191|       |
 3192|       |                /* loading 8-bit 8 pixels values */
 3193|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (0) * dst_strd), src_values0);       /* row=0*/
 3194|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (1) * dst_strd), src_values1);   /* row=1*/
 3195|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (2) * dst_strd), src_values2);   /* row=2*/
 3196|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (3) * dst_strd), src_values3);   /* row=3*/
 3197|       |
 3198|       |
 3199|  15.5k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4]));
 3200|  15.5k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5]));
 3201|  15.5k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6]));
 3202|  15.5k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7]));
 3203|  15.5k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4] + 8));
 3204|  15.5k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5] + 8));
 3205|  15.5k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6] + 8));
 3206|  15.5k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7] + 8));
 3207|       |
 3208|  15.5k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3209|  15.5k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3210|  15.5k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3211|  15.5k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3212|  15.5k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3213|  15.5k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3214|  15.5k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3215|  15.5k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3216|       |
 3217|       |
 3218|  15.5k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 3219|  15.5k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 3220|  15.5k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 3221|  15.5k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 3222|  15.5k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 3223|  15.5k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 3224|  15.5k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 3225|  15.5k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 3226|       |
 3227|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3228|  15.5k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3229|  15.5k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3230|  15.5k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3231|  15.5k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3232|  15.5k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3233|  15.5k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3234|  15.5k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3235|  15.5k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3236|       |
 3237|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3238|  15.5k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3239|  15.5k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3240|  15.5k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3241|  15.5k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3242|  15.5k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3243|  15.5k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3244|  15.5k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3245|  15.5k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3246|       |
 3247|       |                /* converting 16 bit to 8 bit */
 3248|  15.5k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3249|  15.5k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3250|  15.5k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3251|  15.5k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3252|       |
 3253|       |                /* loading 8-bit 8 pixels values */
 3254|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (4) * dst_strd), src_values0);   /* row=4*/
 3255|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (5) * dst_strd), src_values1);   /* row=5*/
 3256|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (6) * dst_strd), src_values2);   /* row=6*/
 3257|  15.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (7) * dst_strd), src_values3);   /* row=7*/
 3258|       |
 3259|  15.5k|            }
 3260|  15.5k|            pu1_dst += 8 * dst_strd;
 3261|  15.5k|        }
 3262|  7.77k|    }
 3263|  58.6k|    else if(nt == 8)
  ------------------
  |  Branch (3263:13): [True: 18.5k, False: 40.1k]
  ------------------
 3264|  18.5k|    {
 3265|       |
 3266|       |
 3267|  18.5k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 3268|  18.5k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3269|       |
 3270|  18.5k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3271|  18.5k|        __m128i src_values0, src_values1, src_values2, src_values3;
 3272|  18.5k|        __m128i  src_values4, src_values5, src_values6, src_values7;
 3273|       |
 3274|       |
 3275|       |        /* Intermediate reference samples for negative angle modes */
 3276|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3277|  18.5k|        ref_temp[two_nt - 1] = pu1_ref[two_nt + nt];
 3278|  18.5k|        temp1 = _mm_loadl_epi64((__m128i *)(pu1_ref + two_nt));
 3279|       |
 3280|       |        /* For negative angled derive the main reference samples from side */
 3281|       |
 3282|  18.5k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref)); /*nt-(nt+15)*/
 3283|       |
 3284|  18.5k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19] + 16));
 3285|       |
 3286|  18.5k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 3287|  18.5k|        src_values0 = _mm_srli_si128(src_values0, 8);
 3288|  18.5k|        _mm_storel_epi64((__m128i *)(ref_temp + nt - 1), temp1);
 3289|  18.5k|        _mm_storel_epi64((__m128i *)(ref_main - nt), src_values0);
 3290|       |
 3291|       |
 3292|       |
 3293|  18.5k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3294|  18.5k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3295|       |
 3296|       |
 3297|  18.5k|        two_nt_4x32b = _mm_set1_epi16(1);
 3298|       |
 3299|       |
 3300|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3301|  18.5k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3302|       |
 3303|  18.5k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3304|       |
 3305|  18.5k|        {
 3306|       |
 3307|  18.5k|            WORD16 ref_main_idx[9];
 3308|       |
 3309|  18.5k|            __m128i res_temp5_4x32b;
 3310|  18.5k|            __m128i fract1_8x16b, fract2_8x16b;
 3311|       |
 3312|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3313|  18.5k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3314|       |
 3315|       |            /* fract = pos & (31); */
 3316|  18.5k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3317|       |
 3318|       |            /* idx = pos >> 5; */
 3319|  18.5k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3320|       |
 3321|       |            /*(32 - fract) */
 3322|  18.5k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 3323|       |
 3324|  18.5k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 3325|  18.5k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 3326|       |
 3327|  18.5k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 3328|  18.5k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 3329|       |
 3330|  18.5k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 3331|  18.5k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 3332|       |
 3333|  18.5k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 3334|  18.5k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 3335|  18.5k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 3336|  18.5k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 3337|       |
 3338|  18.5k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 3339|  18.5k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 3340|  18.5k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 3341|  18.5k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 3342|       |
 3343|  18.5k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 3344|       |
 3345|  18.5k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0]));  /* col = 0-7   */
 3346|  18.5k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1]));  /* col = 8-15  */
 3347|  18.5k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2]));  /* col = 16-23 */
 3348|  18.5k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3]));  /* col = 24-31 */
 3349|  18.5k|            src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4]));  /* col = 32-39   */
 3350|  18.5k|            src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5]));  /* col = 40-47  */
 3351|  18.5k|            src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6]));  /* col = 48-55 */
 3352|  18.5k|            src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7]));  /* col = 56-63*/
 3353|       |
 3354|  18.5k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3355|  18.5k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3356|  18.5k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3357|  18.5k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3358|  18.5k|            src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3359|  18.5k|            src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3360|  18.5k|            src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3361|  18.5k|            src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3362|       |
 3363|       |
 3364|  18.5k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 3365|  18.5k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 3366|  18.5k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 3367|  18.5k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 3368|  18.5k|            src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 3369|  18.5k|            src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 3370|  18.5k|            src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 3371|  18.5k|            src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 3372|       |
 3373|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3374|  18.5k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3375|  18.5k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3376|  18.5k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3377|  18.5k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3378|  18.5k|            src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3379|  18.5k|            src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3380|  18.5k|            src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3381|  18.5k|            src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3382|       |
 3383|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3384|  18.5k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 3385|  18.5k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 3386|  18.5k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 3387|  18.5k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 3388|  18.5k|            src_values4 = _mm_srai_epi16(src_values4,  5);
 3389|  18.5k|            src_values5 = _mm_srai_epi16(src_values5,  5);
 3390|  18.5k|            src_values6 = _mm_srai_epi16(src_values6,  5);
 3391|  18.5k|            src_values7 = _mm_srai_epi16(src_values7,  5);
 3392|       |
 3393|       |            /* converting 16 bit to 8 bit */
 3394|  18.5k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 3395|  18.5k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 3396|  18.5k|            src_values1 = _mm_srli_si128(src_values0, 8);
 3397|  18.5k|            src_values3 = _mm_srli_si128(src_values2, 8);
 3398|  18.5k|            src_values4 = _mm_packus_epi16(src_values4, src_values5);
 3399|  18.5k|            src_values6 = _mm_packus_epi16(src_values6, src_values7);
 3400|  18.5k|            src_values5 = _mm_srli_si128(src_values4, 8);
 3401|  18.5k|            src_values7 = _mm_srli_si128(src_values6, 8);
 3402|       |
 3403|       |            /* loading 8-bit 8 pixels values */
 3404|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_values0);       /* row=0*/
 3405|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_values1);   /* row=1*/
 3406|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_values2);   /* row=2*/
 3407|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_values3);   /* row=3*/
 3408|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), src_values4);   /* row=4*/
 3409|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), src_values5);   /* row=5*/
 3410|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), src_values6);   /* row=6*/
 3411|  18.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), src_values7);   /* row=7*/
 3412|  18.5k|        }
 3413|  18.5k|    }
 3414|  40.1k|    else /* if nt =4*/
 3415|  40.1k|    {
 3416|       |
 3417|  40.1k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 3418|  40.1k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3419|       |
 3420|  40.1k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3421|       |
 3422|       |
 3423|   240k|        for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (3423:20): [True: 200k, False: 40.1k]
  ------------------
 3424|   200k|            ref_temp[k + nt - 1] = pu1_ref[two_nt + k];
 3425|  40.1k|        ref_idx = (nt * intra_pred_ang) >> 5;
 3426|  40.1k|        inv_ang_sum = 128;
 3427|       |
 3428|  95.8k|        for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (3428:21): [True: 55.7k, False: 40.1k]
  ------------------
 3429|  55.7k|        {
 3430|  55.7k|            inv_ang_sum += inv_ang;
 3431|  55.7k|            ref_main[k] = pu1_ref[two_nt - (inv_ang_sum >> 8)];
 3432|  55.7k|        }
 3433|       |
 3434|       |
 3435|  40.1k|        const_temp2_4x32b = _mm_set1_epi32(31);
 3436|  40.1k|        const_temp3_4x32b = _mm_set1_epi32(32);
 3437|       |
 3438|  40.1k|        two_nt_4x32b = _mm_set1_epi32(1);
 3439|       |
 3440|       |
 3441|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3442|  40.1k|        intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 3443|       |
 3444|  40.1k|        row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 3445|  40.1k|        {
 3446|  40.1k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 3447|  40.1k|            int temp11, temp21, temp31, temp41;
 3448|       |
 3449|       |
 3450|  40.1k|            __m128i fract1_8x16b, fract2_8x16b,  res_temp5_4x32b;
 3451|  40.1k|            __m128i src_values0, src_values1, src_values2, src_values3;
 3452|  40.1k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 3453|       |
 3454|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3455|  40.1k|            res_temp5_4x32b  = _mm_mullo_epi32(row_4x32b, intra_pred_ang_4x32b);
 3456|       |
 3457|       |            /* fract = pos & (31); */
 3458|  40.1k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 3459|       |
 3460|  40.1k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 3461|  40.1k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 3462|  40.1k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 3463|  40.1k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 3464|  40.1k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 3465|  40.1k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 3466|  40.1k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 3467|       |
 3468|       |            /* idx = pos >> 5; */
 3469|  40.1k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3470|       |
 3471|       |            /*(32 - fract) */
 3472|  40.1k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 3473|       |
 3474|  40.1k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 3475|  40.1k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 3476|       |
 3477|  40.1k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 3478|  40.1k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 3479|       |
 3480|  40.1k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 3481|  40.1k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 3482|       |
 3483|  40.1k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 3484|  40.1k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 3485|  40.1k|            temp3 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 3486|  40.1k|            temp4 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 3487|       |
 3488|  40.1k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));     /* col = 0-7   */
 3489|  40.1k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2));   /* col = 8-15  */
 3490|  40.1k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3));  /* col = 16-23 */
 3491|  40.1k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4));  /* col = 24-31 */
 3492|       |
 3493|  40.1k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3494|  40.1k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3495|  40.1k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3496|  40.1k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3497|       |
 3498|       |
 3499|  40.1k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 3500|  40.1k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 3501|  40.1k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 3502|  40.1k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 3503|       |
 3504|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3505|  40.1k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3506|  40.1k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3507|  40.1k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3508|  40.1k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3509|       |
 3510|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3511|  40.1k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 3512|  40.1k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 3513|  40.1k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 3514|  40.1k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 3515|       |
 3516|       |            /* converting 16 bit to 8 bit */
 3517|  40.1k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 3518|  40.1k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 3519|  40.1k|            src_values1 = _mm_srli_si128(src_values0, 8);
 3520|  40.1k|            src_values3 = _mm_srli_si128(src_values2, 8);
 3521|       |
 3522|  40.1k|            temp11 = _mm_cvtsi128_si32(src_values0);
 3523|  40.1k|            temp21 = _mm_cvtsi128_si32(src_values1);
 3524|  40.1k|            temp31 = _mm_cvtsi128_si32(src_values2);
 3525|  40.1k|            temp41 = _mm_cvtsi128_si32(src_values3);
 3526|       |
 3527|       |            /* loding 4-bit 8 pixels values */
 3528|  40.1k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 3529|  40.1k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 3530|  40.1k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 3531|  40.1k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 3532|       |
 3533|  40.1k|        }
 3534|  40.1k|    }
 3535|  80.9k|}
ihevc_intra_pred_luma_mode_27_to_33_sse42:
 3582|  54.3k|{
 3583|  54.3k|    WORD32 row;
 3584|  54.3k|    WORD32 two_nt;
 3585|  54.3k|    WORD32 intra_pred_ang;
 3586|       |
 3587|  54.3k|    __m128i temp11, temp12, temp13, temp14;
 3588|       |
 3589|  54.3k|    __m128i     const_temp_8x16b;
 3590|  54.3k|    __m128i temp1, temp2, temp3, temp4, sm3;
 3591|  54.3k|    UNUSED(src_strd);
  ------------------
  |  |   38|  54.3k|#define UNUSED(x) ((void)(x))
  ------------------
 3592|       |
 3593|  54.3k|    two_nt = 2 * nt;
 3594|  54.3k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 3595|       |
 3596|  54.3k|    const_temp_8x16b = _mm_set1_epi16(16);
 3597|  54.3k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 3598|  54.3k|    if(nt == 32)
  ------------------
  |  Branch (3598:8): [True: 15.8k, False: 38.4k]
  ------------------
 3599|  15.8k|    {
 3600|       |
 3601|  15.8k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 3602|  15.8k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3603|  15.8k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3604|  15.8k|        int col = 0;
 3605|       |
 3606|  15.8k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3607|  15.8k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3608|  15.8k|        const_temp8_4x32b = _mm_set1_epi16(8);
 3609|       |
 3610|  15.8k|        two_nt_4x32b = _mm_set1_epi16(two_nt + 1);
 3611|       |
 3612|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3613|  15.8k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3614|       |
 3615|  15.8k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3616|       |
 3617|  79.3k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (3617:22): [True: 63.4k, False: 15.8k]
  ------------------
 3618|  63.4k|        {
 3619|       |
 3620|  63.4k|            WORD16 ref_main_idx[9];
 3621|       |
 3622|  63.4k|            __m128i res_temp5_4x32b;
 3623|  63.4k|            __m128i fract1_8x16b, fract2_8x16b;
 3624|  63.4k|            __m128i src_values0, src_values1, src_values2, src_values3;
 3625|  63.4k|            __m128i  src_values4, src_values5, src_values6, src_values7;
 3626|       |
 3627|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3628|  63.4k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3629|       |
 3630|       |            /* fract = pos & (31); */
 3631|  63.4k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3632|       |
 3633|       |            /* idx = pos >> 5; */
 3634|  63.4k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3635|       |
 3636|       |            /*(32 - fract) */
 3637|  63.4k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 3638|       |
 3639|  63.4k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 3640|  63.4k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 3641|       |
 3642|  63.4k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 3643|  63.4k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 3644|       |
 3645|  63.4k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 3646|  63.4k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 3647|       |
 3648|  63.4k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 3649|  63.4k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 3650|  63.4k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 3651|  63.4k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 3652|       |
 3653|  63.4k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 3654|  63.4k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 3655|  63.4k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 3656|  63.4k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 3657|       |
 3658|  63.4k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 3659|  63.4k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 3660|   190k|            for(col = 0; col < nt; col += 16)
  ------------------
  |  Branch (3660:26): [True: 126k, False: 63.4k]
  ------------------
 3661|   126k|            {
 3662|   126k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0] + col));
 3663|   126k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1] + col));
 3664|   126k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2] + col));
 3665|   126k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3] + col));
 3666|   126k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0] + 8 + col));
 3667|   126k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1] + 8 + col));
 3668|   126k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2] + 8 + col));
 3669|   126k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3] + 8 + col));
 3670|       |
 3671|   126k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3672|   126k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3673|   126k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3674|   126k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3675|   126k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3676|   126k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3677|   126k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3678|   126k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3679|       |
 3680|       |
 3681|   126k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 3682|   126k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 3683|   126k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 3684|   126k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 3685|   126k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 3686|   126k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 3687|   126k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 3688|   126k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 3689|       |
 3690|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3691|   126k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3692|   126k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3693|   126k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3694|   126k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3695|   126k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3696|   126k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3697|   126k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3698|   126k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3699|       |
 3700|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3701|   126k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3702|   126k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3703|   126k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3704|   126k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3705|   126k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3706|   126k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3707|   126k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3708|   126k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3709|       |
 3710|       |                /* converting 16 bit to 8 bit */
 3711|   126k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3712|   126k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3713|   126k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3714|   126k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3715|       |
 3716|       |                /* loading 8-bit 8 pixels values */
 3717|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (0) * dst_strd), src_values0);       /* row=0*/
 3718|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (1) * dst_strd), src_values1);   /* row=1*/
 3719|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (2) * dst_strd), src_values2);   /* row=2*/
 3720|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (3) * dst_strd), src_values3);   /* row=3*/
 3721|       |
 3722|       |
 3723|   126k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4] + col));
 3724|   126k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5] + col));
 3725|   126k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6] + col));
 3726|   126k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7] + col));
 3727|   126k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4] + 8 + col));
 3728|   126k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5] + 8 + col));
 3729|   126k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6] + 8 + col));
 3730|   126k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7] + 8 + col));
 3731|       |
 3732|   126k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3733|   126k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3734|   126k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3735|   126k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3736|   126k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3737|   126k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3738|   126k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3739|   126k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3740|       |
 3741|       |
 3742|   126k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 3743|   126k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 3744|   126k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 3745|   126k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 3746|   126k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 3747|   126k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 3748|   126k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 3749|   126k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 3750|       |
 3751|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3752|   126k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3753|   126k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3754|   126k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3755|   126k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3756|   126k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3757|   126k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3758|   126k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3759|   126k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3760|       |
 3761|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3762|   126k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3763|   126k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3764|   126k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3765|   126k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3766|   126k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3767|   126k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3768|   126k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3769|   126k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3770|       |
 3771|       |                /* converting 16 bit to 8 bit */
 3772|   126k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3773|   126k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3774|   126k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3775|   126k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3776|       |
 3777|       |                /* loading 8-bit 8 pixels values */
 3778|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (4) * dst_strd), src_values0);   /* row=4*/
 3779|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (5) * dst_strd), src_values1);   /* row=5*/
 3780|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (6) * dst_strd), src_values2);   /* row=6*/
 3781|   126k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (7) * dst_strd), src_values3);   /* row=7*/
 3782|       |
 3783|   126k|            }
 3784|  63.4k|            pu1_dst += 8 * dst_strd;
 3785|  63.4k|        }
 3786|       |
 3787|  15.8k|    }
 3788|  38.4k|    else if(nt == 16) /* for nt = 16 case */
  ------------------
  |  Branch (3788:13): [True: 6.68k, False: 31.7k]
  ------------------
 3789|  6.68k|    {
 3790|       |
 3791|  6.68k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 3792|  6.68k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3793|  6.68k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3794|       |
 3795|       |
 3796|  6.68k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3797|  6.68k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3798|  6.68k|        const_temp8_4x32b = _mm_set1_epi16(8);
 3799|       |
 3800|  6.68k|        two_nt_4x32b = _mm_set1_epi16(two_nt + 1);
 3801|       |
 3802|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3803|  6.68k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3804|       |
 3805|  6.68k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3806|       |
 3807|  20.0k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (3807:22): [True: 13.3k, False: 6.68k]
  ------------------
 3808|  13.3k|        {
 3809|       |
 3810|  13.3k|            WORD16 ref_main_idx[9];
 3811|       |
 3812|  13.3k|            __m128i res_temp5_4x32b;
 3813|  13.3k|            __m128i fract1_8x16b, fract2_8x16b;
 3814|  13.3k|            __m128i src_values0, src_values1, src_values2, src_values3;
 3815|  13.3k|            __m128i  src_values4, src_values5, src_values6, src_values7;
 3816|       |
 3817|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3818|  13.3k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3819|       |
 3820|       |            /* fract = pos & (31); */
 3821|  13.3k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3822|       |
 3823|       |            /* idx = pos >> 5; */
 3824|  13.3k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3825|       |
 3826|       |            /*(32 - fract) */
 3827|  13.3k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 3828|       |
 3829|  13.3k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 3830|  13.3k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 3831|       |
 3832|  13.3k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 3833|  13.3k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 3834|       |
 3835|  13.3k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 3836|  13.3k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 3837|       |
 3838|  13.3k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 3839|  13.3k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 3840|  13.3k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 3841|  13.3k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 3842|       |
 3843|  13.3k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 3844|  13.3k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 3845|  13.3k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 3846|  13.3k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 3847|       |
 3848|  13.3k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 3849|  13.3k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 3850|       |
 3851|  13.3k|            {
 3852|  13.3k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0]));
 3853|  13.3k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1]));
 3854|  13.3k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2]));
 3855|  13.3k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3]));
 3856|  13.3k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0] + 8));
 3857|  13.3k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1] + 8));
 3858|  13.3k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2] + 8));
 3859|  13.3k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3] + 8));
 3860|       |
 3861|  13.3k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3862|  13.3k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3863|  13.3k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3864|  13.3k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3865|  13.3k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3866|  13.3k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3867|  13.3k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3868|  13.3k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3869|       |
 3870|       |
 3871|  13.3k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 3872|  13.3k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 3873|  13.3k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 3874|  13.3k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 3875|  13.3k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 3876|  13.3k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 3877|  13.3k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 3878|  13.3k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 3879|       |
 3880|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3881|  13.3k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3882|  13.3k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3883|  13.3k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3884|  13.3k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3885|  13.3k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3886|  13.3k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3887|  13.3k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3888|  13.3k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3889|       |
 3890|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3891|  13.3k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3892|  13.3k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3893|  13.3k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3894|  13.3k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3895|  13.3k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3896|  13.3k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3897|  13.3k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3898|  13.3k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3899|       |
 3900|       |                /* converting 16 bit to 8 bit */
 3901|  13.3k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3902|  13.3k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3903|  13.3k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3904|  13.3k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3905|       |
 3906|       |                /* loading 8-bit 8 pixels values */
 3907|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (0) * dst_strd), src_values0);       /* row=0*/
 3908|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (1) * dst_strd), src_values1);   /* row=1*/
 3909|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (2) * dst_strd), src_values2);   /* row=2*/
 3910|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (3) * dst_strd), src_values3);   /* row=3*/
 3911|       |
 3912|       |
 3913|  13.3k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4]));
 3914|  13.3k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5]));
 3915|  13.3k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6]));
 3916|  13.3k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7]));
 3917|  13.3k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4] + 8));
 3918|  13.3k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5] + 8));
 3919|  13.3k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6] + 8));
 3920|  13.3k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7] + 8));
 3921|       |
 3922|  13.3k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3923|  13.3k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3924|  13.3k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3925|  13.3k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3926|  13.3k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3927|  13.3k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3928|  13.3k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3929|  13.3k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3930|       |
 3931|       |
 3932|  13.3k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 3933|  13.3k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 3934|  13.3k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 3935|  13.3k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 3936|  13.3k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 3937|  13.3k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 3938|  13.3k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 3939|  13.3k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 3940|       |
 3941|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3942|  13.3k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3943|  13.3k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3944|  13.3k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3945|  13.3k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3946|  13.3k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3947|  13.3k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3948|  13.3k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3949|  13.3k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3950|       |
 3951|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3952|  13.3k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3953|  13.3k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3954|  13.3k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3955|  13.3k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3956|  13.3k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3957|  13.3k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3958|  13.3k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3959|  13.3k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3960|       |
 3961|       |                /* converting 16 bit to 8 bit */
 3962|  13.3k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3963|  13.3k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3964|  13.3k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3965|  13.3k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3966|       |
 3967|       |                /* loading 8-bit 8 pixels values */
 3968|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (4) * dst_strd), src_values0);   /* row=4*/
 3969|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (5) * dst_strd), src_values1);   /* row=5*/
 3970|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (6) * dst_strd), src_values2);   /* row=6*/
 3971|  13.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + (7) * dst_strd), src_values3);   /* row=7*/
 3972|       |
 3973|  13.3k|            }
 3974|  13.3k|            pu1_dst += 8 * dst_strd;
 3975|  13.3k|        }
 3976|       |
 3977|  6.68k|    }
 3978|  31.7k|    else if(nt == 8)
  ------------------
  |  Branch (3978:13): [True: 10.7k, False: 20.9k]
  ------------------
 3979|  10.7k|    {
 3980|       |
 3981|  10.7k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 3982|  10.7k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3983|  10.7k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3984|       |
 3985|       |
 3986|  10.7k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3987|  10.7k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3988|       |
 3989|  10.7k|        two_nt_4x32b = _mm_set1_epi16(two_nt + 1);
 3990|       |
 3991|       |
 3992|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3993|  10.7k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3994|       |
 3995|  10.7k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3996|       |
 3997|       |        //for(row = 0; row < nt; row +=4)
 3998|  10.7k|        {
 3999|       |
 4000|  10.7k|            WORD16 ref_main_idx[9];
 4001|       |
 4002|  10.7k|            __m128i res_temp5_4x32b;
 4003|  10.7k|            __m128i fract1_8x16b, fract2_8x16b;
 4004|  10.7k|            __m128i src_values0, src_values1, src_values2, src_values3;
 4005|  10.7k|            __m128i  src_values4, src_values5, src_values6, src_values7;
 4006|       |
 4007|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4008|  10.7k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4009|       |
 4010|       |            /* fract = pos & (31); */
 4011|  10.7k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 4012|       |
 4013|       |            /* idx = pos >> 5; */
 4014|  10.7k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4015|       |
 4016|       |            /*(32 - fract) */
 4017|  10.7k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 4018|       |
 4019|  10.7k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4020|  10.7k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4021|       |
 4022|  10.7k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4023|  10.7k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4024|       |
 4025|  10.7k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4026|  10.7k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4027|       |
 4028|  10.7k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4029|  10.7k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 4030|  10.7k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4031|  10.7k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 4032|       |
 4033|  10.7k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4034|  10.7k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 4035|  10.7k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4036|  10.7k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 4037|       |
 4038|  10.7k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 4039|       |
 4040|  10.7k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0]));  /* col = 0-7   */
 4041|  10.7k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1]));  /* col = 8-15  */
 4042|  10.7k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2]));  /* col = 16-23 */
 4043|  10.7k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3]));  /* col = 24-31 */
 4044|  10.7k|            src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4]));  /* col = 32-39   */
 4045|  10.7k|            src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5]));  /* col = 40-47  */
 4046|  10.7k|            src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6]));  /* col = 48-55 */
 4047|  10.7k|            src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7]));  /* col = 56-63*/
 4048|       |
 4049|  10.7k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4050|  10.7k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4051|  10.7k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4052|  10.7k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4053|  10.7k|            src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4054|  10.7k|            src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4055|  10.7k|            src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4056|  10.7k|            src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4057|       |
 4058|       |
 4059|  10.7k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4060|  10.7k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4061|  10.7k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4062|  10.7k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4063|  10.7k|            src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 4064|  10.7k|            src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 4065|  10.7k|            src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 4066|  10.7k|            src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 4067|       |
 4068|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4069|  10.7k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4070|  10.7k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4071|  10.7k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4072|  10.7k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4073|  10.7k|            src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4074|  10.7k|            src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4075|  10.7k|            src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4076|  10.7k|            src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4077|       |
 4078|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4079|  10.7k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 4080|  10.7k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 4081|  10.7k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 4082|  10.7k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 4083|  10.7k|            src_values4 = _mm_srai_epi16(src_values4,  5);
 4084|  10.7k|            src_values5 = _mm_srai_epi16(src_values5,  5);
 4085|  10.7k|            src_values6 = _mm_srai_epi16(src_values6,  5);
 4086|  10.7k|            src_values7 = _mm_srai_epi16(src_values7,  5);
 4087|       |
 4088|       |            /* converting 16 bit to 8 bit */
 4089|  10.7k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 4090|  10.7k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 4091|  10.7k|            src_values1 = _mm_srli_si128(src_values0, 8);
 4092|  10.7k|            src_values3 = _mm_srli_si128(src_values2, 8);
 4093|  10.7k|            src_values4 = _mm_packus_epi16(src_values4, src_values5);
 4094|  10.7k|            src_values6 = _mm_packus_epi16(src_values6, src_values7);
 4095|  10.7k|            src_values5 = _mm_srli_si128(src_values4, 8);
 4096|  10.7k|            src_values7 = _mm_srli_si128(src_values6, 8);
 4097|       |
 4098|       |            /* loading 8-bit 8 pixels values */
 4099|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_values0);       /* row=0*/
 4100|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_values1);   /* row=1*/
 4101|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_values2);   /* row=2*/
 4102|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_values3);   /* row=3*/
 4103|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), src_values4);   /* row=4*/
 4104|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), src_values5);   /* row=5*/
 4105|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), src_values6);   /* row=6*/
 4106|  10.7k|            _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), src_values7);   /* row=7*/
 4107|  10.7k|        }
 4108|       |
 4109|  10.7k|    }
 4110|  20.9k|    else /* if nt =4*/
 4111|  20.9k|    {
 4112|       |
 4113|  20.9k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 4114|  20.9k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 4115|       |
 4116|  20.9k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 4117|       |
 4118|       |
 4119|  20.9k|        const_temp2_4x32b = _mm_set1_epi32(31);
 4120|  20.9k|        const_temp3_4x32b = _mm_set1_epi32(32);
 4121|       |
 4122|  20.9k|        two_nt_4x32b = _mm_set1_epi32(two_nt + 1);
 4123|       |
 4124|       |
 4125|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4126|  20.9k|        intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 4127|       |
 4128|  20.9k|        row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 4129|  20.9k|        {
 4130|  20.9k|            int temp11, temp21, temp31, temp41;
 4131|       |
 4132|  20.9k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 4133|       |
 4134|  20.9k|            __m128i fract1_8x16b, fract2_8x16b, res_temp5_4x32b;
 4135|  20.9k|            __m128i src_values0, src_values1, src_values2, src_values3;
 4136|  20.9k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 4137|       |
 4138|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4139|  20.9k|            res_temp5_4x32b  = _mm_mullo_epi32(row_4x32b, intra_pred_ang_4x32b);
 4140|       |
 4141|       |            /* fract = pos & (31); */
 4142|  20.9k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 4143|       |
 4144|  20.9k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 4145|  20.9k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 4146|  20.9k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 4147|  20.9k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 4148|  20.9k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 4149|  20.9k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 4150|  20.9k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 4151|       |
 4152|       |            /* idx = pos >> 5; */
 4153|  20.9k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4154|       |
 4155|       |            /*(32 - fract) */
 4156|  20.9k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 4157|       |
 4158|  20.9k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4159|  20.9k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4160|       |
 4161|  20.9k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4162|  20.9k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4163|       |
 4164|  20.9k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4165|  20.9k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4166|       |
 4167|  20.9k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4168|  20.9k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4169|  20.9k|            temp3 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4170|  20.9k|            temp4 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4171|       |
 4172|  20.9k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));     /* col = 0-7   */
 4173|  20.9k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2));   /* col = 8-15  */
 4174|  20.9k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3));  /* col = 16-23 */
 4175|  20.9k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4));  /* col = 24-31 */
 4176|       |
 4177|  20.9k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4178|  20.9k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4179|  20.9k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4180|  20.9k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4181|       |
 4182|  20.9k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4183|  20.9k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4184|  20.9k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4185|  20.9k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4186|       |
 4187|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4188|  20.9k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4189|  20.9k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4190|  20.9k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4191|  20.9k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4192|       |
 4193|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4194|  20.9k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 4195|  20.9k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 4196|  20.9k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 4197|  20.9k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 4198|       |
 4199|       |            /* converting 16 bit to 8 bit */
 4200|  20.9k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 4201|  20.9k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 4202|  20.9k|            src_values1 = _mm_srli_si128(src_values0, 8);
 4203|  20.9k|            src_values3 = _mm_srli_si128(src_values2, 8);
 4204|       |
 4205|  20.9k|            temp11 = _mm_cvtsi128_si32(src_values0);
 4206|  20.9k|            temp21 = _mm_cvtsi128_si32(src_values1);
 4207|  20.9k|            temp31 = _mm_cvtsi128_si32(src_values2);
 4208|  20.9k|            temp41 = _mm_cvtsi128_si32(src_values3);
 4209|       |
 4210|       |            /* loding 4-bit 8 pixels values */
 4211|  20.9k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 4212|  20.9k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 4213|  20.9k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 4214|  20.9k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 4215|       |
 4216|  20.9k|        }
 4217|  20.9k|    }
 4218|  54.3k|}

ihevc_intra_pred_ref_filtering_ssse3:
  397|  2.49M|{
  398|  2.49M|    WORD32 filter_flag;
  399|  2.49M|    WORD32 i; /* Generic indexing variable */
  400|  2.49M|    WORD32 four_nt = 4 * nt;
  401|  2.49M|    UWORD8 au1_flt[(4 * MAX_CU_SIZE) + 1];
  402|  2.49M|    WORD32 bi_linear_int_flag = 0;
  403|  2.49M|    WORD32 abs_cond_left_flag = 0;
  404|  2.49M|    WORD32 abs_cond_top_flag = 0;
  405|  2.49M|    WORD32 dc_val = 1 << (BIT_DEPTH - 5);
  ------------------
  |  |   69|  2.49M|#define BIT_DEPTH 8
  ------------------
  406|  2.49M|    __m128i src_temp1, src_temp2, src_temp3, src_temp7;
  407|  2.49M|    __m128i src_temp4, src_temp5, src_temp6, src_temp8;
  408|       |
  409|  2.49M|    WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3);
  410|  2.49M|    WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1;
  411|  2.49M|    filter_flag = intra_smoothing_disabled ?
  ------------------
  |  Branch (411:19): [True: 11.1k, False: 2.48M]
  ------------------
  412|  2.48M|                    0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)));
  413|  2.49M|    if(0 == filter_flag)
  ------------------
  |  Branch (413:8): [True: 1.54M, False: 951k]
  ------------------
  414|  1.54M|    {
  415|  1.54M|        if(pu1_src == pu1_dst)
  ------------------
  |  Branch (415:12): [True: 1.54M, False: 18.4E]
  ------------------
  416|  1.54M|        {
  417|  1.54M|            return;
  418|  1.54M|        }
  419|  18.4E|        else
  420|  18.4E|        {
  421|  18.4E|            if(nt == 4)
  ------------------
  |  Branch (421:16): [True: 0, False: 18.4E]
  ------------------
  422|      0|            {
  423|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  424|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  425|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  426|       |
  427|      0|            }
  428|       |
  429|  18.4E|            else if(nt == 8)
  ------------------
  |  Branch (429:21): [True: 0, False: 18.4E]
  ------------------
  430|      0|            {
  431|       |
  432|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  433|      0|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_src + 16));
  434|       |
  435|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  436|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  437|       |
  438|       |
  439|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  440|      0|            }
  441|  18.4E|            else if(nt == 16)
  ------------------
  |  Branch (441:21): [True: 0, False: 18.4E]
  ------------------
  442|      0|            {
  443|       |
  444|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  445|      0|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_src + 16));
  446|      0|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_src + 32));
  447|      0|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_src + 48));
  448|       |
  449|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  450|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  451|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  452|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  453|       |
  454|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  455|      0|            }
  456|  18.4E|            else if(nt == 32)
  ------------------
  |  Branch (456:21): [True: 0, False: 18.4E]
  ------------------
  457|      0|            {
  458|       |
  459|      0|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src));
  460|      0|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_src + 16));
  461|      0|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_src + 32));
  462|      0|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_src + 48));
  463|       |
  464|      0|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_src + 64));
  465|      0|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_src + 80));
  466|      0|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_src + 96));
  467|      0|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_src + 112));
  468|       |
  469|      0|                _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  470|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  471|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  472|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  473|       |
  474|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 64), src_temp5);
  475|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 80), src_temp6);
  476|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 96), src_temp7);
  477|      0|                _mm_storeu_si128((__m128i *)(pu1_dst + 112), src_temp8);
  478|       |
  479|      0|                pu1_dst[four_nt] = pu1_src[four_nt];
  480|      0|            }
  481|       |
  482|  18.4E|        }
  483|  1.54M|    }
  484|       |
  485|   951k|    else
  486|   951k|    {
  487|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  488|   951k|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (488:12): [True: 153k, False: 798k]
  |  Branch (488:57): [True: 61.3k, False: 91.8k]
  ------------------
  489|  61.3k|        {
  490|       |            /* Strong Intra Filtering */
  491|  61.3k|            abs_cond_top_flag = (abs(pu1_src[2 * nt] + pu1_src[4 * nt]
  492|  61.3k|                            - (2 * pu1_src[3 * nt]))) < dc_val;
  493|  61.3k|            abs_cond_left_flag = (abs(pu1_src[2 * nt] + pu1_src[0]
  494|  61.3k|                            - (2 * pu1_src[nt]))) < dc_val;
  495|       |
  496|  61.3k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (496:35): [True: 52.6k, False: 8.72k]
  ------------------
  497|  52.6k|                            && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (497:32): [True: 46.7k, False: 5.92k]
  ------------------
  498|  61.3k|        }
  499|       |        /* Extremities Untouched*/
  500|   951k|        au1_flt[0] = pu1_src[0];
  501|   951k|        au1_flt[4 * nt] = pu1_src[4 * nt];
  502|       |
  503|       |        /* Strong filtering of reference samples */
  504|   951k|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (504:12): [True: 46.7k, False: 905k]
  ------------------
  505|  46.7k|        {
  506|  46.7k|            au1_flt[2 * nt] = pu1_src[2 * nt];
  507|       |
  508|  2.98M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (508:24): [True: 2.94M, False: 46.7k]
  ------------------
  509|  2.94M|                au1_flt[i] = (((2 * nt) - i) * pu1_src[0] + i * pu1_src[2 * nt] + 32) >> 6;
  510|       |
  511|  2.99M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (511:24): [True: 2.94M, False: 46.7k]
  ------------------
  512|  2.94M|                au1_flt[i + (2 * nt)] = (((2 * nt) - i) * pu1_src[2 * nt] + i * pu1_src[4 * nt] + 32) >> 6;
  513|  46.7k|        }
  514|   905k|        else
  515|   905k|        {
  516|   905k|            __m128i const_value_8x16, zero_8x16b;
  517|       |
  518|   905k|            const_value_8x16 = _mm_set1_epi16(2);
  519|       |
  520|   905k|            au1_flt[0] = pu1_src[0];
  521|   905k|            au1_flt[4 * nt] = pu1_src[4 * nt];
  522|       |
  523|   905k|            zero_8x16b = _mm_setzero_si128();
  524|       |
  525|       |            /* Perform bilinear filtering of Reference Samples */
  526|  6.72M|            for(i = 0; i < (four_nt); i += 16)
  ------------------
  |  Branch (526:24): [True: 5.81M, False: 905k]
  ------------------
  527|  5.81M|            {
  528|  5.81M|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_src + i));
  529|  5.81M|                src_temp2 = _mm_srli_si128(src_temp1, 1);
  530|  5.81M|                src_temp3 = _mm_srli_si128(src_temp2, 1);
  531|       |
  532|  5.81M|                src_temp1 = _mm_unpacklo_epi8(src_temp1, zero_8x16b);
  533|  5.81M|                src_temp2 = _mm_unpacklo_epi8(src_temp2, zero_8x16b);
  534|  5.81M|                src_temp3 = _mm_unpacklo_epi8(src_temp3, zero_8x16b);
  535|       |
  536|  5.81M|                src_temp2 = _mm_slli_epi16(src_temp2,  1);
  537|       |
  538|  5.81M|                src_temp1 = _mm_add_epi16(src_temp1, src_temp2);
  539|  5.81M|                src_temp1 = _mm_add_epi16(src_temp1, src_temp3);
  540|  5.81M|                src_temp1 = _mm_add_epi16(src_temp1, const_value_8x16);
  541|       |
  542|  5.81M|                src_temp1 = _mm_srai_epi16(src_temp1,  2);
  543|       |
  544|  5.81M|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_src + 8 + i));
  545|  5.81M|                src_temp5 = _mm_srli_si128(src_temp4, 1);
  546|  5.81M|                src_temp6 = _mm_srli_si128(src_temp5, 1);
  547|       |
  548|  5.81M|                src_temp4 = _mm_unpacklo_epi8(src_temp4, zero_8x16b);
  549|  5.81M|                src_temp5 = _mm_unpacklo_epi8(src_temp5, zero_8x16b);
  550|  5.81M|                src_temp6 = _mm_unpacklo_epi8(src_temp6, zero_8x16b);
  551|       |
  552|  5.81M|                src_temp5 = _mm_slli_epi16(src_temp5,  1);
  553|       |
  554|  5.81M|                src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  555|  5.81M|                src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  556|  5.81M|                src_temp4 = _mm_add_epi16(src_temp4, const_value_8x16);
  557|       |
  558|  5.81M|                src_temp4 = _mm_srai_epi16(src_temp4,  2);
  559|       |
  560|       |                /* converting 16 bit to 8 bit */
  561|  5.81M|                src_temp1 = _mm_packus_epi16(src_temp1, src_temp4);
  562|       |
  563|  5.81M|                _mm_storeu_si128((__m128i *)(au1_flt + 1 + i), src_temp1);
  564|  5.81M|            }
  565|   905k|            au1_flt[4 * nt] = pu1_src[4 * nt];
  566|   905k|        }
  567|       |
  568|   951k|        if(nt == 4)
  ------------------
  |  Branch (568:12): [True: 0, False: 951k]
  ------------------
  569|      0|        {
  570|      0|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  571|      0|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  572|      0|            pu1_dst[four_nt] = au1_flt[four_nt];
  573|      0|        }
  574|   951k|        else if(nt == 8)
  ------------------
  |  Branch (574:17): [True: 76.6k, False: 875k]
  ------------------
  575|  76.6k|        {
  576|       |
  577|  76.6k|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  578|  76.6k|            src_temp2 = _mm_loadu_si128((__m128i *)(au1_flt + 16));
  579|       |
  580|  76.6k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  581|  76.6k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  582|       |
  583|  76.6k|            pu1_dst[four_nt] = au1_flt[four_nt];
  584|  76.6k|        }
  585|   875k|        else if(nt == 16)
  ------------------
  |  Branch (585:17): [True: 257k, False: 617k]
  ------------------
  586|   257k|        {
  587|       |
  588|   257k|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  589|   257k|            src_temp2 = _mm_loadu_si128((__m128i *)(au1_flt + 16));
  590|   257k|            src_temp3 = _mm_loadu_si128((__m128i *)(au1_flt + 32));
  591|   257k|            src_temp4 = _mm_loadu_si128((__m128i *)(au1_flt + 48));
  592|       |
  593|   257k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  594|   257k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  595|   257k|            _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  596|   257k|            _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  597|       |
  598|   257k|            pu1_dst[four_nt] = au1_flt[four_nt];
  599|   257k|        }
  600|       |
  601|   617k|        else if(nt == 32)
  ------------------
  |  Branch (601:17): [True: 630k, False: 18.4E]
  ------------------
  602|   630k|        {
  603|       |
  604|   630k|            src_temp1 = _mm_loadu_si128((__m128i *)(au1_flt));
  605|   630k|            src_temp2 = _mm_loadu_si128((__m128i *)(au1_flt + 16));
  606|   630k|            src_temp3 = _mm_loadu_si128((__m128i *)(au1_flt + 32));
  607|   630k|            src_temp4 = _mm_loadu_si128((__m128i *)(au1_flt + 48));
  608|       |
  609|   630k|            src_temp5 = _mm_loadu_si128((__m128i *)(au1_flt + 64));
  610|   630k|            src_temp6 = _mm_loadu_si128((__m128i *)(au1_flt + 80));
  611|   630k|            src_temp7 = _mm_loadu_si128((__m128i *)(au1_flt + 96));
  612|   630k|            src_temp8 = _mm_loadu_si128((__m128i *)(au1_flt + 112));
  613|       |
  614|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp1);
  615|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), src_temp2);
  616|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 32), src_temp3);
  617|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 48), src_temp4);
  618|       |
  619|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 64), src_temp5);
  620|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 80), src_temp6);
  621|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 96), src_temp7);
  622|   630k|            _mm_storeu_si128((__m128i *)(pu1_dst + 112), src_temp8);
  623|       |
  624|   630k|            pu1_dst[four_nt] = au1_flt[four_nt];
  625|   630k|        }
  626|       |
  627|   951k|    }
  628|  2.49M|}
ihevc_intra_pred_luma_planar_ssse3:
  674|   906k|{
  675|       |
  676|       |
  677|   906k|    WORD32 row, col;
  678|   906k|    WORD32 two_nt, three_nt;
  679|   906k|    UWORD16 temp;
  680|       |
  681|   906k|    __m128i pu1_ref_16x8b, const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  682|   906k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b, const_temp8_4x32b;
  683|   906k|    __m128i nt_row_16x8b, nt_row1_16x8b, nt_row2_16x8b, nt_row3_16x8b; //nt-1-row
  684|   906k|    __m128i row_16x8b, row1_16x8b, row2_16x8b, row3_16x8b; //row+1
  685|   906k|    UNUSED(src_strd);
  ------------------
  |  |   38|   906k|#define UNUSED(x) ((void)(x))
  ------------------
  686|   906k|    UNUSED(mode);
  ------------------
  |  |   38|   906k|#define UNUSED(x) ((void)(x))
  ------------------
  687|       |
  688|   906k|    two_nt = 2 * nt;
  689|   906k|    three_nt = 3 * nt;
  690|       |
  691|       |    /* Planar filtering */
  692|   906k|    temp = pu1_ref[nt - 1];
  693|   906k|    temp = (temp << 8) | ((UWORD16)pu1_ref[three_nt + 1]);
  694|       |    /* setting vallues in  registera*/
  695|   906k|    pu1_ref_16x8b  = _mm_set1_epi16(temp);
  696|   906k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  697|       |
  698|       |
  699|       |
  700|   906k|    if(nt == 32) /* for nt multiple of 8*/
  ------------------
  |  Branch (700:8): [True: 178k, False: 728k]
  ------------------
  701|   178k|    {
  702|       |
  703|       |
  704|   178k|        const_temp4_4x32b = _mm_set1_epi16(0x0400);
  705|   178k|        const_temp1_4x32b = _mm_set1_epi16(0x0100);
  706|   178k|        const_temp8_4x32b = _mm_set1_epi16(0x0008);
  707|       |        //(nt-1-y) (nt-1-x) ; x= 0..15 , y = row
  708|       |        //const_temp5_4x32b = _mm_set_epi8(nt_row, 0,nt_row, 1,nt_row, 2,nt_row, 3,nt_row, 4,nt_row, 5,nt_row, 6,nt_row, 7);
  709|   178k|        nt_row_16x8b = _mm_set_epi16(0x1f18, 0x1f19, 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0x1f1e, 0x1f1f);
  710|       |        //(y+1) (x+1) ; x= 0..15 , y = row
  711|       |        //const_temp3_4x32b = _mm_set_epi16(row1,8,row1, 7,row1, 6, row1, 5,row1, 4, row1, 3, row1, 2, row1, 1);
  712|   178k|        row_16x8b = _mm_set_epi16(0x0108, 0x0107, 0x0106, 0x0105, 0x0104, 0x0103, 0x0102, 0x0101);
  713|       |
  714|  5.84M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (714:22): [True: 5.66M, False: 178k]
  ------------------
  715|  5.66M|        {
  716|  5.66M|            __m128i res_temp_8x16b, res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b;
  717|  5.66M|            __m128i res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b, res_temp7_8x16b;
  718|       |
  719|  5.66M|            __m128i src_temp_8x16b, src_temp1_8x16b;
  720|       |
  721|       |
  722|  5.66M|            res_temp1_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 1 - row]);
  723|       |
  724|  5.66M|            nt_row1_16x8b = _mm_sub_epi16(nt_row_16x8b,  const_temp8_4x32b);
  725|  5.66M|            row1_16x8b    = _mm_add_epi16(row_16x8b,     const_temp8_4x32b);
  726|  5.66M|            nt_row2_16x8b = _mm_sub_epi16(nt_row1_16x8b, const_temp8_4x32b);
  727|  5.66M|            row2_16x8b    = _mm_add_epi16(row1_16x8b,    const_temp8_4x32b);
  728|  5.66M|            nt_row3_16x8b = _mm_sub_epi16(nt_row2_16x8b, const_temp8_4x32b);
  729|  5.66M|            row3_16x8b    = _mm_add_epi16(row2_16x8b,    const_temp8_4x32b);
  730|       |            /* loding 8bit 16 pixles*/
  731|  5.66M|            src_temp_8x16b  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  732|  5.66M|            src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 17));
  733|       |
  734|  5.66M|            res_temp4_8x16b =  _mm_unpacklo_epi8(res_temp1_8x16b, src_temp_8x16b); /* row=0*/
  735|  5.66M|            res_temp5_8x16b =  _mm_unpackhi_epi8(res_temp1_8x16b, src_temp_8x16b); /* row=1*/
  736|  5.66M|            res_temp6_8x16b =  _mm_unpacklo_epi8(res_temp1_8x16b, src_temp1_8x16b); /* row=2*/
  737|  5.66M|            res_temp7_8x16b =  _mm_unpackhi_epi8(res_temp1_8x16b, src_temp1_8x16b); /* row=3*/
  738|       |
  739|       |            /*(row + 1) * pu1_ref[nt - 1] + (col + 1) * pu1_ref[three_nt + 1] */
  740|  5.66M|            res_temp_8x16b  = _mm_maddubs_epi16(pu1_ref_16x8b, row_16x8b);
  741|  5.66M|            res_temp1_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row1_16x8b);
  742|  5.66M|            res_temp2_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row2_16x8b);
  743|  5.66M|            res_temp3_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row3_16x8b);
  744|       |            /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] + (nt - 1 - col)* pu1_ref[two_nt - 1 - row] */
  745|  5.66M|            res_temp4_8x16b = _mm_maddubs_epi16(res_temp4_8x16b, nt_row_16x8b);
  746|  5.66M|            res_temp5_8x16b = _mm_maddubs_epi16(res_temp5_8x16b, nt_row1_16x8b);
  747|  5.66M|            res_temp6_8x16b = _mm_maddubs_epi16(res_temp6_8x16b, nt_row2_16x8b);
  748|  5.66M|            res_temp7_8x16b = _mm_maddubs_epi16(res_temp7_8x16b, nt_row3_16x8b);
  749|       |
  750|  5.66M|            res_temp_8x16b  = _mm_add_epi16(res_temp_8x16b, res_temp4_8x16b);
  751|  5.66M|            res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp5_8x16b);
  752|  5.66M|            res_temp2_8x16b = _mm_add_epi16(res_temp2_8x16b, res_temp6_8x16b);
  753|  5.66M|            res_temp3_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp7_8x16b);
  754|       |            /*res_temp + nt)*/
  755|  5.66M|            res_temp_8x16b  = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  756|  5.66M|            res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, const_temp6_4x32b);
  757|  5.66M|            res_temp2_8x16b = _mm_add_epi16(res_temp2_8x16b, const_temp6_4x32b);
  758|  5.66M|            res_temp3_8x16b = _mm_add_epi16(res_temp3_8x16b, const_temp6_4x32b);
  759|       |
  760|  5.66M|            res_temp_8x16b  = _mm_srli_epi16(res_temp_8x16b, 6); //log2(32)+1
  761|  5.66M|            res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, 6);
  762|  5.66M|            res_temp2_8x16b = _mm_srli_epi16(res_temp2_8x16b, 6);
  763|  5.66M|            res_temp3_8x16b = _mm_srli_epi16(res_temp3_8x16b, 6);
  764|       |
  765|  5.66M|            res_temp_8x16b  = _mm_packus_epi16(res_temp_8x16b, res_temp1_8x16b);
  766|  5.66M|            res_temp1_8x16b = _mm_packus_epi16(res_temp2_8x16b, res_temp3_8x16b);
  767|       |
  768|       |
  769|  5.66M|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd)), res_temp_8x16b);
  770|  5.66M|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd) + 16), res_temp1_8x16b);
  771|       |
  772|       |
  773|  5.66M|            nt_row_16x8b = _mm_sub_epi16(nt_row_16x8b, const_temp1_4x32b);
  774|  5.66M|            row_16x8b    = _mm_add_epi16(row_16x8b,    const_temp1_4x32b);
  775|  5.66M|        }
  776|   178k|    }
  777|   728k|    else if(nt == 16) /* for nt multiple of 8*/
  ------------------
  |  Branch (777:13): [True: 137k, False: 591k]
  ------------------
  778|   137k|    {
  779|       |
  780|   137k|        const_temp4_4x32b = _mm_set1_epi16(0x0400);
  781|   137k|        const_temp1_4x32b = _mm_set1_epi16(0x0100);
  782|   137k|        const_temp8_4x32b = _mm_set1_epi16(0x0008);
  783|       |        //(nt-1-y) (nt-1-x) ; x= 0..15 , y = row
  784|       |        //const_temp5_4x32b = _mm_set_epi8(nt_row, 0,nt_row, 1,nt_row, 2,nt_row, 3,nt_row, 4,nt_row, 5,nt_row, 6,nt_row, 7);
  785|   137k|        nt_row_16x8b = _mm_set_epi16(0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e, 0x0f0f);
  786|       |        //(y+1) (x+1) ; x= 0..15 , y = row
  787|       |        //const_temp3_4x32b = _mm_set_epi16(row1,8,row1, 7,row1, 6, row1, 5,row1, 4, row1, 3, row1, 2, row1, 1);
  788|   137k|        row_16x8b = _mm_set_epi16(0x0108, 0x0107, 0x0106, 0x0105, 0x0104, 0x0103, 0x0102, 0x0101);
  789|       |
  790|  1.23M|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (790:22): [True: 1.09M, False: 137k]
  ------------------
  791|  1.09M|        {
  792|  1.09M|            __m128i res_temp_8x16b, res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b;
  793|  1.09M|            __m128i res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b, res_temp7_8x16b;
  794|       |
  795|  1.09M|            __m128i src_temp_8x16b;
  796|       |
  797|       |
  798|  1.09M|            res_temp1_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 1 - row]);
  799|  1.09M|            res_temp2_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 2 - row]);
  800|       |
  801|       |
  802|  1.09M|            nt_row1_16x8b = _mm_sub_epi16(nt_row_16x8b,  const_temp1_4x32b);
  803|  1.09M|            row1_16x8b    = _mm_add_epi16(row_16x8b,     const_temp1_4x32b);
  804|  1.09M|            nt_row2_16x8b = _mm_sub_epi16(nt_row_16x8b,  const_temp8_4x32b);
  805|  1.09M|            row2_16x8b    = _mm_add_epi16(row_16x8b,     const_temp8_4x32b);
  806|  1.09M|            nt_row3_16x8b = _mm_sub_epi16(nt_row1_16x8b, const_temp8_4x32b);
  807|  1.09M|            row3_16x8b    = _mm_add_epi16(row1_16x8b,    const_temp8_4x32b);
  808|       |            /* loding 8bit 16 pixles*/
  809|  1.09M|            src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  810|       |
  811|       |
  812|  1.09M|            res_temp4_8x16b =  _mm_unpacklo_epi8(res_temp1_8x16b, src_temp_8x16b); /* row=0*/
  813|  1.09M|            res_temp5_8x16b =  _mm_unpacklo_epi8(res_temp2_8x16b, src_temp_8x16b); /* row=1*/
  814|  1.09M|            res_temp6_8x16b =  _mm_unpackhi_epi8(res_temp1_8x16b, src_temp_8x16b); /* row=2*/
  815|  1.09M|            res_temp7_8x16b =  _mm_unpackhi_epi8(res_temp2_8x16b, src_temp_8x16b); /* row=3*/
  816|       |
  817|       |            /*(row + 1) * pu1_ref[nt - 1] + (col + 1) * pu1_ref[three_nt + 1] */
  818|  1.09M|            res_temp_8x16b  = _mm_maddubs_epi16(pu1_ref_16x8b, row_16x8b);
  819|  1.09M|            res_temp1_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row1_16x8b);
  820|  1.09M|            res_temp2_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row2_16x8b);
  821|  1.09M|            res_temp3_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row3_16x8b);
  822|       |            /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] + (nt - 1 - col)* pu1_ref[two_nt - 1 - row] */
  823|  1.09M|            res_temp4_8x16b = _mm_maddubs_epi16(res_temp4_8x16b, nt_row_16x8b);
  824|  1.09M|            res_temp5_8x16b = _mm_maddubs_epi16(res_temp5_8x16b, nt_row1_16x8b);
  825|  1.09M|            res_temp6_8x16b = _mm_maddubs_epi16(res_temp6_8x16b, nt_row2_16x8b);
  826|  1.09M|            res_temp7_8x16b = _mm_maddubs_epi16(res_temp7_8x16b, nt_row3_16x8b);
  827|       |
  828|  1.09M|            res_temp_8x16b  = _mm_add_epi16(res_temp_8x16b, res_temp4_8x16b);
  829|  1.09M|            res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp5_8x16b);
  830|  1.09M|            res_temp2_8x16b = _mm_add_epi16(res_temp2_8x16b, res_temp6_8x16b);
  831|  1.09M|            res_temp3_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp7_8x16b);
  832|       |            /*res_temp + nt)*/
  833|  1.09M|            res_temp_8x16b  = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  834|  1.09M|            res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, const_temp6_4x32b);
  835|  1.09M|            res_temp2_8x16b = _mm_add_epi16(res_temp2_8x16b, const_temp6_4x32b);
  836|  1.09M|            res_temp3_8x16b = _mm_add_epi16(res_temp3_8x16b, const_temp6_4x32b);
  837|       |
  838|  1.09M|            res_temp_8x16b  = _mm_srli_epi16(res_temp_8x16b, 5); //log2(16)+1
  839|  1.09M|            res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, 5);
  840|  1.09M|            res_temp2_8x16b = _mm_srli_epi16(res_temp2_8x16b, 5);
  841|  1.09M|            res_temp3_8x16b = _mm_srli_epi16(res_temp3_8x16b, 5);
  842|       |
  843|  1.09M|            res_temp_8x16b  = _mm_packus_epi16(res_temp_8x16b, res_temp2_8x16b);
  844|  1.09M|            res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, res_temp3_8x16b);
  845|       |
  846|  1.09M|            _mm_storeu_si128((__m128i *)(pu1_dst + (row * dst_strd)), res_temp_8x16b);
  847|  1.09M|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), res_temp1_8x16b);
  848|       |
  849|  1.09M|            nt_row_16x8b = _mm_sub_epi16(nt_row1_16x8b, const_temp1_4x32b);
  850|  1.09M|            row_16x8b    = _mm_add_epi16(row1_16x8b,    const_temp1_4x32b);
  851|  1.09M|        }
  852|   137k|    }
  853|   591k|    else if(nt == 8)
  ------------------
  |  Branch (853:13): [True: 64.1k, False: 527k]
  ------------------
  854|  64.1k|    {
  855|       |
  856|       |
  857|  64.1k|        const_temp4_4x32b = _mm_set1_epi16(0x0400);
  858|  64.1k|        const_temp1_4x32b = _mm_set1_epi16(0x0100);
  859|  64.1k|        zero_8x16b = _mm_set1_epi32(0);
  860|       |
  861|       |        //(nt-1-y) (nt-1-x) ; x= 0..7 , y = row
  862|       |        //const_temp5_4x32b = _mm_set_epi8(nt_row, 0,nt_row, 1,nt_row, 2,nt_row, 3,nt_row, 4,nt_row, 5,nt_row, 6,nt_row, 7);
  863|  64.1k|        nt_row_16x8b = _mm_set_epi16(0x0700, 0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707);
  864|       |        //(y+1) (x+1) ; x= 0..7 , y = row
  865|       |        //const_temp3_4x32b = _mm_set_epi16(row1,8,row1, 7,row1, 6, row1, 5,row1, 4, row1, 3, row1, 2, row1, 1);
  866|  64.1k|        row_16x8b = _mm_set_epi16(0x0108, 0x0107, 0x0106, 0x0105, 0x0104, 0x0103, 0x0102, 0x0101);
  867|       |
  868|   192k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (868:22): [True: 128k, False: 64.1k]
  ------------------
  869|   128k|        {
  870|   128k|            __m128i res_temp_8x16b, res_temp1_8x16b, res_temp2_8x16b, res_temp3_8x16b;
  871|   128k|            __m128i res_temp4_8x16b, res_temp5_8x16b, res_temp6_8x16b, res_temp7_8x16b;
  872|       |
  873|   128k|            __m128i src_temp_8x16b;
  874|       |
  875|       |
  876|   128k|            res_temp4_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 1 - row]);
  877|   128k|            res_temp5_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 2 - row]);
  878|   128k|            res_temp6_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 3 - row]);
  879|   128k|            res_temp7_8x16b  = _mm_set1_epi8(pu1_ref[two_nt - 4 - row]);
  880|       |
  881|   128k|            nt_row1_16x8b = _mm_sub_epi16(nt_row_16x8b,  const_temp1_4x32b);
  882|   128k|            row1_16x8b    = _mm_add_epi16(row_16x8b,     const_temp1_4x32b);
  883|   128k|            nt_row2_16x8b = _mm_sub_epi16(nt_row1_16x8b, const_temp1_4x32b);
  884|   128k|            row2_16x8b    = _mm_add_epi16(row1_16x8b,    const_temp1_4x32b);
  885|   128k|            nt_row3_16x8b = _mm_sub_epi16(nt_row2_16x8b, const_temp1_4x32b);
  886|   128k|            row3_16x8b    = _mm_add_epi16(row2_16x8b,    const_temp1_4x32b);
  887|       |            /* loding 8bit 16 pixles*/
  888|   128k|            src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
  889|       |
  890|   128k|            res_temp4_8x16b =  _mm_unpacklo_epi8(res_temp4_8x16b, src_temp_8x16b); /* row=0*/
  891|   128k|            res_temp5_8x16b =  _mm_unpacklo_epi8(res_temp5_8x16b, src_temp_8x16b); /* row=1*/
  892|   128k|            res_temp6_8x16b =  _mm_unpacklo_epi8(res_temp6_8x16b, src_temp_8x16b); /* row=2*/
  893|   128k|            res_temp7_8x16b =  _mm_unpacklo_epi8(res_temp7_8x16b, src_temp_8x16b); /* row=3*/
  894|       |
  895|       |            /*(row + 1) * pu1_ref[nt - 1] + (col + 1) * pu1_ref[three_nt + 1] */
  896|   128k|            res_temp_8x16b  = _mm_maddubs_epi16(pu1_ref_16x8b, row_16x8b);
  897|   128k|            res_temp1_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row1_16x8b);
  898|   128k|            res_temp2_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row2_16x8b);
  899|   128k|            res_temp3_8x16b = _mm_maddubs_epi16(pu1_ref_16x8b, row3_16x8b);
  900|       |            /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] + (nt - 1 - col)* pu1_ref[two_nt - 1 - row] */
  901|   128k|            res_temp4_8x16b = _mm_maddubs_epi16(res_temp4_8x16b, nt_row_16x8b);
  902|   128k|            res_temp5_8x16b = _mm_maddubs_epi16(res_temp5_8x16b, nt_row1_16x8b);
  903|   128k|            res_temp6_8x16b = _mm_maddubs_epi16(res_temp6_8x16b, nt_row2_16x8b);
  904|   128k|            res_temp7_8x16b = _mm_maddubs_epi16(res_temp7_8x16b, nt_row3_16x8b);
  905|       |
  906|   128k|            res_temp_8x16b  = _mm_add_epi16(res_temp_8x16b, res_temp4_8x16b);
  907|   128k|            res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp5_8x16b);
  908|   128k|            res_temp2_8x16b = _mm_add_epi16(res_temp2_8x16b, res_temp6_8x16b);
  909|   128k|            res_temp3_8x16b = _mm_add_epi16(res_temp3_8x16b, res_temp7_8x16b);
  910|       |            /*res_temp + nt)*/
  911|   128k|            res_temp_8x16b  = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  912|   128k|            res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, const_temp6_4x32b);
  913|   128k|            res_temp2_8x16b = _mm_add_epi16(res_temp2_8x16b, const_temp6_4x32b);
  914|   128k|            res_temp3_8x16b = _mm_add_epi16(res_temp3_8x16b, const_temp6_4x32b);
  915|       |
  916|   128k|            res_temp_8x16b  = _mm_srli_epi16(res_temp_8x16b, 4); //log2(16)+1
  917|   128k|            res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, 4);
  918|   128k|            res_temp2_8x16b = _mm_srli_epi16(res_temp2_8x16b, 4);
  919|   128k|            res_temp3_8x16b = _mm_srli_epi16(res_temp3_8x16b, 4);
  920|       |
  921|   128k|            res_temp_8x16b  = _mm_packus_epi16(res_temp_8x16b, zero_8x16b);
  922|   128k|            res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  923|   128k|            res_temp2_8x16b = _mm_packus_epi16(res_temp2_8x16b, zero_8x16b);
  924|   128k|            res_temp3_8x16b = _mm_packus_epi16(res_temp3_8x16b, zero_8x16b);
  925|       |
  926|   128k|            _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd)), res_temp_8x16b);
  927|   128k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), res_temp1_8x16b);
  928|   128k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), res_temp2_8x16b);
  929|   128k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), res_temp3_8x16b);
  930|       |
  931|   128k|            nt_row_16x8b = _mm_sub_epi16(nt_row3_16x8b, const_temp1_4x32b);
  932|   128k|            row_16x8b    = _mm_add_epi16(row3_16x8b,    const_temp1_4x32b);
  933|   128k|        }
  934|  64.1k|    }
  935|   527k|    else
  936|   527k|    {
  937|       |
  938|       |        /* for nt multiple of 4*/
  939|   527k|        const_temp7_4x32b = _mm_set1_epi16(4);
  940|   527k|        const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  941|   527k|        const_temp_4x32b  = _mm_set1_epi16(pu1_ref[three_nt + 1]);
  942|   527k|        const_temp1_4x32b = _mm_set1_epi16(pu1_ref[nt - 1]);
  943|   527k|        zero_8x16b = _mm_set1_epi32(0);
  944|       |
  945|  2.63M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (945:22): [True: 2.10M, False: 527k]
  ------------------
  946|  2.10M|        {
  947|  2.10M|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  948|  2.10M|            __m128i res_temp3_8x16b;
  949|       |
  950|  2.10M|            const_temp2_4x32b  = _mm_set1_epi16(pu1_ref[two_nt - 1 - row]);
  951|  2.10M|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  952|       |
  953|       |
  954|  2.10M|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  955|       |
  956|  2.10M|            const_temp5_4x32b = _mm_set_epi16(7, 6, 5, 4, 3, 2, 1, 0);
  957|  2.10M|            col_8x16b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
  958|       |
  959|  2.10M|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  960|       |
  961|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  962|  2.10M|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  963|       |
  964|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  965|  2.10M|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  966|       |
  967|  4.21M|            for(col = 0; col < nt; col += 4)
  ------------------
  |  Branch (967:26): [True: 2.10M, False: 2.10M]
  ------------------
  968|  2.10M|            {
  969|  2.10M|                __m128i src_temp_8x16b;
  970|  2.10M|                int temp1;
  971|       |
  972|       |                /* loding 8bit 16 pixles*/
  973|  2.10M|                src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + col));
  974|       |
  975|  2.10M|                src_temp_8x16b =  _mm_unpacklo_epi8(src_temp_8x16b, zero_8x16b); /* row=0*/
  976|       |
  977|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  978|  2.10M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  979|       |
  980|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  981|  2.10M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  982|       |
  983|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  984|  2.10M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  985|       |
  986|  2.10M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  987|  2.10M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  988|  2.10M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  989|       |
  990|  2.10M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, 3); //log2(16)+1
  991|  2.10M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  992|       |
  993|  2.10M|                temp1 = _mm_cvtsi128_si32(res_temp1_8x16b);
  994|       |
  995|  2.10M|                *(WORD32 *)(&pu1_dst[(row * dst_strd) + col]) = temp1;
  996|       |
  997|  2.10M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  998|  2.10M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  999|  2.10M|            } /* inner loop ends here */
 1000|  2.10M|        }
 1001|   527k|    }
 1002|       |
 1003|       |
 1004|   906k|}
ihevc_intra_pred_luma_dc_ssse3:
 1049|   243k|{
 1050|       |
 1051|   243k|    WORD32 acc_dc;
 1052|   243k|    WORD32 dc_val, two_dc_val, three_dc_val;
 1053|   243k|    WORD32 row;
 1054|   243k|    WORD32 log2nt = 5;
 1055|   243k|    WORD32 two_nt, three_nt;
 1056|   243k|    __m128i src_temp1, src_temp7, src_temp3, src_temp4, src_temp5, src_temp6;
 1057|   243k|    __m128i src_temp8, src_temp10, src_temp2;
 1058|   243k|    __m128i m_zero = _mm_setzero_si128();
 1059|   243k|    __m128i sm = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASK5[0]);
 1060|   243k|    UNUSED(src_strd);
  ------------------
  |  |   38|   243k|#define UNUSED(x) ((void)(x))
  ------------------
 1061|   243k|    UNUSED(mode);
  ------------------
  |  |   38|   243k|#define UNUSED(x) ((void)(x))
  ------------------
 1062|       |
 1063|       |
 1064|   243k|    switch(nt)
 1065|   243k|    {
 1066|  39.8k|        case 32:
  ------------------
  |  Branch (1066:9): [True: 39.8k, False: 203k]
  ------------------
 1067|  39.8k|            log2nt = 5;
 1068|  39.8k|            break;
 1069|  41.4k|        case 16:
  ------------------
  |  Branch (1069:9): [True: 41.4k, False: 202k]
  ------------------
 1070|  41.4k|            log2nt = 4;
 1071|  41.4k|            break;
 1072|  28.2k|        case 8:
  ------------------
  |  Branch (1072:9): [True: 28.2k, False: 215k]
  ------------------
 1073|  28.2k|            log2nt = 3;
 1074|  28.2k|            break;
 1075|   134k|        case 4:
  ------------------
  |  Branch (1075:9): [True: 134k, False: 109k]
  ------------------
 1076|   134k|            log2nt = 2;
 1077|   134k|            break;
 1078|      0|        default:
  ------------------
  |  Branch (1078:9): [True: 0, False: 243k]
  ------------------
 1079|      0|            break;
 1080|   243k|    }
 1081|   243k|    two_nt = 2 * nt;
 1082|   243k|    three_nt = 3 * nt;
 1083|       |
 1084|   243k|    acc_dc = 0;
 1085|       |    /* Calculate DC value for the transform block */
 1086|       |
 1087|       |
 1088|       |
 1089|   243k|    if(nt == 32)
  ------------------
  |  Branch (1089:8): [True: 39.8k, False: 203k]
  ------------------
 1090|  39.8k|    {
 1091|  39.8k|        __m128i temp;
 1092|  39.8k|        WORD32 itr_count;
 1093|       |
 1094|  39.8k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
 1095|  39.8k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 16));
 1096|  39.8k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 32));
 1097|  39.8k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 48));
 1098|       |
 1099|  39.8k|        src_temp3 = _mm_sad_epu8(src_temp3, m_zero);
 1100|  39.8k|        src_temp4 = _mm_sad_epu8(src_temp4, m_zero);
 1101|  39.8k|        src_temp7 = _mm_sad_epu8(src_temp7, m_zero);
 1102|  39.8k|        src_temp8 = _mm_sad_epu8(src_temp8, m_zero);
 1103|       |
 1104|  39.8k|        src_temp4 = _mm_add_epi16(src_temp3, src_temp4);
 1105|  39.8k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
 1106|  39.8k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
 1107|       |
 1108|  39.8k|        src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
 1109|  39.8k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
 1110|       |
 1111|  39.8k|        acc_dc = _mm_cvtsi128_si32(src_temp4);
 1112|       |
 1113|  39.8k|        acc_dc += pu1_ref[three_nt];
 1114|  39.8k|        acc_dc -= pu1_ref[two_nt];
 1115|       |
 1116|       |        /* computing acc_dc value */
 1117|  39.8k|        dc_val = (acc_dc + nt) >> (log2nt + 1);
 1118|       |
 1119|  39.8k|        two_dc_val = 2 * dc_val;
 1120|  39.8k|        three_dc_val = 3 * dc_val;
 1121|       |
 1122|  39.8k|        temp = _mm_set1_epi8(dc_val);
 1123|       |
 1124|   119k|        for(itr_count = 0; itr_count < 2; itr_count++)
  ------------------
  |  Branch (1124:28): [True: 79.7k, False: 39.8k]
  ------------------
 1125|  79.7k|        {
 1126|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
 1127|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp);
 1128|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp);
 1129|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp);
 1130|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp);
 1131|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp);
 1132|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp);
 1133|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp);
 1134|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp);
 1135|       |
 1136|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp);
 1137|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp);
 1138|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp);
 1139|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp);
 1140|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp);
 1141|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp);
 1142|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp);
 1143|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp);
 1144|       |
 1145|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp);
 1146|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp);
 1147|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp);
 1148|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp);
 1149|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp);
 1150|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp);
 1151|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp);
 1152|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp);
 1153|       |
 1154|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp);
 1155|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp);
 1156|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp);
 1157|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp);
 1158|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp);
 1159|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp);
 1160|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp);
 1161|  79.7k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp);
 1162|       |
 1163|  79.7k|            pu1_dst += 16 * dst_strd;
 1164|  79.7k|        }
 1165|  39.8k|    }
 1166|   203k|    else
 1167|       |
 1168|   203k|    {
 1169|   203k|        __m128i sm1 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASK4[0]);
 1170|       |
 1171|       |        /* DC filtering for the first top row and first left column */
 1172|       |
 1173|       |
 1174|       |
 1175|   203k|        if(nt == 4) /* nt multiple of 4*/
  ------------------
  |  Branch (1175:12): [True: 134k, False: 69.7k]
  ------------------
 1176|   134k|        {
 1177|   134k|            WORD32 temp1, temp2, temp3;
 1178|       |
 1179|   134k|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
 1180|   134k|            src_temp2 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1181|       |
 1182|   134k|            src_temp4 =  _mm_unpacklo_epi8(src_temp3, m_zero);
 1183|   134k|            src_temp2 =  _mm_unpacklo_epi8(src_temp2, m_zero);
 1184|       |
 1185|   134k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
 1186|   134k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
 1187|   134k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
 1188|       |
 1189|   134k|            acc_dc = _mm_cvtsi128_si32(src_temp4);
 1190|   134k|            acc_dc += pu1_ref[three_nt];
 1191|   134k|            acc_dc -= pu1_ref[two_nt];
 1192|       |
 1193|       |/* computing acc_dc value */
 1194|       |
 1195|   134k|            dc_val = (acc_dc + nt) >> (log2nt + 1);
 1196|       |
 1197|   134k|            three_dc_val = 3 * dc_val;
 1198|       |
 1199|       |            /* loding 8-bit 16 pixel */
 1200|   134k|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
 1201|   134k|            two_dc_val = 2 * dc_val;
 1202|       |
 1203|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
 1204|   134k|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
 1205|       |
 1206|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2 */
 1207|   134k|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
 1208|       |
 1209|   134k|            src_temp2 = _mm_packus_epi16(src_temp2, m_zero);
 1210|       |
 1211|   134k|            temp1 = _mm_cvtsi128_si32(src_temp2);
 1212|       |
 1213|   134k|            *(WORD32 *)(&pu1_dst[0]) = temp1;
 1214|       |
 1215|   134k|            src_temp2 = _mm_insert_epi16(src_temp2, dc_val, 0);
 1216|       |
 1217|   134k|            src_temp2 =  _mm_shuffle_epi8(src_temp2, sm1);
 1218|   134k|            src_temp3 =  _mm_shuffle_epi8(src_temp2, sm1);
 1219|   134k|            src_temp4 =  _mm_shuffle_epi8(src_temp2, sm1);
 1220|       |
 1221|   134k|            temp1 = _mm_cvtsi128_si32(src_temp2);
 1222|   134k|            temp2 = _mm_cvtsi128_si32(src_temp3);
 1223|   134k|            temp3 = _mm_cvtsi128_si32(src_temp4);
 1224|       |
 1225|   134k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp1;
 1226|   134k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp2;
 1227|   134k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp3;
 1228|       |
 1229|       |            /*  retore  first value*/
 1230|   134k|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
 1231|   134k|                            >> 2);
 1232|       |
 1233|   536k|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (1233:26): [True: 402k, False: 134k]
  ------------------
 1234|   402k|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
 1235|   402k|                                >> 2;
 1236|       |
 1237|   134k|        }
 1238|  69.7k|        else if(nt == 8) /* if nt%8==0*/
  ------------------
  |  Branch (1238:17): [True: 28.2k, False: 41.4k]
  ------------------
 1239|  28.2k|        {
 1240|       |
 1241|  28.2k|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
 1242|       |
 1243|  28.2k|            src_temp4 = _mm_sad_epu8(src_temp3, m_zero);
 1244|  28.2k|            src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
 1245|  28.2k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
 1246|       |
 1247|  28.2k|            acc_dc = _mm_cvtsi128_si32(src_temp4);
 1248|       |
 1249|  28.2k|            acc_dc += pu1_ref[three_nt];
 1250|  28.2k|            acc_dc -= pu1_ref[two_nt];
 1251|       |
 1252|       |            /* computing acc_dc value */
 1253|       |
 1254|  28.2k|            dc_val = (acc_dc + nt) >> (log2nt + 1);
 1255|       |
 1256|  28.2k|            three_dc_val = 3 * dc_val;
 1257|  28.2k|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
 1258|  28.2k|            two_dc_val = 2 * dc_val;
 1259|       |
 1260|       |            /* loding 8-bit 16 pixel */
 1261|  28.2k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1262|  28.2k|            src_temp2 =  _mm_unpacklo_epi8(src_temp2, m_zero);
 1263|       |
 1264|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
 1265|  28.2k|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
 1266|       |
 1267|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2)>>2 */
 1268|  28.2k|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
 1269|  28.2k|            src_temp2 = _mm_packus_epi16(src_temp2, m_zero);
 1270|       |
 1271|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_temp2);
 1272|       |
 1273|       |            /* Fill the remaining rows with DC value*/
 1274|       |
 1275|  28.2k|            src_temp1 = _mm_set1_epi8(dc_val);
 1276|  28.2k|            src_temp2 = _mm_set1_epi8(dc_val);
 1277|  28.2k|            src_temp3 = _mm_set1_epi8(dc_val);
 1278|  28.2k|            src_temp4 = _mm_set1_epi8(dc_val);
 1279|  28.2k|            src_temp5 = _mm_set1_epi8(dc_val);
 1280|  28.2k|            src_temp6 = _mm_set1_epi8(dc_val);
 1281|  28.2k|            src_temp7 = _mm_set1_epi8(dc_val);
 1282|       |
 1283|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
 1284|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
 1285|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
 1286|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
 1287|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
 1288|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
 1289|  28.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
 1290|       |
 1291|       |            /*  retore  first value*/
 1292|  28.2k|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
 1293|  28.2k|                            >> 2);
 1294|       |
 1295|   226k|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (1295:26): [True: 198k, False: 28.2k]
  ------------------
 1296|   198k|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
 1297|   198k|                                >> 2;
 1298|       |
 1299|  28.2k|        }
 1300|  41.4k|        else /* if nt == 16*/
 1301|  41.4k|        {
 1302|       |
 1303|  41.4k|            src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt));
 1304|  41.4k|            src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + nt + 16));
 1305|       |
 1306|  41.4k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1307|  41.4k|            src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 8));
 1308|       |
 1309|  41.4k|            src_temp3 = _mm_sad_epu8(src_temp3, m_zero);
 1310|  41.4k|            src_temp4 = _mm_sad_epu8(src_temp4, m_zero);
 1311|       |
 1312|  41.4k|            src_temp2  =  _mm_unpacklo_epi8(src_temp2, m_zero);
 1313|  41.4k|            src_temp10 =  _mm_unpacklo_epi8(src_temp10, m_zero);
 1314|       |
 1315|  41.4k|            src_temp4 = _mm_add_epi16(src_temp3, src_temp4);
 1316|  41.4k|            src_temp4 = _mm_shuffle_epi8(src_temp4, sm);
 1317|  41.4k|            src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
 1318|       |
 1319|  41.4k|            acc_dc = _mm_cvtsi128_si32(src_temp4);
 1320|       |
 1321|  41.4k|            acc_dc += pu1_ref[three_nt];
 1322|  41.4k|            acc_dc -= pu1_ref[two_nt];
 1323|       |
 1324|       |            /* computing acc_dc value */
 1325|       |
 1326|  41.4k|            dc_val = (acc_dc + nt) >> (log2nt + 1);
 1327|       |
 1328|  41.4k|            three_dc_val = 3 * dc_val;
 1329|  41.4k|            src_temp1 = _mm_set1_epi16(three_dc_val + 2);
 1330|  41.4k|            two_dc_val = 2 * dc_val;
 1331|       |
 1332|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2 */
 1333|  41.4k|            src_temp2 = _mm_add_epi16(src_temp2, src_temp1);
 1334|  41.4k|            src_temp10 = _mm_add_epi16(src_temp10, src_temp1);
 1335|       |            /*(pu1_ref[two_nt + 1 + col] + three_dc_val + 2)>>2 */
 1336|  41.4k|            src_temp2 = _mm_srli_epi16(src_temp2, 2);
 1337|  41.4k|            src_temp10 = _mm_srli_epi16(src_temp10, 2);
 1338|       |
 1339|  41.4k|            src_temp2 = _mm_packus_epi16(src_temp2, src_temp10);
 1340|       |
 1341|  41.4k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp2);
 1342|       |
 1343|       |            /* Fill the remaining rows with DC value*/
 1344|  41.4k|            src_temp1 =  _mm_set1_epi8(dc_val);
 1345|  41.4k|            src_temp2 =  _mm_set1_epi8(dc_val);
 1346|  41.4k|            src_temp3 =  _mm_set1_epi8(dc_val);
 1347|  41.4k|            src_temp4 =  _mm_set1_epi8(dc_val);
 1348|  41.4k|            src_temp5 =  _mm_set1_epi8(dc_val);
 1349|  41.4k|            src_temp6 =  _mm_set1_epi8(dc_val);
 1350|  41.4k|            src_temp7 =  _mm_set1_epi8(dc_val);
 1351|       |
 1352|   124k|            for(row = 1; row < nt; row += 8)
  ------------------
  |  Branch (1352:26): [True: 82.9k, False: 41.4k]
  ------------------
 1353|  82.9k|            {
 1354|       |
 1355|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
 1356|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
 1357|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
 1358|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
 1359|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
 1360|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
 1361|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
 1362|       |
 1363|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), src_temp1);
 1364|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), src_temp2);
 1365|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), src_temp3);
 1366|       |
 1367|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), src_temp4);
 1368|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), src_temp5);
 1369|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), src_temp6);
 1370|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), src_temp7);
 1371|       |
 1372|  82.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), src_temp1);
 1373|       |
 1374|  82.9k|            }
 1375|       |
 1376|       |            /*  retore  first value*/
 1377|  41.4k|            pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
 1378|  41.4k|                            >> 2);
 1379|       |
 1380|   663k|            for(row = 1; row < nt; row++)
  ------------------
  |  Branch (1380:26): [True: 621k, False: 41.4k]
  ------------------
 1381|   621k|                pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
 1382|   621k|                                >> 2;
 1383|       |
 1384|  41.4k|        }
 1385|   203k|    }
 1386|   243k|}
ihevc_intra_pred_luma_horz_ssse3:
 1431|  45.8k|{
 1432|       |
 1433|  45.8k|    WORD32 row;
 1434|  45.8k|    WORD32 two_nt;
 1435|  45.8k|    UNUSED(src_strd);
  ------------------
  |  |   38|  45.8k|#define UNUSED(x) ((void)(x))
  ------------------
 1436|       |
 1437|  45.8k|    two_nt = 2 * nt;
 1438|       |
 1439|       |
 1440|  45.8k|    if(nt == 32)
  ------------------
  |  Branch (1440:8): [True: 23.0k, False: 22.8k]
  ------------------
 1441|  23.0k|    {
 1442|  23.0k|        __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
 1443|  23.0k|        __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 1444|  23.0k|        __m128i sm = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASK4[0]);
 1445|       |
 1446|  68.9k|        for(row = 0; row < nt; row += 16)
  ------------------
  |  Branch (1446:22): [True: 45.9k, False: 23.0k]
  ------------------
 1447|  45.9k|        {
 1448|  45.9k|            {
 1449|  45.9k|                src_temp1 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 1 - row - 15));
 1450|       |
 1451|  45.9k|                src_temp2 =  _mm_srli_si128(src_temp1, 1);
 1452|  45.9k|                src_temp3 =  _mm_srli_si128(src_temp1, 2);
 1453|  45.9k|                src_temp4 =  _mm_srli_si128(src_temp1, 3);
 1454|  45.9k|                src_temp5 =  _mm_srli_si128(src_temp1, 4);
 1455|  45.9k|                src_temp6 =  _mm_srli_si128(src_temp1, 5);
 1456|  45.9k|                src_temp7 =  _mm_srli_si128(src_temp1, 6);
 1457|  45.9k|                src_temp8 =  _mm_srli_si128(src_temp1, 7);
 1458|       |
 1459|  45.9k|                src_temp9 =  _mm_srli_si128(src_temp1, 8);
 1460|  45.9k|                src_temp10 =  _mm_srli_si128(src_temp1, 9);
 1461|  45.9k|                src_temp11 =  _mm_srli_si128(src_temp1, 10);
 1462|  45.9k|                src_temp12 =  _mm_srli_si128(src_temp1, 11);
 1463|  45.9k|                src_temp13 =  _mm_srli_si128(src_temp1, 12);
 1464|  45.9k|                src_temp14 =  _mm_srli_si128(src_temp1, 13);
 1465|  45.9k|                src_temp15 =  _mm_srli_si128(src_temp1, 14);
 1466|  45.9k|                src_temp16 =  _mm_srli_si128(src_temp1, 15);
 1467|       |
 1468|  45.9k|                src_temp8 =  _mm_shuffle_epi8(src_temp8, sm);
 1469|  45.9k|                src_temp7 =  _mm_shuffle_epi8(src_temp7, sm);
 1470|  45.9k|                src_temp6 =  _mm_shuffle_epi8(src_temp6, sm);
 1471|  45.9k|                src_temp5 =  _mm_shuffle_epi8(src_temp5, sm);
 1472|  45.9k|                src_temp4 =  _mm_shuffle_epi8(src_temp4, sm);
 1473|  45.9k|                src_temp3 =  _mm_shuffle_epi8(src_temp3, sm);
 1474|  45.9k|                src_temp2 =  _mm_shuffle_epi8(src_temp2, sm);
 1475|  45.9k|                src_temp1 =  _mm_shuffle_epi8(src_temp1, sm);
 1476|       |
 1477|  45.9k|                src_temp16 =  _mm_shuffle_epi8(src_temp16, sm);
 1478|  45.9k|                src_temp15 =  _mm_shuffle_epi8(src_temp15, sm);
 1479|  45.9k|                src_temp14 =  _mm_shuffle_epi8(src_temp14, sm);
 1480|  45.9k|                src_temp13 =  _mm_shuffle_epi8(src_temp13, sm);
 1481|  45.9k|                src_temp12 =  _mm_shuffle_epi8(src_temp12, sm);
 1482|  45.9k|                src_temp11 =  _mm_shuffle_epi8(src_temp11, sm);
 1483|  45.9k|                src_temp10 =  _mm_shuffle_epi8(src_temp10, sm);
 1484|  45.9k|                src_temp9 =  _mm_shuffle_epi8(src_temp9, sm);
 1485|       |
 1486|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), src_temp16);
 1487|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp15);
 1488|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp14);
 1489|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp13);
 1490|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp12);
 1491|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp11);
 1492|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp10);
 1493|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 7) * dst_strd)), src_temp9);
 1494|       |
 1495|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 8) * dst_strd)), src_temp8);
 1496|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 9) * dst_strd)), src_temp7);
 1497|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 10) * dst_strd)), src_temp6);
 1498|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 11) * dst_strd)), src_temp5);
 1499|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 12) * dst_strd)), src_temp4);
 1500|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 13) * dst_strd)), src_temp3);
 1501|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 14) * dst_strd)), src_temp2);
 1502|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 15) * dst_strd)), src_temp1);
 1503|       |
 1504|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 0) * dst_strd)), src_temp16);
 1505|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 1) * dst_strd)), src_temp15);
 1506|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 2) * dst_strd)), src_temp14);
 1507|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 3) * dst_strd)), src_temp13);
 1508|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 4) * dst_strd)), src_temp12);
 1509|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 5) * dst_strd)), src_temp11);
 1510|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 6) * dst_strd)), src_temp10);
 1511|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 7) * dst_strd)), src_temp9);
 1512|       |
 1513|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 8) * dst_strd)), src_temp8);
 1514|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 9) * dst_strd)), src_temp7);
 1515|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 10) * dst_strd)), src_temp6);
 1516|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 11) * dst_strd)), src_temp5);
 1517|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 12) * dst_strd)), src_temp4);
 1518|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 13) * dst_strd)), src_temp3);
 1519|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 14) * dst_strd)), src_temp2);
 1520|  45.9k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((row + 15) * dst_strd)), src_temp1);
 1521|       |
 1522|  45.9k|            }
 1523|       |
 1524|  45.9k|        }
 1525|       |
 1526|  23.0k|    }
 1527|  22.8k|    else
 1528|       |
 1529|  22.8k|    {
 1530|  22.8k|        __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6;
 1531|  22.8k|        __m128i src_temp10, zero_8x16b, src_temp7;
 1532|       |
 1533|       |        /* DC filtering for the first top row and first left column */
 1534|  22.8k|        if (!disable_boundary_filter)
  ------------------
  |  Branch (1534:13): [True: 19.0k, False: 3.81k]
  ------------------
 1535|  19.0k|        {
 1536|  19.0k|            zero_8x16b = _mm_set1_epi16(0);
 1537|       |
 1538|       |            /*Filtering done for the 1st row */
 1539|       |
 1540|  19.0k|            src_temp2 =  _mm_set1_epi16(pu1_ref[two_nt - 1]);
 1541|  19.0k|            src_temp10 =  _mm_set1_epi16(pu1_ref[two_nt]);
 1542|       |
 1543|       |            /*  loding 8-bit 16 pixels */
 1544|  19.0k|            src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1545|       |
 1546|  19.0k|            src_temp4 =  _mm_unpacklo_epi8(src_temp4, zero_8x16b);
 1547|       |
 1548|       |            /*(pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt])*/
 1549|  19.0k|            src_temp3 = _mm_sub_epi16(src_temp4, src_temp10);
 1550|       |
 1551|       |            /* ((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1)*/
 1552|  19.0k|            src_temp3 = _mm_srai_epi16(src_temp3, 1);
 1553|       |
 1554|       |            /* pu1_ref[two_nt - 1]+((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1)*/
 1555|  19.0k|            src_temp3 = _mm_add_epi16(src_temp2, src_temp3);
 1556|  19.0k|        }
 1557|       |
 1558|  22.8k|        if(nt == 4)
  ------------------
  |  Branch (1558:12): [True: 8.60k, False: 14.2k]
  ------------------
 1559|  8.60k|        {
 1560|  8.60k|            int temp1, temp2, temp3;
 1561|  8.60k|            if (disable_boundary_filter)
  ------------------
  |  Branch (1561:17): [True: 3.56k, False: 5.03k]
  ------------------
 1562|  3.56k|            {
 1563|  3.56k|                src_temp3 = _mm_set1_epi8(pu1_ref[two_nt - 1]);
 1564|  3.56k|                temp1 = _mm_cvtsi128_si32(src_temp3);
 1565|  3.56k|            }
 1566|  5.03k|            else
 1567|  5.03k|            {
 1568|  5.03k|                src_temp3 = _mm_packus_epi16(src_temp3, zero_8x16b);
 1569|  5.03k|                temp1 = _mm_cvtsi128_si32(src_temp3);
 1570|  5.03k|            }
 1571|       |
 1572|  8.60k|            *(WORD32 *)(&pu1_dst[0]) = temp1;
 1573|       |
 1574|  8.60k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 2]);
 1575|  8.60k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 3]);
 1576|  8.60k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 4]);
 1577|       |
 1578|  8.60k|            temp1 = _mm_cvtsi128_si32(src_temp2);
 1579|  8.60k|            temp2 = _mm_cvtsi128_si32(src_temp3);
 1580|  8.60k|            temp3 = _mm_cvtsi128_si32(src_temp4);
 1581|       |
 1582|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1583|  8.60k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp1;
 1584|  8.60k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp2;
 1585|  8.60k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp3;
 1586|       |
 1587|  8.60k|        }
 1588|  14.2k|        else if(nt == 8)
  ------------------
  |  Branch (1588:17): [True: 7.95k, False: 6.33k]
  ------------------
 1589|  7.95k|        {
 1590|  7.95k|            if (disable_boundary_filter)
  ------------------
  |  Branch (1590:17): [True: 208, False: 7.75k]
  ------------------
 1591|    208|            {
 1592|    208|                src_temp10 = _mm_set1_epi8(pu1_ref[two_nt - 1]);
 1593|    208|            }
 1594|  7.75k|            else
 1595|  7.75k|            {
 1596|  7.75k|                src_temp10 = _mm_packus_epi16(src_temp3, zero_8x16b);
 1597|  7.75k|            }
 1598|       |
 1599|       |
 1600|  7.95k|            src_temp1 =  _mm_set1_epi8(pu1_ref[two_nt - 2]);
 1601|  7.95k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 3]);
 1602|  7.95k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 4]);
 1603|  7.95k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 5]);
 1604|  7.95k|            src_temp5 =  _mm_set1_epi8(pu1_ref[two_nt - 6]);
 1605|  7.95k|            src_temp6 =  _mm_set1_epi8(pu1_ref[two_nt - 7]);
 1606|  7.95k|            src_temp7 =  _mm_set1_epi8(pu1_ref[two_nt - 8]);
 1607|       |
 1608|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_temp10);
 1609|       |
 1610|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1611|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
 1612|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp2);
 1613|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp3);
 1614|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp4);
 1615|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp5);
 1616|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp6);
 1617|  7.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp7);
 1618|       |
 1619|  7.95k|        }
 1620|  6.33k|        else if(nt == 16)
  ------------------
  |  Branch (1620:17): [True: 6.36k, False: 18.4E]
  ------------------
 1621|  6.36k|        {
 1622|  6.36k|            if(disable_boundary_filter)
  ------------------
  |  Branch (1622:16): [True: 73, False: 6.29k]
  ------------------
 1623|     73|            {
 1624|     73|                src_temp3 = _mm_set1_epi8(pu1_ref[two_nt - 1]);
 1625|     73|            }
 1626|  6.29k|            else
 1627|  6.29k|            {
 1628|  6.29k|                src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 8));
 1629|  6.29k|                src_temp4 =  _mm_unpacklo_epi8(src_temp4, zero_8x16b);
 1630|       |                //src_temp4 =  _mm_cvtepu8_epi16 (src_temp4);
 1631|       |
 1632|  6.29k|                src_temp10 = _mm_sub_epi16(src_temp4, src_temp10);
 1633|  6.29k|                src_temp10 = _mm_srai_epi16(src_temp10, 1);
 1634|  6.29k|                src_temp10 = _mm_add_epi16(src_temp2, src_temp10);
 1635|       |
 1636|  6.29k|                src_temp3 = _mm_packus_epi16(src_temp3, src_temp10);
 1637|  6.29k|            }
 1638|       |
 1639|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst), src_temp3);
 1640|       |
 1641|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1642|  6.36k|            src_temp1 =  _mm_set1_epi8(pu1_ref[two_nt - 2]);
 1643|  6.36k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 3]);
 1644|  6.36k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 4]);
 1645|  6.36k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 5]);
 1646|  6.36k|            src_temp5 =  _mm_set1_epi8(pu1_ref[two_nt - 6]);
 1647|  6.36k|            src_temp6 =  _mm_set1_epi8(pu1_ref[two_nt - 7]);
 1648|  6.36k|            src_temp7 =  _mm_set1_epi8(pu1_ref[two_nt - 8]);
 1649|  6.36k|            src_temp10 =  _mm_set1_epi8(pu1_ref[two_nt - 9]);
 1650|       |
 1651|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
 1652|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp2);
 1653|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp3);
 1654|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp4);
 1655|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp5);
 1656|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp6);
 1657|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp7);
 1658|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), src_temp10);
 1659|       |
 1660|  6.36k|            src_temp1 =  _mm_set1_epi8(pu1_ref[two_nt - 10]);
 1661|  6.36k|            src_temp2 =  _mm_set1_epi8(pu1_ref[two_nt - 11]);
 1662|  6.36k|            src_temp3 =  _mm_set1_epi8(pu1_ref[two_nt - 12]);
 1663|  6.36k|            src_temp4 =  _mm_set1_epi8(pu1_ref[two_nt - 13]);
 1664|  6.36k|            src_temp5 =  _mm_set1_epi8(pu1_ref[two_nt - 14]);
 1665|  6.36k|            src_temp6 =  _mm_set1_epi8(pu1_ref[two_nt - 15]);
 1666|  6.36k|            src_temp7 =  _mm_set1_epi8(pu1_ref[two_nt - 16]);
 1667|       |
 1668|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), src_temp1);
 1669|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), src_temp2);
 1670|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), src_temp3);
 1671|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), src_temp4);
 1672|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), src_temp5);
 1673|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), src_temp6);
 1674|  6.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), src_temp7);
 1675|       |
 1676|  6.36k|        }
 1677|  22.8k|    }
 1678|  45.8k|}
ihevc_intra_pred_luma_ver_ssse3:
 1725|   151k|{
 1726|   151k|    WORD32 row;
 1727|   151k|    WORD16 s2_predpixel;
 1728|   151k|    WORD32 two_nt = 2 * nt;
 1729|   151k|    __m128i src_temp0, src_temp2;
 1730|   151k|    UNUSED(src_strd);
  ------------------
  |  |   38|   151k|#define UNUSED(x) ((void)(x))
  ------------------
 1731|       |
 1732|       |
 1733|   151k|    if(nt == 32)
  ------------------
  |  Branch (1733:8): [True: 57.8k, False: 93.2k]
  ------------------
 1734|  57.8k|    {
 1735|  57.8k|        __m128i temp1, temp2;
 1736|  57.8k|        WORD32 itr_count;
 1737|       |
 1738|  57.8k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1739|  57.8k|        temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1 + 16));
 1740|       |
 1741|   173k|        for(itr_count = 0; itr_count < 2; itr_count++)
  ------------------
  |  Branch (1741:28): [True: 115k, False: 57.8k]
  ------------------
 1742|   115k|        {
 1743|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
 1744|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp1);
 1745|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp1);
 1746|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp1);
 1747|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp1);
 1748|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp1);
 1749|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp1);
 1750|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp1);
 1751|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp1);
 1752|       |
 1753|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp2);
 1754|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp2);
 1755|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp2);
 1756|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp2);
 1757|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp2);
 1758|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp2);
 1759|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp2);
 1760|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp2);
 1761|       |
 1762|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp1);
 1763|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp1);
 1764|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp1);
 1765|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp1);
 1766|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp1);
 1767|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp1);
 1768|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp1);
 1769|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp1);
 1770|       |
 1771|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp2);
 1772|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp2);
 1773|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp2);
 1774|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp2);
 1775|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp2);
 1776|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp2);
 1777|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp2);
 1778|   115k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp2);
 1779|       |
 1780|   115k|            pu1_dst += 16 * dst_strd;
 1781|   115k|        }
 1782|  57.8k|    }
 1783|  93.2k|    else
 1784|  93.2k|    {
 1785|       |        /* Replication to next columns*/
 1786|       |
 1787|  93.2k|        if(nt == 4)
  ------------------
  |  Branch (1787:12): [True: 32.8k, False: 60.4k]
  ------------------
 1788|  32.8k|        {
 1789|  32.8k|            int temp1;
 1790|       |
 1791|  32.8k|            src_temp2 =   _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1792|       |
 1793|  32.8k|            temp1 = _mm_cvtsi128_si32(src_temp2);
 1794|       |
 1795|       |            /* loding 4-bit 8 pixels values */
 1796|  32.8k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp1;
 1797|  32.8k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp1;
 1798|  32.8k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp1;
 1799|  32.8k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp1;
 1800|       |
 1801|  32.8k|        }
 1802|  60.4k|        else if(nt == 8)
  ------------------
  |  Branch (1802:17): [True: 17.6k, False: 42.7k]
  ------------------
 1803|  17.6k|        {
 1804|       |
 1805|  17.6k|            src_temp0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1806|       |
 1807|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((0) * dst_strd)), src_temp0);
 1808|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp0);
 1809|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp0);
 1810|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp0);
 1811|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp0);
 1812|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp0);
 1813|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp0);
 1814|  17.6k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp0);
 1815|       |
 1816|       |
 1817|  17.6k|        }
 1818|  42.7k|        else if(nt == 16)
  ------------------
  |  Branch (1818:17): [True: 42.7k, False: 18.4E]
  ------------------
 1819|  42.7k|        {
 1820|   128k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1820:26): [True: 85.5k, False: 42.7k]
  ------------------
 1821|  85.5k|            {
 1822|       |
 1823|  85.5k|                src_temp0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1));
 1824|       |
 1825|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), src_temp0);
 1826|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp0);
 1827|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp0);
 1828|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp0);
 1829|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp0);
 1830|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp0);
 1831|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp0);
 1832|  85.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 7) * dst_strd)), src_temp0);
 1833|       |
 1834|  85.5k|            }
 1835|       |
 1836|  42.7k|        }
 1837|       |
 1838|       |        /*Filtering done for the 1st column */
 1839|  93.2k|        if (!disable_boundary_filter)
  ------------------
  |  Branch (1839:13): [True: 92.4k, False: 853]
  ------------------
 1840|  92.4k|        {
 1841|  1.04M|            for(row = nt - 1; row >= 0; row--)
  ------------------
  |  Branch (1841:31): [True: 950k, False: 92.4k]
  ------------------
 1842|   950k|            {
 1843|   950k|                s2_predpixel = pu1_ref[two_nt + 1]
 1844|   950k|                                + ((pu1_ref[two_nt - 1 - row] - pu1_ref[two_nt]) >> 1);
 1845|   950k|                pu1_dst[row * dst_strd] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|   950k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   950k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 32.5k, False: 918k]
  |  |  |  |  |  Branch (40:53): [True: 5.69k, False: 912k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1846|   950k|            }
 1847|  92.4k|        }
 1848|       |
 1849|       |
 1850|  93.2k|    }
 1851|   151k|}
ihevc_intra_pred_luma_mode2_ssse3:
 1896|   286k|{
 1897|   286k|    WORD32 row, col;
 1898|   286k|    WORD32 two_nt = 2 * nt;
 1899|       |
 1900|   286k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
 1901|   286k|    __m128i   sm1, sm2, sm3;
 1902|   286k|    UNUSED(src_strd);
  ------------------
  |  |   38|   286k|#define UNUSED(x) ((void)(x))
  ------------------
 1903|   286k|    UNUSED(mode);
  ------------------
  |  |   38|   286k|#define UNUSED(x) ((void)(x))
  ------------------
 1904|       |
 1905|       |
 1906|   286k|    sm1 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY1[0]);
 1907|   286k|    sm2 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY2[0]);
 1908|   286k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY3[0]);
 1909|       |
 1910|       |    /* For the angle 45, replication is done from the corresponding angle */
 1911|       |    /* intra_pred_ang = tan(angle) in q5 format */
 1912|       |
 1913|   286k|    if(nt == 4)
  ------------------
  |  Branch (1913:8): [True: 172k, False: 113k]
  ------------------
 1914|   172k|    {
 1915|   172k|        int temp1, temp2, temp3, temp4;
 1916|       |
 1917|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1918|   172k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 8));
 1919|   172k|        src_temp2 = _mm_srli_si128(src_temp1, 1);
 1920|   172k|        src_temp3 = _mm_srli_si128(src_temp1, 2);
 1921|   172k|        src_temp4 = _mm_srli_si128(src_temp1, 3);
 1922|       |
 1923|   172k|        src_temp4 = _mm_shuffle_epi8(src_temp4, sm1);
 1924|   172k|        src_temp3 = _mm_shuffle_epi8(src_temp3, sm1);
 1925|   172k|        src_temp2 = _mm_shuffle_epi8(src_temp2, sm1);
 1926|   172k|        src_temp1 = _mm_shuffle_epi8(src_temp1, sm1);
 1927|       |
 1928|   172k|        temp1 = _mm_cvtsi128_si32(src_temp4);
 1929|   172k|        temp2 = _mm_cvtsi128_si32(src_temp3);
 1930|   172k|        temp3 = _mm_cvtsi128_si32(src_temp2);
 1931|   172k|        temp4 = _mm_cvtsi128_si32(src_temp1);
 1932|       |
 1933|       |        /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 1934|   172k|        *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp1;
 1935|   172k|        *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp2;
 1936|   172k|        *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp3;
 1937|   172k|        *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp4;
 1938|       |
 1939|       |
 1940|   172k|    }
 1941|   113k|    else if(nt == 8)
  ------------------
  |  Branch (1941:13): [True: 20.7k, False: 93.1k]
  ------------------
 1942|  20.7k|    {
 1943|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1944|  20.7k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 16));
 1945|  20.7k|        src_temp2 = _mm_srli_si128(src_temp1, 1);
 1946|  20.7k|        src_temp3 = _mm_srli_si128(src_temp1, 2);
 1947|  20.7k|        src_temp4 = _mm_srli_si128(src_temp1, 3);
 1948|  20.7k|        src_temp5 = _mm_srli_si128(src_temp1, 4);
 1949|  20.7k|        src_temp6 = _mm_srli_si128(src_temp1, 5);
 1950|  20.7k|        src_temp7 = _mm_srli_si128(src_temp1, 6);
 1951|  20.7k|        src_temp8 = _mm_srli_si128(src_temp1, 7);
 1952|       |
 1953|  20.7k|        src_temp1 = _mm_shuffle_epi8(src_temp1, sm2);
 1954|  20.7k|        src_temp2 = _mm_shuffle_epi8(src_temp2, sm2);
 1955|  20.7k|        src_temp3 = _mm_shuffle_epi8(src_temp3, sm2);
 1956|  20.7k|        src_temp4 = _mm_shuffle_epi8(src_temp4, sm2);
 1957|  20.7k|        src_temp5 = _mm_shuffle_epi8(src_temp5, sm2);
 1958|  20.7k|        src_temp6 = _mm_shuffle_epi8(src_temp6, sm2);
 1959|  20.7k|        src_temp7 = _mm_shuffle_epi8(src_temp7, sm2);
 1960|  20.7k|        src_temp8 = _mm_shuffle_epi8(src_temp8, sm2);
 1961|       |
 1962|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp8);
 1963|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp7);
 1964|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp6);
 1965|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp5);
 1966|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp4);
 1967|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp3);
 1968|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp2);
 1969|  20.7k|        _mm_storel_epi64((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
 1970|       |
 1971|  20.7k|    }
 1972|  93.1k|    else
 1973|  93.1k|    {
 1974|   431k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1974:22): [True: 338k, False: 93.1k]
  ------------------
 1975|   338k|        {
 1976|   981k|            for(col = 0; col < nt; col += 16)
  ------------------
  |  Branch (1976:26): [True: 643k, False: 338k]
  ------------------
 1977|   643k|            {   /*pu1_ref[two_nt - row - (col+1) - 1]*/
 1978|       |
 1979|   643k|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 0) - (col + 16) - 1));
 1980|   643k|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 1) - (col + 16) - 1));
 1981|   643k|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 2) - (col + 16) - 1));
 1982|   643k|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 3) - (col + 16) - 1));
 1983|   643k|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 4) - (col + 16) - 1));
 1984|   643k|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 5) - (col + 16) - 1));
 1985|   643k|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 6) - (col + 16) - 1));
 1986|   643k|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 7) - (col + 16) - 1));
 1987|       |
 1988|   643k|                src_temp1 = _mm_shuffle_epi8(src_temp1, sm3);
 1989|   643k|                src_temp2 = _mm_shuffle_epi8(src_temp2, sm3);
 1990|   643k|                src_temp3 = _mm_shuffle_epi8(src_temp3, sm3);
 1991|   643k|                src_temp4 = _mm_shuffle_epi8(src_temp4, sm3);
 1992|   643k|                src_temp5 = _mm_shuffle_epi8(src_temp5, sm3);
 1993|   643k|                src_temp6 = _mm_shuffle_epi8(src_temp6, sm3);
 1994|   643k|                src_temp7 = _mm_shuffle_epi8(src_temp7, sm3);
 1995|   643k|                src_temp8 = _mm_shuffle_epi8(src_temp8, sm3);
 1996|       |
 1997|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 0) * dst_strd)), src_temp1);
 1998|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 1) * dst_strd)), src_temp2);
 1999|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 2) * dst_strd)), src_temp3);
 2000|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 3) * dst_strd)), src_temp4);
 2001|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 4) * dst_strd)), src_temp5);
 2002|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 5) * dst_strd)), src_temp6);
 2003|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 6) * dst_strd)), src_temp7);
 2004|   643k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 7) * dst_strd)), src_temp8);
 2005|   643k|            }
 2006|   338k|        }
 2007|  93.1k|    }
 2008|       |
 2009|   286k|}
ihevc_intra_pred_luma_mode_18_34_ssse3:
 2054|   110k|{
 2055|   110k|    WORD32 row;
 2056|   110k|    WORD32 two_nt = 2 * nt;
 2057|   110k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
 2058|   110k|    UNUSED(src_strd);
  ------------------
  |  |   38|   110k|#define UNUSED(x) ((void)(x))
  ------------------
 2059|   110k|    if(mode == 34)
  ------------------
  |  Branch (2059:8): [True: 72.2k, False: 38.6k]
  ------------------
 2060|  72.2k|    {
 2061|  72.2k|        if(nt == 4)
  ------------------
  |  Branch (2061:12): [True: 41.6k, False: 30.5k]
  ------------------
 2062|  41.6k|        {
 2063|       |
 2064|  41.6k|            int temp1, temp2, temp3, temp4;
 2065|       |
 2066|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 2067|  41.6k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 2));
 2068|  41.6k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 3));
 2069|  41.6k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 4));
 2070|  41.6k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 5));
 2071|       |
 2072|  41.6k|            temp1 = _mm_cvtsi128_si32(src_temp1);
 2073|  41.6k|            temp2 = _mm_cvtsi128_si32(src_temp2);
 2074|  41.6k|            temp3 = _mm_cvtsi128_si32(src_temp3);
 2075|  41.6k|            temp4 = _mm_cvtsi128_si32(src_temp4);
 2076|       |
 2077|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 2078|  41.6k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp1;
 2079|  41.6k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp2;
 2080|  41.6k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp3;
 2081|  41.6k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp4;
 2082|       |
 2083|  41.6k|        }
 2084|  30.5k|        else if(nt == 8)
  ------------------
  |  Branch (2084:17): [True: 8.45k, False: 22.1k]
  ------------------
 2085|  8.45k|        {
 2086|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 2087|  8.45k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 2));
 2088|  8.45k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 3));
 2089|  8.45k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 4));
 2090|  8.45k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 5));
 2091|  8.45k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 6));
 2092|  8.45k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 7));
 2093|  8.45k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 8));
 2094|  8.45k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 9));
 2095|       |
 2096|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 2097|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 2098|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 2099|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 2100|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
 2101|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
 2102|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
 2103|  8.45k|            _mm_storel_epi64((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
 2104|       |
 2105|  8.45k|        }
 2106|  22.1k|        else if(nt == 16)
  ------------------
  |  Branch (2106:17): [True: 4.75k, False: 17.3k]
  ------------------
 2107|  4.75k|        {
 2108|  14.2k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2108:26): [True: 9.51k, False: 4.75k]
  ------------------
 2109|  9.51k|            {
 2110|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 2111|  9.51k|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 0) + 2));
 2112|  9.51k|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 1) + 2));
 2113|  9.51k|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 2) + 2));
 2114|  9.51k|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 3) + 2));
 2115|  9.51k|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 4) + 2));
 2116|  9.51k|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 5) + 2));
 2117|  9.51k|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 6) + 2));
 2118|  9.51k|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (row + 7) + 2));
 2119|       |
 2120|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), src_temp1);
 2121|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp2);
 2122|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp3);
 2123|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp4);
 2124|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp5);
 2125|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp6);
 2126|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp7);
 2127|  9.51k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 7) * dst_strd)), src_temp8);
 2128|       |
 2129|       |
 2130|  9.51k|            }
 2131|  4.75k|        }
 2132|  17.3k|        else
 2133|  17.3k|        {
 2134|  17.3k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 2135|  86.7k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2135:26): [True: 69.3k, False: 17.3k]
  ------------------
 2136|  69.3k|            {
 2137|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 2138|  69.3k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (0 + 0) + 2));
 2139|  69.3k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (0 + 16) + 2));
 2140|  69.3k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (1 + 0) + 2));
 2141|  69.3k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (1 + 16) + 2));
 2142|  69.3k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (2 + 0) + 2));
 2143|  69.3k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (2 + 16) + 2));
 2144|  69.3k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (3 + 0) + 2));
 2145|  69.3k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (3 + 16) + 2));
 2146|       |
 2147|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 2148|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 2149|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 2150|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 2151|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 2152|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 2153|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 2154|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 2155|       |
 2156|  69.3k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (4 + 0) + 2));
 2157|  69.3k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (4 + 16) + 2));
 2158|  69.3k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (5 + 0) + 2));
 2159|  69.3k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (5 + 16) + 2));
 2160|  69.3k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (6 + 0) + 2));
 2161|  69.3k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (6 + 16) + 2));
 2162|  69.3k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (7 + 0) + 2));
 2163|  69.3k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + (7 + 16) + 2));
 2164|       |
 2165|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 2166|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 2167|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 2168|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 2169|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 2170|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 2171|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 2172|  69.3k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 2173|       |
 2174|  69.3k|                pu1_ref += 8;
 2175|  69.3k|                pu1_dst += 8 * dst_strd;
 2176|  69.3k|            }
 2177|  17.3k|        }
 2178|  72.2k|    }
 2179|  38.6k|    else
 2180|  38.6k|    {
 2181|  38.6k|        if(nt == 4)
  ------------------
  |  Branch (2181:12): [True: 9.12k, False: 29.5k]
  ------------------
 2182|  9.12k|        {
 2183|  9.12k|            int temp1, temp2, temp3, temp4;
 2184|       |
 2185|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 2186|  9.12k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 3));
 2187|  9.12k|            src_temp2 = _mm_srli_si128(src_temp1, 1);
 2188|  9.12k|            src_temp3 = _mm_srli_si128(src_temp1, 2);
 2189|  9.12k|            src_temp4 = _mm_srli_si128(src_temp1, 3);
 2190|       |
 2191|  9.12k|            temp1 = _mm_cvtsi128_si32(src_temp4);
 2192|  9.12k|            temp2 = _mm_cvtsi128_si32(src_temp3);
 2193|  9.12k|            temp3 = _mm_cvtsi128_si32(src_temp2);
 2194|  9.12k|            temp4 = _mm_cvtsi128_si32(src_temp1);
 2195|       |
 2196|       |            /*pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];*/
 2197|  9.12k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp1;
 2198|  9.12k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp2;
 2199|  9.12k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp3;
 2200|  9.12k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp4;
 2201|       |
 2202|  9.12k|        }
 2203|  29.5k|        else if(nt == 8)
  ------------------
  |  Branch (2203:17): [True: 6.48k, False: 23.0k]
  ------------------
 2204|  6.48k|        {
 2205|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 2206|  6.48k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 7));
 2207|  6.48k|            src_temp2 = _mm_srli_si128(src_temp1, 1);
 2208|  6.48k|            src_temp3 = _mm_srli_si128(src_temp1, 2);
 2209|  6.48k|            src_temp4 = _mm_srli_si128(src_temp1, 3);
 2210|  6.48k|            src_temp5 = _mm_srli_si128(src_temp1, 4);
 2211|  6.48k|            src_temp6 = _mm_srli_si128(src_temp1, 5);
 2212|  6.48k|            src_temp7 = _mm_srli_si128(src_temp1, 6);
 2213|  6.48k|            src_temp8 = _mm_srli_si128(src_temp1, 7);
 2214|       |
 2215|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp8);
 2216|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp7);
 2217|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp6);
 2218|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp5);
 2219|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp4);
 2220|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp3);
 2221|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp2);
 2222|  6.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
 2223|       |
 2224|       |
 2225|  6.48k|        }
 2226|  23.0k|        else if(nt == 16)
  ------------------
  |  Branch (2226:17): [True: 5.43k, False: 17.5k]
  ------------------
 2227|  5.43k|        {
 2228|  16.2k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2228:26): [True: 10.8k, False: 5.43k]
  ------------------
 2229|  10.8k|            {
 2230|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 2231|  10.8k|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 0)));
 2232|  10.8k|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 1)));
 2233|  10.8k|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 2)));
 2234|  10.8k|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 3)));
 2235|  10.8k|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 4)));
 2236|  10.8k|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 5)));
 2237|  10.8k|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 6)));
 2238|  10.8k|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - (row + 7)));
 2239|       |
 2240|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), src_temp1);
 2241|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), src_temp2);
 2242|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), src_temp3);
 2243|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), src_temp4);
 2244|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 4) * dst_strd)), src_temp5);
 2245|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 5) * dst_strd)), src_temp6);
 2246|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 6) * dst_strd)), src_temp7);
 2247|  10.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 7) * dst_strd)), src_temp8);
 2248|       |
 2249|  10.8k|            }
 2250|       |
 2251|  5.43k|        }
 2252|  17.5k|        else
 2253|  17.5k|        {
 2254|  17.5k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 2255|  87.8k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2255:26): [True: 70.2k, False: 17.5k]
  ------------------
 2256|  70.2k|            {
 2257|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 2258|  70.2k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 0 + 0));
 2259|  70.2k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 0 + 16));
 2260|  70.2k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 1 + 0));
 2261|  70.2k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 1 + 16));
 2262|  70.2k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 2 + 0));
 2263|  70.2k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 2 + 16));
 2264|  70.2k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 3 + 0));
 2265|  70.2k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 3 + 16));
 2266|       |
 2267|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 2268|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 2269|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 2270|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 2271|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 2272|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 2273|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 2274|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 2275|       |
 2276|  70.2k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 4 + 0));
 2277|  70.2k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 4 + 16));
 2278|  70.2k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 5 + 0));
 2279|  70.2k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 5 + 16));
 2280|  70.2k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 6 + 0));
 2281|  70.2k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 6 + 16));
 2282|  70.2k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 7 + 0));
 2283|  70.2k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 7 + 16));
 2284|       |
 2285|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 2286|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 2287|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 2288|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 2289|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 2290|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 2291|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 2292|  70.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 2293|       |
 2294|  70.2k|                pu1_ref -= 8;
 2295|  70.2k|                pu1_dst += 8 * dst_strd;
 2296|  70.2k|            }
 2297|  17.5k|        }
 2298|  38.6k|    }
 2299|   110k|}
ihevc_intra_pred_luma_mode_3_to_9_ssse3:
 2345|   288k|{
 2346|   288k|    WORD32 row, col;
 2347|   288k|    WORD32 two_nt = 2 * nt;
 2348|   288k|    WORD32 intra_pred_ang;
 2349|       |
 2350|       |
 2351|   288k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b, zero_8x16b;
 2352|   288k|    __m128i fract_4x32b, intra_pred_ang_4x32b;
 2353|   288k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm3;
 2354|   288k|    UNUSED(src_strd);
  ------------------
  |  |   38|   288k|#define UNUSED(x) ((void)(x))
  ------------------
 2355|       |
 2356|       |    /* Intra Pred Angle according to the mode */
 2357|   288k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 2358|       |
 2359|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 2360|       |    /* samples dependent on distance to obtain destination sample */
 2361|       |
 2362|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 2363|       |    /* samples dependent on distance to obtain destination sample */
 2364|       |
 2365|   288k|    const_temp_4x32b  = _mm_set1_epi16(16);
 2366|   288k|    const_temp2_4x32b = _mm_set1_epi32(31);
 2367|   288k|    const_temp3_4x32b = _mm_set1_epi32(32);
 2368|   288k|    const_temp4_4x32b = _mm_set1_epi32(4);
 2369|       |
 2370|   288k|    two_nt_4x32b = _mm_set1_epi32(two_nt - nt);
 2371|       |
 2372|       |
 2373|   288k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 2374|       |
 2375|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2376|   288k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 2377|       |
 2378|   288k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 2379|       |
 2380|   288k|    if(nt == 4)
  ------------------
  |  Branch (2380:8): [True: 74.6k, False: 213k]
  ------------------
 2381|  74.6k|    {
 2382|       |
 2383|  74.6k|        WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2384|  74.6k|        int temp11, temp21, temp31, temp41;
 2385|       |        // WORD8  ai1_fract_temp_val[16], ai1_row_temp_val[16];
 2386|       |
 2387|  74.6k|        __m128i fract1_8x16b, fract2_8x16b, sign_8x16b;
 2388|  74.6k|        __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2389|       |
 2390|  74.6k|        __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2391|  74.6k|        __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b; //, src_temp8_8x16b;
 2392|  74.6k|        __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 2393|       |
 2394|  74.6k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2395|  74.6k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2396|       |
 2397|       |        /* pos = ((row + 1) * intra_pred_ang); */
 2398|  74.6k|        res_temp5_4x32b = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2399|  74.6k|        zero_8x16b      = _mm_setzero_si128();
 2400|  74.6k|        sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2401|  74.6k|        res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2402|       |
 2403|       |        /* idx = pos >> 5; */
 2404|  74.6k|        fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2405|       |
 2406|       |        /* fract = pos & (31); */
 2407|  74.6k|        ref_main_idx_4x32b = _mm_sub_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2408|       |
 2409|       |        /*(32 - fract) */
 2410|  74.6k|        row_4x32b = _mm_sub_epi32(const_temp3_4x32b, fract_4x32b);
 2411|       |
 2412|  74.6k|        fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2413|  74.6k|        fract2_8x16b = _mm_slli_epi16(row_4x32b, 8);
 2414|       |
 2415|  74.6k|        fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2416|  74.6k|        row_4x32b = _mm_or_si128(row_4x32b, fract2_8x16b); /*(32 - fract) */
 2417|       |
 2418|  74.6k|        fract2_8x16b = _mm_unpackhi_epi8(row_4x32b, fract_4x32b);
 2419|  74.6k|        fract1_8x16b = _mm_unpacklo_epi8(row_4x32b, fract_4x32b);
 2420|       |
 2421|  74.6k|        temp1_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 2422|  74.6k|        temp2_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 2423|  74.6k|        temp3_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 2424|  74.6k|        temp4_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 2425|       |
 2426|  74.6k|        ref_main_temp0 = _mm_srli_si128(ref_main_idx_4x32b, 4);  /* next 32 bit values */
 2427|  74.6k|        ref_main_temp1 = _mm_srli_si128(ref_main_idx_4x32b, 8);  /* next 32 bit values */
 2428|  74.6k|        ref_main_temp2 = _mm_srli_si128(ref_main_idx_4x32b, 12); /* next 32 bit values */
 2429|  74.6k|        ref_main_idx1  = _mm_cvtsi128_si32(ref_main_idx_4x32b);    /* col=0*/
 2430|  74.6k|        ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* col=1*/
 2431|  74.6k|        ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* col=2*/
 2432|  74.6k|        ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* col=3*/
 2433|       |
 2434|       |        /* loding 8-bit 16 pixels */
 2435|  74.6k|        src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1 - 1)); /* col=0*/
 2436|  74.6k|        src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2 - 1)); /* col=1*/
 2437|  74.6k|        src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3 - 1)); /* col=2*/
 2438|  74.6k|        src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4 - 1)); /* col=3*/
 2439|       |
 2440|  74.6k|        src_temp1_8x16b =  _mm_shuffle_epi8(src_temp1_8x16b, sm3); /* col=0*/
 2441|  74.6k|        src_temp2_8x16b =  _mm_shuffle_epi8(src_temp2_8x16b, sm3); /* col=1*/
 2442|  74.6k|        src_temp3_8x16b =  _mm_shuffle_epi8(src_temp3_8x16b, sm3); /* col=2*/
 2443|  74.6k|        src_temp4_8x16b =  _mm_shuffle_epi8(src_temp4_8x16b, sm3); /* col=3*/
 2444|       |
 2445|       |        /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2446|  74.6k|        src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2447|  74.6k|        src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2448|  74.6k|        src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2449|  74.6k|        src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2450|       |
 2451|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2452|  74.6k|        src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2453|  74.6k|        src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2454|  74.6k|        src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2455|  74.6k|        src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2456|       |
 2457|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2458|  74.6k|        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2459|  74.6k|        src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2460|  74.6k|        src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2461|  74.6k|        src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2462|       |
 2463|       |        /* converting 16 bit to 8 bit */
 2464|  74.6k|        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2465|  74.6k|        src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2466|       |
 2467|       |
 2468|  74.6k|        src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2469|  74.6k|        src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2470|       |
 2471|  74.6k|        src_temp3_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2472|  74.6k|        src_temp2_8x16b = _mm_srli_si128(src_temp3_8x16b, 4);
 2473|  74.6k|        src_temp1_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 2474|  74.6k|        src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 12);
 2475|       |
 2476|  74.6k|        temp11 = _mm_cvtsi128_si32(src_temp7_8x16b);
 2477|  74.6k|        temp21 = _mm_cvtsi128_si32(src_temp1_8x16b);
 2478|  74.6k|        temp31 = _mm_cvtsi128_si32(src_temp2_8x16b);
 2479|  74.6k|        temp41 = _mm_cvtsi128_si32(src_temp3_8x16b);
 2480|       |
 2481|       |        /* loding 4-bit 8 pixels values */
 2482|  74.6k|        *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 2483|  74.6k|        *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 2484|  74.6k|        *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 2485|  74.6k|        *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 2486|       |
 2487|  74.6k|    }
 2488|       |
 2489|   213k|    else if(nt == 16 || nt == 32)
  ------------------
  |  Branch (2489:13): [True: 34.3k, False: 179k]
  |  Branch (2489:25): [True: 135k, False: 44.1k]
  ------------------
 2490|   169k|    {
 2491|   169k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2492|   169k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2493|   169k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2494|   169k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2495|   169k|        const_temp3_4x32b = _mm_set1_epi16(32);
 2496|   169k|        two_nt_4x32b = _mm_set1_epi16(two_nt);
 2497|       |
 2498|   775k|        for(col = 0; col < nt; col += 8)
  ------------------
  |  Branch (2498:22): [True: 605k, False: 169k]
  ------------------
 2499|   605k|        {
 2500|   605k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2501|   605k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2502|       |            //WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 2503|       |
 2504|   605k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 2505|       |
 2506|   605k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2507|   605k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2508|       |
 2509|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2510|   605k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2511|       |
 2512|       |            /* idx = pos >> 5; */
 2513|   605k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2514|       |
 2515|       |            /*(32 - fract) */
 2516|   605k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2517|       |
 2518|   605k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2519|   605k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 2520|       |
 2521|   605k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2522|   605k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 2523|       |
 2524|       |
 2525|   605k|            fract8_8x16b = _mm_unpackhi_epi8(fract2_8x16b, fract_4x32b);
 2526|   605k|            fract_4x32b = _mm_unpacklo_epi8(fract2_8x16b, fract_4x32b);
 2527|       |
 2528|   605k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 2529|   605k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 2530|   605k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 2531|   605k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 2532|       |
 2533|   605k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 2534|   605k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 2535|   605k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 2536|   605k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 2537|       |
 2538|       |            /* fract = pos & (31); */
 2539|   605k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2540|       |
 2541|   605k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 2542|       |
 2543|   605k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2544|   605k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2545|   605k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2546|   605k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2547|       |
 2548|   605k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2549|   605k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2550|   605k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2551|   605k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 2552|       |
 2553|  2.88M|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (2553:26): [True: 2.28M, False: 605k]
  ------------------
 2554|  2.28M|            {
 2555|  2.28M|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2556|  2.28M|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2557|       |
 2558|       |
 2559|  2.28M|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2560|  2.28M|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2561|       |
 2562|       |                /* loding 8-bit 16 pixels */
 2563|  2.28M|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 1 - (8 + row))); /* col=0*/
 2564|  2.28M|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 1 - (8 + row))); /* col=1*/
 2565|  2.28M|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 1 - (8 + row))); /* col=2*/
 2566|  2.28M|                src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 1 - (8 + row))); /* col=3*/
 2567|       |
 2568|       |                /* loding 8-bit 16 pixels */
 2569|  2.28M|                src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - 1 - (8 + row))); /* col=5*/
 2570|  2.28M|                src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - 1 - (8 + row))); /* col=6*/
 2571|  2.28M|                src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - 1 - (8 + row))); /* col=7*/
 2572|  2.28M|                src_temp14_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - 1 - (8 + row))); /* col=8*/
 2573|       |
 2574|  2.28M|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp1_8x16b, sm3); /* col=0*/
 2575|  2.28M|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp2_8x16b, sm3); /* col=1*/
 2576|  2.28M|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp3_8x16b, sm3); /* col=2*/
 2577|  2.28M|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp4_8x16b, sm3); /* col=3*/
 2578|       |
 2579|  2.28M|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp11_8x16b, sm3); /* col=0*/
 2580|  2.28M|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp12_8x16b, sm3); /* col=1*/
 2581|  2.28M|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp13_8x16b, sm3); /* col=2*/
 2582|  2.28M|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp14_8x16b, sm3); /* col=3*/
 2583|       |
 2584|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2585|  2.28M|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2586|  2.28M|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2587|  2.28M|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2588|  2.28M|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2589|       |
 2590|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2591|  2.28M|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2592|  2.28M|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2593|  2.28M|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2594|  2.28M|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 2595|       |
 2596|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2597|  2.28M|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2598|  2.28M|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2599|  2.28M|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2600|  2.28M|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2601|       |
 2602|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2603|  2.28M|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2604|  2.28M|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2605|  2.28M|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2606|  2.28M|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2607|       |
 2608|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2609|  2.28M|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2610|  2.28M|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2611|  2.28M|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2612|  2.28M|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 2613|       |
 2614|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2615|  2.28M|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2616|  2.28M|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2617|  2.28M|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2618|  2.28M|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2619|       |
 2620|       |                /* converting 16 bit to 8 bit */
 2621|  2.28M|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2622|  2.28M|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2623|       |
 2624|       |                /* converting 16 bit to 8 bit */
 2625|  2.28M|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 2626|  2.28M|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 2627|       |
 2628|  2.28M|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2629|  2.28M|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2630|       |
 2631|  2.28M|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2632|  2.28M|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2633|       |
 2634|  2.28M|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2635|  2.28M|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2636|       |
 2637|  2.28M|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2638|  2.28M|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2639|       |
 2640|  2.28M|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2641|  2.28M|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2642|       |
 2643|  2.28M|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 2644|  2.28M|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 2645|       |
 2646|  2.28M|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2647|  2.28M|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2648|       |
 2649|  2.28M|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 2650|  2.28M|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 2651|       |
 2652|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 7))), src_temp1_8x16b);       /* row=7*/
 2653|       |
 2654|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 6))), src_temp5_8x16b);       /* row=6*/
 2655|       |
 2656|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 5))), src_temp2_8x16b);       /* row=5*/
 2657|       |
 2658|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 4))), src_temp6_8x16b);       /* row=4*/
 2659|       |
 2660|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp3_8x16b);       /* row=3*/
 2661|       |
 2662|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp7_8x16b);       /* row=2*/
 2663|       |
 2664|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp4_8x16b);       /* row=1*/
 2665|       |
 2666|  2.28M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 0))), src_temp8_8x16b);       /* row=0*/
 2667|       |
 2668|  2.28M|            }
 2669|   605k|        }
 2670|   169k|    }
 2671|  43.9k|    else
 2672|  43.9k|    {
 2673|  43.9k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2674|  43.9k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 2675|  43.9k|        const_temp2_4x32b = _mm_set1_epi16(31);
 2676|  43.9k|        const_temp4_4x32b = _mm_set1_epi16(8);
 2677|  43.9k|        const_temp3_4x32b = _mm_set1_epi16(32);
 2678|  43.9k|        two_nt_4x32b = _mm_set1_epi16(two_nt - nt);
 2679|  43.9k|        {
 2680|  43.9k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 2681|  43.9k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 2682|       |
 2683|  43.9k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 2684|       |
 2685|  43.9k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2686|  43.9k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 2687|       |
 2688|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2689|  43.9k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2690|       |
 2691|       |            /* idx = pos >> 5; */
 2692|  43.9k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2693|       |
 2694|       |            /* fract = pos & (31); */
 2695|  43.9k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 2696|       |
 2697|       |            /*(32 - fract) */
 2698|  43.9k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 2699|       |
 2700|  43.9k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2701|  43.9k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 2702|       |
 2703|  43.9k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2704|  43.9k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 2705|       |
 2706|       |
 2707|  43.9k|            fract8_8x16b = _mm_unpackhi_epi8(fract2_8x16b, fract_4x32b);
 2708|  43.9k|            fract_4x32b = _mm_unpacklo_epi8(fract2_8x16b, fract_4x32b);
 2709|       |
 2710|  43.9k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 2711|  43.9k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 2712|  43.9k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 2713|  43.9k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 2714|       |
 2715|  43.9k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 2716|  43.9k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 2717|  43.9k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 2718|  43.9k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 2719|       |
 2720|  43.9k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 2721|  43.9k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 2722|  43.9k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 2723|  43.9k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 2724|       |
 2725|  43.9k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 2726|  43.9k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 2727|  43.9k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 2728|  43.9k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 2729|       |
 2730|  43.9k|            {
 2731|  43.9k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2732|  43.9k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2733|       |
 2734|  43.9k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 2735|  43.9k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 2736|       |
 2737|       |                /* loding 8-bit 16 pixels */
 2738|  43.9k|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 1)); /* col=0*/
 2739|  43.9k|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 1)); /* col=1*/
 2740|  43.9k|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 1)); /* col=2*/
 2741|  43.9k|                src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 1)); /* col=3*/
 2742|       |
 2743|       |                /* loding 8-bit 16 pixels */
 2744|  43.9k|                src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - 1)); /* col=5*/
 2745|  43.9k|                src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - 1)); /* col=6*/
 2746|  43.9k|                src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - 1)); /* col=7*/
 2747|  43.9k|                src_temp14_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - 1)); /* col=8*/
 2748|       |
 2749|  43.9k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp1_8x16b, sm3); /* col=0*/
 2750|  43.9k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp2_8x16b, sm3); /* col=1*/
 2751|  43.9k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp3_8x16b, sm3); /* col=2*/
 2752|  43.9k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp4_8x16b, sm3); /* col=3*/
 2753|       |
 2754|  43.9k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp11_8x16b, sm3); /* col=0*/
 2755|  43.9k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp12_8x16b, sm3); /* col=1*/
 2756|  43.9k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp13_8x16b, sm3); /* col=2*/
 2757|  43.9k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp14_8x16b, sm3); /* col=3*/
 2758|       |
 2759|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2760|  43.9k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 2761|  43.9k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 2762|  43.9k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 2763|  43.9k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 2764|       |
 2765|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2766|  43.9k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 2767|  43.9k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 2768|  43.9k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 2769|  43.9k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 2770|       |
 2771|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2772|  43.9k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 2773|  43.9k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 2774|  43.9k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 2775|  43.9k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 2776|       |
 2777|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2778|  43.9k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 2779|  43.9k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 2780|  43.9k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 2781|  43.9k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 2782|       |
 2783|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2784|  43.9k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 2785|  43.9k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 2786|  43.9k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 2787|  43.9k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 2788|       |
 2789|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2790|  43.9k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 2791|  43.9k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 2792|  43.9k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 2793|  43.9k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 2794|       |
 2795|       |                /* converting 16 bit to 8 bit */
 2796|  43.9k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 2797|  43.9k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 2798|       |
 2799|       |                /* converting 16 bit to 8 bit */
 2800|  43.9k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 2801|  43.9k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 2802|       |
 2803|  43.9k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2804|  43.9k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 2805|       |
 2806|  43.9k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2807|  43.9k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 2808|       |
 2809|  43.9k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2810|  43.9k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2811|       |
 2812|  43.9k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2813|  43.9k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 2814|       |
 2815|  43.9k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2816|  43.9k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 2817|       |
 2818|  43.9k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 2819|  43.9k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 2820|       |
 2821|  43.9k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2822|  43.9k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 2823|       |
 2824|  43.9k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 2825|  43.9k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 2826|       |
 2827|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst), src_temp8_8x16b);       /* row=0*/
 2828|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 1)), src_temp4_8x16b);       /* row=1*/
 2829|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 2)), src_temp7_8x16b);       /* row=2*/
 2830|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 3)), src_temp3_8x16b);       /* row=3*/
 2831|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 4)), src_temp6_8x16b);       /* row=4*/
 2832|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 5)), src_temp2_8x16b);       /* row=5*/
 2833|       |
 2834|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 6)), src_temp5_8x16b);       /* row=6*/
 2835|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 7)), src_temp1_8x16b);       /* row=7*/
 2836|       |
 2837|  43.9k|            }
 2838|  43.9k|        }
 2839|  43.9k|    }
 2840|       |
 2841|   288k|}
ihevc_intra_pred_luma_mode_11_to_17_ssse3:
 2889|   198k|{
 2890|       |
 2891|       |    /* This function and ihevc_intra_pred_luma_mode_19_to_25 are same except*/
 2892|       |    /* for ref main & side samples assignment,can be combined for */
 2893|       |    /* optimzation*/
 2894|       |
 2895|   198k|    WORD32 row, col, k;
 2896|   198k|    WORD32 two_nt;
 2897|   198k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 2898|   198k|    WORD32 ref_idx;
 2899|       |
 2900|   198k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 2901|   198k|    __m128i fract_4x32b,  intra_pred_ang_4x32b;
 2902|   198k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm3;
 2903|       |
 2904|       |
 2905|   198k|    UWORD8 ref_tmp[2 * MAX_CU_SIZE + 2] = {0};
 2906|   198k|    UWORD8 *ref_main;
 2907|   198k|    UWORD8 *ref_temp;
 2908|   198k|    UNUSED(src_strd);
  ------------------
  |  |   38|   198k|#define UNUSED(x) ((void)(x))
  ------------------
 2909|   198k|    inv_ang_sum = 128;
 2910|   198k|    two_nt    = 2 * nt;
 2911|   198k|    ref_temp = ref_tmp + 1;
 2912|   198k|    ref_main = ref_temp + nt - 1;
 2913|   198k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 2914|       |
 2915|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 2916|       |    /* samples dependent on distance to obtain destination sample */
 2917|   198k|    const_temp_4x32b  = _mm_set1_epi16(16);
 2918|   198k|    const_temp2_4x32b = _mm_set1_epi32(31);
 2919|   198k|    const_temp3_4x32b = _mm_set1_epi32(32);
 2920|   198k|    const_temp4_4x32b = _mm_set1_epi32(4);
 2921|       |
 2922|   198k|    two_nt_4x32b = _mm_set1_epi32(1);
 2923|       |
 2924|       |
 2925|   198k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 2926|       |
 2927|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2928|   198k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 2929|       |
 2930|   198k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 2931|       |
 2932|   198k|    if(nt == 4)
  ------------------
  |  Branch (2932:8): [True: 37.2k, False: 161k]
  ------------------
 2933|  37.2k|    {
 2934|       |
 2935|  37.2k|        WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2936|  37.2k|        int temp11, temp21, temp31, temp41;
 2937|       |//        WORD8  ai1_fract_temp_val[16], ai1_row_temp_val[16];
 2938|       |
 2939|  37.2k|        __m128i fract1_8x16b, fract2_8x16b;
 2940|  37.2k|        __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2941|       |
 2942|  37.2k|        __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 2943|  37.2k|        __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 2944|  37.2k|        __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, zero_8x16b, sign_8x16b;
 2945|       |
 2946|       |        /* Intermediate reference samples for negative angle modes */
 2947|       |        /* This have to be removed during optimization*/
 2948|       |        /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 2949|  37.2k|        inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 2950|       |
 2951|  37.2k|        ref_main = ref_temp + nt - 1;
 2952|   223k|        for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (2952:20): [True: 186k, False: 37.2k]
  ------------------
 2953|   186k|            ref_temp[k + nt - 1] = pu1_ref[two_nt - k];
 2954|       |
 2955|  37.2k|        ref_main = ref_temp + nt - 1;
 2956|  37.2k|        ref_idx = (nt * intra_pred_ang) >> 5;
 2957|  37.2k|        zero_8x16b = _mm_setzero_si128();
 2958|       |
 2959|  37.2k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2960|  37.2k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2961|       |        /* SIMD Optimization can be done using look-up table for the loop */
 2962|       |        /* For negative angled derive the main reference samples from side */
 2963|       |        /*  reference samples refer to section 8.4.4.2.6 */
 2964|  82.0k|        for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (2964:21): [True: 44.8k, False: 37.2k]
  ------------------
 2965|  44.8k|        {
 2966|  44.8k|            inv_ang_sum += inv_ang;
 2967|  44.8k|            ref_main[k] = pu1_ref[two_nt + (inv_ang_sum >> 8)];
 2968|  44.8k|        }
 2969|       |
 2970|       |
 2971|       |        /* pos = ((row + 1) * intra_pred_ang); */
 2972|  37.2k|        res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2973|       |
 2974|  37.2k|        sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2975|  37.2k|        res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2976|       |
 2977|       |        /* idx = pos >> 5; */
 2978|  37.2k|        fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2979|       |
 2980|       |        /* fract = pos & (31); */
 2981|  37.2k|        ref_main_idx_4x32b = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2982|       |
 2983|       |        /*(32 - fract) */
 2984|  37.2k|        row_4x32b = _mm_sub_epi32(const_temp3_4x32b, fract_4x32b);
 2985|       |
 2986|  37.2k|        fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 2987|  37.2k|        fract2_8x16b = _mm_slli_epi16(row_4x32b, 8);
 2988|       |
 2989|  37.2k|        fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 2990|  37.2k|        row_4x32b = _mm_or_si128(row_4x32b, fract2_8x16b); /*(32 - fract) */
 2991|       |
 2992|  37.2k|        fract2_8x16b = _mm_unpackhi_epi8(fract_4x32b, row_4x32b);
 2993|  37.2k|        fract1_8x16b = _mm_unpacklo_epi8(fract_4x32b, row_4x32b);
 2994|       |
 2995|  37.2k|        temp1_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 2996|  37.2k|        temp2_8x16b =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 2997|  37.2k|        temp3_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 2998|  37.2k|        temp4_8x16b =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 2999|       |
 3000|  37.2k|        ref_main_temp0 = _mm_srli_si128(ref_main_idx_4x32b, 4);  /* next 32 bit values */
 3001|  37.2k|        ref_main_temp1 = _mm_srli_si128(ref_main_idx_4x32b, 8);  /* next 32 bit values */
 3002|  37.2k|        ref_main_temp2 = _mm_srli_si128(ref_main_idx_4x32b, 12); /* next 32 bit values */
 3003|  37.2k|        ref_main_idx1  = _mm_cvtsi128_si32(ref_main_idx_4x32b);    /* col=0*/
 3004|  37.2k|        ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* col=1*/
 3005|  37.2k|        ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* col=2*/
 3006|  37.2k|        ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* col=3*/
 3007|       |
 3008|       |        /* loding 8-bit 16 pixels */
 3009|  37.2k|        src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1)); /* col=0*/
 3010|  37.2k|        src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2)); /* col=1*/
 3011|  37.2k|        src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3)); /* col=2*/
 3012|  37.2k|        src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4)); /* col=3*/
 3013|       |
 3014|  37.2k|        src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 3015|  37.2k|        src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 3016|  37.2k|        src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 3017|  37.2k|        src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 3018|       |
 3019|       |        /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3020|  37.2k|        src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 3021|  37.2k|        src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 3022|  37.2k|        src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 3023|  37.2k|        src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 3024|       |
 3025|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3026|  37.2k|        src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 3027|  37.2k|        src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 3028|  37.2k|        src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 3029|  37.2k|        src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 3030|       |
 3031|       |        /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3032|  37.2k|        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 3033|  37.2k|        src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 3034|  37.2k|        src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 3035|  37.2k|        src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 3036|       |
 3037|       |        /* converting 16 bit to 8 bit */
 3038|  37.2k|        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 3039|  37.2k|        src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 3040|       |
 3041|       |
 3042|  37.2k|        src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3043|  37.2k|        src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3044|       |
 3045|  37.2k|        src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3046|  37.2k|        src_temp1_8x16b = _mm_srli_si128(src_temp7_8x16b, 4);
 3047|  37.2k|        src_temp2_8x16b = _mm_srli_si128(src_temp7_8x16b, 8);
 3048|  37.2k|        src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 12);
 3049|       |
 3050|  37.2k|        temp11 = _mm_cvtsi128_si32(src_temp7_8x16b);
 3051|  37.2k|        temp21 = _mm_cvtsi128_si32(src_temp1_8x16b);
 3052|  37.2k|        temp31 = _mm_cvtsi128_si32(src_temp2_8x16b);
 3053|  37.2k|        temp41 = _mm_cvtsi128_si32(src_temp3_8x16b);
 3054|       |
 3055|       |        /* loding 8-bit 4 pixels values */
 3056|  37.2k|        *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 3057|  37.2k|        *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 3058|  37.2k|        *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 3059|  37.2k|        *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 3060|  37.2k|    }
 3061|       |
 3062|   161k|    else if(nt == 32)
  ------------------
  |  Branch (3062:13): [True: 99.1k, False: 62.2k]
  ------------------
 3063|  99.1k|    {
 3064|       |
 3065|       |
 3066|  99.1k|        __m128i temp1, temp2, temp3, temp11, temp12;
 3067|  99.1k|        __m128i src_values0, src_values1;
 3068|       |        /* Intermediate reference samples for negative angle modes */
 3069|       |
 3070|  99.1k|        ref_temp[two_nt - 1] = pu1_ref[two_nt - nt];
 3071|  99.1k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + nt + 1));
 3072|  99.1k|        temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + nt + 17));
 3073|  99.1k|        temp2 = _mm_loadu_si128((__m128i *)IHEVCE_SHUFFLEMASKY3);
 3074|       |
 3075|       |        /* For negative angled derive the main reference samples from side */
 3076|       |
 3077|  99.1k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1)); /*nt-(nt+15)*/
 3078|  99.1k|        src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 17)); /*(nt+16)-(two_nt-1)*/
 3079|       |
 3080|  99.1k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode]));
 3081|  99.1k|        temp12 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode] + 16));
 3082|       |
 3083|  99.1k|        src_values0 = _mm_shuffle_epi8(src_values0, temp2);
 3084|  99.1k|        src_values1 = _mm_shuffle_epi8(src_values1, temp2);
 3085|  99.1k|        src_values0 = _mm_shuffle_epi8(src_values0, temp12);
 3086|  99.1k|        src_values1 = _mm_shuffle_epi8(src_values1, temp11);
 3087|       |
 3088|  99.1k|        temp1 = _mm_shuffle_epi8(temp1, temp2);
 3089|  99.1k|        temp3 = _mm_shuffle_epi8(temp3, temp2);
 3090|       |
 3091|  99.1k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp3);
 3092|  99.1k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1 + 16), temp1);
 3093|  99.1k|        _mm_storeu_si128((__m128i *)(ref_main - 16), src_values0);
 3094|  99.1k|        _mm_storeu_si128((__m128i *)(ref_main - nt + inv_angle_shuffle[17 - mode][0]), src_values1);
 3095|       |
 3096|       |
 3097|  99.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3098|  99.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3099|  99.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3100|  99.1k|        const_temp4_4x32b = _mm_set1_epi16(8);
 3101|  99.1k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3102|  99.1k|        two_nt_4x32b = _mm_set1_epi16(1);
 3103|       |
 3104|   493k|        for(col = 0; col < nt; col += 8)
  ------------------
  |  Branch (3104:22): [True: 394k, False: 99.1k]
  ------------------
 3105|   394k|        {
 3106|   394k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 3107|   394k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 3108|       |            // WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 3109|       |
 3110|   394k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 3111|       |
 3112|   394k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 3113|   394k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 3114|       |
 3115|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3116|   394k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3117|       |
 3118|       |            /* idx = pos >> 5; */
 3119|   394k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3120|       |
 3121|       |            /* fract = pos & (31); */
 3122|   394k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3123|       |
 3124|   394k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 3125|       |            /*(32 - fract) */
 3126|   394k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 3127|       |
 3128|   394k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 3129|   394k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 3130|       |
 3131|   394k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 3132|   394k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 3133|       |
 3134|       |
 3135|   394k|            fract8_8x16b = _mm_unpackhi_epi8(fract_4x32b, fract2_8x16b);
 3136|   394k|            fract_4x32b = _mm_unpacklo_epi8(fract_4x32b, fract2_8x16b);
 3137|       |
 3138|   394k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 3139|   394k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 3140|   394k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 3141|   394k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 3142|       |
 3143|   394k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 3144|   394k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 3145|   394k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 3146|   394k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 3147|       |
 3148|   394k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 3149|   394k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 3150|   394k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 3151|   394k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 3152|       |
 3153|   394k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 3154|   394k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 3155|   394k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 3156|   394k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 3157|       |
 3158|  1.97M|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (3158:26): [True: 1.57M, False: 394k]
  ------------------
 3159|  1.57M|            {
 3160|  1.57M|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 3161|  1.57M|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 3162|       |
 3163|       |
 3164|  1.57M|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 3165|  1.57M|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 3166|       |
 3167|       |                /* loding 8-bit 16 pixels */
 3168|  1.57M|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row)); /* col=0*/
 3169|  1.57M|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row)); /* col=1*/
 3170|  1.57M|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row)); /* col=2*/
 3171|  1.57M|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row)); /* col=3*/
 3172|       |
 3173|  1.57M|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 1); /* col=0*/
 3174|  1.57M|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 1); /* col=1*/
 3175|  1.57M|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 1); /* col=2*/
 3176|  1.57M|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 1); /* col=3*/
 3177|       |
 3178|       |                /* loding 8-bit 16 pixels */
 3179|  1.57M|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row)); /* col=5*/
 3180|  1.57M|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row)); /* col=6*/
 3181|  1.57M|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row)); /* col=7*/
 3182|  1.57M|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row)); /* col=8*/
 3183|       |
 3184|  1.57M|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 3185|  1.57M|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 3186|  1.57M|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 3187|  1.57M|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 3188|       |
 3189|  1.57M|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp15_8x16b, sm3); /* col=0*/
 3190|  1.57M|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp16_8x16b, sm3); /* col=1*/
 3191|  1.57M|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp17_8x16b, sm3); /* col=2*/
 3192|  1.57M|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp18_8x16b, sm3); /* col=3*/
 3193|       |
 3194|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3195|  1.57M|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 3196|  1.57M|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 3197|  1.57M|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 3198|  1.57M|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 3199|       |
 3200|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3201|  1.57M|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 3202|  1.57M|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 3203|  1.57M|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 3204|  1.57M|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 3205|       |
 3206|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3207|  1.57M|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 3208|  1.57M|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 3209|  1.57M|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 3210|  1.57M|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 3211|       |
 3212|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3213|  1.57M|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 3214|  1.57M|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 3215|  1.57M|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 3216|  1.57M|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 3217|       |
 3218|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3219|  1.57M|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 3220|  1.57M|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 3221|  1.57M|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 3222|  1.57M|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 3223|       |
 3224|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3225|  1.57M|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 3226|  1.57M|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 3227|  1.57M|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 3228|  1.57M|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 3229|       |
 3230|       |                /* converting 16 bit to 8 bit */
 3231|  1.57M|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 3232|  1.57M|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 3233|       |
 3234|       |                /* converting 16 bit to 8 bit */
 3235|  1.57M|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 3236|  1.57M|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 3237|       |
 3238|  1.57M|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3239|  1.57M|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3240|       |
 3241|  1.57M|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 3242|  1.57M|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 3243|       |
 3244|  1.57M|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3245|  1.57M|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3246|       |
 3247|  1.57M|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 3248|  1.57M|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 3249|       |
 3250|       |
 3251|  1.57M|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 3252|  1.57M|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 3253|       |
 3254|  1.57M|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 3255|  1.57M|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 3256|       |
 3257|  1.57M|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 3258|  1.57M|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 3259|  1.57M|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 3260|  1.57M|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 3261|       |
 3262|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * row)), src_temp1_8x16b);          /* row=0*/
 3263|       |
 3264|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp5_8x16b);       /* row=1*/
 3265|       |
 3266|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp2_8x16b);       /* row=2*/
 3267|       |
 3268|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp6_8x16b);       /* row=4*/
 3269|       |
 3270|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 4))), src_temp3_8x16b);       /* row=5*/
 3271|       |
 3272|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 5))), src_temp7_8x16b);       /* row=6*/
 3273|       |
 3274|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 6))), src_temp4_8x16b);       /* row=7*/
 3275|       |
 3276|  1.57M|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 7))), src_temp8_8x16b);       /* row=8*/
 3277|       |
 3278|  1.57M|            }
 3279|   394k|        }
 3280|  99.1k|    }
 3281|  62.2k|    else if(nt == 16)
  ------------------
  |  Branch (3281:13): [True: 33.1k, False: 29.1k]
  ------------------
 3282|  33.1k|    {
 3283|       |
 3284|  33.1k|        __m128i temp1, temp2, temp11, src_values0;
 3285|       |        /* Intermediate reference samples for negative angle modes */
 3286|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3287|  33.1k|        ref_temp[two_nt - 1] = pu1_ref[two_nt - nt];
 3288|  33.1k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + nt + 1));
 3289|  33.1k|        temp2 = _mm_loadu_si128((__m128i *)IHEVCE_SHUFFLEMASKY3);
 3290|  33.1k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1)); /*nt-(nt+15)*/
 3291|       |
 3292|  33.1k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode] + 16));
 3293|       |
 3294|  33.1k|        src_values0 = _mm_shuffle_epi8(src_values0, temp2);
 3295|  33.1k|        temp1 = _mm_shuffle_epi8(temp1, temp2);
 3296|  33.1k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 3297|       |
 3298|  33.1k|        _mm_storeu_si128((__m128i *)(ref_main - nt), src_values0);
 3299|  33.1k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp1);
 3300|       |
 3301|  33.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3302|  33.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3303|  33.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3304|  33.1k|        const_temp4_4x32b = _mm_set1_epi16(8);
 3305|  33.1k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3306|  33.1k|        two_nt_4x32b = _mm_set1_epi16(1);
 3307|       |
 3308|  99.3k|        for(col = 0; col < nt; col += 8)
  ------------------
  |  Branch (3308:22): [True: 66.2k, False: 33.1k]
  ------------------
 3309|  66.2k|        {
 3310|  66.2k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 3311|  66.2k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 3312|       |            // WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 3313|       |
 3314|  66.2k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 3315|       |
 3316|  66.2k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 3317|  66.2k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 3318|       |
 3319|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3320|  66.2k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3321|       |
 3322|       |            /* idx = pos >> 5; */
 3323|  66.2k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3324|       |
 3325|       |            /* fract = pos & (31); */
 3326|  66.2k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3327|       |
 3328|  66.2k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 3329|       |            /*(32 - fract) */
 3330|  66.2k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 3331|       |
 3332|  66.2k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 3333|  66.2k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 3334|       |
 3335|  66.2k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 3336|  66.2k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 3337|       |
 3338|       |
 3339|  66.2k|            fract8_8x16b = _mm_unpackhi_epi8(fract_4x32b, fract2_8x16b);
 3340|  66.2k|            fract_4x32b = _mm_unpacklo_epi8(fract_4x32b, fract2_8x16b);
 3341|       |
 3342|  66.2k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 3343|  66.2k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 3344|  66.2k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 3345|  66.2k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 3346|       |
 3347|  66.2k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 3348|  66.2k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 3349|  66.2k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 3350|  66.2k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 3351|       |
 3352|  66.2k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 3353|  66.2k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 3354|  66.2k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 3355|  66.2k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 3356|       |
 3357|  66.2k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 3358|  66.2k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 3359|  66.2k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 3360|  66.2k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 3361|       |
 3362|   198k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (3362:26): [True: 132k, False: 66.2k]
  ------------------
 3363|   132k|            {
 3364|   132k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 3365|   132k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 3366|       |
 3367|       |
 3368|   132k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 3369|   132k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 3370|       |
 3371|       |                /* loding 8-bit 16 pixels */
 3372|   132k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row)); /* col=0*/
 3373|   132k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row)); /* col=1*/
 3374|   132k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row)); /* col=2*/
 3375|   132k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row)); /* col=3*/
 3376|       |
 3377|   132k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 1); /* col=0*/
 3378|   132k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 1); /* col=1*/
 3379|   132k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 1); /* col=2*/
 3380|   132k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 1); /* col=3*/
 3381|       |
 3382|       |                /* loding 8-bit 16 pixels */
 3383|   132k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row)); /* col=5*/
 3384|   132k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row)); /* col=6*/
 3385|   132k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row)); /* col=7*/
 3386|   132k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row)); /* col=8*/
 3387|       |
 3388|   132k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 3389|   132k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 3390|   132k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 3391|   132k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 3392|       |
 3393|   132k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp15_8x16b, sm3); /* col=0*/
 3394|   132k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp16_8x16b, sm3); /* col=1*/
 3395|   132k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp17_8x16b, sm3); /* col=2*/
 3396|   132k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp18_8x16b, sm3); /* col=3*/
 3397|       |
 3398|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3399|   132k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 3400|   132k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 3401|   132k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 3402|   132k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 3403|       |
 3404|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3405|   132k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 3406|   132k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 3407|   132k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 3408|   132k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 3409|       |
 3410|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3411|   132k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 3412|   132k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 3413|   132k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 3414|   132k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 3415|       |
 3416|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3417|   132k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 3418|   132k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 3419|   132k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 3420|   132k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 3421|       |
 3422|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3423|   132k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 3424|   132k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 3425|   132k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 3426|   132k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 3427|       |
 3428|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3429|   132k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 3430|   132k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 3431|   132k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 3432|   132k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 3433|       |
 3434|       |                /* converting 16 bit to 8 bit */
 3435|   132k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 3436|   132k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 3437|       |
 3438|       |                /* converting 16 bit to 8 bit */
 3439|   132k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=5*/
 3440|   132k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=6*/
 3441|       |
 3442|   132k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3443|   132k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3444|       |
 3445|   132k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 3446|   132k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 3447|       |
 3448|   132k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3449|   132k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3450|       |
 3451|   132k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 3452|   132k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 3453|       |
 3454|       |
 3455|   132k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 3456|   132k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 3457|       |
 3458|   132k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 3459|   132k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 3460|       |
 3461|   132k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 3462|   132k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 3463|   132k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 3464|   132k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 3465|       |
 3466|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * row)), src_temp1_8x16b);          /* row=0*/
 3467|       |
 3468|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp5_8x16b);       /* row=1*/
 3469|       |
 3470|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp2_8x16b);       /* row=2*/
 3471|       |
 3472|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp6_8x16b);       /* row=4*/
 3473|       |
 3474|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 4))), src_temp3_8x16b);       /* row=5*/
 3475|       |
 3476|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 5))), src_temp7_8x16b);       /* row=6*/
 3477|       |
 3478|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 6))), src_temp4_8x16b);       /* row=7*/
 3479|       |
 3480|   132k|                _mm_storel_epi64((__m128i *)(pu1_dst + col + (dst_strd * (row + 7))), src_temp8_8x16b);       /* row=8*/
 3481|       |
 3482|   132k|            }
 3483|  66.2k|        }
 3484|  33.1k|    }
 3485|  29.1k|    else
 3486|  29.1k|    {
 3487|       |
 3488|       |
 3489|  29.1k|        __m128i temp1, temp2, temp11, src_values0;
 3490|       |        /* Intermediate reference samples for negative angle modes */
 3491|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3492|  29.1k|        ref_temp[two_nt - 1] = pu1_ref[nt];
 3493|  29.1k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 1));
 3494|       |
 3495|       |        /* For negative angled derive the main reference samples from side */
 3496|       |
 3497|  29.1k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 1)); /*nt-(nt+15)*/
 3498|  29.1k|        temp2 = _mm_loadu_si128((__m128i *)IHEVCE_SHUFFLEMASKY3);
 3499|  29.1k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[17 - mode] + 16));
 3500|       |
 3501|  29.1k|        src_values0 = _mm_shuffle_epi8(src_values0, temp2);
 3502|  29.1k|        temp1 = _mm_shuffle_epi8(temp1, temp2);
 3503|  29.1k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 3504|  29.1k|        src_values0 = _mm_srli_si128(src_values0, 8);
 3505|       |
 3506|  29.1k|        _mm_storel_epi64((__m128i *)(ref_temp + nt - 1), temp1);
 3507|  29.1k|        _mm_storel_epi64((__m128i *)(ref_main - nt), src_values0);
 3508|       |
 3509|       |
 3510|  29.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3511|  29.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3512|  29.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3513|  29.1k|        const_temp4_4x32b = _mm_set1_epi16(8);
 3514|  29.1k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3515|  29.1k|        two_nt_4x32b = _mm_set1_epi16(1);
 3516|       |
 3517|  29.1k|        {
 3518|  29.1k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 3519|  29.1k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 3520|       |            //WORD8  ai1_fract_temp0_val[16], ai1_fract_temp1_val[16];
 3521|       |
 3522|  29.1k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract8_8x16b;
 3523|       |
 3524|  29.1k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 3525|  29.1k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 3526|       |
 3527|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3528|  29.1k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3529|       |
 3530|       |            /* idx = pos >> 5; */
 3531|  29.1k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3532|       |
 3533|       |            /* fract = pos & (31); */
 3534|  29.1k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3535|       |
 3536|       |            /*(32 - fract) */
 3537|  29.1k|            fract2_8x16b =  _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 3538|       |
 3539|  29.1k|            fract1_8x16b = _mm_slli_epi16(fract_4x32b, 8);
 3540|  29.1k|            fract3_8x16b = _mm_slli_epi16(fract2_8x16b, 8); /*(32 - fract) */
 3541|       |
 3542|  29.1k|            fract_4x32b = _mm_or_si128(fract_4x32b, fract1_8x16b);
 3543|  29.1k|            fract2_8x16b = _mm_or_si128(fract2_8x16b, fract3_8x16b); /*(32 - fract) */
 3544|       |
 3545|  29.1k|            fract8_8x16b = _mm_unpackhi_epi8(fract_4x32b, fract2_8x16b);
 3546|  29.1k|            fract_4x32b = _mm_unpacklo_epi8(fract_4x32b, fract2_8x16b);
 3547|       |
 3548|  29.1k|            temp1_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x00);
 3549|  29.1k|            temp2_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0x55);
 3550|  29.1k|            temp3_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xaa);
 3551|  29.1k|            temp4_8x16b =  _mm_shuffle_epi32(fract_4x32b, 0xff);
 3552|       |
 3553|  29.1k|            temp11_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x00);
 3554|  29.1k|            temp12_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0x55);
 3555|  29.1k|            temp13_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xaa);
 3556|  29.1k|            temp14_8x16b =  _mm_shuffle_epi32(fract8_8x16b, 0xff);
 3557|       |
 3558|  29.1k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 3559|  29.1k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 3560|  29.1k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 3561|  29.1k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 3562|       |
 3563|  29.1k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 3564|  29.1k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 3565|  29.1k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 3566|  29.1k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 3567|       |
 3568|  29.1k|            {
 3569|  29.1k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 3570|  29.1k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 3571|       |
 3572|  29.1k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 3573|  29.1k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 3574|       |
 3575|       |                /* loding 8-bit 16 pixels */
 3576|  29.1k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1)); /* col=0*/
 3577|  29.1k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2)); /* col=1*/
 3578|  29.1k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3)); /* col=2*/
 3579|  29.1k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4)); /* col=3*/
 3580|       |
 3581|       |                /* loding 8-bit 16 pixels */
 3582|  29.1k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5)); /* col=5*/
 3583|  29.1k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6)); /* col=6*/
 3584|  29.1k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7)); /* col=7*/
 3585|  29.1k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8)); /* col=8*/
 3586|       |
 3587|  29.1k|                src_temp1_8x16b =  _mm_shuffle_epi8(src_temp5_8x16b, sm3); /* col=0*/
 3588|  29.1k|                src_temp2_8x16b =  _mm_shuffle_epi8(src_temp6_8x16b, sm3); /* col=1*/
 3589|  29.1k|                src_temp3_8x16b =  _mm_shuffle_epi8(src_temp7_8x16b, sm3); /* col=2*/
 3590|  29.1k|                src_temp4_8x16b =  _mm_shuffle_epi8(src_temp8_8x16b, sm3); /* col=3*/
 3591|       |
 3592|  29.1k|                src_temp11_8x16b =  _mm_shuffle_epi8(src_temp15_8x16b, sm3); /* col=0*/
 3593|  29.1k|                src_temp12_8x16b =  _mm_shuffle_epi8(src_temp16_8x16b, sm3); /* col=1*/
 3594|  29.1k|                src_temp13_8x16b =  _mm_shuffle_epi8(src_temp17_8x16b, sm3); /* col=2*/
 3595|  29.1k|                src_temp14_8x16b =  _mm_shuffle_epi8(src_temp18_8x16b, sm3); /* col=3*/
 3596|       |
 3597|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3598|  29.1k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 3599|  29.1k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 3600|  29.1k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 3601|  29.1k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 3602|       |
 3603|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 3604|  29.1k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 3605|  29.1k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 3606|  29.1k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 3607|  29.1k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 3608|       |
 3609|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3610|  29.1k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 3611|  29.1k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 3612|  29.1k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 3613|  29.1k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 3614|       |
 3615|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3616|  29.1k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* row=0*/
 3617|  29.1k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* row=1*/
 3618|  29.1k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* row=2*/
 3619|  29.1k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* row=3*/
 3620|       |
 3621|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3622|  29.1k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 3623|  29.1k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 3624|  29.1k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 3625|  29.1k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 3626|       |
 3627|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3628|  29.1k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 3629|  29.1k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 3630|  29.1k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 3631|  29.1k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 3632|       |
 3633|       |                /* converting 16 bit to 8 bit */
 3634|  29.1k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp3_8x16b); /* col=0*/
 3635|  29.1k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, src_temp4_8x16b); /* col=1*/
 3636|       |
 3637|       |                /* converting 16 bit to 8 bit */
 3638|  29.1k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, src_temp13_8x16b); /* col=4*/
 3639|  29.1k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, src_temp14_8x16b); /* col=5*/
 3640|       |
 3641|  29.1k|                src_temp5_8x16b = _mm_unpacklo_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3642|  29.1k|                src_temp6_8x16b = _mm_unpackhi_epi8(src_temp1_8x16b, src_temp2_8x16b);
 3643|       |
 3644|  29.1k|                src_temp15_8x16b = _mm_unpacklo_epi8(src_temp11_8x16b, src_temp12_8x16b);
 3645|  29.1k|                src_temp16_8x16b = _mm_unpackhi_epi8(src_temp11_8x16b, src_temp12_8x16b);
 3646|       |
 3647|  29.1k|                src_temp7_8x16b = _mm_unpacklo_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3648|  29.1k|                src_temp8_8x16b = _mm_unpackhi_epi16(src_temp5_8x16b, src_temp6_8x16b);
 3649|       |
 3650|  29.1k|                src_temp17_8x16b = _mm_unpacklo_epi16(src_temp15_8x16b, src_temp16_8x16b);
 3651|  29.1k|                src_temp18_8x16b = _mm_unpackhi_epi16(src_temp15_8x16b, src_temp16_8x16b);
 3652|       |
 3653|       |
 3654|  29.1k|                src_temp1_8x16b = _mm_unpacklo_epi32(src_temp7_8x16b, src_temp17_8x16b);
 3655|  29.1k|                src_temp2_8x16b = _mm_unpackhi_epi32(src_temp7_8x16b, src_temp17_8x16b);
 3656|       |
 3657|  29.1k|                src_temp3_8x16b = _mm_unpacklo_epi32(src_temp8_8x16b, src_temp18_8x16b);
 3658|  29.1k|                src_temp4_8x16b = _mm_unpackhi_epi32(src_temp8_8x16b, src_temp18_8x16b);
 3659|       |
 3660|  29.1k|                src_temp5_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
 3661|  29.1k|                src_temp6_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
 3662|  29.1k|                src_temp7_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
 3663|  29.1k|                src_temp8_8x16b = _mm_srli_si128(src_temp4_8x16b, 8);
 3664|       |
 3665|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp1_8x16b);       /* row=0*/
 3666|       |
 3667|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp5_8x16b);       /* row=1*/
 3668|       |
 3669|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp2_8x16b);       /* row=2*/
 3670|       |
 3671|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp6_8x16b);       /* row=3*/
 3672|       |
 3673|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (4))), src_temp3_8x16b);       /* row=4*/
 3674|       |
 3675|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (5))), src_temp7_8x16b);       /* row=5*/
 3676|       |
 3677|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (6))), src_temp4_8x16b);       /* row=6*/
 3678|       |
 3679|  29.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (7))), src_temp8_8x16b);       /* row=7*/
 3680|       |
 3681|  29.1k|            }
 3682|  29.1k|        }
 3683|  29.1k|    }
 3684|       |
 3685|   198k|}
ihevc_intra_pred_luma_mode_19_to_25_ssse3:
 3731|   192k|{
 3732|       |
 3733|   192k|    WORD32 row, k;
 3734|   192k|    WORD32 two_nt, intra_pred_ang;
 3735|   192k|    WORD32 inv_ang, inv_ang_sum;
 3736|       |    //WORD32 ref_main_idx, pos, fract, idx;
 3737|   192k|    WORD32 ref_idx;
 3738|   192k|    UWORD8 ref_tmp[(2 * MAX_CU_SIZE) + 2] = {0};
 3739|   192k|    UWORD8 *ref_main, *ref_temp;
 3740|       |
 3741|   192k|    __m128i  /*fract_8x16b,*/ const_temp_8x16b, sm3;
 3742|   192k|    __m128i temp1, temp2, temp3, temp4;
 3743|   192k|    __m128i temp11, temp12, temp13, temp14;
 3744|   192k|    UNUSED(src_strd);
  ------------------
  |  |   38|   192k|#define UNUSED(x) ((void)(x))
  ------------------
 3745|   192k|    two_nt = 2 * nt;
 3746|   192k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 3747|   192k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 12];
 3748|       |
 3749|       |    /* Intermediate reference samples for negative angle modes */
 3750|       |    /* This have to be removed during optimization*/
 3751|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3752|   192k|    ref_temp = ref_tmp + 1;
 3753|   192k|    ref_main = ref_temp + nt - 1;
 3754|       |
 3755|       |
 3756|   192k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 3757|       |
 3758|       |
 3759|       |
 3760|   192k|    const_temp_8x16b = _mm_set1_epi16(16);
 3761|       |
 3762|   192k|    if(nt == 32)
  ------------------
  |  Branch (3762:8): [True: 79.4k, False: 112k]
  ------------------
 3763|  79.4k|    {
 3764|       |
 3765|  79.4k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 3766|  79.4k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3767|  79.4k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3768|       |
 3769|  79.4k|        __m128i src_values0, src_values1, src_values2, src_values3;
 3770|  79.4k|        __m128i  src_values4, src_values5, src_values6, src_values7;
 3771|  79.4k|        WORD32 col = 0;
 3772|       |
 3773|       |        /* Intermediate reference samples for negative angle modes */
 3774|       |        /* This have to be removed during optimization*/
 3775|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3776|  79.4k|        ref_temp[two_nt - 1] = pu1_ref[two_nt + nt];
 3777|  79.4k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt));
 3778|  79.4k|        temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt + 16));
 3779|       |
 3780|       |        /* SIMD Optimization can be done using look-up table for the loop */
 3781|       |        /* For negative angled derive the main reference samples from side */
 3782|       |        /*  reference samples refer to section 8.4.4.2.6 */
 3783|  79.4k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - nt)); /*nt-(nt+15)*/
 3784|  79.4k|        src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - 16)); /*(nt+16)-(two_nt-1)*/
 3785|       |
 3786|  79.4k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19]));
 3787|  79.4k|        temp12 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19] + 16));
 3788|       |
 3789|  79.4k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 3790|  79.4k|        src_values1 = _mm_shuffle_epi8(src_values1, temp12);
 3791|       |
 3792|  79.4k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp1);
 3793|  79.4k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1 + 16), temp3);
 3794|  79.4k|        _mm_storeu_si128((__m128i *)(ref_main - 16), src_values1);
 3795|  79.4k|        _mm_storeu_si128((__m128i *)(ref_main - nt + inv_angle_shuffle[mode - 19][0]), src_values0);
 3796|       |
 3797|  79.4k|        const_temp2_4x32b = _mm_set1_epi16(31);
 3798|  79.4k|        const_temp3_4x32b = _mm_set1_epi16(32);
 3799|  79.4k|        const_temp8_4x32b = _mm_set1_epi16(8);
 3800|       |
 3801|  79.4k|        two_nt_4x32b = _mm_set1_epi16(1);
 3802|       |
 3803|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 3804|  79.4k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 3805|       |
 3806|  79.4k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 3807|       |
 3808|   396k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (3808:22): [True: 316k, False: 79.4k]
  ------------------
 3809|   316k|        {
 3810|       |
 3811|   316k|            WORD16 ref_main_idx[9];
 3812|       |
 3813|   316k|            __m128i res_temp5_4x32b;
 3814|   316k|            __m128i fract1_8x16b, fract2_8x16b;
 3815|       |
 3816|       |            /* pos = ((row + 1) * intra_pred_ang); */
 3817|   316k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 3818|       |
 3819|       |            /* fract = pos & (31); */
 3820|   316k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 3821|       |
 3822|       |            /* idx = pos >> 5; */
 3823|   316k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 3824|       |
 3825|       |            /*(32 - fract) */
 3826|   316k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 3827|       |
 3828|   316k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 3829|   316k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 3830|       |
 3831|   316k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 3832|   316k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 3833|       |
 3834|   316k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 3835|   316k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 3836|       |
 3837|   316k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 3838|   316k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 3839|   316k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 3840|   316k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 3841|       |
 3842|   316k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 3843|   316k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 3844|   316k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 3845|   316k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 3846|       |
 3847|   316k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 3848|   316k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 3849|   950k|            for(col = 0; col < nt; col += 16)
  ------------------
  |  Branch (3849:26): [True: 633k, False: 316k]
  ------------------
 3850|   633k|            {
 3851|   633k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0] + col));
 3852|   633k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1] + col));
 3853|   633k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2] + col));
 3854|   633k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3] + col));
 3855|   633k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0] + 8 + col));
 3856|   633k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1] + 8 + col));
 3857|   633k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2] + 8 + col));
 3858|   633k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3] + 8 + col));
 3859|       |
 3860|   633k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3861|   633k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3862|   633k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3863|   633k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3864|   633k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3865|   633k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3866|   633k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3867|   633k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3868|       |
 3869|       |
 3870|   633k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 3871|   633k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 3872|   633k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 3873|   633k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 3874|   633k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 3875|   633k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 3876|   633k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 3877|   633k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 3878|       |
 3879|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3880|   633k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3881|   633k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3882|   633k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3883|   633k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3884|   633k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3885|   633k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3886|   633k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3887|   633k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3888|       |
 3889|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3890|   633k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3891|   633k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3892|   633k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3893|   633k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3894|   633k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3895|   633k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3896|   633k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3897|   633k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3898|       |
 3899|       |                /* converting 16 bit to 8 bit */
 3900|   633k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3901|   633k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3902|   633k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3903|   633k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3904|       |
 3905|       |                /* loading 8-bit 8 pixels values */
 3906|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (0) * dst_strd), src_values0);       /* row=0*/
 3907|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (1) * dst_strd), src_values1);   /* row=1*/
 3908|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (2) * dst_strd), src_values2);   /* row=2*/
 3909|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (3) * dst_strd), src_values3);   /* row=3*/
 3910|       |
 3911|       |
 3912|   633k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4] + col));
 3913|   633k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5] + col));
 3914|   633k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6] + col));
 3915|   633k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7] + col));
 3916|   633k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4] + 8 + col));
 3917|   633k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5] + 8 + col));
 3918|   633k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6] + 8 + col));
 3919|   633k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7] + 8 + col));
 3920|       |
 3921|   633k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 3922|   633k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 3923|   633k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 3924|   633k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 3925|   633k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 3926|   633k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 3927|   633k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 3928|   633k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 3929|       |
 3930|       |
 3931|   633k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 3932|   633k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 3933|   633k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 3934|   633k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 3935|   633k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 3936|   633k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 3937|   633k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 3938|   633k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 3939|       |
 3940|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 3941|   633k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 3942|   633k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 3943|   633k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 3944|   633k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 3945|   633k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 3946|   633k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 3947|   633k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 3948|   633k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 3949|       |
 3950|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 3951|   633k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 3952|   633k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 3953|   633k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 3954|   633k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 3955|   633k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 3956|   633k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 3957|   633k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 3958|   633k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 3959|       |
 3960|       |                /* converting 16 bit to 8 bit */
 3961|   633k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 3962|   633k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 3963|   633k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 3964|   633k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 3965|       |
 3966|       |                /* loading 8-bit 8 pixels values */
 3967|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (4) * dst_strd), src_values0);   /* row=4*/
 3968|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (5) * dst_strd), src_values1);   /* row=5*/
 3969|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (6) * dst_strd), src_values2);   /* row=6*/
 3970|   633k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (7) * dst_strd), src_values3);   /* row=7*/
 3971|       |
 3972|   633k|            }
 3973|   316k|            pu1_dst += 8 * dst_strd;
 3974|   316k|        }
 3975|       |
 3976|  79.4k|    }
 3977|   112k|    else if(nt == 16) /* for nt = 16 case */
  ------------------
  |  Branch (3977:13): [True: 40.7k, False: 72.2k]
  ------------------
 3978|  40.7k|    {
 3979|       |
 3980|  40.7k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 3981|  40.7k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 3982|  40.7k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 3983|  40.7k|        __m128i src_values0, src_values1, src_values2, src_values3;
 3984|  40.7k|        __m128i  src_values4, src_values5, src_values6, src_values7;
 3985|       |
 3986|       |
 3987|       |        /* Intermediate reference samples for negative angle modes */
 3988|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 3989|  40.7k|        ref_temp[two_nt - 1] = pu1_ref[two_nt + nt];
 3990|  40.7k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt));
 3991|       |
 3992|  40.7k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + two_nt - nt)); /*nt-(nt+15)*/
 3993|       |
 3994|  40.7k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19] + 16));
 3995|       |
 3996|  40.7k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 3997|       |
 3998|  40.7k|        _mm_storeu_si128((__m128i *)(ref_main - nt), src_values0);
 3999|  40.7k|        _mm_storeu_si128((__m128i *)(ref_temp + nt - 1), temp1);
 4000|       |
 4001|  40.7k|        const_temp2_4x32b = _mm_set1_epi16(31);
 4002|  40.7k|        const_temp3_4x32b = _mm_set1_epi16(32);
 4003|  40.7k|        const_temp8_4x32b = _mm_set1_epi16(8);
 4004|       |
 4005|  40.7k|        two_nt_4x32b = _mm_set1_epi16(1);
 4006|       |
 4007|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4008|  40.7k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 4009|       |
 4010|  40.7k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 4011|       |
 4012|   122k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (4012:22): [True: 81.5k, False: 40.7k]
  ------------------
 4013|  81.5k|        {
 4014|       |
 4015|  81.5k|            WORD16 ref_main_idx[9];
 4016|       |
 4017|  81.5k|            __m128i res_temp5_4x32b;
 4018|  81.5k|            __m128i fract1_8x16b, fract2_8x16b;
 4019|       |
 4020|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4021|  81.5k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4022|       |
 4023|       |            /* fract = pos & (31); */
 4024|  81.5k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 4025|       |
 4026|       |            /* idx = pos >> 5; */
 4027|  81.5k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4028|       |
 4029|       |            /*(32 - fract) */
 4030|  81.5k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 4031|       |
 4032|  81.5k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4033|  81.5k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4034|       |
 4035|  81.5k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4036|  81.5k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4037|       |
 4038|  81.5k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4039|  81.5k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4040|       |
 4041|  81.5k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4042|  81.5k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 4043|  81.5k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4044|  81.5k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 4045|       |
 4046|  81.5k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4047|  81.5k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 4048|  81.5k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4049|  81.5k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 4050|       |
 4051|  81.5k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 4052|  81.5k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 4053|       |
 4054|  81.5k|            {
 4055|  81.5k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0]));
 4056|  81.5k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1]));
 4057|  81.5k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2]));
 4058|  81.5k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3]));
 4059|  81.5k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0] + 8));
 4060|  81.5k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1] + 8));
 4061|  81.5k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2] + 8));
 4062|  81.5k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3] + 8));
 4063|       |
 4064|  81.5k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4065|  81.5k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4066|  81.5k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4067|  81.5k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4068|  81.5k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4069|  81.5k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4070|  81.5k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4071|  81.5k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4072|       |
 4073|       |
 4074|  81.5k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4075|  81.5k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4076|  81.5k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4077|  81.5k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4078|  81.5k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 4079|  81.5k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 4080|  81.5k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 4081|  81.5k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 4082|       |
 4083|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4084|  81.5k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4085|  81.5k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4086|  81.5k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4087|  81.5k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4088|  81.5k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4089|  81.5k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4090|  81.5k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4091|  81.5k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4092|       |
 4093|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4094|  81.5k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 4095|  81.5k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 4096|  81.5k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 4097|  81.5k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 4098|  81.5k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 4099|  81.5k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 4100|  81.5k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 4101|  81.5k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 4102|       |
 4103|       |                /* converting 16 bit to 8 bit */
 4104|  81.5k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 4105|  81.5k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 4106|  81.5k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 4107|  81.5k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 4108|       |
 4109|       |                /* loading 8-bit 8 pixels values */
 4110|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (0) * dst_strd), src_values0);       /* row=0*/
 4111|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (1) * dst_strd), src_values1);   /* row=1*/
 4112|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (2) * dst_strd), src_values2);   /* row=2*/
 4113|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (3) * dst_strd), src_values3);   /* row=3*/
 4114|       |
 4115|       |
 4116|  81.5k|                src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4]));
 4117|  81.5k|                src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5]));
 4118|  81.5k|                src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6]));
 4119|  81.5k|                src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7]));
 4120|  81.5k|                src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4] + 8));
 4121|  81.5k|                src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5] + 8));
 4122|  81.5k|                src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6] + 8));
 4123|  81.5k|                src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7] + 8));
 4124|       |
 4125|  81.5k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4126|  81.5k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4127|  81.5k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4128|  81.5k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4129|  81.5k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4130|  81.5k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4131|  81.5k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4132|  81.5k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4133|       |
 4134|       |
 4135|  81.5k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 4136|  81.5k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 4137|  81.5k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 4138|  81.5k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 4139|  81.5k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 4140|  81.5k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 4141|  81.5k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 4142|  81.5k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 4143|       |
 4144|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4145|  81.5k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4146|  81.5k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4147|  81.5k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4148|  81.5k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4149|  81.5k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4150|  81.5k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4151|  81.5k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4152|  81.5k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4153|       |
 4154|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4155|  81.5k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 4156|  81.5k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 4157|  81.5k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 4158|  81.5k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 4159|  81.5k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 4160|  81.5k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 4161|  81.5k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 4162|  81.5k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 4163|       |
 4164|       |                /* converting 16 bit to 8 bit */
 4165|  81.5k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 4166|  81.5k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 4167|  81.5k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 4168|  81.5k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 4169|       |
 4170|       |                /* loading 8-bit 8 pixels values */
 4171|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (4) * dst_strd), src_values0);   /* row=4*/
 4172|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (5) * dst_strd), src_values1);   /* row=5*/
 4173|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (6) * dst_strd), src_values2);   /* row=6*/
 4174|  81.5k|                _mm_storeu_si128((__m128i *)(pu1_dst + (7) * dst_strd), src_values3);   /* row=7*/
 4175|       |
 4176|  81.5k|            }
 4177|  81.5k|            pu1_dst += 8 * dst_strd;
 4178|  81.5k|        }
 4179|  40.7k|    }
 4180|  72.2k|    else if(nt == 8)
  ------------------
  |  Branch (4180:13): [True: 36.0k, False: 36.2k]
  ------------------
 4181|  36.0k|    {
 4182|       |
 4183|       |
 4184|  36.0k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 4185|  36.0k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 4186|       |
 4187|  36.0k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 4188|  36.0k|        __m128i src_values0, src_values1, src_values2, src_values3;
 4189|  36.0k|        __m128i  src_values4, src_values5, src_values6, src_values7;
 4190|       |
 4191|       |
 4192|       |        /* Intermediate reference samples for negative angle modes */
 4193|       |        /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 4194|  36.0k|        ref_temp[two_nt - 1] = pu1_ref[two_nt + nt];
 4195|  36.0k|        temp1 = _mm_loadl_epi64((__m128i *)(pu1_ref + two_nt));
 4196|       |
 4197|       |        /* For negative angled derive the main reference samples from side */
 4198|       |
 4199|  36.0k|        src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref)); /*nt-(nt+15)*/
 4200|       |
 4201|  36.0k|        temp11 = _mm_loadu_si128((__m128i *)(inv_angle_shuffle[mode - 19] + 16));
 4202|       |
 4203|  36.0k|        src_values0 = _mm_shuffle_epi8(src_values0, temp11);
 4204|  36.0k|        src_values0 = _mm_srli_si128(src_values0, 8);
 4205|  36.0k|        _mm_storel_epi64((__m128i *)(ref_temp + nt - 1), temp1);
 4206|  36.0k|        _mm_storel_epi64((__m128i *)(ref_main - nt), src_values0);
 4207|       |
 4208|       |
 4209|       |
 4210|  36.0k|        const_temp2_4x32b = _mm_set1_epi16(31);
 4211|  36.0k|        const_temp3_4x32b = _mm_set1_epi16(32);
 4212|       |
 4213|       |
 4214|  36.0k|        two_nt_4x32b = _mm_set1_epi16(1);
 4215|       |
 4216|       |
 4217|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4218|  36.0k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 4219|       |
 4220|  36.0k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 4221|       |
 4222|  36.0k|        {
 4223|       |
 4224|  36.0k|            WORD16 ref_main_idx[9];
 4225|       |
 4226|  36.0k|            __m128i res_temp5_4x32b;
 4227|  36.0k|            __m128i fract1_8x16b, fract2_8x16b;
 4228|       |
 4229|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4230|  36.0k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4231|       |
 4232|       |            /* fract = pos & (31); */
 4233|  36.0k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 4234|       |
 4235|       |            /* idx = pos >> 5; */
 4236|  36.0k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4237|       |
 4238|       |            /*(32 - fract) */
 4239|  36.0k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 4240|       |
 4241|  36.0k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4242|  36.0k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4243|       |
 4244|  36.0k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4245|  36.0k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4246|       |
 4247|  36.0k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4248|  36.0k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4249|       |
 4250|  36.0k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4251|  36.0k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 4252|  36.0k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4253|  36.0k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 4254|       |
 4255|  36.0k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4256|  36.0k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 4257|  36.0k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4258|  36.0k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 4259|       |
 4260|  36.0k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 4261|       |
 4262|  36.0k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[0]));  /* col = 0-7   */
 4263|  36.0k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[1]));  /* col = 8-15  */
 4264|  36.0k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[2]));  /* col = 16-23 */
 4265|  36.0k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[3]));  /* col = 24-31 */
 4266|  36.0k|            src_values4 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[4]));  /* col = 32-39   */
 4267|  36.0k|            src_values5 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[5]));  /* col = 40-47  */
 4268|  36.0k|            src_values6 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[6]));  /* col = 48-55 */
 4269|  36.0k|            src_values7 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx[7]));  /* col = 56-63*/
 4270|       |
 4271|  36.0k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4272|  36.0k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4273|  36.0k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4274|  36.0k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4275|  36.0k|            src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4276|  36.0k|            src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4277|  36.0k|            src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4278|  36.0k|            src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4279|       |
 4280|       |
 4281|  36.0k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4282|  36.0k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4283|  36.0k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4284|  36.0k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4285|  36.0k|            src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 4286|  36.0k|            src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 4287|  36.0k|            src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 4288|  36.0k|            src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 4289|       |
 4290|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4291|  36.0k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4292|  36.0k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4293|  36.0k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4294|  36.0k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4295|  36.0k|            src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4296|  36.0k|            src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4297|  36.0k|            src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4298|  36.0k|            src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4299|       |
 4300|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4301|  36.0k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 4302|  36.0k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 4303|  36.0k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 4304|  36.0k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 4305|  36.0k|            src_values4 = _mm_srai_epi16(src_values4,  5);
 4306|  36.0k|            src_values5 = _mm_srai_epi16(src_values5,  5);
 4307|  36.0k|            src_values6 = _mm_srai_epi16(src_values6,  5);
 4308|  36.0k|            src_values7 = _mm_srai_epi16(src_values7,  5);
 4309|       |
 4310|       |            /* converting 16 bit to 8 bit */
 4311|  36.0k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 4312|  36.0k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 4313|  36.0k|            src_values1 = _mm_srli_si128(src_values0, 8);
 4314|  36.0k|            src_values3 = _mm_srli_si128(src_values2, 8);
 4315|  36.0k|            src_values4 = _mm_packus_epi16(src_values4, src_values5);
 4316|  36.0k|            src_values6 = _mm_packus_epi16(src_values6, src_values7);
 4317|  36.0k|            src_values5 = _mm_srli_si128(src_values4, 8);
 4318|  36.0k|            src_values7 = _mm_srli_si128(src_values6, 8);
 4319|       |
 4320|       |            /* loading 8-bit 8 pixels values */
 4321|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_values0);       /* row=0*/
 4322|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_values1);   /* row=1*/
 4323|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_values2);   /* row=2*/
 4324|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_values3);   /* row=3*/
 4325|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), src_values4);   /* row=4*/
 4326|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), src_values5);   /* row=5*/
 4327|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), src_values6);   /* row=6*/
 4328|  36.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), src_values7);   /* row=7*/
 4329|  36.0k|        }
 4330|  36.0k|    }
 4331|  36.2k|    else /* if nt =4*/
 4332|  36.2k|    {
 4333|       |
 4334|  36.2k|        __m128i const_temp2_4x32b, const_temp3_4x32b, zero_8x16b;
 4335|  36.2k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b, sign_8x16b;
 4336|       |
 4337|  36.2k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 4338|       |
 4339|       |
 4340|   218k|        for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (4340:20): [True: 182k, False: 36.2k]
  ------------------
 4341|   182k|            ref_temp[k + nt - 1] = pu1_ref[two_nt + k];
 4342|  36.2k|        ref_idx = (nt * intra_pred_ang) >> 5;
 4343|  36.2k|        inv_ang_sum = 128;
 4344|       |
 4345|  86.6k|        for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (4345:21): [True: 50.3k, False: 36.2k]
  ------------------
 4346|  50.3k|        {
 4347|  50.3k|            inv_ang_sum += inv_ang;
 4348|  50.3k|            ref_main[k] = pu1_ref[two_nt - (inv_ang_sum >> 8)];
 4349|  50.3k|        }
 4350|       |
 4351|       |
 4352|  36.2k|        const_temp2_4x32b = _mm_set1_epi32(31);
 4353|  36.2k|        const_temp3_4x32b = _mm_set1_epi32(32);
 4354|  36.2k|        zero_8x16b = _mm_setzero_si128();
 4355|  36.2k|        two_nt_4x32b = _mm_set1_epi32(1);
 4356|       |
 4357|       |
 4358|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4359|  36.2k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 4360|  36.2k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 4361|       |
 4362|  36.2k|        {
 4363|  36.2k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 4364|  36.2k|            int temp11, temp21, temp31, temp41;
 4365|       |
 4366|       |
 4367|  36.2k|            __m128i fract1_8x16b, fract2_8x16b,  res_temp5_4x32b;
 4368|  36.2k|            __m128i src_values0, src_values1, src_values2, src_values3;
 4369|  36.2k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 4370|       |
 4371|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4372|  36.2k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4373|  36.2k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 4374|  36.2k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 4375|       |
 4376|       |            /* fract = pos & (31); */
 4377|  36.2k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 4378|       |
 4379|  36.2k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 4380|  36.2k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 4381|  36.2k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 4382|  36.2k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 4383|  36.2k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 4384|  36.2k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 4385|  36.2k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 4386|       |
 4387|       |            /* idx = pos >> 5; */
 4388|  36.2k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4389|       |
 4390|       |            /*(32 - fract) */
 4391|  36.2k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 4392|       |
 4393|  36.2k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4394|  36.2k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4395|       |
 4396|  36.2k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4397|  36.2k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4398|       |
 4399|  36.2k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4400|  36.2k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4401|       |
 4402|  36.2k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4403|  36.2k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4404|  36.2k|            temp3 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4405|  36.2k|            temp4 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4406|       |
 4407|  36.2k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));     /* col = 0-7   */
 4408|  36.2k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2));   /* col = 8-15  */
 4409|  36.2k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3));  /* col = 16-23 */
 4410|  36.2k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4));  /* col = 24-31 */
 4411|       |
 4412|  36.2k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4413|  36.2k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4414|  36.2k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4415|  36.2k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4416|       |
 4417|       |
 4418|  36.2k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4419|  36.2k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4420|  36.2k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4421|  36.2k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4422|       |
 4423|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4424|  36.2k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4425|  36.2k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4426|  36.2k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4427|  36.2k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4428|       |
 4429|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4430|  36.2k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 4431|  36.2k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 4432|  36.2k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 4433|  36.2k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 4434|       |
 4435|       |            /* converting 16 bit to 8 bit */
 4436|  36.2k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 4437|  36.2k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 4438|  36.2k|            src_values1 = _mm_srli_si128(src_values0, 8);
 4439|  36.2k|            src_values3 = _mm_srli_si128(src_values2, 8);
 4440|       |
 4441|  36.2k|            temp11 = _mm_cvtsi128_si32(src_values0);
 4442|  36.2k|            temp21 = _mm_cvtsi128_si32(src_values1);
 4443|  36.2k|            temp31 = _mm_cvtsi128_si32(src_values2);
 4444|  36.2k|            temp41 = _mm_cvtsi128_si32(src_values3);
 4445|       |
 4446|       |            /* loding 4-bit 8 pixels values */
 4447|  36.2k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 4448|  36.2k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 4449|  36.2k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 4450|  36.2k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 4451|       |
 4452|  36.2k|        }
 4453|  36.2k|    }
 4454|   192k|}
ihevc_intra_pred_luma_mode_27_to_33_ssse3:
 4503|   275k|{
 4504|   275k|    WORD32 row;
 4505|   275k|    WORD32 two_nt;
 4506|   275k|    WORD32 intra_pred_ang;
 4507|       |
 4508|   275k|    __m128i temp11, temp12, temp13, temp14;
 4509|       |
 4510|   275k|    __m128i     const_temp_8x16b;
 4511|   275k|    __m128i temp1, temp2, temp3, temp4, sm3;
 4512|   275k|    UNUSED(src_strd);
  ------------------
  |  |   38|   275k|#define UNUSED(x) ((void)(x))
  ------------------
 4513|   275k|    two_nt = 2 * nt;
 4514|   275k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 4515|       |
 4516|   275k|    const_temp_8x16b = _mm_set1_epi16(16);
 4517|   275k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY11[0]);
 4518|   275k|    if(nt == 32)
  ------------------
  |  Branch (4518:8): [True: 93.3k, False: 182k]
  ------------------
 4519|  93.3k|    {
 4520|       |
 4521|  93.3k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 4522|  93.3k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 4523|  93.3k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 4524|  93.3k|        int col = 0;
 4525|       |
 4526|  93.3k|        const_temp2_4x32b = _mm_set1_epi16(31);
 4527|  93.3k|        const_temp3_4x32b = _mm_set1_epi16(32);
 4528|  93.3k|        const_temp8_4x32b = _mm_set1_epi16(8);
 4529|       |
 4530|  93.3k|        two_nt_4x32b = _mm_set1_epi16(two_nt + 1);
 4531|       |
 4532|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4533|  93.3k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 4534|       |
 4535|  93.3k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 4536|       |
 4537|   465k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (4537:22): [True: 372k, False: 93.3k]
  ------------------
 4538|   372k|        {
 4539|       |
 4540|   372k|            WORD16 ref_main_idx[9];
 4541|       |
 4542|   372k|            __m128i res_temp5_4x32b;
 4543|   372k|            __m128i fract1_8x16b, fract2_8x16b;
 4544|   372k|            __m128i src_values0, src_values1, src_values2, src_values3;
 4545|   372k|            __m128i  src_values4, src_values5, src_values6, src_values7;
 4546|       |
 4547|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4548|   372k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4549|       |
 4550|       |            /* fract = pos & (31); */
 4551|   372k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 4552|       |
 4553|       |            /* idx = pos >> 5; */
 4554|   372k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4555|       |
 4556|       |            /*(32 - fract) */
 4557|   372k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 4558|       |
 4559|   372k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4560|   372k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4561|       |
 4562|   372k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4563|   372k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4564|       |
 4565|   372k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4566|   372k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4567|       |
 4568|   372k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4569|   372k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 4570|   372k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4571|   372k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 4572|       |
 4573|   372k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4574|   372k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 4575|   372k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4576|   372k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 4577|       |
 4578|   372k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 4579|   372k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 4580|  1.11M|            for(col = 0; col < nt; col += 16)
  ------------------
  |  Branch (4580:26): [True: 744k, False: 372k]
  ------------------
 4581|   744k|            {
 4582|   744k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0] + col));
 4583|   744k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1] + col));
 4584|   744k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2] + col));
 4585|   744k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3] + col));
 4586|   744k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0] + 8 + col));
 4587|   744k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1] + 8 + col));
 4588|   744k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2] + 8 + col));
 4589|   744k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3] + 8 + col));
 4590|       |
 4591|   744k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4592|   744k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4593|   744k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4594|   744k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4595|   744k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4596|   744k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4597|   744k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4598|   744k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4599|       |
 4600|       |
 4601|   744k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4602|   744k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4603|   744k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4604|   744k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4605|   744k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 4606|   744k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 4607|   744k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 4608|   744k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 4609|       |
 4610|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4611|   744k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4612|   744k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4613|   744k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4614|   744k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4615|   744k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4616|   744k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4617|   744k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4618|   744k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4619|       |
 4620|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4621|   744k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 4622|   744k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 4623|   744k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 4624|   744k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 4625|   744k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 4626|   744k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 4627|   744k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 4628|   744k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 4629|       |
 4630|       |                /* converting 16 bit to 8 bit */
 4631|   744k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 4632|   744k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 4633|   744k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 4634|   744k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 4635|       |
 4636|       |                /* loading 8-bit 8 pixels values */
 4637|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (0) * dst_strd), src_values0);       /* row=0*/
 4638|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (1) * dst_strd), src_values1);   /* row=1*/
 4639|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (2) * dst_strd), src_values2);   /* row=2*/
 4640|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (3) * dst_strd), src_values3);   /* row=3*/
 4641|       |
 4642|       |
 4643|   744k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4] + col));
 4644|   744k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5] + col));
 4645|   744k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6] + col));
 4646|   744k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7] + col));
 4647|   744k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4] + 8 + col));
 4648|   744k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5] + 8 + col));
 4649|   744k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6] + 8 + col));
 4650|   744k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7] + 8 + col));
 4651|       |
 4652|   744k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4653|   744k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4654|   744k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4655|   744k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4656|   744k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4657|   744k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4658|   744k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4659|   744k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4660|       |
 4661|       |
 4662|   744k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 4663|   744k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 4664|   744k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 4665|   744k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 4666|   744k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 4667|   744k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 4668|   744k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 4669|   744k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 4670|       |
 4671|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4672|   744k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4673|   744k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4674|   744k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4675|   744k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4676|   744k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4677|   744k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4678|   744k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4679|   744k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4680|       |
 4681|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4682|   744k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 4683|   744k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 4684|   744k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 4685|   744k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 4686|   744k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 4687|   744k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 4688|   744k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 4689|   744k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 4690|       |
 4691|       |                /* converting 16 bit to 8 bit */
 4692|   744k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 4693|   744k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 4694|   744k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 4695|   744k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 4696|       |
 4697|       |                /* loading 8-bit 8 pixels values */
 4698|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (4) * dst_strd), src_values0);   /* row=4*/
 4699|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (5) * dst_strd), src_values1);   /* row=5*/
 4700|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (6) * dst_strd), src_values2);   /* row=6*/
 4701|   744k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (7) * dst_strd), src_values3);   /* row=7*/
 4702|       |
 4703|   744k|            }
 4704|   372k|            pu1_dst += 8 * dst_strd;
 4705|   372k|        }
 4706|       |
 4707|  93.3k|    }
 4708|   182k|    else if(nt == 16) /* for nt = 16 case */
  ------------------
  |  Branch (4708:13): [True: 40.6k, False: 141k]
  ------------------
 4709|  40.6k|    {
 4710|       |
 4711|  40.6k|        __m128i const_temp2_4x32b, const_temp3_4x32b, const_temp8_4x32b;
 4712|  40.6k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 4713|  40.6k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 4714|       |
 4715|       |
 4716|  40.6k|        const_temp2_4x32b = _mm_set1_epi16(31);
 4717|  40.6k|        const_temp3_4x32b = _mm_set1_epi16(32);
 4718|  40.6k|        const_temp8_4x32b = _mm_set1_epi16(8);
 4719|       |
 4720|  40.6k|        two_nt_4x32b = _mm_set1_epi16(two_nt + 1);
 4721|       |
 4722|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4723|  40.6k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 4724|       |
 4725|  40.6k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 4726|       |
 4727|   121k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (4727:22): [True: 81.2k, False: 40.6k]
  ------------------
 4728|  81.2k|        {
 4729|       |
 4730|  81.2k|            WORD16 ref_main_idx[9];
 4731|       |
 4732|  81.2k|            __m128i res_temp5_4x32b;
 4733|  81.2k|            __m128i fract1_8x16b, fract2_8x16b;
 4734|  81.2k|            __m128i src_values0, src_values1, src_values2, src_values3;
 4735|  81.2k|            __m128i  src_values4, src_values5, src_values6, src_values7;
 4736|       |
 4737|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4738|  81.2k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4739|       |
 4740|       |            /* fract = pos & (31); */
 4741|  81.2k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 4742|       |
 4743|       |            /* idx = pos >> 5; */
 4744|  81.2k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4745|       |
 4746|       |            /*(32 - fract) */
 4747|  81.2k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 4748|       |
 4749|  81.2k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4750|  81.2k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4751|       |
 4752|  81.2k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4753|  81.2k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4754|       |
 4755|  81.2k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4756|  81.2k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4757|       |
 4758|  81.2k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4759|  81.2k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 4760|  81.2k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4761|  81.2k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 4762|       |
 4763|  81.2k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4764|  81.2k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 4765|  81.2k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4766|  81.2k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 4767|       |
 4768|  81.2k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp8_4x32b);
 4769|  81.2k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 4770|       |
 4771|  81.2k|            {
 4772|  81.2k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0]));
 4773|  81.2k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1]));
 4774|  81.2k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2]));
 4775|  81.2k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3]));
 4776|  81.2k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0] + 8));
 4777|  81.2k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1] + 8));
 4778|  81.2k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2] + 8));
 4779|  81.2k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3] + 8));
 4780|       |
 4781|  81.2k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4782|  81.2k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4783|  81.2k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4784|  81.2k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4785|  81.2k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4786|  81.2k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4787|  81.2k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4788|  81.2k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4789|       |
 4790|       |
 4791|  81.2k|                src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4792|  81.2k|                src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4793|  81.2k|                src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4794|  81.2k|                src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4795|  81.2k|                src_values4 = _mm_maddubs_epi16(src_values4, temp1);
 4796|  81.2k|                src_values5 = _mm_maddubs_epi16(src_values5, temp2);
 4797|  81.2k|                src_values6 = _mm_maddubs_epi16(src_values6, temp3);
 4798|  81.2k|                src_values7 = _mm_maddubs_epi16(src_values7, temp4);
 4799|       |
 4800|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4801|  81.2k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4802|  81.2k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4803|  81.2k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4804|  81.2k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4805|  81.2k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4806|  81.2k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4807|  81.2k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4808|  81.2k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4809|       |
 4810|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4811|  81.2k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 4812|  81.2k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 4813|  81.2k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 4814|  81.2k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 4815|  81.2k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 4816|  81.2k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 4817|  81.2k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 4818|  81.2k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 4819|       |
 4820|       |                /* converting 16 bit to 8 bit */
 4821|  81.2k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 4822|  81.2k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 4823|  81.2k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 4824|  81.2k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 4825|       |
 4826|       |                /* loading 8-bit 8 pixels values */
 4827|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (0) * dst_strd), src_values0);       /* row=0*/
 4828|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (1) * dst_strd), src_values1);   /* row=1*/
 4829|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (2) * dst_strd), src_values2);   /* row=2*/
 4830|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (3) * dst_strd), src_values3);   /* row=3*/
 4831|       |
 4832|       |
 4833|  81.2k|                src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4]));
 4834|  81.2k|                src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5]));
 4835|  81.2k|                src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6]));
 4836|  81.2k|                src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7]));
 4837|  81.2k|                src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4] + 8));
 4838|  81.2k|                src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5] + 8));
 4839|  81.2k|                src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6] + 8));
 4840|  81.2k|                src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7] + 8));
 4841|       |
 4842|  81.2k|                src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4843|  81.2k|                src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4844|  81.2k|                src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4845|  81.2k|                src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4846|  81.2k|                src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4847|  81.2k|                src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4848|  81.2k|                src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4849|  81.2k|                src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4850|       |
 4851|       |
 4852|  81.2k|                src_values0 = _mm_maddubs_epi16(src_values0, temp11);
 4853|  81.2k|                src_values1 = _mm_maddubs_epi16(src_values1, temp12);
 4854|  81.2k|                src_values2 = _mm_maddubs_epi16(src_values2, temp13);
 4855|  81.2k|                src_values3 = _mm_maddubs_epi16(src_values3, temp14);
 4856|  81.2k|                src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 4857|  81.2k|                src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 4858|  81.2k|                src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 4859|  81.2k|                src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 4860|       |
 4861|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4862|  81.2k|                src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4863|  81.2k|                src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4864|  81.2k|                src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4865|  81.2k|                src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4866|  81.2k|                src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4867|  81.2k|                src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4868|  81.2k|                src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4869|  81.2k|                src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4870|       |
 4871|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4872|  81.2k|                src_values0 = _mm_srai_epi16(src_values0,  5);
 4873|  81.2k|                src_values1 = _mm_srai_epi16(src_values1,  5);
 4874|  81.2k|                src_values2 = _mm_srai_epi16(src_values2,  5);
 4875|  81.2k|                src_values3 = _mm_srai_epi16(src_values3,  5);
 4876|  81.2k|                src_values4 = _mm_srai_epi16(src_values4,  5);
 4877|  81.2k|                src_values5 = _mm_srai_epi16(src_values5,  5);
 4878|  81.2k|                src_values6 = _mm_srai_epi16(src_values6,  5);
 4879|  81.2k|                src_values7 = _mm_srai_epi16(src_values7,  5);
 4880|       |
 4881|       |                /* converting 16 bit to 8 bit */
 4882|  81.2k|                src_values0 = _mm_packus_epi16(src_values0, src_values4);
 4883|  81.2k|                src_values1 = _mm_packus_epi16(src_values1, src_values5);
 4884|  81.2k|                src_values2 = _mm_packus_epi16(src_values2, src_values6);
 4885|  81.2k|                src_values3 = _mm_packus_epi16(src_values3, src_values7);
 4886|       |
 4887|       |                /* loading 8-bit 8 pixels values */
 4888|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (4) * dst_strd), src_values0);   /* row=4*/
 4889|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (5) * dst_strd), src_values1);   /* row=5*/
 4890|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (6) * dst_strd), src_values2);   /* row=6*/
 4891|  81.2k|                _mm_storeu_si128((__m128i *)(pu1_dst + (7) * dst_strd), src_values3);   /* row=7*/
 4892|       |
 4893|  81.2k|            }
 4894|  81.2k|            pu1_dst += 8 * dst_strd;
 4895|  81.2k|        }
 4896|       |
 4897|  40.6k|    }
 4898|   141k|    else if(nt == 8)
  ------------------
  |  Branch (4898:13): [True: 49.3k, False: 92.6k]
  ------------------
 4899|  49.3k|    {
 4900|       |
 4901|  49.3k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 4902|  49.3k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 4903|  49.3k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 4904|       |
 4905|       |
 4906|  49.3k|        const_temp2_4x32b = _mm_set1_epi16(31);
 4907|  49.3k|        const_temp3_4x32b = _mm_set1_epi16(32);
 4908|       |
 4909|  49.3k|        two_nt_4x32b = _mm_set1_epi16(two_nt + 1);
 4910|       |
 4911|       |
 4912|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 4913|  49.3k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 4914|       |
 4915|  49.3k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 4916|       |
 4917|       |        //for(row = 0; row < nt; row +=4)
 4918|  49.3k|        {
 4919|       |
 4920|  49.3k|            WORD16 ref_main_idx[9];
 4921|       |
 4922|  49.3k|            __m128i res_temp5_4x32b;
 4923|  49.3k|            __m128i fract1_8x16b, fract2_8x16b;
 4924|  49.3k|            __m128i src_values0, src_values1, src_values2, src_values3;
 4925|  49.3k|            __m128i  src_values4, src_values5, src_values6, src_values7;
 4926|       |
 4927|       |            /* pos = ((row + 1) * intra_pred_ang); */
 4928|  49.3k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 4929|       |
 4930|       |            /* fract = pos & (31); */
 4931|  49.3k|            src_values12 = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 4932|       |
 4933|       |            /* idx = pos >> 5; */
 4934|  49.3k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 4935|       |
 4936|       |            /*(32 - fract) */
 4937|  49.3k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, src_values11);
 4938|       |
 4939|  49.3k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 4940|  49.3k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 4941|       |
 4942|  49.3k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 4943|  49.3k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 4944|       |
 4945|  49.3k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 4946|  49.3k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 4947|       |
 4948|  49.3k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 4949|  49.3k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0x55);
 4950|  49.3k|            temp3 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 4951|  49.3k|            temp4 =  _mm_shuffle_epi32(fract1_8x16b, 0xff);
 4952|       |
 4953|  49.3k|            temp11 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 4954|  49.3k|            temp12 =  _mm_shuffle_epi32(fract2_8x16b, 0x55);
 4955|  49.3k|            temp13 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 4956|  49.3k|            temp14 =  _mm_shuffle_epi32(fract2_8x16b, 0xff);
 4957|       |
 4958|  49.3k|            _mm_storeu_si128((__m128i *)ref_main_idx, src_values12);
 4959|       |
 4960|  49.3k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[0]));  /* col = 0-7   */
 4961|  49.3k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[1]));  /* col = 8-15  */
 4962|  49.3k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[2]));  /* col = 16-23 */
 4963|  49.3k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[3]));  /* col = 24-31 */
 4964|  49.3k|            src_values4 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[4]));  /* col = 32-39   */
 4965|  49.3k|            src_values5 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[5]));  /* col = 40-47  */
 4966|  49.3k|            src_values6 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[6]));  /* col = 48-55 */
 4967|  49.3k|            src_values7 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx[7]));  /* col = 56-63*/
 4968|       |
 4969|  49.3k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 4970|  49.3k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 4971|  49.3k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 4972|  49.3k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 4973|  49.3k|            src_values4 =  _mm_shuffle_epi8(src_values4, sm3);
 4974|  49.3k|            src_values5 =  _mm_shuffle_epi8(src_values5, sm3);
 4975|  49.3k|            src_values6 =  _mm_shuffle_epi8(src_values6, sm3);
 4976|  49.3k|            src_values7 =  _mm_shuffle_epi8(src_values7, sm3);
 4977|       |
 4978|       |
 4979|  49.3k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 4980|  49.3k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 4981|  49.3k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 4982|  49.3k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 4983|  49.3k|            src_values4 = _mm_maddubs_epi16(src_values4, temp11);
 4984|  49.3k|            src_values5 = _mm_maddubs_epi16(src_values5, temp12);
 4985|  49.3k|            src_values6 = _mm_maddubs_epi16(src_values6, temp13);
 4986|  49.3k|            src_values7 = _mm_maddubs_epi16(src_values7, temp14);
 4987|       |
 4988|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 4989|  49.3k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 4990|  49.3k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 4991|  49.3k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 4992|  49.3k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 4993|  49.3k|            src_values4 = _mm_add_epi16(src_values4, const_temp_8x16b);
 4994|  49.3k|            src_values5 = _mm_add_epi16(src_values5, const_temp_8x16b);
 4995|  49.3k|            src_values6 = _mm_add_epi16(src_values6, const_temp_8x16b);
 4996|  49.3k|            src_values7 = _mm_add_epi16(src_values7, const_temp_8x16b);
 4997|       |
 4998|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 4999|  49.3k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 5000|  49.3k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 5001|  49.3k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 5002|  49.3k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 5003|  49.3k|            src_values4 = _mm_srai_epi16(src_values4,  5);
 5004|  49.3k|            src_values5 = _mm_srai_epi16(src_values5,  5);
 5005|  49.3k|            src_values6 = _mm_srai_epi16(src_values6,  5);
 5006|  49.3k|            src_values7 = _mm_srai_epi16(src_values7,  5);
 5007|       |
 5008|       |            /* converting 16 bit to 8 bit */
 5009|  49.3k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 5010|  49.3k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 5011|  49.3k|            src_values1 = _mm_srli_si128(src_values0, 8);
 5012|  49.3k|            src_values3 = _mm_srli_si128(src_values2, 8);
 5013|  49.3k|            src_values4 = _mm_packus_epi16(src_values4, src_values5);
 5014|  49.3k|            src_values6 = _mm_packus_epi16(src_values6, src_values7);
 5015|  49.3k|            src_values5 = _mm_srli_si128(src_values4, 8);
 5016|  49.3k|            src_values7 = _mm_srli_si128(src_values6, 8);
 5017|       |
 5018|       |            /* loading 8-bit 8 pixels values */
 5019|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_values0);       /* row=0*/
 5020|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_values1);   /* row=1*/
 5021|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_values2);   /* row=2*/
 5022|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_values3);   /* row=3*/
 5023|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), src_values4);   /* row=4*/
 5024|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), src_values5);   /* row=5*/
 5025|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), src_values6);   /* row=6*/
 5026|  49.3k|            _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), src_values7);   /* row=7*/
 5027|  49.3k|        }
 5028|       |
 5029|  49.3k|    }
 5030|  92.6k|    else /* if nt =4*/
 5031|  92.6k|    {
 5032|       |
 5033|  92.6k|        __m128i const_temp2_4x32b, const_temp3_4x32b, zero_8x16b;
 5034|  92.6k|        __m128i src_values10, src_values11, intra_pred_ang_4x32b;
 5035|       |
 5036|  92.6k|        __m128i row_4x32b, two_nt_4x32b, src_values12, sign_8x16b;
 5037|       |
 5038|       |
 5039|  92.6k|        const_temp2_4x32b = _mm_set1_epi32(31);
 5040|  92.6k|        const_temp3_4x32b = _mm_set1_epi32(32);
 5041|  92.6k|        zero_8x16b = _mm_setzero_si128();
 5042|  92.6k|        two_nt_4x32b = _mm_set1_epi32(two_nt + 1);
 5043|       |
 5044|       |
 5045|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 5046|  92.6k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 5047|  92.6k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 5048|  92.6k|        {
 5049|  92.6k|            int temp11, temp21, temp31, temp41;
 5050|       |
 5051|  92.6k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 5052|       |
 5053|  92.6k|            __m128i fract1_8x16b, fract2_8x16b, res_temp5_4x32b;
 5054|  92.6k|            __m128i src_values0, src_values1, src_values2, src_values3;
 5055|  92.6k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2;
 5056|       |
 5057|       |            /* pos = ((row + 1) * intra_pred_ang); */
 5058|  92.6k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 5059|  92.6k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 5060|  92.6k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 5061|       |
 5062|       |            /* fract = pos & (31); */
 5063|  92.6k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 5064|       |
 5065|  92.6k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 5066|  92.6k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 5067|  92.6k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 5068|  92.6k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 5069|  92.6k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 5070|  92.6k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 5071|  92.6k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 5072|       |
 5073|       |            /* idx = pos >> 5; */
 5074|  92.6k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 5075|       |
 5076|       |            /*(32 - fract) */
 5077|  92.6k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 5078|       |
 5079|  92.6k|            fract1_8x16b = _mm_slli_epi16(src_values11, 8);
 5080|  92.6k|            fract2_8x16b = _mm_slli_epi16(src_values10, 8);
 5081|       |
 5082|  92.6k|            src_values11 = _mm_or_si128(src_values11, fract1_8x16b);
 5083|  92.6k|            src_values10 = _mm_or_si128(src_values10, fract2_8x16b); /*(32 - fract) */
 5084|       |
 5085|  92.6k|            fract2_8x16b = _mm_unpackhi_epi8(src_values11, src_values10);
 5086|  92.6k|            fract1_8x16b = _mm_unpacklo_epi8(src_values11, src_values10);
 5087|       |
 5088|  92.6k|            temp1 =  _mm_shuffle_epi32(fract1_8x16b, 0x00);
 5089|  92.6k|            temp2 =  _mm_shuffle_epi32(fract1_8x16b, 0xaa);
 5090|  92.6k|            temp3 =  _mm_shuffle_epi32(fract2_8x16b, 0x00);
 5091|  92.6k|            temp4 =  _mm_shuffle_epi32(fract2_8x16b, 0xaa);
 5092|       |
 5093|  92.6k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));     /* col = 0-7   */
 5094|  92.6k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2));   /* col = 8-15  */
 5095|  92.6k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3));  /* col = 16-23 */
 5096|  92.6k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4));  /* col = 24-31 */
 5097|       |
 5098|  92.6k|            src_values0 =  _mm_shuffle_epi8(src_values0, sm3);
 5099|  92.6k|            src_values1 =  _mm_shuffle_epi8(src_values1, sm3);
 5100|  92.6k|            src_values2 =  _mm_shuffle_epi8(src_values2, sm3);
 5101|  92.6k|            src_values3 =  _mm_shuffle_epi8(src_values3, sm3);
 5102|       |
 5103|  92.6k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1);
 5104|  92.6k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2);
 5105|  92.6k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3);
 5106|  92.6k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4);
 5107|       |
 5108|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 5109|  92.6k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 5110|  92.6k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 5111|  92.6k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 5112|  92.6k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 5113|       |
 5114|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 5115|  92.6k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 5116|  92.6k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 5117|  92.6k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 5118|  92.6k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 5119|       |
 5120|       |            /* converting 16 bit to 8 bit */
 5121|  92.6k|            src_values0 = _mm_packus_epi16(src_values0, src_values1);
 5122|  92.6k|            src_values2 = _mm_packus_epi16(src_values2, src_values3);
 5123|  92.6k|            src_values1 = _mm_srli_si128(src_values0, 8);
 5124|  92.6k|            src_values3 = _mm_srli_si128(src_values2, 8);
 5125|       |
 5126|  92.6k|            temp11 = _mm_cvtsi128_si32(src_values0);
 5127|  92.6k|            temp21 = _mm_cvtsi128_si32(src_values1);
 5128|  92.6k|            temp31 = _mm_cvtsi128_si32(src_values2);
 5129|  92.6k|            temp41 = _mm_cvtsi128_si32(src_values3);
 5130|       |
 5131|       |            /* loding 4-bit 8 pixels values */
 5132|  92.6k|            *(WORD32 *)(&pu1_dst[(0 * dst_strd)]) = temp11;
 5133|  92.6k|            *(WORD32 *)(&pu1_dst[(1 * dst_strd)]) = temp21;
 5134|  92.6k|            *(WORD32 *)(&pu1_dst[(2 * dst_strd)]) = temp31;
 5135|  92.6k|            *(WORD32 *)(&pu1_dst[(3 * dst_strd)]) = temp41;
 5136|       |
 5137|  92.6k|        }
 5138|  92.6k|    }
 5139|   275k|}

ihevc_itrans_recon_16x16_ssse3:
  119|   207k|{
  120|   207k|    __m128i m_temp_reg_0;
  121|   207k|    __m128i m_temp_reg_1;
  122|   207k|    __m128i m_temp_reg_10;
  123|   207k|    __m128i m_temp_reg_11;
  124|   207k|    __m128i m_temp_reg_12;
  125|   207k|    __m128i m_temp_reg_13;
  126|   207k|    __m128i m_temp_reg_14;
  127|       |
  128|   207k|    __m128i m_temp_reg_20;
  129|   207k|    __m128i m_temp_reg_21;
  130|   207k|    __m128i m_temp_reg_22;
  131|   207k|    __m128i m_temp_reg_23;
  132|   207k|    __m128i m_temp_reg_24;
  133|   207k|    __m128i m_temp_reg_25;
  134|   207k|    __m128i m_temp_reg_26;
  135|   207k|    __m128i m_temp_reg_27;
  136|   207k|    __m128i m_temp_reg_30;
  137|   207k|    __m128i m_temp_reg_31;
  138|   207k|    __m128i m_temp_reg_32;
  139|   207k|    __m128i m_temp_reg_33;
  140|   207k|    __m128i m_temp_reg_34;
  141|   207k|    __m128i m_temp_reg_35;
  142|   207k|    __m128i m_temp_reg_36;
  143|   207k|    __m128i m_temp_reg_37;
  144|   207k|    __m128i m_temp_reg_40;
  145|   207k|    __m128i m_temp_reg_41;
  146|   207k|    __m128i m_temp_reg_42;
  147|   207k|    __m128i m_temp_reg_43;
  148|   207k|    __m128i m_temp_reg_44;
  149|   207k|    __m128i m_temp_reg_45;
  150|   207k|    __m128i m_temp_reg_46;
  151|   207k|    __m128i m_temp_reg_47;
  152|       |
  153|   207k|    __m128i m_temp_reg_70;
  154|   207k|    __m128i m_temp_reg_71;
  155|   207k|    __m128i m_temp_reg_72;
  156|   207k|    __m128i m_temp_reg_73;
  157|   207k|    __m128i m_temp_reg_74;
  158|   207k|    __m128i m_temp_reg_75;
  159|   207k|    __m128i m_temp_reg_76;
  160|   207k|    __m128i m_temp_reg_77;
  161|   207k|    __m128i m_rdng_factor;
  162|   207k|    __m128i m_count;
  163|   207k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
  164|   207k|    __m128i m_coeff5, m_coeff6, m_coeff7, m_coeff8;
  165|       |
  166|   207k|    WORD32 i;
  167|       |/*Lokesh*/
  168|   207k|    WORD32  zero_last8_cols_stg1;
  169|   207k|    WORD32  zero_last8_rows_stg1;
  170|   207k|    WORD32  zero_last12_rows_stg1;
  171|   207k|    WORD32  zero_last12_rows_stg2;
  172|   207k|    WORD32  zero_last8_rows_stg2;
  173|       |
  174|   207k|    WORD32  loop = 0;
  175|       |
  176|   207k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   207k|#define IT_SHIFT_STAGE_1 7
  ------------------
  177|   207k|    WORD32 trans_size = TRANS_SIZE_16;
  ------------------
  |  |  431|   207k|#define TRANS_SIZE_16 16
  ------------------
  178|       |
  179|       |
  180|       |
  181|       |
  182|       |    /* Following 3 instructions replicates the value in the */
  183|       |    /* lower 16 bits of m_add_iq in the entire register */
  184|       |
  185|       |    /* Last 8 cols of 16x16 block are skipped based on the below flag : Lokesh */
  186|       |
  187|   207k|    zero_last8_cols_stg1 = ((zero_cols & 0xFF00) == 0xFF00) ? 1 : 0;
  ------------------
  |  Branch (187:28): [True: 192k, False: 14.8k]
  ------------------
  188|   207k|    zero_last8_rows_stg1 = ((zero_rows & 0xFF00) == 0xFF00) ? 1 : 0;
  ------------------
  |  Branch (188:28): [True: 93.2k, False: 114k]
  ------------------
  189|   207k|    zero_last12_rows_stg1 = ((zero_rows & 0xFFF0) == 0xFFF0) ? 1 : 0;
  ------------------
  |  Branch (189:29): [True: 75.5k, False: 132k]
  ------------------
  190|       |
  191|   207k|    zero_last12_rows_stg2 = ((zero_cols & 0xFFF0) == 0xFFF0) ? 1 : 0;
  ------------------
  |  Branch (191:29): [True: 181k, False: 25.8k]
  ------------------
  192|   207k|    zero_last8_rows_stg2 = zero_last8_cols_stg1;
  193|   207k|    if(zero_last8_cols_stg1)
  ------------------
  |  Branch (193:8): [True: 192k, False: 15.0k]
  ------------------
  194|   192k|    {
  195|   192k|        loop = 1;
  196|   192k|    }
  197|  15.0k|    else
  198|  15.0k|        loop = 2;
  199|       |
  200|       |    /* i = 0 => lower 8 samples */
  201|       |    /* i = 1 => higher 8 samples */
  202|   430k|    for(i = 0; i < loop; i++)
  ------------------
  |  Branch (202:16): [True: 222k, False: 207k]
  ------------------
  203|   222k|    {
  204|   222k|        {
  205|   222k|            WORD32 sample_half_index = i << 3;
  206|   222k|            WORD16 *pi2_tmp_src = pi2_src + sample_half_index;
  207|   222k|            WORD16 *pi2_scratch = (i) ? (pi2_tmp + 8 * trans_size) : pi2_tmp;
  ------------------
  |  Branch (207:35): [True: 14.8k, False: 207k]
  ------------------
  208|       |
  209|   222k|            m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_tmp_src);
  210|   222k|            pi2_tmp_src += (src_strd << 1);
  211|   222k|            m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_tmp_src);
  212|   222k|            pi2_tmp_src += (src_strd << 1);
  213|   222k|            m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_tmp_src);
  214|   222k|            pi2_tmp_src += (src_strd << 1);
  215|   222k|            m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_tmp_src);
  216|   222k|            pi2_tmp_src += (src_strd << 1);
  217|   222k|            m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_tmp_src);
  218|   222k|            pi2_tmp_src += (src_strd << 1);
  219|   222k|            m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_tmp_src);
  220|   222k|            pi2_tmp_src += (src_strd << 1);
  221|   222k|            m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_tmp_src);
  222|   222k|            pi2_tmp_src += (src_strd << 1);
  223|   222k|            m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_tmp_src);
  224|   222k|            pi2_tmp_src += (src_strd << 1);
  225|       |
  226|       |
  227|       |
  228|       |
  229|       |            /* If last 12 rows are zero : Rishab */
  230|   222k|            if(zero_last12_rows_stg1)
  ------------------
  |  Branch (230:16): [True: 80.5k, False: 142k]
  ------------------
  231|  80.5k|            {
  232|       |
  233|       |                /* eee */
  234|       |                /* eee[0] stored in m_temp_reg_24 and m_temp_reg_25 */
  235|       |                /* eee[1] stored in m_temp_reg_26 and m_temp_reg_27 */
  236|  80.5k|                {
  237|       |                    /* Loading coeff and src for use in next block */
  238|       |
  239|  80.5k|                    m_temp_reg_77 = _mm_cmpgt_epi16(m_temp_reg_77, m_temp_reg_70); //to get sign
  240|  80.5k|                    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_77); //row 0
  241|       |
  242|  80.5k|                    m_temp_reg_24 = _mm_slli_epi32(m_temp_reg_0, 6);
  243|       |
  244|  80.5k|                    m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_77);
  245|       |
  246|  80.5k|                    m_temp_reg_25 = _mm_slli_epi32(m_temp_reg_1, 6);
  247|       |
  248|  80.5k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[2][0]); //89 75
  249|       |
  250|  80.5k|                    m_temp_reg_26 = m_temp_reg_24;
  251|  80.5k|                    m_temp_reg_27 = m_temp_reg_25;
  252|  80.5k|                }
  253|       |
  254|       |                /* eo */
  255|       |
  256|       |                /* eo0[0-3] */
  257|  80.5k|                {
  258|  80.5k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  259|  80.5k|                    m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
  260|       |
  261|  80.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  262|       |
  263|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
  264|       |
  265|       |                    /* e[0][0-3] stored in pi2_tmp[0][0-7] */
  266|       |                    /* e[7][0-3] stored in pi2_tmp[0][8-15] */
  267|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_30);
  268|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_30);
  269|       |
  270|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  271|  80.5k|                    pi2_scratch += 8;
  272|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  273|  80.5k|                    pi2_scratch += 8;
  274|       |
  275|  80.5k|                }
  276|       |
  277|       |
  278|       |                /* eo0[4-7] */
  279|  80.5k|                {
  280|  80.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
  281|       |
  282|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
  283|       |
  284|       |                    /* e[0][4-7] stored in pi2_tmp[1][0-7] */
  285|       |                    /* e[7][4-7] stored in pi2_tmp[1][8-15] */
  286|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_31);
  287|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_31);
  288|       |
  289|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  290|  80.5k|                    pi2_scratch += 8;
  291|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  292|  80.5k|                    pi2_scratch += 8;
  293|       |
  294|  80.5k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[3][0]); //75 -18
  295|  80.5k|                }
  296|       |
  297|       |                /* eo1[0-3] */
  298|  80.5k|                {
  299|  80.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  300|       |
  301|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
  302|       |
  303|       |                    /* e[1][0-3] stored in pi2_tmp[2][0-7] */
  304|       |                    /* e[6][0-3] stored in pi2_tmp[2][8-15] */
  305|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_30);
  306|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_30);
  307|       |
  308|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  309|  80.5k|                    pi2_scratch += 8;
  310|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  311|  80.5k|                    pi2_scratch += 8;
  312|  80.5k|                }
  313|       |
  314|       |                /* eo1[4-7] */
  315|  80.5k|                {
  316|  80.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
  317|       |
  318|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
  319|       |
  320|       |                    /* e[1][4-7] stored in pi2_tmp[3][0-7] */
  321|       |                    /* e[6][4-7] stored in pi2_tmp[3][8-15] */
  322|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_31);
  323|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_31);
  324|       |
  325|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  326|  80.5k|                    pi2_scratch += 8;
  327|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  328|  80.5k|                    pi2_scratch += 8;
  329|       |
  330|  80.5k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[8][0]); //50 -89
  331|       |
  332|  80.5k|                }
  333|       |
  334|       |                /* eo2[0-3] */
  335|  80.5k|                {
  336|  80.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  337|       |
  338|       |                    /* e[2][0-3] stored in pi2_tmp[4][0-7] */
  339|       |                    /* e[5][0-3] stored in pi2_tmp[4][8-15] */
  340|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_30);
  341|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_30);
  342|       |
  343|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  344|  80.5k|                    pi2_scratch += 8;
  345|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  346|  80.5k|                    pi2_scratch += 8;
  347|       |
  348|  80.5k|                }
  349|       |
  350|       |                /* eo2[4-7] */
  351|  80.5k|                {
  352|  80.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
  353|       |
  354|       |                    /* e[2][4-7] stored in pi2_tmp[5][0-7] */
  355|       |                    /* e[5][4-7] stored in pi2_tmp[5][8-15] */
  356|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_31);
  357|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_31);
  358|       |
  359|       |
  360|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  361|  80.5k|                    pi2_scratch += 8;
  362|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  363|  80.5k|                    pi2_scratch += 8;
  364|       |
  365|  80.5k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[9][0]); //18 -50
  366|  80.5k|                }
  367|       |
  368|       |                /* eo3[0-3] */
  369|  80.5k|                {
  370|  80.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  371|       |
  372|       |                    /* e[3][0-3] stored in pi2_tmp[6][0-7] */
  373|       |                    /* e[4][0-3] stored in pi2_tmp[6][8-15] */
  374|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_30);
  375|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_30);
  376|       |
  377|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  378|  80.5k|                    pi2_scratch += 8;
  379|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  380|  80.5k|                    pi2_scratch += 8;
  381|  80.5k|                }
  382|       |
  383|       |                /* eo3[4-7] */
  384|  80.5k|                {
  385|  80.5k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
  386|       |
  387|       |                    /* e[3][4-7] stored in pi2_tmp[7][0-7] */
  388|       |                    /* e[4][4-7] stored in pi2_tmp[7][8-15] */
  389|  80.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_31);
  390|  80.5k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_31);
  391|       |
  392|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  393|  80.5k|                    pi2_scratch += 8;
  394|  80.5k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  395|  80.5k|                    pi2_scratch += 8;
  396|  80.5k|                }
  397|  80.5k|            }
  398|       |            /* If last 8 rows are zero : Rishab */
  399|   142k|            else if(zero_last8_rows_stg1)
  ------------------
  |  Branch (399:21): [True: 19.2k, False: 122k]
  ------------------
  400|  19.2k|            {
  401|       |                /* eeo */
  402|       |                /* eeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
  403|       |                /* eeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
  404|  19.2k|                {
  405|  19.2k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[6][0]); //83  36
  406|  19.2k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[7][0]); //36 -83
  407|       |
  408|  19.2k|                    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved LSB's
  409|  19.2k|                    m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved MSB's
  410|       |
  411|  19.2k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
  412|  19.2k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
  413|       |
  414|  19.2k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
  415|  19.2k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
  416|       |
  417|  19.2k|                }
  418|       |
  419|       |                /* eee */
  420|       |                /* eee[0] stored in m_temp_reg_24 and m_temp_reg_25 */
  421|       |                /* eee[1] stored in m_temp_reg_26 and m_temp_reg_27 */
  422|  19.2k|                {
  423|       |                    /* Loading coeff and src for use in next block */
  424|  19.2k|                    m_temp_reg_77 = _mm_cmpgt_epi16(m_temp_reg_77, m_temp_reg_70); //to  get signs
  425|  19.2k|                    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_77); //row 0
  426|       |
  427|  19.2k|                    m_temp_reg_24 = _mm_slli_epi32(m_temp_reg_0, 6);
  428|       |
  429|  19.2k|                    m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_77);
  430|       |
  431|  19.2k|                    m_temp_reg_25 = _mm_slli_epi32(m_temp_reg_1, 6);
  432|       |
  433|  19.2k|                    m_temp_reg_26 = m_temp_reg_24;
  434|  19.2k|                    m_temp_reg_27 = m_temp_reg_25;
  435|       |
  436|  19.2k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[2][0]); //89 75
  437|  19.2k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[4][0]); //50 18
  438|  19.2k|                }
  439|       |
  440|       |                /* eo0[0-3] */
  441|  19.2k|                {
  442|  19.2k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  443|  19.2k|                    m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
  444|       |
  445|  19.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  446|       |
  447|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
  448|  19.2k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_20);
  449|  19.2k|                    m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_20);
  450|       |
  451|       |                    /* e[0][0-3] stored in pi2_tmp[0][0-7] */
  452|       |                    /* e[7][0-3] stored in pi2_tmp[0][8-15] */
  453|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  454|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  455|       |
  456|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  457|  19.2k|                    pi2_scratch += 8;
  458|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  459|  19.2k|                    pi2_scratch += 8;
  460|       |
  461|  19.2k|                }
  462|       |
  463|       |                /* eo0[4-7] */
  464|  19.2k|                {
  465|  19.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
  466|       |
  467|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
  468|  19.2k|                    m_temp_reg_41 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_21);
  469|  19.2k|                    m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_21);
  470|       |
  471|       |                    /* e[0][4-7] stored in pi2_tmp[1][0-7] */
  472|       |                    /* e[7][4-7] stored in pi2_tmp[1][8-15] */
  473|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
  474|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
  475|       |
  476|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  477|  19.2k|                    pi2_scratch += 8;
  478|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  479|  19.2k|                    pi2_scratch += 8;
  480|       |
  481|  19.2k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[3][0]); //75 -18
  482|  19.2k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[5][0]); //89 50
  483|       |
  484|  19.2k|                }
  485|       |
  486|       |                /* eo1[0-3] */
  487|  19.2k|                {
  488|  19.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  489|       |
  490|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
  491|  19.2k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_22);
  492|  19.2k|                    m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_22);
  493|       |
  494|       |                    /* e[1][0-3] stored in pi2_tmp[2][0-7] */
  495|       |                    /* e[6][0-3] stored in pi2_tmp[2][8-15] */
  496|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  497|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  498|       |
  499|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  500|  19.2k|                    pi2_scratch += 8;
  501|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  502|  19.2k|                    pi2_scratch += 8;
  503|       |
  504|  19.2k|                }
  505|       |
  506|       |                /* eo1[4-7] */
  507|  19.2k|                {
  508|  19.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
  509|       |
  510|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
  511|  19.2k|                    m_temp_reg_43 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_23);
  512|  19.2k|                    m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_23);
  513|       |
  514|       |                    /* e[1][4-7] stored in pi2_tmp[3][0-7] */
  515|       |                    /* e[6][4-7] stored in pi2_tmp[3][8-15] */
  516|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_31);
  517|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_31);
  518|       |
  519|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  520|  19.2k|                    pi2_scratch += 8;
  521|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  522|  19.2k|                    pi2_scratch += 8;
  523|       |
  524|  19.2k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[8][0]); //50 -89
  525|  19.2k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[10][0]); //18 75
  526|       |
  527|  19.2k|                }
  528|       |
  529|       |                /* eo2[0-3] */
  530|  19.2k|                {
  531|  19.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  532|       |
  533|       |                    /* e[2][0-3] stored in pi2_tmp[4][0-7] */
  534|       |                    /* e[5][0-3] stored in pi2_tmp[4][8-15] */
  535|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  536|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  537|       |
  538|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  539|  19.2k|                    pi2_scratch += 8;
  540|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  541|  19.2k|                    pi2_scratch += 8;
  542|       |
  543|  19.2k|                }
  544|       |
  545|       |                /* eo2[4-7] */
  546|  19.2k|                {
  547|  19.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
  548|       |
  549|       |                    /* e[2][4-7] stored in pi2_tmp[5][0-7] */
  550|       |                    /* e[5][4-7] stored in pi2_tmp[5][8-15] */
  551|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_31);
  552|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_31);
  553|       |
  554|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  555|  19.2k|                    pi2_scratch += 8;
  556|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  557|  19.2k|                    pi2_scratch += 8;
  558|       |
  559|  19.2k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[9][0]); //18 -50
  560|  19.2k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[11][0]); //75 -89
  561|       |
  562|  19.2k|                }
  563|       |
  564|       |                /* eo3[0-3] */
  565|  19.2k|                {
  566|  19.2k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  567|       |
  568|       |                    /* e[3][0-3] stored in pi2_tmp[6][0-7] */
  569|       |                    /* e[4][0-3] stored in pi2_tmp[6][8-15] */
  570|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  571|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  572|       |
  573|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  574|  19.2k|                    pi2_scratch += 8;
  575|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  576|  19.2k|                    pi2_scratch += 8;
  577|  19.2k|                }
  578|       |
  579|       |                /* eo3[4-7] */
  580|  19.2k|                {
  581|  19.2k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
  582|       |
  583|       |                    /* e[3][4-7] stored in pi2_tmp[7][0-7] */
  584|       |                    /* e[4][4-7] stored in pi2_tmp[7][8-15] */
  585|  19.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_31);
  586|  19.2k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_31);
  587|       |
  588|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  589|  19.2k|                    pi2_scratch += 8;
  590|  19.2k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  591|  19.2k|                    pi2_scratch += 8;
  592|  19.2k|                }
  593|  19.2k|            } /* If all the rows are non-zero : Rishab */
  594|   122k|            else
  595|   122k|            {
  596|       |                /* eeo */
  597|       |                /* eeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
  598|       |                /* eeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
  599|       |
  600|   122k|                {
  601|   122k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[6][0]); //83  36
  602|   122k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[7][0]); //36 -83
  603|       |
  604|   122k|                    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved LSB's
  605|   122k|                    m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved MSB's
  606|       |
  607|   122k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
  608|   122k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
  609|       |
  610|   122k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
  611|   122k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
  612|   122k|                }
  613|       |
  614|       |                /* eee */
  615|       |                /* eee[0] stored in m_temp_reg_24 and m_temp_reg_25 */
  616|       |                /* eee[1] stored in m_temp_reg_26 and m_temp_reg_27 */
  617|   122k|                {
  618|       |                    /* Loading coeff and src for use in next block */
  619|   122k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[0][0]); //64  64
  620|   122k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[1][0]); //64 -64
  621|       |
  622|   122k|                    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74); //row 0 and row 8 interleaved LSB's
  623|   122k|                    m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74); //row 0 and row 8 interleaved MSB's
  624|       |
  625|   122k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
  626|   122k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_0, m_coeff4);
  627|       |
  628|   122k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  629|   122k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);
  630|       |
  631|   122k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[2][0]); //89 75
  632|   122k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[4][0]); //50 18
  633|       |
  634|   122k|                }
  635|       |                /* eo0[0-3] */
  636|   122k|                {
  637|   122k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  638|   122k|                    m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
  639|   122k|                    m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
  640|   122k|                    m_temp_reg_13 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_77);
  641|       |
  642|   122k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  643|   122k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff2);
  644|       |
  645|       |
  646|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
  647|   122k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_20);
  648|   122k|                    m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_20);
  649|       |
  650|       |                    /* e[0][0-3] stored in pi2_tmp[0][0-7] */
  651|       |                    /* e[7][0-3] stored in pi2_tmp[0][8-15] */
  652|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  653|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  654|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_32);
  655|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_32);
  656|       |
  657|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  658|   122k|                    pi2_scratch += 8;
  659|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  660|   122k|                    pi2_scratch += 8;
  661|       |
  662|       |
  663|   122k|                }
  664|       |
  665|       |                /* eo0[4-7] */
  666|   122k|                {
  667|   122k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
  668|   122k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff2);
  669|       |
  670|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
  671|   122k|                    m_temp_reg_41 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_21);
  672|   122k|                    m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_21);
  673|       |
  674|       |                    /* e[0][4-7] stored in pi2_tmp[1][0-7] */
  675|       |                    /* e[7][4-7] stored in pi2_tmp[1][8-15] */
  676|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
  677|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
  678|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_33);
  679|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_33);
  680|       |
  681|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  682|   122k|                    pi2_scratch += 8;
  683|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  684|   122k|                    pi2_scratch += 8;
  685|       |
  686|   122k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[3][0]); //75 -18
  687|   122k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[5][0]); //89 50
  688|       |
  689|   122k|                }
  690|       |
  691|       |                /* eo1[0-3] */
  692|   122k|                {
  693|   122k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  694|   122k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff4);
  695|       |
  696|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
  697|   122k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_22);
  698|   122k|                    m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_22);
  699|       |
  700|       |                    /* e[1][0-3] stored in pi2_tmp[2][0-7] */
  701|       |                    /* e[6][0-3] stored in pi2_tmp[2][8-15] */
  702|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  703|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  704|   122k|                    m_temp_reg_34 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_32);
  705|   122k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_32);
  706|       |
  707|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  708|   122k|                    pi2_scratch += 8;
  709|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  710|   122k|                    pi2_scratch += 8;
  711|       |
  712|   122k|                }
  713|       |
  714|       |                /* eo1[4-7] */
  715|   122k|                {
  716|   122k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
  717|   122k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
  718|       |
  719|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
  720|   122k|                    m_temp_reg_43 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_23);
  721|   122k|                    m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_23);
  722|       |
  723|       |                    /* e[1][4-7] stored in pi2_tmp[3][0-7] */
  724|       |                    /* e[6][4-7] stored in pi2_tmp[3][8-15] */
  725|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_31);
  726|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_31);
  727|   122k|                    m_temp_reg_34 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_33);
  728|   122k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_33);
  729|       |
  730|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  731|   122k|                    pi2_scratch += 8;
  732|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  733|   122k|                    pi2_scratch += 8;
  734|   122k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[8][0]); //50 -89
  735|   122k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[10][0]); //18 75
  736|   122k|                }
  737|       |
  738|       |                /* eo2[0-3] */
  739|   122k|                {
  740|   122k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  741|   122k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff2);
  742|       |
  743|       |                    /* e[2][0-3] stored in pi2_tmp[4][0-7] */
  744|       |                    /* e[5][0-3] stored in pi2_tmp[4][8-15] */
  745|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  746|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  747|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_32);
  748|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_32);
  749|       |
  750|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  751|   122k|                    pi2_scratch += 8;
  752|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  753|   122k|                    pi2_scratch += 8;
  754|   122k|                }
  755|       |
  756|       |                /* eo2[4-7] */
  757|   122k|                {
  758|   122k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
  759|   122k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff2);
  760|       |
  761|       |                    /* e[2][4-7] stored in pi2_tmp[5][0-7] */
  762|       |                    /* e[5][4-7] stored in pi2_tmp[5][8-15] */
  763|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_31);
  764|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_31);
  765|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_33);
  766|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_33);
  767|       |
  768|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  769|   122k|                    pi2_scratch += 8;
  770|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  771|   122k|                    pi2_scratch += 8;
  772|       |
  773|   122k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[9][0]); //18 -50
  774|   122k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[11][0]); //75 -89
  775|       |
  776|   122k|                }
  777|       |
  778|       |                /* eo3[0-3] */
  779|   122k|                {
  780|   122k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  781|   122k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff4);
  782|       |
  783|       |                    /* e[3][0-3] stored in pi2_tmp[6][0-7] */
  784|       |                    /* e[4][0-3] stored in pi2_tmp[6][8-15] */
  785|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  786|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  787|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_32);
  788|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_32);
  789|       |
  790|       |
  791|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  792|   122k|                    pi2_scratch += 8;
  793|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  794|   122k|                    pi2_scratch += 8;
  795|   122k|                }
  796|       |
  797|       |                /* eo3[4-7] */
  798|   122k|                {
  799|   122k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
  800|   122k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
  801|       |
  802|       |                    /* e[3][4-7] stored in pi2_tmp[7][0-7] */
  803|       |                    /* e[4][4-7] stored in pi2_tmp[7][8-15] */
  804|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_31);
  805|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_31);
  806|   122k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_33);
  807|   122k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_33);
  808|       |
  809|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  810|   122k|                    pi2_scratch += 8;
  811|   122k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  812|   122k|                    pi2_scratch += 8;
  813|   122k|                }
  814|       |
  815|   122k|            }
  816|   222k|        }
  817|       |
  818|   222k|        {
  819|   222k|            WORD32 sample_half_index = i << 3;
  820|   222k|            WORD16 *pi2_tmp_src = pi2_src + sample_half_index + src_strd;
  821|       |
  822|   222k|            m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_tmp_src);
  823|   222k|            pi2_tmp_src += (src_strd << 1);
  824|   222k|            m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_tmp_src);
  825|   222k|            pi2_tmp_src += (src_strd << 1);
  826|   222k|            m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_tmp_src);
  827|   222k|            pi2_tmp_src += (src_strd << 1);
  828|   222k|            m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_tmp_src);
  829|   222k|            pi2_tmp_src += (src_strd << 1);
  830|   222k|            m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_tmp_src);
  831|   222k|            pi2_tmp_src += (src_strd << 1);
  832|   222k|            m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_tmp_src);
  833|   222k|            pi2_tmp_src += (src_strd << 1);
  834|   222k|            m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_tmp_src);
  835|   222k|            pi2_tmp_src += (src_strd << 1);
  836|   222k|            m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_tmp_src);
  837|   222k|            pi2_tmp_src += (src_strd << 1);
  838|   222k|        }
  839|       |
  840|       |        /* o & stage 1 out */
  841|   222k|        {
  842|   222k|            WORD32 j;
  843|   222k|            WORD16 *pi2_src_scratch = (i) ? (pi2_tmp + 8 * trans_size) : pi2_tmp;
  ------------------
  |  Branch (843:39): [True: 14.8k, False: 207k]
  ------------------
  844|   222k|            WORD16 *pi2_dst_scratch = (i) ? (pi2_tmp + 8 * trans_size) : pi2_tmp;
  ------------------
  |  Branch (844:39): [True: 14.8k, False: 207k]
  ------------------
  845|   222k|            WORD32 out_stride = (trans_size << 1);
  846|   222k|            WORD32 in_stride = trans_size << 1;
  847|       |
  848|   222k|            if(zero_last12_rows_stg1)
  ------------------
  |  Branch (848:16): [True: 80.6k, False: 142k]
  ------------------
  849|  80.6k|            {
  850|   241k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (850:28): [True: 161k, False: 80.6k]
  ------------------
  851|   161k|                {
  852|   161k|                    if(j) //H8B= higher 8 bytes L8B lower 8 bytes
  ------------------
  |  Branch (852:24): [True: 80.6k, False: 80.5k]
  ------------------
  853|  80.6k|                    {
  854|  80.6k|                        m_temp_reg_10 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 H8B
  855|  80.6k|                    }
  856|  80.5k|                    else
  857|  80.5k|                    {
  858|  80.5k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 L8B
  859|  80.5k|                    }
  860|   161k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[0][0]); //90 87
  861|       |
  862|       |
  863|       |                    /* o0[0-3] */
  864|   161k|                    {
  865|   161k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  866|       |
  867|       |
  868|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
  869|   161k|                        pi2_src_scratch += in_stride;
  870|       |
  871|   161k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[4][0]); //87 57
  872|       |
  873|       |
  874|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
  875|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
  876|       |
  877|   161k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  878|   161k|                        m_count = _mm_cvtsi32_si128(i4_shift);
  879|   161k|                        m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x00);
  880|       |
  881|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  882|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  883|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
  884|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
  885|       |
  886|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
  887|       |
  888|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
  889|   161k|                        pi2_dst_scratch += out_stride;
  890|   161k|                    }
  891|       |
  892|       |                    /* o1[0-3] */
  893|   161k|                    {
  894|   161k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
  895|       |
  896|       |
  897|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
  898|   161k|                        pi2_src_scratch += in_stride;
  899|       |
  900|   161k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[8][0]); //80 9
  901|       |
  902|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
  903|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
  904|       |
  905|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  906|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  907|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
  908|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
  909|       |
  910|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
  911|       |
  912|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
  913|   161k|                        pi2_dst_scratch += out_stride;
  914|   161k|                    }
  915|       |
  916|       |                    /* o2[0-3] */
  917|   161k|                    {
  918|   161k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  919|       |
  920|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
  921|   161k|                        pi2_src_scratch += in_stride;
  922|       |
  923|   161k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[12][0]); //70 -43
  924|       |
  925|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
  926|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
  927|       |
  928|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  929|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  930|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
  931|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
  932|       |
  933|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
  934|       |
  935|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
  936|   161k|                        pi2_dst_scratch += out_stride;
  937|   161k|                    }
  938|       |
  939|       |                    /* o3[0-3] */
  940|   161k|                    {
  941|   161k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
  942|       |
  943|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
  944|   161k|                        pi2_src_scratch += 8;
  945|       |
  946|   161k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[16][0]); //57 -80
  947|       |
  948|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
  949|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
  950|       |
  951|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  952|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  953|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
  954|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
  955|       |
  956|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
  957|       |
  958|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
  959|   161k|                        pi2_dst_scratch += 8;
  960|   161k|                    }
  961|       |
  962|       |                    /* o4[0-3] */
  963|   161k|                    {
  964|   161k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  965|       |
  966|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
  967|   161k|                        pi2_src_scratch -= in_stride;
  968|       |
  969|   161k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[20][0]); //43 -90
  970|       |
  971|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
  972|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
  973|       |
  974|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  975|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  976|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
  977|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
  978|       |
  979|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
  980|       |
  981|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
  982|   161k|                        pi2_dst_scratch -= out_stride;
  983|   161k|                    }
  984|       |
  985|       |                    /* o5[0-3] */
  986|   161k|                    {
  987|   161k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
  988|       |
  989|       |
  990|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
  991|   161k|                        pi2_src_scratch -= in_stride;
  992|       |
  993|   161k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[24][0]); //25 -70
  994|       |
  995|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
  996|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
  997|       |
  998|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  999|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1000|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1001|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1002|       |
 1003|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1004|       |
 1005|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1006|   161k|                        pi2_dst_scratch -= out_stride;
 1007|   161k|                    }
 1008|       |
 1009|       |                    /* o6[0-3] */
 1010|   161k|                    {
 1011|   161k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1012|       |
 1013|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1014|   161k|                        pi2_src_scratch -= in_stride;
 1015|       |
 1016|   161k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[28][0]); //9 -25
 1017|       |
 1018|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1019|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1020|       |
 1021|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1022|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1023|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1024|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1025|       |
 1026|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1027|       |
 1028|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1029|   161k|                        pi2_dst_scratch -= out_stride;
 1030|   161k|                    }
 1031|       |
 1032|       |                    /* o7[0-3] */
 1033|   161k|                    {
 1034|   161k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1035|       |
 1036|   161k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1037|   161k|                        pi2_src_scratch += 8;
 1038|       |
 1039|   161k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1040|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1041|       |
 1042|   161k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1043|   161k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1044|   161k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1045|   161k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1046|       |
 1047|   161k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1048|       |
 1049|   161k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1050|   161k|                        pi2_dst_scratch += 8;
 1051|   161k|                    }
 1052|   161k|                }
 1053|  80.6k|            }
 1054|   142k|            else if(zero_last8_rows_stg1)
  ------------------
  |  Branch (1054:21): [True: 19.2k, False: 122k]
  ------------------
 1055|  19.2k|            {
 1056|  57.6k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (1056:28): [True: 38.4k, False: 19.2k]
  ------------------
 1057|  38.4k|                {
 1058|  38.4k|                    if(j)
  ------------------
  |  Branch (1058:24): [True: 19.2k, False: 19.2k]
  ------------------
 1059|  19.2k|                    {
 1060|  19.2k|                        m_temp_reg_10 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 H8B
 1061|  19.2k|                        m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 H8B
 1062|  19.2k|                    }
 1063|  19.2k|                    else
 1064|  19.2k|                    {
 1065|  19.2k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 L8B
 1066|  19.2k|                        m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 L8B
 1067|  19.2k|                    }
 1068|  38.4k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[0][0]); //90 87
 1069|  38.4k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[1][0]); //80 70
 1070|       |
 1071|       |                    /* o0[0-3] */
 1072|  38.4k|                    {
 1073|  38.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1074|  38.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1075|       |
 1076|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1077|  38.4k|                        pi2_src_scratch += in_stride;
 1078|       |
 1079|  38.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[4][0]); //87 57
 1080|  38.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[5][0]); //9 -43
 1081|       |
 1082|  38.4k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 1083|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1084|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1085|       |
 1086|       |
 1087|  38.4k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1088|  38.4k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1089|       |
 1090|  38.4k|                        m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x00);
 1091|       |
 1092|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1093|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1094|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1095|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1096|       |
 1097|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1098|       |
 1099|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1100|  38.4k|                        pi2_dst_scratch += out_stride;
 1101|  38.4k|                    }
 1102|       |
 1103|       |                    /* o1[0-3] */
 1104|  38.4k|                    {
 1105|  38.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1106|  38.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1107|       |
 1108|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1109|  38.4k|                        pi2_src_scratch += in_stride;
 1110|       |
 1111|  38.4k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[8][0]); //80 9
 1112|  38.4k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[9][0]); //70 87
 1113|       |
 1114|  38.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 1115|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1116|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1117|       |
 1118|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1119|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1120|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1121|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1122|       |
 1123|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1124|       |
 1125|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1126|  38.4k|                        pi2_dst_scratch += out_stride;
 1127|  38.4k|                    }
 1128|       |
 1129|       |                    /* o2[0-3] */
 1130|  38.4k|                    {
 1131|  38.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1132|  38.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1133|       |
 1134|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1135|  38.4k|                        pi2_src_scratch += in_stride;
 1136|       |
 1137|  38.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[12][0]); //70 -43
 1138|  38.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[13][0]); //87 -9
 1139|       |
 1140|  38.4k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 1141|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1142|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1143|       |
 1144|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1145|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1146|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1147|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1148|       |
 1149|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1150|       |
 1151|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1152|  38.4k|                        pi2_dst_scratch += out_stride;
 1153|  38.4k|                    }
 1154|       |
 1155|       |                    /* o3[0-3] */
 1156|  38.4k|                    {
 1157|  38.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1158|  38.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1159|       |
 1160|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1161|  38.4k|                        pi2_src_scratch += 8;
 1162|       |
 1163|  38.4k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[16][0]); //57 -80
 1164|  38.4k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[17][0]); //25 -90
 1165|       |
 1166|  38.4k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_25);
 1167|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1168|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1169|       |
 1170|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1171|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1172|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1173|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1174|       |
 1175|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1176|       |
 1177|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1178|  38.4k|                        pi2_dst_scratch += 8;
 1179|  38.4k|                    }
 1180|       |
 1181|       |                    /* o4[0-3] */
 1182|  38.4k|                    {
 1183|  38.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1184|  38.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1185|       |
 1186|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1187|  38.4k|                        pi2_src_scratch -= in_stride;
 1188|       |
 1189|  38.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[20][0]); //43 -90
 1190|  38.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[21][0]); //57 25
 1191|       |
 1192|  38.4k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 1193|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1194|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1195|       |
 1196|       |
 1197|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1198|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1199|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1200|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1201|       |
 1202|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1203|       |
 1204|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1205|  38.4k|                        pi2_dst_scratch -= out_stride;
 1206|  38.4k|                    }
 1207|       |
 1208|       |                    /* o5[0-3] */
 1209|  38.4k|                    {
 1210|  38.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1211|  38.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1212|       |
 1213|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1214|  38.4k|                        pi2_src_scratch -= in_stride;
 1215|       |
 1216|  38.4k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[24][0]); //25 -70
 1217|  38.4k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[25][0]); //90 -80
 1218|       |
 1219|  38.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 1220|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1221|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1222|       |
 1223|       |
 1224|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1225|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1226|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1227|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1228|       |
 1229|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1230|       |
 1231|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1232|  38.4k|                        pi2_dst_scratch -= out_stride;
 1233|  38.4k|                    }
 1234|       |
 1235|       |                    /* o6[0-3] */
 1236|  38.4k|                    {
 1237|  38.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1238|  38.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1239|       |
 1240|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1241|  38.4k|                        pi2_src_scratch -= in_stride;
 1242|       |
 1243|  38.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[28][0]); //9 -25
 1244|  38.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[29][0]); //43 -57
 1245|       |
 1246|  38.4k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 1247|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1248|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1249|       |
 1250|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1251|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1252|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1253|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1254|       |
 1255|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1256|       |
 1257|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1258|  38.4k|                        pi2_dst_scratch -= out_stride;
 1259|  38.4k|                    }
 1260|       |
 1261|       |                    /* o7[0-3] */
 1262|  38.4k|                    {
 1263|  38.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1264|  38.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1265|       |
 1266|  38.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1267|  38.4k|                        pi2_src_scratch += 8;
 1268|       |
 1269|  38.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 1270|  38.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1271|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1272|       |
 1273|  38.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1274|  38.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1275|  38.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1276|  38.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1277|       |
 1278|  38.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1279|       |
 1280|  38.4k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1281|  38.4k|                        pi2_dst_scratch += 8;
 1282|  38.4k|                    }
 1283|  38.4k|                }
 1284|       |
 1285|  19.2k|            }
 1286|   122k|            else
 1287|   122k|            {
 1288|       |
 1289|       |
 1290|       |
 1291|   369k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (1291:28): [True: 246k, False: 122k]
  ------------------
 1292|   246k|                {
 1293|   246k|                    if(j) //H8B= higher 8 bytes L8B lower 8 bytes
  ------------------
  |  Branch (1293:24): [True: 123k, False: 123k]
  ------------------
 1294|   123k|                    {
 1295|   123k|                        m_temp_reg_10 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 H8B
 1296|   123k|                        m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 H8B
 1297|   123k|                        m_temp_reg_12 = _mm_unpackhi_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 H8B
 1298|   123k|                        m_temp_reg_13 = _mm_unpackhi_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 H8B
 1299|   123k|                    }
 1300|   123k|                    else
 1301|   123k|                    {
 1302|   123k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 L8B
 1303|   123k|                        m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 L8B
 1304|   123k|                        m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 L8B
 1305|   123k|                        m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 L8B
 1306|   123k|                    }
 1307|   246k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[0][0]); //90 87
 1308|   246k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[1][0]); //80 70
 1309|   246k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[2][0]); //57 43
 1310|   246k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[3][0]); //25  9
 1311|       |
 1312|       |
 1313|       |                    /* o0[0-3] */
 1314|   246k|                    {
 1315|   246k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1316|   246k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1317|   246k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1318|   246k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1319|       |
 1320|       |
 1321|   246k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1322|   246k|                        pi2_src_scratch += in_stride;
 1323|       |
 1324|   246k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[4][0]); //87 57
 1325|   246k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[5][0]); //9 -43
 1326|   246k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[6][0]); //80 90
 1327|   246k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[7][0]); //70 25
 1328|       |
 1329|   246k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 1330|   246k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 1331|   246k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 1332|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1333|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1334|       |
 1335|   246k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1336|   246k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1337|   246k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1338|   246k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1339|       |
 1340|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1341|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1342|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1343|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1344|       |
 1345|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1346|       |
 1347|   246k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1348|   246k|                        pi2_dst_scratch += out_stride;
 1349|   246k|                    }
 1350|       |
 1351|       |                    /* o1[0-3] */
 1352|   246k|                    {
 1353|   246k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1354|   246k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1355|   246k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 1356|   246k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 1357|       |
 1358|       |
 1359|   246k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1360|   246k|                        pi2_src_scratch += in_stride;
 1361|       |
 1362|   246k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[8][0]); //80 9
 1363|   246k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[9][0]); //70 87
 1364|   246k|                        m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[10][0]); //25 -57
 1365|   246k|                        m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[11][0]); //90 43
 1366|       |
 1367|   246k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 1368|   246k|                        m_temp_reg_26 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_27);
 1369|   246k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_26);
 1370|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1371|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1372|       |
 1373|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1374|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1375|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1376|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1377|       |
 1378|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1379|       |
 1380|   246k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1381|   246k|                        pi2_dst_scratch += out_stride;
 1382|   246k|                    }
 1383|       |
 1384|       |                    /* o2[0-3] */
 1385|   246k|                    {
 1386|   246k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1387|   246k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1388|   246k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1389|   246k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1390|       |
 1391|   246k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1392|   246k|                        pi2_src_scratch += in_stride;
 1393|       |
 1394|   246k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[12][0]); //70 -43
 1395|   246k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[13][0]); //87 -9
 1396|   246k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[14][0]); //90 25
 1397|   246k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[15][0]); //80 57
 1398|       |
 1399|   246k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 1400|   246k|                        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_23);
 1401|   246k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_22);
 1402|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1403|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1404|       |
 1405|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1406|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1407|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1408|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1409|       |
 1410|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1411|       |
 1412|   246k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1413|   246k|                        pi2_dst_scratch += out_stride;
 1414|   246k|                    }
 1415|       |
 1416|       |                    /* o3[0-3] */
 1417|   246k|                    {
 1418|   246k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1419|   246k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1420|   246k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 1421|   246k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 1422|       |
 1423|       |
 1424|   246k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1425|   246k|                        pi2_src_scratch += 8;
 1426|       |
 1427|   246k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[16][0]); //57 -80
 1428|   246k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[17][0]); //25 -90
 1429|   246k|                        m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[18][0]); //9 87
 1430|   246k|                        m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[19][0]); //43 70
 1431|       |
 1432|   246k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_25);
 1433|   246k|                        m_temp_reg_26 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_27);
 1434|   246k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_26);
 1435|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1436|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1437|       |
 1438|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1439|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1440|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1441|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1442|       |
 1443|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1444|       |
 1445|   246k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1446|   246k|                        pi2_dst_scratch += 8;
 1447|   246k|                    }
 1448|       |
 1449|       |                    /* o4[0-3] */
 1450|   246k|                    {
 1451|   246k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1452|   246k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1453|   246k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1454|   246k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1455|       |
 1456|   246k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1457|   246k|                        pi2_src_scratch -= in_stride;
 1458|       |
 1459|   246k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[20][0]); //43 -90
 1460|   246k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[21][0]); //57 25
 1461|   246k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[22][0]); //87 -70
 1462|   246k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[23][0]); //9 -80
 1463|       |
 1464|   246k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 1465|   246k|                        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_23);
 1466|   246k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_22);
 1467|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1468|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1469|       |
 1470|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1471|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1472|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1473|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1474|       |
 1475|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1476|       |
 1477|   246k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1478|   246k|                        pi2_dst_scratch -= out_stride;
 1479|   246k|                    }
 1480|       |
 1481|       |                    /* o5[0-3] */
 1482|   246k|                    {
 1483|   246k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1484|   246k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1485|   246k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 1486|   246k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 1487|       |
 1488|       |
 1489|   246k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1490|   246k|                        pi2_src_scratch -= in_stride;
 1491|       |
 1492|   246k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[24][0]); //25 -70
 1493|   246k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[25][0]); //90 -80
 1494|   246k|                        m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[26][0]); //43 9
 1495|   246k|                        m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[27][0]); //57 -87
 1496|       |
 1497|   246k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 1498|   246k|                        m_temp_reg_26 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_27);
 1499|   246k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_26);
 1500|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1501|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1502|       |
 1503|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1504|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1505|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1506|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1507|       |
 1508|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1509|       |
 1510|   246k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1511|   246k|                        pi2_dst_scratch -= out_stride;
 1512|   246k|                    }
 1513|       |
 1514|       |                    /* o6[0-3] */
 1515|   246k|                    {
 1516|   246k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1517|   246k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1518|   246k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1519|   246k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1520|       |
 1521|       |
 1522|   246k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1523|   246k|                        pi2_src_scratch -= in_stride;
 1524|       |
 1525|   246k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[28][0]); //9 -25
 1526|   246k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[29][0]); //43 -57
 1527|   246k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[30][0]); //70 -80
 1528|   246k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[31][0]); //87 -90
 1529|       |
 1530|       |
 1531|   246k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 1532|   246k|                        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_23);
 1533|   246k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 1534|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1535|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1536|       |
 1537|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1538|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1539|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1540|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1541|       |
 1542|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1543|       |
 1544|   246k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1545|   246k|                        pi2_dst_scratch -= out_stride;
 1546|   246k|                    }
 1547|       |
 1548|       |                    /* o7[0-3] */
 1549|   246k|                    {
 1550|   246k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 1551|   246k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 1552|   246k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 1553|   246k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 1554|       |
 1555|   246k|                        m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch);
 1556|   246k|                        pi2_src_scratch += 8;
 1557|       |
 1558|   246k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 1559|   246k|                        m_temp_reg_26 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_27);
 1560|   246k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_26);
 1561|   246k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 1562|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 1563|       |
 1564|       |
 1565|   246k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1566|   246k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1567|   246k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1568|   246k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1569|       |
 1570|   246k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1571|       |
 1572|   246k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1573|   246k|                        pi2_dst_scratch += 8;
 1574|   246k|                    }
 1575|   246k|                }
 1576|   122k|            }
 1577|   222k|        }
 1578|       |
 1579|       |        /* Transpose */
 1580|   222k|        {
 1581|   222k|            WORD16 *pi2_src_scratch = (i) ? (pi2_tmp + 8 * trans_size) : pi2_tmp;
  ------------------
  |  Branch (1581:39): [True: 14.8k, False: 207k]
  ------------------
 1582|   222k|            WORD16 *pi2_dst_scratch = ((i) ? (pi2_tmp + 8 * trans_size) : pi2_tmp);
  ------------------
  |  Branch (1582:40): [True: 14.8k, False: 207k]
  ------------------
 1583|   222k|            WORD32 out_stride = (trans_size << 1);
 1584|   222k|            WORD32 in_stride = (trans_size << 1);
 1585|   222k|            WORD32 j;
 1586|       |
 1587|   668k|            for(j = 0; j < 2; j++)
  ------------------
  |  Branch (1587:24): [True: 445k, False: 222k]
  ------------------
 1588|   445k|            {
 1589|   445k|                m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //b, a
 1590|   445k|                pi2_src_scratch += in_stride;
 1591|   445k|                m_temp_reg_31 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //d, c
 1592|   445k|                pi2_src_scratch += in_stride;
 1593|   445k|                m_temp_reg_32 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //f, e
 1594|   445k|                pi2_src_scratch += in_stride;
 1595|   445k|                m_temp_reg_33 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //h, g
 1596|   445k|                pi2_src_scratch += 8;
 1597|   445k|                m_temp_reg_34 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //j, i
 1598|   445k|                pi2_src_scratch -= in_stride;
 1599|   445k|                m_temp_reg_35 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //l, k
 1600|   445k|                pi2_src_scratch -= in_stride;
 1601|   445k|                m_temp_reg_36 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //n, m
 1602|   445k|                pi2_src_scratch -= in_stride;
 1603|   445k|                m_temp_reg_37 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //p, o
 1604|   445k|                pi2_src_scratch += 8;
 1605|       |
 1606|   445k|                m_temp_reg_40 = _mm_unpacklo_epi16(m_temp_reg_30, m_temp_reg_31); //ca3ca2ca1ca0
 1607|   445k|                m_temp_reg_41 = _mm_unpackhi_epi16(m_temp_reg_31, m_temp_reg_30); //bd3bd2bd1bd0
 1608|       |
 1609|   445k|                m_temp_reg_42 = _mm_unpacklo_epi16(m_temp_reg_32, m_temp_reg_33); //ge3ge2ge1ge0
 1610|   445k|                m_temp_reg_43 = _mm_unpackhi_epi16(m_temp_reg_33, m_temp_reg_32); //fh3fh2fh1fh0
 1611|       |
 1612|   445k|                m_temp_reg_44 = _mm_unpacklo_epi16(m_temp_reg_34, m_temp_reg_35); //ki3ki2ki1ki0
 1613|   445k|                m_temp_reg_45 = _mm_unpackhi_epi16(m_temp_reg_35, m_temp_reg_34); //jl3jl2jl1jl0
 1614|       |
 1615|   445k|                m_temp_reg_46 = _mm_unpacklo_epi16(m_temp_reg_36, m_temp_reg_37); //om3om2om1om0
 1616|   445k|                m_temp_reg_47 = _mm_unpackhi_epi16(m_temp_reg_37, m_temp_reg_36); //np3np2np1np0
 1617|       |
 1618|       |
 1619|   445k|                m_temp_reg_30 = _mm_unpacklo_epi32(m_temp_reg_40, m_temp_reg_42); //ge1ca1ge0ca0
 1620|   445k|                m_temp_reg_31 = _mm_unpackhi_epi32(m_temp_reg_40, m_temp_reg_42); //ge3ca3ge2ca2
 1621|       |
 1622|   445k|                m_temp_reg_32 = _mm_unpacklo_epi32(m_temp_reg_44, m_temp_reg_46); //om1ki1om0ki0
 1623|   445k|                m_temp_reg_33 = _mm_unpackhi_epi32(m_temp_reg_44, m_temp_reg_46); //om3ki3om2ki2
 1624|       |
 1625|   445k|                m_temp_reg_34 = _mm_unpacklo_epi32(m_temp_reg_43, m_temp_reg_41); //bd1fh1bd0fh0
 1626|   445k|                m_temp_reg_35 = _mm_unpackhi_epi32(m_temp_reg_43, m_temp_reg_41); //bd3fh3bd2fh2
 1627|       |
 1628|   445k|                m_temp_reg_36 = _mm_unpacklo_epi32(m_temp_reg_47, m_temp_reg_45); //jl1np1jl0np0
 1629|   445k|                m_temp_reg_37 = _mm_unpackhi_epi32(m_temp_reg_47, m_temp_reg_45); //jl3np3jl2np2
 1630|       |
 1631|       |
 1632|   445k|                m_temp_reg_40 = _mm_unpacklo_epi64(m_temp_reg_30, m_temp_reg_32); //omkigeca0
 1633|   445k|                m_temp_reg_41 = _mm_unpackhi_epi64(m_temp_reg_30, m_temp_reg_32); //omkigeca1
 1634|       |
 1635|   445k|                m_temp_reg_42 = _mm_unpacklo_epi64(m_temp_reg_31, m_temp_reg_33); //omkigeca2
 1636|   445k|                m_temp_reg_43 = _mm_unpackhi_epi64(m_temp_reg_31, m_temp_reg_33); //omkigeca3
 1637|       |
 1638|   445k|                m_temp_reg_44 = _mm_unpacklo_epi64(m_temp_reg_36, m_temp_reg_34); //bdfhjlnp0
 1639|   445k|                m_temp_reg_45 = _mm_unpackhi_epi64(m_temp_reg_36, m_temp_reg_34); //bdfhjlnp1
 1640|       |
 1641|   445k|                m_temp_reg_46 = _mm_unpacklo_epi64(m_temp_reg_37, m_temp_reg_35); //bdfhjlnp2
 1642|   445k|                m_temp_reg_47 = _mm_unpackhi_epi64(m_temp_reg_37, m_temp_reg_35); //bdfhjlnp3
 1643|       |
 1644|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1645|   445k|                pi2_dst_scratch += out_stride;
 1646|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_44);
 1647|   445k|                pi2_dst_scratch += out_stride;
 1648|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_41);
 1649|   445k|                pi2_dst_scratch += out_stride;
 1650|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_45);
 1651|   445k|                pi2_dst_scratch += 8;
 1652|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_42);
 1653|   445k|                pi2_dst_scratch -= out_stride;
 1654|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_46);
 1655|   445k|                pi2_dst_scratch -= out_stride;
 1656|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_43);
 1657|   445k|                pi2_dst_scratch -= out_stride;
 1658|   445k|                _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_47);
 1659|   445k|                pi2_dst_scratch += 8;
 1660|   445k|            }
 1661|   222k|        }
 1662|   222k|    }
 1663|       |
 1664|   207k|    if(zero_last8_cols_stg1)
  ------------------
  |  Branch (1664:8): [True: 193k, False: 14.3k]
  ------------------
 1665|   193k|    {
 1666|   193k|        WORD16 *pi2_dst_scratch = (pi2_tmp + 8 * trans_size);
 1667|   193k|        WORD32 out_stride = (trans_size << 1);
 1668|   193k|        WORD32 j;
 1669|       |
 1670|   193k|        m_temp_reg_40 = _mm_setzero_si128();
 1671|   579k|        for(j = 0; j < 2; j++)
  ------------------
  |  Branch (1671:20): [True: 386k, False: 193k]
  ------------------
 1672|   386k|        {
 1673|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1674|   386k|            pi2_dst_scratch += out_stride;
 1675|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1676|   386k|            pi2_dst_scratch += out_stride;
 1677|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1678|   386k|            pi2_dst_scratch += out_stride;
 1679|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1680|   386k|            pi2_dst_scratch += 8;
 1681|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1682|   386k|            pi2_dst_scratch -= out_stride;
 1683|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1684|   386k|            pi2_dst_scratch -= out_stride;
 1685|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1686|   386k|            pi2_dst_scratch -= out_stride;
 1687|   386k|            _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_40);
 1688|   386k|            pi2_dst_scratch += 8;
 1689|   386k|        }
 1690|   193k|    }
 1691|       |
 1692|       |
 1693|       |
 1694|       |
 1695|       |    /* Stage 2 */
 1696|   623k|    for(i = 0; i < 2; i++)
  ------------------
  |  Branch (1696:16): [True: 415k, False: 207k]
  ------------------
 1697|   415k|    {
 1698|   415k|        WORD16 *pi2_src_temp = (i) ? (pi2_tmp + 2 * trans_size) : (WORD16 *)(pi2_tmp);
  ------------------
  |  Branch (1698:32): [True: 208k, False: 207k]
  ------------------
 1699|   415k|        WORD32 stride = (trans_size);
 1700|   415k|        MEM_ALIGN16 WORD16 temp_array[256];
  ------------------
  |  |  192|   415k|#define MEM_ALIGN16 __attribute__ ((aligned (16)))
  ------------------
 1701|       |
 1702|   415k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   415k|#define IT_SHIFT_STAGE_2 12
  ------------------
 1703|       |
 1704|   415k|        if(zero_last12_rows_stg2)
  ------------------
  |  Branch (1704:12): [True: 364k, False: 51.6k]
  ------------------
 1705|   364k|        {
 1706|       |            /* eeo */
 1707|       |            /* eeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
 1708|       |            /* eeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
 1709|   364k|            {
 1710|   364k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src_temp); //0
 1711|       |
 1712|   364k|                pi2_src_temp += (stride * 9);
 1713|       |
 1714|   364k|                if(!i)
  ------------------
  |  Branch (1714:20): [True: 182k, False: 182k]
  ------------------
 1715|   182k|                {
 1716|   182k|                    pi2_src_temp += (stride * 6 + 8);
 1717|   182k|                }
 1718|   182k|                else
 1719|   182k|                {
 1720|   182k|                    pi2_src_temp += (stride * 2 + 8);
 1721|   182k|                }
 1722|       |
 1723|   364k|                pi2_src_temp -= (stride * 9);
 1724|       |
 1725|   364k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src_temp); //2
 1726|       |
 1727|   364k|                m_temp_reg_20 = _mm_setzero_si128();
 1728|   364k|                m_temp_reg_22 = _mm_setzero_si128();
 1729|       |
 1730|   364k|                m_temp_reg_21 = _mm_setzero_si128();
 1731|   364k|                m_temp_reg_23 = _mm_setzero_si128();
 1732|   364k|            }
 1733|       |
 1734|       |            /* eee */
 1735|       |            /* eee[0] stored in m_temp_reg_24 and m_temp_reg_25 */
 1736|       |            /* eee[1] stored in m_temp_reg_26 and m_temp_reg_27 */
 1737|   364k|            {
 1738|       |                /* Loading coeff and src for use in next block */
 1739|       |
 1740|       |                /* Loading coeff and src for use in next block */
 1741|   364k|                m_temp_reg_77 = _mm_cmpgt_epi16(m_temp_reg_20, m_temp_reg_70);
 1742|       |
 1743|   364k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_77); //row 0
 1744|       |
 1745|   364k|                m_temp_reg_24 = _mm_slli_epi32(m_temp_reg_0, 6);
 1746|       |
 1747|   364k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_77);
 1748|   364k|                m_temp_reg_25 = _mm_slli_epi32(m_temp_reg_1, 6);
 1749|       |
 1750|   364k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[2][0]); //89 75
 1751|   364k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[4][0]); //50 18
 1752|       |
 1753|   364k|                m_temp_reg_26 = m_temp_reg_24;
 1754|   364k|                m_temp_reg_27 = m_temp_reg_25;
 1755|       |                /*  */
 1756|       |
 1757|   364k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_20);
 1758|   364k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_20);
 1759|   364k|            }
 1760|       |
 1761|       |            /* eo */
 1762|   364k|            {
 1763|   364k|                WORD16 *pi2_scratch = temp_array;
 1764|   364k|                WORD32 out_stride = 8;
 1765|       |
 1766|       |
 1767|       |                /* eo0[0-3] */
 1768|   364k|                {
 1769|   364k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1770|       |
 1771|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
 1772|       |
 1773|       |                    /* e[0][0-3] stored in pu1_dst[0] */
 1774|       |                    /* e[7][0-3] stored in pu1_dst[1] */
 1775|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_30);
 1776|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_30);
 1777|       |
 1778|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1779|   364k|                    pi2_scratch += out_stride;
 1780|   364k|                    _mm_store_si128((__m128i *)(pi2_scratch), m_temp_reg_35);
 1781|   364k|                    pi2_scratch += out_stride;
 1782|   364k|                }
 1783|       |
 1784|       |                /* eo0[4-7] */
 1785|   364k|                {
 1786|   364k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1787|       |
 1788|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
 1789|       |
 1790|       |                    /* e[0][4-7] stored in pu1_dst[2] */
 1791|       |                    /* e[7][4-7] stored in pu1_dst[3] */
 1792|       |
 1793|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_31);
 1794|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_31);
 1795|       |
 1796|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1797|   364k|                    pi2_scratch += out_stride;
 1798|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1799|   364k|                    pi2_scratch += out_stride;
 1800|       |
 1801|   364k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[3][0]); //75 -18
 1802|   364k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[5][0]); //89 50
 1803|       |
 1804|   364k|                }
 1805|       |
 1806|       |                /* eo1[0-3] */
 1807|   364k|                {
 1808|   364k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1809|       |
 1810|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
 1811|       |
 1812|       |                    /* e[1][0-3] stored in pu1_dst[4] */
 1813|       |                    /* e[6][0-3] stored in pu1_dst[5] */
 1814|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_30);
 1815|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_30);
 1816|       |
 1817|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1818|   364k|                    pi2_scratch += out_stride;
 1819|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1820|   364k|                    pi2_scratch += out_stride;
 1821|   364k|                }
 1822|       |
 1823|       |                /* eo1[4-7] */
 1824|   364k|                {
 1825|   364k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1826|       |
 1827|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
 1828|       |
 1829|       |                    /* e[1][4-7] stored in pu1_dst[6]*/
 1830|       |                    /* e[6][4-7] stored in pu1_dst[7] */
 1831|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_31);
 1832|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_31);
 1833|       |
 1834|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1835|   364k|                    pi2_scratch += out_stride;
 1836|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1837|   364k|                    pi2_scratch += out_stride;
 1838|       |
 1839|   364k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[8][0]); //50 -89
 1840|       |
 1841|   364k|                }
 1842|       |
 1843|       |                /* eo2[0-3] */
 1844|   364k|                {
 1845|   364k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1846|       |
 1847|       |                    /* e[2][0-3] stored in pu1_dst[8]*/
 1848|       |                    /* e[5][0-3] stored in pu1_dst[9] */
 1849|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_30);
 1850|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_30);
 1851|       |
 1852|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1853|   364k|                    pi2_scratch += out_stride;
 1854|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1855|   364k|                    pi2_scratch += out_stride;
 1856|   364k|                }
 1857|       |
 1858|       |                /* eo2[4-7] */
 1859|   364k|                {
 1860|   364k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1861|       |
 1862|       |                    /* e[2][4-7] stored in pu1_dst[10]*/
 1863|       |                    /* e[5][4-7] stored in pu1_dst[11] */
 1864|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_31);
 1865|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_31);
 1866|       |
 1867|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1868|   364k|                    pi2_scratch += out_stride;
 1869|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1870|   364k|                    pi2_scratch += out_stride;
 1871|       |
 1872|   364k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[9][0]); //18 -50
 1873|   364k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[11][0]); //75 -89
 1874|       |
 1875|   364k|                }
 1876|       |
 1877|       |                /* eo3[0-3] */
 1878|   364k|                {
 1879|   364k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1880|       |
 1881|       |                    /* e[3][0-3] stored in pu1_dst[12]*/
 1882|       |                    /* e[4][0-3] stored in pu1_dst[13] */
 1883|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_30);
 1884|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_30);
 1885|       |
 1886|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1887|   364k|                    pi2_scratch += out_stride;
 1888|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1889|   364k|                    pi2_scratch += out_stride;
 1890|   364k|                }
 1891|       |
 1892|       |                /* eo3[4-7] */
 1893|   364k|                {
 1894|   364k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1895|       |
 1896|       |                    /* e[3][4-7] stored in pu1_dst[14]*/
 1897|       |                    /* e[4][4-7] stored in pu1_dst[15] */
 1898|   364k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_31);
 1899|   364k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_31);
 1900|       |
 1901|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1902|   364k|                    pi2_scratch += out_stride;
 1903|   364k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1904|   364k|                    pi2_scratch += out_stride;
 1905|   364k|                }
 1906|       |
 1907|   364k|            }
 1908|   364k|        }
 1909|  51.6k|        else if(zero_last8_rows_stg2)
  ------------------
  |  Branch (1909:17): [True: 21.9k, False: 29.6k]
  ------------------
 1910|  21.9k|        {
 1911|       |            /* eeo */
 1912|       |            /* eeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
 1913|       |            /* eeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
 1914|  21.9k|            {
 1915|       |
 1916|  21.9k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_16_even[3][0]); //83
 1917|  21.9k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_16_even[4][0]); //36
 1918|       |
 1919|  21.9k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src_temp); //0
 1920|  21.9k|                pi2_src_temp += (stride);
 1921|  21.9k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_src_temp); //4
 1922|  21.9k|                pi2_src_temp += (stride * 8);
 1923|       |
 1924|  21.9k|                if(!i)
  ------------------
  |  Branch (1924:20): [True: 10.9k, False: 10.9k]
  ------------------
 1925|  10.9k|                {
 1926|  10.9k|                    pi2_src_temp += (stride * 6 + 8);
 1927|  10.9k|                }
 1928|  10.9k|                else
 1929|  10.9k|                {
 1930|  10.9k|                    pi2_src_temp += (stride * 2 + 8);
 1931|  10.9k|                }
 1932|       |
 1933|  21.9k|                pi2_src_temp -= (stride * 8);
 1934|  21.9k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_src_temp); //6
 1935|  21.9k|                pi2_src_temp -= (stride);
 1936|  21.9k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src_temp); //2
 1937|       |
 1938|       |
 1939|  21.9k|                m_temp_reg_76 = _mm_setzero_si128();
 1940|       |
 1941|       |
 1942|  21.9k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[6][0]); //83  36
 1943|  21.9k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[7][0]); //36 -83
 1944|       |
 1945|  21.9k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved LSB's
 1946|  21.9k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved MSB's
 1947|       |
 1948|  21.9k|                m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1949|  21.9k|                m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1950|       |
 1951|  21.9k|                m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1952|  21.9k|                m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1953|  21.9k|            }
 1954|       |
 1955|       |            /* eee */
 1956|       |            /* eee[0] stored in m_temp_reg_24 and m_temp_reg_25 */
 1957|       |            /* eee[1] stored in m_temp_reg_26 and m_temp_reg_27 */
 1958|  21.9k|            {
 1959|       |                /* Loading coeff and src for use in next block */
 1960|       |
 1961|       |
 1962|  21.9k|                m_temp_reg_77 = _mm_cmpgt_epi16(m_temp_reg_76, m_temp_reg_70);
 1963|       |
 1964|  21.9k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_77); //row 0
 1965|       |
 1966|  21.9k|                m_temp_reg_24 = _mm_slli_epi32(m_temp_reg_0, 6);
 1967|  21.9k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_77);
 1968|  21.9k|                m_temp_reg_25 = _mm_slli_epi32(m_temp_reg_1, 6);
 1969|       |
 1970|  21.9k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[2][0]); //89 75
 1971|       |
 1972|  21.9k|                m_temp_reg_26 = m_temp_reg_24;
 1973|  21.9k|                m_temp_reg_27 = m_temp_reg_25;
 1974|       |
 1975|  21.9k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1976|  21.9k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 1977|  21.9k|            }
 1978|       |
 1979|       |            /* eo */
 1980|  21.9k|            {
 1981|  21.9k|                WORD16 *pi2_scratch = temp_array;
 1982|  21.9k|                WORD32 out_stride = 8;
 1983|       |
 1984|       |
 1985|       |                /* eo0[0-3] */
 1986|  21.9k|                {
 1987|  21.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1988|       |
 1989|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
 1990|  21.9k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_20);
 1991|  21.9k|                    m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_20);
 1992|       |
 1993|       |                    /* e[0][0-3] stored in pu1_dst[0] */
 1994|       |                    /* e[7][0-3] stored in pu1_dst[1] */
 1995|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1996|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1997|       |
 1998|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1999|  21.9k|                    pi2_scratch += out_stride;
 2000|  21.9k|                    _mm_store_si128((__m128i *)(pi2_scratch), m_temp_reg_35);
 2001|  21.9k|                    pi2_scratch += out_stride;
 2002|  21.9k|                }
 2003|       |
 2004|       |                /* eo0[4-7] */
 2005|  21.9k|                {
 2006|  21.9k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 2007|       |
 2008|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
 2009|  21.9k|                    m_temp_reg_41 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_21);
 2010|  21.9k|                    m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_21);
 2011|       |
 2012|       |                    /* e[0][4-7] stored in pu1_dst[2] */
 2013|       |                    /* e[7][4-7] stored in pu1_dst[3] */
 2014|       |
 2015|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2016|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2017|       |
 2018|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2019|  21.9k|                    pi2_scratch += out_stride;
 2020|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2021|  21.9k|                    pi2_scratch += out_stride;
 2022|       |
 2023|  21.9k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[3][0]); //75 -18
 2024|  21.9k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[5][0]); //89 50
 2025|       |
 2026|  21.9k|                }
 2027|       |
 2028|       |                /* eo1[0-3] */
 2029|  21.9k|                {
 2030|  21.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 2031|       |
 2032|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
 2033|  21.9k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_22);
 2034|  21.9k|                    m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_22);
 2035|       |
 2036|       |                    /* e[1][0-3] stored in pu1_dst[4] */
 2037|       |                    /* e[6][0-3] stored in pu1_dst[5] */
 2038|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
 2039|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
 2040|       |
 2041|  21.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2042|  21.9k|                    pi2_scratch += out_stride;
 2043|  21.9k|                    _mm_storeu_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2044|  21.9k|                    pi2_scratch += out_stride;
 2045|  21.9k|                }
 2046|       |
 2047|       |                /* eo1[4-7] */
 2048|  21.9k|                {
 2049|  21.9k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 2050|       |
 2051|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
 2052|  21.9k|                    m_temp_reg_43 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_23);
 2053|  21.9k|                    m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_23);
 2054|       |
 2055|       |                    /* e[1][4-7] stored in pu1_dst[6]*/
 2056|       |                    /* e[6][4-7] stored in pu1_dst[7] */
 2057|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_31);
 2058|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_31);
 2059|       |
 2060|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2061|  21.9k|                    pi2_scratch += out_stride;
 2062|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2063|  21.9k|                    pi2_scratch += out_stride;
 2064|       |
 2065|  21.9k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[8][0]); //50 -89
 2066|       |
 2067|  21.9k|                }
 2068|       |
 2069|       |                /* eo2[0-3] */
 2070|  21.9k|                {
 2071|  21.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2072|       |
 2073|       |                    /* e[2][0-3] stored in pu1_dst[8]*/
 2074|       |                    /* e[5][0-3] stored in pu1_dst[9] */
 2075|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
 2076|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
 2077|       |
 2078|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2079|  21.9k|                    pi2_scratch += out_stride;
 2080|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2081|  21.9k|                    pi2_scratch += out_stride;
 2082|  21.9k|                }
 2083|       |
 2084|       |                /* eo2[4-7] */
 2085|  21.9k|                {
 2086|  21.9k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 2087|       |
 2088|       |                    /* e[2][4-7] stored in pu1_dst[10]*/
 2089|       |                    /* e[5][4-7] stored in pu1_dst[11] */
 2090|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_31);
 2091|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_31);
 2092|       |
 2093|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2094|  21.9k|                    pi2_scratch += out_stride;
 2095|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2096|  21.9k|                    pi2_scratch += out_stride;
 2097|       |
 2098|  21.9k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[9][0]); //18 -50
 2099|  21.9k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[11][0]); //75 -89
 2100|       |
 2101|  21.9k|                }
 2102|       |
 2103|       |                /* eo3[0-3] */
 2104|  21.9k|                {
 2105|  21.9k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 2106|       |
 2107|       |                    /* e[3][0-3] stored in pu1_dst[12]*/
 2108|       |                    /* e[4][0-3] stored in pu1_dst[13] */
 2109|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
 2110|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
 2111|       |
 2112|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2113|  21.9k|                    pi2_scratch += out_stride;
 2114|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2115|  21.9k|                    pi2_scratch += out_stride;
 2116|  21.9k|                }
 2117|       |
 2118|       |                /* eo3[4-7] */
 2119|  21.9k|                {
 2120|  21.9k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 2121|       |
 2122|       |                    /* e[3][4-7] stored in pu1_dst[14]*/
 2123|       |                    /* e[4][4-7] stored in pu1_dst[15] */
 2124|  21.9k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_31);
 2125|  21.9k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_31);
 2126|       |
 2127|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2128|  21.9k|                    pi2_scratch += out_stride;
 2129|  21.9k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2130|  21.9k|                    pi2_scratch += out_stride;
 2131|  21.9k|                }
 2132|  21.9k|            }
 2133|  21.9k|        }
 2134|       |
 2135|  29.6k|        else
 2136|  29.6k|        {
 2137|       |            /* eeo */
 2138|       |            /* eeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
 2139|       |            /* eeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
 2140|  29.6k|            {
 2141|       |
 2142|       |
 2143|  29.6k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src_temp); //0
 2144|  29.6k|                pi2_src_temp += (stride);
 2145|  29.6k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_src_temp); //4
 2146|  29.6k|                pi2_src_temp += (stride * 7);
 2147|  29.6k|                m_temp_reg_74 = _mm_loadu_si128((__m128i *)pi2_src_temp); //8
 2148|  29.6k|                pi2_src_temp += (stride);
 2149|  29.6k|                m_temp_reg_76 = _mm_loadu_si128((__m128i *)pi2_src_temp); //12
 2150|  29.6k|                if(!i)
  ------------------
  |  Branch (2150:20): [True: 14.8k, False: 14.8k]
  ------------------
 2151|  14.8k|                {
 2152|  14.8k|                    pi2_src_temp += (stride * 6 + 8);
 2153|  14.8k|                }
 2154|  14.8k|                else
 2155|  14.8k|                {
 2156|  14.8k|                    pi2_src_temp += (stride * 2 + 8);
 2157|  14.8k|                }
 2158|  29.6k|                m_temp_reg_77 = _mm_loadu_si128((__m128i *)pi2_src_temp); //14
 2159|  29.6k|                pi2_src_temp -= (stride);
 2160|  29.6k|                m_temp_reg_75 = _mm_loadu_si128((__m128i *)pi2_src_temp); //10
 2161|  29.6k|                pi2_src_temp -= (stride * 7);
 2162|  29.6k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_src_temp); //6
 2163|  29.6k|                pi2_src_temp -= (stride);
 2164|  29.6k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src_temp); //2
 2165|       |
 2166|  29.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[6][0]); //83  36
 2167|  29.6k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[7][0]); //36 -83
 2168|       |
 2169|  29.6k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved LSB's
 2170|  29.6k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76); //row 4 and row 12 interleaved MSB's
 2171|       |
 2172|  29.6k|                m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2173|  29.6k|                m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2174|       |
 2175|  29.6k|                m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2176|  29.6k|                m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2177|       |
 2178|       |
 2179|  29.6k|            }
 2180|       |
 2181|       |            /* eee */
 2182|       |            /* eee[0] stored in m_temp_reg_24 and m_temp_reg_25 */
 2183|       |            /* eee[1] stored in m_temp_reg_26 and m_temp_reg_27 */
 2184|  29.6k|            {
 2185|       |                /* Loading coeff and src for use in next block */
 2186|  29.6k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[0][0]); //64  64
 2187|  29.6k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[1][0]); //64 -64
 2188|       |
 2189|  29.6k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74); //row 0 and row 8 interleaved LSB's
 2190|  29.6k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74); //row 0 and row 8 interleaved MSB's
 2191|       |
 2192|  29.6k|                m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2193|  29.6k|                m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_0, m_coeff4);
 2194|       |
 2195|  29.6k|                m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2196|  29.6k|                m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);
 2197|       |
 2198|  29.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[2][0]); //89 75
 2199|  29.6k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[4][0]); //50 18
 2200|       |
 2201|  29.6k|            }
 2202|       |
 2203|       |            /* eo */
 2204|  29.6k|            {
 2205|  29.6k|                WORD16 *pi2_scratch = temp_array;
 2206|  29.6k|                WORD32 out_stride = 8;
 2207|       |
 2208|       |
 2209|       |
 2210|       |                /* eo0[0-3] */
 2211|  29.6k|                {
 2212|  29.6k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 2213|  29.6k|                    m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 2214|  29.6k|                    m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 2215|  29.6k|                    m_temp_reg_13 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_77);
 2216|       |
 2217|       |
 2218|  29.6k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2219|  29.6k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff2);
 2220|       |
 2221|       |
 2222|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
 2223|  29.6k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_20);
 2224|  29.6k|                    m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_20);
 2225|       |
 2226|       |
 2227|       |                    /* e[0][0-3] stored in pi2_tmp[0][0-7] */
 2228|       |                    /* e[7][0-3] stored in pi2_tmp[0][8-15] */
 2229|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2230|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2231|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_32);
 2232|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_32);
 2233|       |
 2234|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2235|  29.6k|                    pi2_scratch += out_stride;
 2236|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2237|  29.6k|                    pi2_scratch += out_stride;
 2238|       |
 2239|       |
 2240|  29.6k|                }
 2241|       |
 2242|       |                /* eo0[4-7] */
 2243|  29.6k|                {
 2244|       |
 2245|  29.6k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
 2246|  29.6k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff2);
 2247|       |
 2248|       |                    /* ee[0] and ee[3] stored in m_temp_reg_40-41 & m_temp_reg_46-47 */
 2249|  29.6k|                    m_temp_reg_41 = _mm_add_epi32(m_temp_reg_25, m_temp_reg_21);
 2250|  29.6k|                    m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_25, m_temp_reg_21);
 2251|       |
 2252|       |                    /* e[0][4-7] stored in pi2_tmp[1][0-7] */
 2253|       |                    /* e[7][4-7] stored in pi2_tmp[1][8-15] */
 2254|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2255|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2256|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_33);
 2257|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_33);
 2258|       |
 2259|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2260|  29.6k|                    pi2_scratch += out_stride;
 2261|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2262|  29.6k|                    pi2_scratch += out_stride;
 2263|       |
 2264|  29.6k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[3][0]); //75 -18
 2265|  29.6k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[5][0]); //89 50
 2266|       |
 2267|  29.6k|                }
 2268|       |
 2269|       |                /* eo1[0-3] */
 2270|  29.6k|                {
 2271|  29.6k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 2272|  29.6k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff4);
 2273|       |
 2274|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
 2275|  29.6k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_22);
 2276|  29.6k|                    m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_22);
 2277|       |
 2278|       |                    /* e[1][0-3] stored in pi2_tmp[2][0-7] */
 2279|       |                    /* e[6][0-3] stored in pi2_tmp[2][8-15] */
 2280|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
 2281|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
 2282|  29.6k|                    m_temp_reg_34 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_32);
 2283|  29.6k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_32);
 2284|       |
 2285|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2286|  29.6k|                    pi2_scratch += out_stride;
 2287|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2288|  29.6k|                    pi2_scratch += out_stride;
 2289|       |
 2290|  29.6k|                }
 2291|       |
 2292|       |                /* eo1[4-7] */
 2293|  29.6k|                {
 2294|  29.6k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
 2295|  29.6k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2296|       |
 2297|       |                    /* ee[1] and ee[2] stored in m_temp_reg_4-43 & m_temp_reg_44-45 */
 2298|  29.6k|                    m_temp_reg_43 = _mm_add_epi32(m_temp_reg_27, m_temp_reg_23);
 2299|  29.6k|                    m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_27, m_temp_reg_23);
 2300|       |
 2301|       |                    /* e[1][4-7] stored in pi2_tmp[3][0-7] */
 2302|       |                    /* e[6][4-7] stored in pi2_tmp[3][8-15] */
 2303|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_31);
 2304|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_31);
 2305|  29.6k|                    m_temp_reg_34 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_33);
 2306|  29.6k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_33);
 2307|       |
 2308|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2309|  29.6k|                    pi2_scratch += out_stride;
 2310|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2311|  29.6k|                    pi2_scratch += out_stride;
 2312|  29.6k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[8][0]); //50 -89
 2313|  29.6k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[10][0]); //18 75
 2314|  29.6k|                }
 2315|       |
 2316|       |                /* eo2[0-3] */
 2317|  29.6k|                {
 2318|  29.6k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2319|  29.6k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff2);
 2320|       |
 2321|       |                    /* e[2][0-3] stored in pi2_tmp[4][0-7] */
 2322|       |                    /* e[5][0-3] stored in pi2_tmp[4][8-15] */
 2323|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
 2324|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
 2325|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_32);
 2326|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_32);
 2327|       |
 2328|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2329|  29.6k|                    pi2_scratch += out_stride;
 2330|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2331|  29.6k|                    pi2_scratch += out_stride;
 2332|  29.6k|                }
 2333|       |
 2334|       |                /* eo2[4-7] */
 2335|  29.6k|                {
 2336|  29.6k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff1);
 2337|  29.6k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff2);
 2338|       |
 2339|       |                    /* e[2][4-7] stored in pi2_tmp[5][0-7] */
 2340|       |                    /* e[5][4-7] stored in pi2_tmp[5][8-15] */
 2341|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_31);
 2342|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_31);
 2343|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_33);
 2344|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_33);
 2345|       |
 2346|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2347|  29.6k|                    pi2_scratch += out_stride;
 2348|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2349|  29.6k|                    pi2_scratch += out_stride;
 2350|       |
 2351|  29.6k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[9][0]); //18 -50
 2352|  29.6k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even[11][0]); //75 -89
 2353|       |
 2354|  29.6k|                }
 2355|       |
 2356|       |                /* eo3[0-3] */
 2357|  29.6k|                {
 2358|  29.6k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 2359|  29.6k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff4);
 2360|       |
 2361|       |                    /* e[3][0-3] stored in pi2_tmp[6][0-7] */
 2362|       |                    /* e[4][0-3] stored in pi2_tmp[6][8-15] */
 2363|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
 2364|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
 2365|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_32);
 2366|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_32);
 2367|       |
 2368|       |
 2369|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2370|  29.6k|                    pi2_scratch += out_stride;
 2371|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2372|  29.6k|                    pi2_scratch += out_stride;
 2373|  29.6k|                }
 2374|       |
 2375|       |                /* eo3[4-7] */
 2376|  29.6k|                {
 2377|  29.6k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff3);
 2378|  29.6k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2379|       |
 2380|       |                    /* e[3][4-7] stored in pi2_tmp[7][0-7] */
 2381|       |                    /* e[4][4-7] stored in pi2_tmp[7][8-15] */
 2382|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_31);
 2383|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_31);
 2384|  29.6k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_33);
 2385|  29.6k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_33);
 2386|       |
 2387|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 2388|  29.6k|                    pi2_scratch += out_stride;
 2389|  29.6k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 2390|  29.6k|                    pi2_scratch += out_stride;
 2391|  29.6k|                }
 2392|  29.6k|            }
 2393|  29.6k|        }
 2394|       |
 2395|   415k|        if(zero_last12_rows_stg2)
  ------------------
  |  Branch (2395:12): [True: 364k, False: 51.5k]
  ------------------
 2396|   364k|        {
 2397|       |            /* o & stage 2 pre-transposed out */
 2398|   364k|            {
 2399|   364k|                WORD32 j;
 2400|   364k|                WORD16 *pi2_src_scratch = temp_array;
 2401|   364k|                WORD16 *pi2_dst_scratch = (i) ? (pi2_tmp + 8) : (pi2_tmp);
  ------------------
  |  Branch (2401:43): [True: 182k, False: 182k]
  ------------------
 2402|   364k|                WORD32 out_stride = (trans_size);
 2403|   364k|                WORD32 in_stride = (8) * 4;
 2404|       |
 2405|   364k|                pi2_src_temp = pi2_tmp + (stride * 4) + i * (stride * 2);
 2406|       |
 2407|   364k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src_temp); //1
 2408|       |
 2409|   364k|                pi2_src_temp += (stride * 9);
 2410|       |
 2411|   364k|                if(0 == i)
  ------------------
  |  Branch (2411:20): [True: 182k, False: 182k]
  ------------------
 2412|   182k|                {
 2413|   182k|                    pi2_src_temp -= (stride * 2 - 8);
 2414|   182k|                }
 2415|   182k|                else
 2416|   182k|                {
 2417|   182k|                    pi2_src_temp -= (stride * 6 - 8);
 2418|   182k|                }
 2419|   364k|                pi2_src_temp -= (stride * 9);
 2420|       |
 2421|   364k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src_temp); //3
 2422|       |
 2423|       |
 2424|  1.09M|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2424:28): [True: 728k, False: 364k]
  ------------------
 2425|   728k|                {
 2426|   728k|                    if(j)
  ------------------
  |  Branch (2426:24): [True: 364k, False: 364k]
  ------------------
 2427|   364k|                    {
 2428|   364k|                        m_temp_reg_10 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 H8B
 2429|   364k|                    }
 2430|   364k|                    else
 2431|   364k|                    {
 2432|   364k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 L8B
 2433|   364k|                    }
 2434|   728k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[0][0]); //90 87
 2435|       |
 2436|       |                    /* o0[0-3] */
 2437|   728k|                    {
 2438|   728k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2439|       |
 2440|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2441|   728k|                        pi2_src_scratch += in_stride;
 2442|       |
 2443|   728k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[4][0]); //87 57
 2444|       |
 2445|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2446|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2447|       |
 2448|       |
 2449|   728k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2450|   728k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2451|   728k|                        m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x00);
 2452|       |
 2453|       |
 2454|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2455|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2456|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2457|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2458|       |
 2459|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2460|       |
 2461|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2462|   728k|                        pi2_dst_scratch += out_stride;
 2463|   728k|                    }
 2464|       |
 2465|       |                    /* o1[0-3] */
 2466|   728k|                    {
 2467|   728k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2468|       |
 2469|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2470|   728k|                        pi2_src_scratch += in_stride;
 2471|       |
 2472|   728k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[8][0]); //80 9
 2473|       |
 2474|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2475|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2476|       |
 2477|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2478|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2479|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2480|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2481|       |
 2482|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2483|       |
 2484|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2485|   728k|                        pi2_dst_scratch += ((!i) * out_stride + 8);
 2486|   728k|                    }
 2487|       |
 2488|       |                    /* o2[0-3] */
 2489|   728k|                    {
 2490|   728k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2491|       |
 2492|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2493|   728k|                        pi2_src_scratch += in_stride;
 2494|       |
 2495|   728k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[12][0]); //70 -43
 2496|       |
 2497|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2498|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2499|       |
 2500|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2501|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2502|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2503|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2504|       |
 2505|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2506|       |
 2507|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2508|   728k|                        pi2_dst_scratch += out_stride;
 2509|   728k|                    }
 2510|       |
 2511|       |                    /* o3[0-3] */
 2512|   728k|                    {
 2513|   728k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2514|       |
 2515|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2516|   728k|                        pi2_src_scratch += 8;
 2517|       |
 2518|   728k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[16][0]); //57 -80
 2519|       |
 2520|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2521|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2522|       |
 2523|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2524|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2525|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2526|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2527|       |
 2528|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2529|       |
 2530|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2531|   728k|                        pi2_dst_scratch += (i * out_stride + 8);
 2532|   728k|                    }
 2533|       |
 2534|       |                    /* o4[0-3] */
 2535|   728k|                    {
 2536|   728k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2537|       |
 2538|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2539|   728k|                        pi2_src_scratch -= in_stride;
 2540|       |
 2541|   728k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[20][0]); //43 -90
 2542|       |
 2543|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2544|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2545|       |
 2546|       |
 2547|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2548|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2549|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2550|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2551|       |
 2552|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2553|       |
 2554|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2555|   728k|                        pi2_dst_scratch += out_stride;
 2556|   728k|                    }
 2557|       |
 2558|       |                    /* o5[0-3] */
 2559|   728k|                    {
 2560|   728k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2561|       |
 2562|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2563|   728k|                        pi2_src_scratch -= in_stride;
 2564|       |
 2565|   728k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[24][0]); //25 -70
 2566|       |
 2567|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2568|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2569|       |
 2570|       |
 2571|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2572|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2573|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2574|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2575|       |
 2576|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2577|       |
 2578|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2579|   728k|                        pi2_dst_scratch += ((!i) * out_stride + 8);
 2580|   728k|                    }
 2581|       |
 2582|       |                    /* o6[0-3] */
 2583|   728k|                    {
 2584|   728k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2585|       |
 2586|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2587|   728k|                        pi2_src_scratch -= in_stride;
 2588|       |
 2589|   728k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[28][0]); //9 -25
 2590|       |
 2591|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2592|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2593|       |
 2594|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2595|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2596|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2597|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2598|       |
 2599|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2600|       |
 2601|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2602|   728k|                        pi2_dst_scratch += out_stride;
 2603|   728k|                    }
 2604|       |
 2605|       |                    /* o7[0-3] */
 2606|   728k|                    {
 2607|   728k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2608|       |
 2609|   728k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2610|   728k|                        pi2_src_scratch += 8;
 2611|       |
 2612|   728k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2613|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2614|       |
 2615|   728k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2616|   728k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2617|   728k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2618|   728k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2619|       |
 2620|   728k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2621|       |
 2622|   728k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2623|   728k|                        pi2_dst_scratch += (i * out_stride + 8);
 2624|   728k|                    }
 2625|       |
 2626|       |
 2627|   728k|                }
 2628|   364k|            }
 2629|   364k|        }
 2630|  51.5k|        else if(zero_last8_rows_stg2)
  ------------------
  |  Branch (2630:17): [True: 21.9k, False: 29.5k]
  ------------------
 2631|  21.9k|        {
 2632|       |            /* o & stage 2 pre-transposed out */
 2633|  21.9k|            {
 2634|  21.9k|                WORD32 j;
 2635|  21.9k|                WORD16 *pi2_src_scratch = temp_array;
 2636|  21.9k|                WORD16 *pi2_dst_scratch = (i) ? (pi2_tmp + 8) : (pi2_tmp);
  ------------------
  |  Branch (2636:43): [True: 10.9k, False: 10.9k]
  ------------------
 2637|  21.9k|                WORD32 out_stride = (trans_size);
 2638|  21.9k|                WORD32 in_stride = (8) * 4;
 2639|       |
 2640|  21.9k|                pi2_src_temp = pi2_tmp + (stride * 4) + i * (stride * 2);
 2641|       |
 2642|       |
 2643|  21.9k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src_temp); //1
 2644|  21.9k|                pi2_src_temp += (stride);
 2645|  21.9k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_src_temp); //5
 2646|  21.9k|                pi2_src_temp += (stride * 8);
 2647|       |
 2648|  21.9k|                if(0 == i)
  ------------------
  |  Branch (2648:20): [True: 10.9k, False: 10.9k]
  ------------------
 2649|  10.9k|                {
 2650|  10.9k|                    pi2_src_temp -= (stride * 2 - 8);
 2651|  10.9k|                }
 2652|  10.9k|                else
 2653|  10.9k|                {
 2654|  10.9k|                    pi2_src_temp -= (stride * 6 - 8);
 2655|  10.9k|                }
 2656|       |
 2657|  21.9k|                pi2_src_temp -= (stride * 8);
 2658|  21.9k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_src_temp); //7
 2659|  21.9k|                pi2_src_temp -= (stride);
 2660|  21.9k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src_temp); //3
 2661|       |
 2662|       |
 2663|  65.8k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2663:28): [True: 43.8k, False: 21.9k]
  ------------------
 2664|  43.8k|                {
 2665|  43.8k|                    if(j)
  ------------------
  |  Branch (2665:24): [True: 21.9k, False: 21.9k]
  ------------------
 2666|  21.9k|                    {
 2667|  21.9k|                        m_temp_reg_10 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 H8B
 2668|  21.9k|                        m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 H8B
 2669|  21.9k|                    }
 2670|  21.9k|                    else
 2671|  21.9k|                    {
 2672|  21.9k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 L8B
 2673|  21.9k|                        m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 L8B
 2674|  21.9k|                    }
 2675|  43.8k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[0][0]); //90 87
 2676|  43.8k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[1][0]); //80 70
 2677|       |
 2678|       |                    /* o0[0-3] */
 2679|  43.8k|                    {
 2680|  43.8k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2681|  43.8k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2682|       |
 2683|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2684|  43.8k|                        pi2_src_scratch += in_stride;
 2685|       |
 2686|  43.8k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[4][0]); //87 57
 2687|  43.8k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[5][0]); //9 -43
 2688|       |
 2689|  43.8k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2690|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2691|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2692|       |
 2693|       |
 2694|  43.8k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2695|  43.8k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2696|       |
 2697|  43.8k|                        m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x00);
 2698|       |
 2699|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2700|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2701|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2702|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2703|       |
 2704|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2705|       |
 2706|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2707|  43.8k|                        pi2_dst_scratch += out_stride;
 2708|  43.8k|                    }
 2709|       |
 2710|       |                    /* o1[0-3] */
 2711|  43.8k|                    {
 2712|  43.8k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2713|  43.8k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 2714|       |
 2715|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2716|  43.8k|                        pi2_src_scratch += in_stride;
 2717|       |
 2718|  43.8k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[8][0]); //80 9
 2719|  43.8k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[9][0]); //70 87
 2720|       |
 2721|  43.8k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 2722|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2723|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2724|       |
 2725|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2726|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2727|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2728|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2729|       |
 2730|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2731|       |
 2732|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2733|  43.8k|                        pi2_dst_scratch += ((!i) * out_stride + 8);
 2734|  43.8k|                    }
 2735|       |
 2736|       |                    /* o2[0-3] */
 2737|  43.8k|                    {
 2738|  43.8k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2739|  43.8k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2740|       |
 2741|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2742|  43.8k|                        pi2_src_scratch += in_stride;
 2743|       |
 2744|  43.8k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[12][0]); //70 -43
 2745|  43.8k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[13][0]); //87 -9
 2746|       |
 2747|  43.8k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 2748|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2749|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2750|       |
 2751|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2752|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2753|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2754|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2755|       |
 2756|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2757|       |
 2758|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2759|  43.8k|                        pi2_dst_scratch += out_stride;
 2760|  43.8k|                    }
 2761|       |
 2762|       |                    /* o3[0-3] */
 2763|  43.8k|                    {
 2764|  43.8k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2765|  43.8k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 2766|       |
 2767|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2768|  43.8k|                        pi2_src_scratch += 8;
 2769|       |
 2770|  43.8k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[16][0]); //57 -80
 2771|  43.8k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[17][0]); //25 -90
 2772|       |
 2773|  43.8k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_25);
 2774|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2775|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2776|       |
 2777|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2778|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2779|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2780|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2781|       |
 2782|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2783|       |
 2784|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2785|  43.8k|                        pi2_dst_scratch += (i * out_stride + 8);
 2786|  43.8k|                    }
 2787|       |
 2788|       |                    /* o4[0-3] */
 2789|  43.8k|                    {
 2790|  43.8k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2791|  43.8k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2792|       |
 2793|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2794|  43.8k|                        pi2_src_scratch -= in_stride;
 2795|       |
 2796|  43.8k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[20][0]); //43 -90
 2797|  43.8k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[21][0]); //57 25
 2798|       |
 2799|  43.8k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 2800|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2801|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2802|       |
 2803|       |
 2804|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2805|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2806|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2807|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2808|       |
 2809|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2810|       |
 2811|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2812|  43.8k|                        pi2_dst_scratch += out_stride;
 2813|  43.8k|                    }
 2814|       |
 2815|       |                    /* o5[0-3] */
 2816|  43.8k|                    {
 2817|  43.8k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2818|  43.8k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 2819|       |
 2820|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2821|  43.8k|                        pi2_src_scratch -= in_stride;
 2822|       |
 2823|  43.8k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[24][0]); //25 -70
 2824|  43.8k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[25][0]); //90 -80
 2825|       |
 2826|  43.8k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 2827|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2828|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2829|       |
 2830|       |
 2831|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2832|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2833|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2834|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2835|       |
 2836|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2837|       |
 2838|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2839|  43.8k|                        pi2_dst_scratch += ((!i) * out_stride + 8);
 2840|  43.8k|                    }
 2841|       |
 2842|       |                    /* o6[0-3] */
 2843|  43.8k|                    {
 2844|  43.8k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2845|  43.8k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2846|       |
 2847|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2848|  43.8k|                        pi2_src_scratch -= in_stride;
 2849|       |
 2850|  43.8k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[28][0]); //9 -25
 2851|  43.8k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[29][0]); //43 -57
 2852|       |
 2853|  43.8k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2854|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2855|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2856|       |
 2857|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2858|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2859|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2860|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2861|       |
 2862|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2863|       |
 2864|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2865|  43.8k|                        pi2_dst_scratch += out_stride;
 2866|  43.8k|                    }
 2867|       |
 2868|       |                    /* o7[0-3] */
 2869|  43.8k|                    {
 2870|  43.8k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2871|  43.8k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 2872|       |
 2873|  43.8k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2874|  43.8k|                        pi2_src_scratch += 8;
 2875|       |
 2876|  43.8k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 2877|  43.8k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 2878|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 2879|       |
 2880|  43.8k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2881|  43.8k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2882|  43.8k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2883|  43.8k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2884|       |
 2885|  43.8k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2886|       |
 2887|  43.8k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2888|  43.8k|                        pi2_dst_scratch += (i * out_stride + 8);
 2889|  43.8k|                    }
 2890|  43.8k|                }
 2891|  21.9k|            }
 2892|  21.9k|        }
 2893|  29.5k|        else
 2894|  29.5k|        {
 2895|       |            /* o & stage 2 pre-transposed out */
 2896|  29.5k|            {
 2897|  29.5k|                WORD32 j;
 2898|  29.5k|                WORD16 *pi2_src_scratch = temp_array;
 2899|  29.5k|                WORD16 *pi2_dst_scratch = (i) ? (pi2_tmp + 8) : (pi2_tmp);
  ------------------
  |  Branch (2899:43): [True: 14.8k, False: 14.6k]
  ------------------
 2900|  29.5k|                WORD32 out_stride = (trans_size);
 2901|  29.5k|                WORD32 in_stride = (8) * 4;
 2902|       |
 2903|  29.5k|                pi2_src_temp = pi2_tmp + (stride * 4) + i * (stride * 2);
 2904|       |
 2905|       |
 2906|  29.5k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src_temp); //1
 2907|  29.5k|                pi2_src_temp += (stride);
 2908|  29.5k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_src_temp); //5
 2909|  29.5k|                pi2_src_temp += (stride * 7);
 2910|  29.5k|                m_temp_reg_74 = _mm_loadu_si128((__m128i *)pi2_src_temp); //9
 2911|  29.5k|                pi2_src_temp += (stride);
 2912|  29.5k|                m_temp_reg_76 = _mm_loadu_si128((__m128i *)pi2_src_temp); //13
 2913|  29.5k|                if(0 == i)
  ------------------
  |  Branch (2913:20): [True: 14.8k, False: 14.6k]
  ------------------
 2914|  14.8k|                {
 2915|  14.8k|                    pi2_src_temp -= (stride * 2 - 8);
 2916|  14.8k|                }
 2917|  14.6k|                else
 2918|  14.6k|                {
 2919|  14.6k|                    pi2_src_temp -= (stride * 6 - 8);
 2920|  14.6k|                }
 2921|  29.5k|                m_temp_reg_77 = _mm_loadu_si128((__m128i *)pi2_src_temp); //15
 2922|  29.5k|                pi2_src_temp -= (stride);
 2923|  29.5k|                m_temp_reg_75 = _mm_loadu_si128((__m128i *)pi2_src_temp); //11
 2924|  29.5k|                pi2_src_temp -= (stride * 7);
 2925|  29.5k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_src_temp); //7
 2926|  29.5k|                pi2_src_temp -= (stride);
 2927|  29.5k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src_temp); //3
 2928|       |
 2929|       |
 2930|  89.0k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2930:28): [True: 59.4k, False: 29.5k]
  ------------------
 2931|  59.4k|                {
 2932|       |
 2933|  59.4k|                    if(j) //H8B= higher 8 bytes L8B lower 8 bytes
  ------------------
  |  Branch (2933:24): [True: 29.7k, False: 29.7k]
  ------------------
 2934|  29.7k|                    {
 2935|  29.7k|                        m_temp_reg_10 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 H8B
 2936|  29.7k|                        m_temp_reg_11 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 H8B
 2937|  29.7k|                        m_temp_reg_12 = _mm_unpackhi_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 H8B
 2938|  29.7k|                        m_temp_reg_13 = _mm_unpackhi_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 H8B
 2939|  29.7k|                    }
 2940|  29.7k|                    else
 2941|  29.7k|                    {
 2942|  29.7k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 L8B
 2943|  29.7k|                        m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 L8B
 2944|  29.7k|                        m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 L8B
 2945|  29.7k|                        m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 L8B
 2946|  29.7k|                    }
 2947|  59.4k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[0][0]); //90 87
 2948|  59.4k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[1][0]); //80 70
 2949|  59.4k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[2][0]); //57 43
 2950|  59.4k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[3][0]); //25  9
 2951|       |
 2952|       |
 2953|       |                    /* o0[0-3] */
 2954|  59.4k|                    {
 2955|  59.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2956|  59.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2957|  59.4k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 2958|  59.4k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2959|       |
 2960|       |
 2961|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2962|  59.4k|                        pi2_src_scratch += in_stride;
 2963|       |
 2964|  59.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[4][0]); //87 57
 2965|  59.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[5][0]); //9 -43
 2966|  59.4k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[6][0]); //80 90
 2967|  59.4k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[7][0]); //70 25
 2968|       |
 2969|  59.4k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2970|  59.4k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 2971|  59.4k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 2972|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2973|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2974|       |
 2975|  59.4k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2976|  59.4k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2977|  59.4k|                        m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x00);
 2978|       |
 2979|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2980|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2981|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2982|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2983|       |
 2984|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2985|       |
 2986|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2987|  59.4k|                        pi2_dst_scratch += out_stride;
 2988|  59.4k|                    }
 2989|       |
 2990|       |                    /* o1[0-3] */
 2991|  59.4k|                    {
 2992|  59.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 2993|  59.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 2994|  59.4k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 2995|  59.4k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 2996|       |
 2997|       |
 2998|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2999|  59.4k|                        pi2_src_scratch += in_stride;
 3000|       |
 3001|  59.4k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[8][0]); //80 9
 3002|  59.4k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[9][0]); //70 87
 3003|  59.4k|                        m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[10][0]); //25 -57
 3004|  59.4k|                        m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[11][0]); //90 43
 3005|       |
 3006|  59.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 3007|  59.4k|                        m_temp_reg_26 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_27);
 3008|  59.4k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_26);
 3009|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 3010|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 3011|       |
 3012|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3013|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3014|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3015|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3016|       |
 3017|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3018|       |
 3019|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3020|  59.4k|                        pi2_dst_scratch += ((!i) * out_stride + 8);
 3021|  59.4k|                    }
 3022|       |
 3023|       |                    /* o2[0-3] */
 3024|  59.4k|                    {
 3025|  59.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3026|  59.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3027|  59.4k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3028|  59.4k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3029|       |
 3030|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3031|  59.4k|                        pi2_src_scratch += in_stride;
 3032|       |
 3033|  59.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[12][0]); //70 -43
 3034|  59.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[13][0]); //87 -9
 3035|  59.4k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[14][0]); //90 25
 3036|  59.4k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[15][0]); //80 57
 3037|       |
 3038|  59.4k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 3039|  59.4k|                        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_23);
 3040|  59.4k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_22);
 3041|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3042|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3043|       |
 3044|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3045|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3046|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3047|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3048|       |
 3049|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3050|       |
 3051|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3052|  59.4k|                        pi2_dst_scratch += out_stride;
 3053|  59.4k|                    }
 3054|       |
 3055|       |                    /* o3[0-3] */
 3056|  59.4k|                    {
 3057|  59.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 3058|  59.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 3059|  59.4k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 3060|  59.4k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 3061|       |
 3062|       |
 3063|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3064|  59.4k|                        pi2_src_scratch += 8;
 3065|       |
 3066|  59.4k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[16][0]); //57 -80
 3067|  59.4k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[17][0]); //25 -90
 3068|  59.4k|                        m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[18][0]); //9 87
 3069|  59.4k|                        m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[19][0]); //43 70
 3070|       |
 3071|  59.4k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_25);
 3072|  59.4k|                        m_temp_reg_26 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_27);
 3073|  59.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_26);
 3074|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 3075|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 3076|       |
 3077|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3078|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3079|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3080|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3081|       |
 3082|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3083|       |
 3084|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3085|  59.4k|                        pi2_dst_scratch += (i * out_stride + 8);
 3086|  59.4k|                    }
 3087|       |
 3088|       |                    /* o4[0-3] */
 3089|  59.4k|                    {
 3090|  59.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3091|  59.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3092|  59.4k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3093|  59.4k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3094|       |
 3095|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3096|  59.4k|                        pi2_src_scratch -= in_stride;
 3097|       |
 3098|  59.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[20][0]); //43 -90
 3099|  59.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[21][0]); //57 25
 3100|  59.4k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[22][0]); //87 -70
 3101|  59.4k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[23][0]); //9 -80
 3102|       |
 3103|  59.4k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
 3104|  59.4k|                        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_23);
 3105|  59.4k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_22);
 3106|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3107|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3108|       |
 3109|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3110|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3111|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3112|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3113|       |
 3114|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3115|       |
 3116|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3117|  59.4k|                        pi2_dst_scratch += out_stride;
 3118|  59.4k|                    }
 3119|       |
 3120|       |                    /* o5[0-3] */
 3121|  59.4k|                    {
 3122|  59.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 3123|  59.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 3124|  59.4k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 3125|  59.4k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 3126|       |
 3127|       |
 3128|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3129|  59.4k|                        pi2_src_scratch -= in_stride;
 3130|       |
 3131|  59.4k|                        m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[24][0]); //25 -70
 3132|  59.4k|                        m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[25][0]); //90 -80
 3133|  59.4k|                        m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[26][0]); //43 9
 3134|  59.4k|                        m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[27][0]); //57 -87
 3135|       |
 3136|  59.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 3137|  59.4k|                        m_temp_reg_26 = _mm_sub_epi32(m_temp_reg_26, m_temp_reg_27);
 3138|  59.4k|                        m_temp_reg_24 = _mm_sub_epi32(m_temp_reg_24, m_temp_reg_26);
 3139|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 3140|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 3141|       |
 3142|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3143|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3144|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3145|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3146|       |
 3147|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3148|       |
 3149|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3150|  59.4k|                        pi2_dst_scratch += ((!i) * out_stride + 8);
 3151|  59.4k|                    }
 3152|       |
 3153|       |                    /* o6[0-3] */
 3154|  59.4k|                    {
 3155|  59.4k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3156|  59.4k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3157|  59.4k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3158|  59.4k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3159|       |
 3160|       |
 3161|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3162|  59.4k|                        pi2_src_scratch -= in_stride;
 3163|       |
 3164|  59.4k|                        m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[28][0]); //9 -25
 3165|  59.4k|                        m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[29][0]); //43 -57
 3166|  59.4k|                        m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[30][0]); //70 -80
 3167|  59.4k|                        m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_odd[31][0]); //87 -90
 3168|       |
 3169|       |
 3170|  59.4k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3171|  59.4k|                        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_23);
 3172|  59.4k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3173|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3174|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3175|       |
 3176|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3177|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3178|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3179|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3180|       |
 3181|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3182|       |
 3183|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3184|  59.4k|                        pi2_dst_scratch += out_stride;
 3185|  59.4k|                    }
 3186|       |
 3187|       |                    /* o7[0-3] */
 3188|  59.4k|                    {
 3189|  59.4k|                        m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 3190|  59.4k|                        m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_11, m_coeff6);
 3191|  59.4k|                        m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_12, m_coeff7);
 3192|  59.4k|                        m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_13, m_coeff8);
 3193|       |
 3194|  59.4k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3195|  59.4k|                        pi2_src_scratch += 8;
 3196|       |
 3197|  59.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_25);
 3198|  59.4k|                        m_temp_reg_26 = _mm_add_epi32(m_temp_reg_26, m_temp_reg_27);
 3199|  59.4k|                        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_24, m_temp_reg_26);
 3200|  59.4k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_24);
 3201|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_24);
 3202|       |
 3203|       |
 3204|  59.4k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3205|  59.4k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3206|  59.4k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3207|  59.4k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3208|       |
 3209|  59.4k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3210|       |
 3211|  59.4k|                        _mm_storeu_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3212|  59.4k|                        pi2_dst_scratch += (i * out_stride + 8);
 3213|  59.4k|                    }
 3214|       |
 3215|  59.4k|                }
 3216|  29.5k|            }
 3217|  29.5k|        }
 3218|   415k|    }
 3219|       |
 3220|       |    /* Transpose */
 3221|   207k|    {
 3222|   207k|        WORD16 *pi2_src_scratch;
 3223|   207k|        UWORD8 *pu1_pred_temp = pu1_pred;
 3224|   207k|        WORD32 out_stride = dst_strd;
 3225|   207k|        WORD32 in_stride = trans_size;
 3226|   207k|        WORD32 j;
 3227|   207k|        m_temp_reg_1 = _mm_setzero_si128();
 3228|   623k|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (3228:20): [True: 416k, False: 207k]
  ------------------
 3229|   416k|        {
 3230|   416k|            pi2_src_scratch = (i) ? (pi2_tmp + 8) : pi2_tmp;
  ------------------
  |  Branch (3230:31): [True: 208k, False: 208k]
  ------------------
 3231|       |
 3232|  1.24M|            for(j = 0; j < 2; j++)
  ------------------
  |  Branch (3232:24): [True: 832k, False: 416k]
  ------------------
 3233|   832k|            {
 3234|   832k|                m_temp_reg_30 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //b, a
 3235|   832k|                pi2_src_scratch += in_stride;
 3236|   832k|                m_temp_reg_31 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //d, c
 3237|   832k|                pi2_src_scratch += ((!i) * in_stride + 8);
 3238|   832k|                m_temp_reg_32 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //f, e
 3239|   832k|                pi2_src_scratch += (in_stride);
 3240|   832k|                m_temp_reg_33 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //h, g
 3241|   832k|                pi2_src_scratch += (i * in_stride + 8);
 3242|   832k|                m_temp_reg_34 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //j, i
 3243|   832k|                pi2_src_scratch += in_stride;
 3244|   832k|                m_temp_reg_35 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //l, k
 3245|   832k|                pi2_src_scratch += ((!i) * in_stride + 8);
 3246|   832k|                m_temp_reg_36 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //n, m
 3247|   832k|                pi2_src_scratch += in_stride;
 3248|   832k|                m_temp_reg_37 = _mm_loadu_si128((__m128i *)pi2_src_scratch); //p, o
 3249|   832k|                pi2_src_scratch += (i * in_stride + 8);
 3250|       |
 3251|   832k|                m_temp_reg_40 = _mm_unpacklo_epi16(m_temp_reg_30, m_temp_reg_31); //ca3ca2ca1ca0
 3252|   832k|                m_temp_reg_41 = _mm_unpackhi_epi16(m_temp_reg_31, m_temp_reg_30); //bd3bd2bd1bd0
 3253|       |
 3254|   832k|                m_temp_reg_42 = _mm_unpacklo_epi16(m_temp_reg_32, m_temp_reg_33); //ge3ge2ge1ge0
 3255|   832k|                m_temp_reg_43 = _mm_unpackhi_epi16(m_temp_reg_33, m_temp_reg_32); //fh3fh2fh1fh0
 3256|       |
 3257|   832k|                m_temp_reg_44 = _mm_unpacklo_epi16(m_temp_reg_34, m_temp_reg_35); //ki3ki2ki1ki0
 3258|   832k|                m_temp_reg_45 = _mm_unpackhi_epi16(m_temp_reg_35, m_temp_reg_34); //jl3jl2jl1jl0
 3259|       |
 3260|   832k|                m_temp_reg_46 = _mm_unpacklo_epi16(m_temp_reg_36, m_temp_reg_37); //om3om2om1om0
 3261|   832k|                m_temp_reg_47 = _mm_unpackhi_epi16(m_temp_reg_37, m_temp_reg_36); //np3np2np1np0
 3262|       |
 3263|       |
 3264|   832k|                m_temp_reg_30 = _mm_unpacklo_epi32(m_temp_reg_40, m_temp_reg_42); //ge1ca1ge0ca0
 3265|   832k|                m_temp_reg_31 = _mm_unpackhi_epi32(m_temp_reg_40, m_temp_reg_42); //ge3ca3ge2ca2
 3266|       |
 3267|   832k|                m_temp_reg_32 = _mm_unpacklo_epi32(m_temp_reg_44, m_temp_reg_46); //om1ki1om0ki0
 3268|   832k|                m_temp_reg_33 = _mm_unpackhi_epi32(m_temp_reg_44, m_temp_reg_46); //om3ki3om2ki2
 3269|       |
 3270|   832k|                m_temp_reg_34 = _mm_unpacklo_epi32(m_temp_reg_43, m_temp_reg_41); //bd1fh1bd0fh0
 3271|   832k|                m_temp_reg_35 = _mm_unpackhi_epi32(m_temp_reg_43, m_temp_reg_41); //bd3fh3bd2fh2
 3272|       |
 3273|   832k|                m_temp_reg_36 = _mm_unpacklo_epi32(m_temp_reg_47, m_temp_reg_45); //jl1np1jl0np0
 3274|   832k|                m_temp_reg_37 = _mm_unpackhi_epi32(m_temp_reg_47, m_temp_reg_45); //jl3np3jl2np2
 3275|       |
 3276|       |
 3277|   832k|                m_temp_reg_40 = _mm_unpacklo_epi64(m_temp_reg_30, m_temp_reg_32); //omkigeca0
 3278|   832k|                m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred_temp);
 3279|       |
 3280|   832k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, m_temp_reg_1);
 3281|   832k|                m_temp_reg_12 = _mm_unpackhi_epi8(m_temp_reg_20, m_temp_reg_1);
 3282|       |
 3283|   832k|                m_temp_reg_44 = _mm_unpacklo_epi64(m_temp_reg_36, m_temp_reg_34); //bdfhjlnp0
 3284|   832k|                m_temp_reg_40 = _mm_add_epi16(m_temp_reg_40, m_temp_reg_0);
 3285|   832k|                m_temp_reg_44 = _mm_add_epi16(m_temp_reg_44, m_temp_reg_12);
 3286|       |
 3287|   832k|                m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 3288|   832k|                _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 3289|   832k|                pu1_dst += out_stride;
 3290|   832k|                pu1_pred_temp += pred_strd;
 3291|       |
 3292|   832k|                m_temp_reg_41 = _mm_unpackhi_epi64(m_temp_reg_30, m_temp_reg_32); //omkigeca1
 3293|   832k|                m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred_temp);
 3294|       |
 3295|   832k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, m_temp_reg_1);
 3296|   832k|                m_temp_reg_12 = _mm_unpackhi_epi8(m_temp_reg_20, m_temp_reg_1);
 3297|       |
 3298|   832k|                m_temp_reg_45 = _mm_unpackhi_epi64(m_temp_reg_36, m_temp_reg_34); //bdfhjlnp0
 3299|   832k|                m_temp_reg_41 = _mm_add_epi16(m_temp_reg_41, m_temp_reg_0);
 3300|   832k|                m_temp_reg_45 = _mm_add_epi16(m_temp_reg_45, m_temp_reg_12);
 3301|       |
 3302|   832k|                m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_41, m_temp_reg_45);
 3303|   832k|                _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 3304|   832k|                pu1_dst += out_stride;
 3305|   832k|                pu1_pred_temp += pred_strd;
 3306|       |
 3307|   832k|                m_temp_reg_42 = _mm_unpacklo_epi64(m_temp_reg_31, m_temp_reg_33); //omkigeca2
 3308|   832k|                m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred_temp);
 3309|       |
 3310|   832k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, m_temp_reg_1);
 3311|   832k|                m_temp_reg_12 = _mm_unpackhi_epi8(m_temp_reg_20, m_temp_reg_1);
 3312|       |
 3313|   832k|                m_temp_reg_46 = _mm_unpacklo_epi64(m_temp_reg_37, m_temp_reg_35); //bdfhjlnp0
 3314|   832k|                m_temp_reg_42 = _mm_add_epi16(m_temp_reg_42, m_temp_reg_0);
 3315|   832k|                m_temp_reg_46 = _mm_add_epi16(m_temp_reg_46, m_temp_reg_12);
 3316|       |
 3317|   832k|                m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_42, m_temp_reg_46);
 3318|   832k|                _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 3319|   832k|                pu1_dst += out_stride;
 3320|   832k|                pu1_pred_temp += pred_strd;
 3321|       |
 3322|   832k|                m_temp_reg_43 = _mm_unpackhi_epi64(m_temp_reg_31, m_temp_reg_33); //omkigeca3
 3323|   832k|                m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred_temp);
 3324|       |
 3325|   832k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, m_temp_reg_1);
 3326|   832k|                m_temp_reg_12 = _mm_unpackhi_epi8(m_temp_reg_20, m_temp_reg_1);
 3327|       |
 3328|   832k|                m_temp_reg_47 = _mm_unpackhi_epi64(m_temp_reg_37, m_temp_reg_35); //bdfhjlnp0
 3329|   832k|                m_temp_reg_43 = _mm_add_epi16(m_temp_reg_43, m_temp_reg_0);
 3330|   832k|                m_temp_reg_47 = _mm_add_epi16(m_temp_reg_47, m_temp_reg_12);
 3331|       |
 3332|   832k|                m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_43, m_temp_reg_47);
 3333|   832k|                _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 3334|   832k|                pu1_dst += out_stride;
 3335|   832k|                pu1_pred_temp += pred_strd;
 3336|   832k|            }
 3337|   416k|        }
 3338|   207k|    }
 3339|   207k|}

ihevc_itrans_recon_32x32_ssse3:
  115|   185k|{
  116|       |    /* Inverse Transform */
  117|       |
  118|   185k|    WORD32 j;
  119|       |
  120|       |
  121|   185k|    WORD16 *pi2_tmp_orig;
  122|       |
  123|       |
  124|       |    /*MEM_ALIGN16  WORD32 temp_array[1024];
  125|       |    MEM_ALIGN16  WORD16 temp1_array[1024];*/
  126|   185k|    WORD16 *o_temp_ptr;
  127|   185k|    WORD16 *temp_ptr;
  128|       |
  129|   185k|    __m128i m_temp_reg_0;
  130|   185k|    __m128i m_temp_reg_1;
  131|   185k|    __m128i m_temp_reg_2;
  132|   185k|    __m128i m_temp_reg_3;
  133|   185k|    __m128i m_temp_reg_4;
  134|   185k|    __m128i m_temp_reg_5;
  135|   185k|    __m128i m_temp_reg_6;
  136|   185k|    __m128i m_temp_reg_7;
  137|   185k|    __m128i m_temp_reg_10;
  138|   185k|    __m128i m_temp_reg_11;
  139|   185k|    __m128i m_temp_reg_12;
  140|   185k|    __m128i m_temp_reg_13;
  141|   185k|    __m128i m_temp_reg_14;
  142|   185k|    __m128i m_temp_reg_15;
  143|   185k|    __m128i m_temp_reg_16;
  144|   185k|    __m128i m_temp_reg_17;
  145|   185k|    __m128i m_temp_reg_18;
  146|   185k|    __m128i m_temp_reg_19;
  147|   185k|    __m128i m_temp_reg_20;
  148|   185k|    __m128i m_temp_reg_21;
  149|   185k|    __m128i m_temp_reg_22;
  150|   185k|    __m128i m_temp_reg_23;
  151|   185k|    __m128i m_temp_reg_30;
  152|   185k|    __m128i m_temp_reg_31;
  153|   185k|    __m128i m_temp_reg_32;
  154|   185k|    __m128i m_temp_reg_33;
  155|   185k|    __m128i m_temp_reg_34;
  156|   185k|    __m128i m_temp_reg_35;
  157|   185k|    __m128i m_temp_reg_36;
  158|   185k|    __m128i m_temp_reg_37;
  159|   185k|    __m128i m_temp_reg_40;
  160|   185k|    __m128i m_temp_reg_41;
  161|   185k|    __m128i m_temp_reg_42;
  162|   185k|    __m128i m_temp_reg_43;
  163|   185k|    __m128i m_temp_reg_44;
  164|   185k|    __m128i m_temp_reg_45;
  165|   185k|    __m128i m_temp_reg_46;
  166|   185k|    __m128i m_temp_reg_47;
  167|       |
  168|   185k|    __m128i m_temp_reg_70;
  169|   185k|    __m128i m_temp_reg_71;
  170|   185k|    __m128i m_temp_reg_72;
  171|   185k|    __m128i m_temp_reg_73;
  172|   185k|    __m128i m_temp_reg_74;
  173|   185k|    __m128i m_temp_reg_75;
  174|   185k|    __m128i m_temp_reg_76;
  175|   185k|    __m128i m_temp_reg_77;
  176|       |
  177|   185k|    __m128i m_temp_reg_80;
  178|   185k|    __m128i m_temp_reg_81;
  179|   185k|    __m128i m_temp_reg_82;
  180|   185k|    __m128i m_temp_reg_83;
  181|   185k|    __m128i m_temp_reg_84;
  182|   185k|    __m128i m_temp_reg_85;
  183|   185k|    __m128i m_temp_reg_86;
  184|   185k|    __m128i m_temp_reg_87;
  185|       |
  186|   185k|    __m128i m_temp_reg_90;
  187|   185k|    __m128i m_temp_reg_91;
  188|   185k|    __m128i m_temp_reg_92;
  189|   185k|    __m128i m_temp_reg_93;
  190|   185k|    __m128i m_temp_reg_94;
  191|   185k|    __m128i m_temp_reg_95;
  192|   185k|    __m128i m_temp_reg_96;
  193|   185k|    __m128i m_temp_reg_97;
  194|       |
  195|   185k|    __m128i m_rdng_factor;
  196|   185k|    __m128i m_count;
  197|   185k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
  198|   185k|    __m128i m_coeff5, m_coeff6, m_coeff7, m_coeff8;
  199|       |
  200|   185k|    __m128i temp1, temp2, temp3, temp4;
  201|   185k|    __m128i temp5, temp6, temp7, temp8;
  202|       |
  203|   185k|    __m128i all_zero_reg;
  204|   185k|    WORD32 i;
  205|       |
  206|       |    /*Lokesh*/
  207|   185k|    WORD32  zero_last24_cols_stg1;
  208|   185k|    WORD32  zero_last24_rows_stg1;
  209|   185k|    WORD32  zero_last28_rows_stg1;
  210|       |
  211|   185k|    WORD32  zero_last28_rows_stg2;
  212|   185k|    WORD32  zero_last24_rows_stg2;
  213|       |
  214|   185k|    WORD32  trans_size_stg1;
  215|       |
  216|   185k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   185k|#define IT_SHIFT_STAGE_1 7
  ------------------
  217|   185k|    WORD32 trans_size = TRANS_SIZE_32;
  ------------------
  |  |  432|   185k|#define TRANS_SIZE_32 32
  ------------------
  218|       |
  219|       |
  220|       |    /* Last 8 cols of 16x16 block are skipped based on the below flag : Lokesh */
  221|   185k|    zero_last24_cols_stg1 = ((zero_cols & 0xFFFFFF00) == 0xFFFFFF00) ? 1 : 0;
  ------------------
  |  Branch (221:29): [True: 129k, False: 56.2k]
  ------------------
  222|   185k|    zero_last24_rows_stg1 = ((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) ? 1 : 0;
  ------------------
  |  Branch (222:29): [True: 142k, False: 42.5k]
  ------------------
  223|   185k|    zero_last28_rows_stg1 = ((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0) ? 1 : 0;
  ------------------
  |  Branch (223:29): [True: 93.4k, False: 91.8k]
  ------------------
  224|       |
  225|   185k|    zero_last28_rows_stg2 = ((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0) ? 1 : 0;
  ------------------
  |  Branch (225:29): [True: 86.8k, False: 98.4k]
  ------------------
  226|   185k|    zero_last24_rows_stg2 = zero_last24_cols_stg1;
  227|       |
  228|   185k|    if((zero_last28_rows_stg2) || (zero_last24_cols_stg1))
  ------------------
  |  Branch (228:8): [True: 86.6k, False: 98.6k]
  |  Branch (228:35): [True: 42.2k, False: 56.4k]
  ------------------
  229|   129k|    {
  230|   129k|        trans_size_stg1 = 8;
  231|       |
  232|   129k|    }
  233|  56.1k|    else
  234|  56.1k|    {
  235|  56.1k|        trans_size_stg1 = 32;
  236|  56.1k|    }
  237|       |
  238|   185k|    all_zero_reg = _mm_setzero_si128();
  239|       |
  240|   185k|    o_temp_ptr  = pi2_tmp;
  241|   185k|    temp_ptr = (pi2_tmp + 1024);
  242|       |
  243|   185k|    pi2_tmp += 2048;
  244|   185k|    pi2_tmp_orig = pi2_tmp;
  245|       |
  246|   539k|    for(i = 0; i < trans_size_stg1; i += 8)
  ------------------
  |  Branch (246:16): [True: 354k, False: 185k]
  ------------------
  247|   354k|    {
  248|       |
  249|       |
  250|   354k|        {
  251|   354k|            WORD16 *pi2_tmp_src = pi2_src;
  252|       |
  253|   354k|            m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_tmp_src);
  254|   354k|            pi2_tmp_src += (src_strd << 1);
  255|   354k|            m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_tmp_src);
  256|   354k|            pi2_tmp_src += (src_strd << 1);
  257|   354k|            m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_tmp_src);
  258|   354k|            pi2_tmp_src += (src_strd << 1);
  259|   354k|            m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_tmp_src);
  260|   354k|            pi2_tmp_src += (src_strd << 1);
  261|   354k|            m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_tmp_src);
  262|   354k|            pi2_tmp_src += (src_strd << 1);
  263|   354k|            m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_tmp_src);
  264|   354k|            pi2_tmp_src += (src_strd << 1);
  265|   354k|            m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_tmp_src);
  266|   354k|            pi2_tmp_src += (src_strd << 1);
  267|   354k|            m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_tmp_src);
  268|   354k|            pi2_tmp_src += (src_strd << 1);
  269|       |
  270|   354k|            m_temp_reg_80 = _mm_load_si128((__m128i *)pi2_tmp_src);
  271|   354k|            pi2_tmp_src += (src_strd << 1);
  272|   354k|            m_temp_reg_81 = _mm_load_si128((__m128i *)pi2_tmp_src);
  273|   354k|            pi2_tmp_src += (src_strd << 1);
  274|   354k|            m_temp_reg_82 = _mm_load_si128((__m128i *)pi2_tmp_src);
  275|   354k|            pi2_tmp_src += (src_strd << 1);
  276|   354k|            m_temp_reg_83 = _mm_load_si128((__m128i *)pi2_tmp_src);
  277|   354k|            pi2_tmp_src += (src_strd << 1);
  278|   354k|            m_temp_reg_84 = _mm_load_si128((__m128i *)pi2_tmp_src);
  279|   354k|            pi2_tmp_src += (src_strd << 1);
  280|   354k|            m_temp_reg_85 = _mm_load_si128((__m128i *)pi2_tmp_src);
  281|   354k|            pi2_tmp_src += (src_strd << 1);
  282|   354k|            m_temp_reg_86 = _mm_load_si128((__m128i *)pi2_tmp_src);
  283|   354k|            pi2_tmp_src += (src_strd << 1);
  284|   354k|            m_temp_reg_87 = _mm_load_si128((__m128i *)pi2_tmp_src);
  285|   354k|        }
  286|       |
  287|   354k|        if(zero_last28_rows_stg1)
  ------------------
  |  Branch (287:12): [True: 151k, False: 202k]
  ------------------
  288|   151k|        {
  289|       |            /* eeo */
  290|       |            /* eeeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
  291|       |            /* eeeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
  292|   151k|            {
  293|   151k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64
  294|       |
  295|   151k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  296|       |
  297|   151k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  298|       |
  299|       |/* eeeo[0]= m_temp_reg_20  */
  300|       |/* eeeo[1]= m_temp_reg_21  */
  301|       |/* eeee[0]= m_temp_reg_22  */
  302|       |/* eeee[1]= m_temp_reg_23  */
  303|       |
  304|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  305|   151k|                m_temp_reg_40 = m_temp_reg_14;
  306|       |
  307|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  308|   151k|                m_temp_reg_43 = m_temp_reg_14;
  309|       |
  310|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  311|   151k|                m_temp_reg_42 = m_temp_reg_14; //m_temp_reg_16;
  312|       |
  313|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  314|   151k|                m_temp_reg_41 = m_temp_reg_14; //m_temp_reg_16;
  315|       |
  316|   151k|                m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
  317|       |
  318|   151k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  319|       |
  320|   151k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  321|       |
  322|       |/* eeeo[0]= m_temp_reg_20  */
  323|       |/* eeeo[1]= m_temp_reg_21  */
  324|       |/* eeee[0]= m_temp_reg_22  */
  325|       |/* eeee[1]= m_temp_reg_23  */
  326|       |
  327|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  328|   151k|                m_temp_reg_44 = m_temp_reg_14;
  329|       |
  330|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  331|   151k|                m_temp_reg_47 = m_temp_reg_14;
  332|       |
  333|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  334|   151k|                m_temp_reg_46 = m_temp_reg_14; //m_temp_reg_16;
  335|       |
  336|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  337|   151k|                m_temp_reg_45 = m_temp_reg_14; //m_temp_reg_16;
  338|       |
  339|       |
  340|   151k|            }
  341|       |            /* eo */
  342|   151k|            {
  343|   151k|                WORD16 *pi2_scratch = o_temp_ptr;
  344|       |
  345|   151k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90
  346|   151k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87
  347|   151k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80
  348|   151k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70
  349|   151k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57
  350|   151k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43
  351|   151k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25
  352|   151k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //9
  353|       |
  354|       |                //m_temp_reg_10 = _mm_cvtepi16_epi32(m_temp_reg_71);
  355|   151k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, all_zero_reg);
  356|       |
  357|   151k|                m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
  358|       |
  359|       |                /* eo0[0-3] */
  360|   151k|                {
  361|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  362|       |
  363|       |                    //m_temp_reg_14 = _mm_cvtepi16_epi32(m_temp_reg_71);
  364|   151k|                    m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_71, all_zero_reg);
  365|       |
  366|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  367|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  368|       |
  369|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  370|   151k|                    pi2_scratch += 8;
  371|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  372|   151k|                    pi2_scratch += 8;
  373|       |
  374|   151k|                }
  375|       |
  376|       |                /* eo0[4-7] */
  377|   151k|                {
  378|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  379|       |
  380|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  381|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  382|       |
  383|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  384|   151k|                    pi2_scratch += 8;
  385|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  386|   151k|                    pi2_scratch += 8;
  387|       |
  388|   151k|                }
  389|       |                /* eo1[0-3] */
  390|   151k|                {
  391|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
  392|       |
  393|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
  394|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
  395|       |
  396|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  397|   151k|                    pi2_scratch += 8;
  398|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  399|   151k|                    pi2_scratch += 8;
  400|       |
  401|   151k|                }
  402|       |
  403|       |                /* eo1[4-7] */
  404|   151k|                {
  405|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff2);
  406|       |
  407|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
  408|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
  409|       |
  410|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  411|   151k|                    pi2_scratch += 8;
  412|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  413|   151k|                    pi2_scratch += 8;
  414|       |
  415|   151k|                }
  416|       |
  417|       |                /* eo2[0-3] */
  418|   151k|                {
  419|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  420|       |
  421|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  422|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  423|       |
  424|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  425|   151k|                    pi2_scratch += 8;
  426|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  427|   151k|                    pi2_scratch += 8;
  428|       |
  429|   151k|                }
  430|       |
  431|       |                /* eo2[4-7] */
  432|   151k|                {
  433|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
  434|       |
  435|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  436|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  437|       |
  438|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  439|   151k|                    pi2_scratch += 8;
  440|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  441|   151k|                    pi2_scratch += 8;
  442|       |
  443|   151k|                }
  444|       |
  445|       |                /**************************************************************************/
  446|       |
  447|       |
  448|       |                /* eo3[0-3] */
  449|   151k|                {
  450|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
  451|       |
  452|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
  453|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
  454|       |
  455|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  456|   151k|                    pi2_scratch += 8;
  457|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  458|   151k|                    pi2_scratch += 8;
  459|       |
  460|   151k|                }
  461|       |
  462|       |                /* eo3[4-7] */
  463|   151k|                {
  464|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff4);
  465|       |
  466|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
  467|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
  468|       |
  469|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  470|   151k|                    pi2_scratch += 8;
  471|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  472|   151k|                    pi2_scratch += 8;
  473|       |
  474|   151k|                }
  475|       |
  476|       |
  477|       |                /* eo4[0-3] */
  478|   151k|                {
  479|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
  480|       |
  481|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
  482|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
  483|       |
  484|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  485|   151k|                    pi2_scratch += 8;
  486|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  487|   151k|                    pi2_scratch += 8;
  488|       |
  489|   151k|                }
  490|       |                /* eo4[4-7] */
  491|   151k|                {
  492|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
  493|       |
  494|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
  495|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
  496|       |
  497|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  498|   151k|                    pi2_scratch += 8;
  499|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  500|   151k|                    pi2_scratch += 8;
  501|       |
  502|   151k|                }
  503|       |
  504|       |                /***********************************************************************/
  505|       |
  506|       |                /* eo5[0-3] */
  507|   151k|                {
  508|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff6);
  509|       |
  510|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  511|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  512|       |
  513|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  514|   151k|                    pi2_scratch += 8;
  515|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  516|   151k|                    pi2_scratch += 8;
  517|       |
  518|   151k|                }
  519|       |
  520|       |
  521|       |                /* eo5[4-7] */
  522|   151k|                {
  523|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff6);
  524|       |
  525|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  526|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  527|       |
  528|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  529|   151k|                    pi2_scratch += 8;
  530|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  531|   151k|                    pi2_scratch += 8;
  532|       |
  533|   151k|                }
  534|       |
  535|       |                /* eo6[0-3] */
  536|   151k|                {
  537|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff7);
  538|       |
  539|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
  540|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
  541|       |
  542|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  543|   151k|                    pi2_scratch += 8;
  544|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  545|   151k|                    pi2_scratch += 8;
  546|       |
  547|   151k|                }
  548|       |
  549|       |
  550|       |                /* eo6[4-7] */
  551|   151k|                {
  552|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff7);
  553|       |
  554|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
  555|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
  556|       |
  557|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  558|   151k|                    pi2_scratch += 8;
  559|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  560|   151k|                    pi2_scratch += 8;
  561|       |
  562|   151k|                }
  563|       |
  564|       |
  565|       |                /* eo7[0-3] */
  566|   151k|                {
  567|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff8);
  568|       |
  569|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  570|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  571|       |
  572|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  573|   151k|                    pi2_scratch += 8;
  574|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  575|   151k|                    pi2_scratch += 8;
  576|       |
  577|   151k|                }
  578|       |
  579|       |
  580|       |                /* eo7[4-7] */
  581|   151k|                {
  582|   151k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff8);
  583|       |
  584|   151k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  585|   151k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  586|       |
  587|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  588|   151k|                    pi2_scratch += 8;
  589|   151k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  590|   151k|                    pi2_scratch += 8;
  591|       |
  592|   151k|                }
  593|       |
  594|   151k|            }
  595|   151k|        }
  596|   202k|        else if(zero_last24_rows_stg1)
  ------------------
  |  Branch (596:17): [True: 135k, False: 66.7k]
  ------------------
  597|   135k|        {
  598|   135k|            {
  599|       |                /* eeo */
  600|       |                /* eeeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
  601|       |                /* eeeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
  602|       |
  603|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83 36
  604|   135k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36 -83
  605|       |
  606|   135k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64 64
  607|       |
  608|   135k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  609|       |
  610|   135k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  611|       |
  612|       |                /* eeeo[0]= m_temp_reg_20  */
  613|       |                /* eeeo[1]= m_temp_reg_21  */
  614|       |                /* eeee[0]= m_temp_reg_22  */
  615|       |                /* eeee[1]= m_temp_reg_23  */
  616|       |
  617|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  618|   135k|                m_temp_reg_40 = m_temp_reg_14;
  619|       |
  620|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  621|   135k|                m_temp_reg_43 = m_temp_reg_14;
  622|       |
  623|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  624|   135k|                m_temp_reg_42 = m_temp_reg_14; //m_temp_reg_16;
  625|       |
  626|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  627|   135k|                m_temp_reg_41 = m_temp_reg_14; //m_temp_reg_16;
  628|       |
  629|       |                /* for row 4 to 7 */
  630|       |
  631|   135k|                m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
  632|       |
  633|   135k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
  634|       |
  635|   135k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
  636|       |
  637|       |                /* eeeo[0]= m_temp_reg_20  */
  638|       |                /* eeeo[1]= m_temp_reg_21  */
  639|       |                /* eeee[0]= m_temp_reg_22  */
  640|       |                /* eeee[1]= m_temp_reg_23  */
  641|       |
  642|       |                /* eee[0] = eeee[0] + eeeo[0]; */
  643|   135k|                m_temp_reg_44 = m_temp_reg_14;
  644|       |
  645|       |                /* eee[3] = eeee[0] - eeeo[0]; */
  646|   135k|                m_temp_reg_47 = m_temp_reg_14;
  647|       |
  648|       |                /* eee[2] = eeee[1] - eeeo[1]; */
  649|   135k|                m_temp_reg_46 = m_temp_reg_14; //m_temp_reg_16;
  650|       |
  651|       |                /* eee[1] = eeee[1] + eeeo[1];*/
  652|   135k|                m_temp_reg_45 = m_temp_reg_14; //m_temp_reg_16;
  653|       |
  654|       |
  655|       |                /* eeo[] */
  656|       |                /* for(k = 0; k < 4; k++) */
  657|       |
  658|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
  659|   135k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75
  660|   135k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18
  661|   135k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[5][0]); //50 18
  662|       |
  663|   135k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, all_zero_reg);
  664|       |
  665|   135k|                m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
  666|       |
  667|   135k|                m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_72, all_zero_reg);
  668|       |
  669|   135k|                m_temp_reg_33 = _mm_setzero_si128();
  670|       |
  671|       |                /* eeo */
  672|   135k|                {
  673|       |                    /* eeo0[0-3] */
  674|   135k|                    {
  675|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  676|       |
  677|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  678|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  679|       |
  680|   135k|                        m_temp_reg_90 = m_temp_reg_34;
  681|   135k|                        m_temp_reg_97 = m_temp_reg_35;
  682|   135k|                    }
  683|       |                    /* eeo0[4-7] */
  684|   135k|                    {
  685|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  686|       |
  687|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
  688|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
  689|       |
  690|   135k|                        m_temp_reg_91 = m_temp_reg_34;
  691|   135k|                        m_temp_reg_96 = m_temp_reg_35;
  692|       |
  693|   135k|                    }
  694|       |
  695|       |                    /* eeo1[0-3] */
  696|   135k|                    {
  697|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
  698|       |
  699|       |                        /* e[1][0-3] stored in pi2_tmp[2][0-7] */
  700|       |                        /* e[6][0-3] stored in pi2_tmp[2][8-15] */
  701|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
  702|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
  703|       |
  704|   135k|                        m_temp_reg_92 = m_temp_reg_34;
  705|   135k|                        m_temp_reg_95 = m_temp_reg_35;
  706|       |
  707|   135k|                    }
  708|       |
  709|       |                    /* eo1[4-7] */
  710|   135k|                    {
  711|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff2);
  712|       |
  713|       |                        /* e[1][4-7] stored in pi2_tmp[3][0-7] */
  714|       |                        /* e[6][4-7] stored in pi2_tmp[3][8-15] */
  715|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
  716|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
  717|       |
  718|   135k|                        m_temp_reg_93 = m_temp_reg_34;
  719|   135k|                        m_temp_reg_94 = m_temp_reg_35;
  720|       |
  721|       |
  722|   135k|                    }
  723|       |
  724|       |                    /* eo2[0-3] */
  725|   135k|                    {
  726|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
  727|       |
  728|       |                        /* e[2][0-3] stored in pi2_tmp[4][0-7] */
  729|       |                        /* e[5][0-3] stored in pi2_tmp[4][8-15] */
  730|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
  731|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
  732|       |
  733|   135k|                        temp1 = m_temp_reg_34;
  734|   135k|                        temp7 = m_temp_reg_35;
  735|       |
  736|   135k|                    }
  737|       |
  738|       |                    /* eo2[4-7] */
  739|   135k|                    {
  740|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff4);
  741|       |
  742|       |                        /* e[2][4-7] stored in pi2_tmp[5][0-7] */
  743|       |                        /* e[5][4-7] stored in pi2_tmp[5][8-15] */
  744|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
  745|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
  746|       |
  747|   135k|                        temp2 = m_temp_reg_34;
  748|   135k|                        temp6 = m_temp_reg_35;
  749|       |
  750|   135k|                    }
  751|       |
  752|       |                    /* eo3[0-3] */
  753|   135k|                    {
  754|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
  755|       |
  756|       |                        /* e[3][0-3] stored in pi2_tmp[6][0-7] */
  757|       |                        /* e[4][0-3] stored in pi2_tmp[6][8-15] */
  758|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
  759|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
  760|       |
  761|   135k|                        temp3 = m_temp_reg_34;
  762|   135k|                        temp5 = m_temp_reg_35;
  763|       |
  764|   135k|                    }
  765|       |
  766|       |
  767|       |                    /* eo3[4-7] */
  768|   135k|                    {
  769|   135k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
  770|       |
  771|       |                        /* e[3][4-7] stored in pi2_tmp[7][0-7] */
  772|       |                        /* e[4][4-7] stored in pi2_tmp[7][8-15] */
  773|   135k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
  774|   135k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
  775|       |
  776|   135k|                        temp4 = m_temp_reg_34;
  777|   135k|                        temp8 = m_temp_reg_35;
  778|       |
  779|       |
  780|   135k|                    }
  781|       |                    /* All values of ee[] array in pi2_temp */
  782|       |
  783|   135k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
  784|   135k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[1][0]); //80 70
  785|   135k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57 43
  786|   135k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25 9
  787|       |
  788|   135k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  789|       |
  790|   135k|                    m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
  791|   135k|                    m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
  792|       |
  793|   135k|                }
  794|   135k|            }
  795|       |            /* eo */
  796|   135k|            {
  797|   135k|                WORD16 *pi2_scratch = o_temp_ptr;
  798|       |
  799|       |                /* eo0[0-3] */
  800|   135k|                {
  801|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  802|       |
  803|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_30);
  804|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_30);
  805|       |
  806|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  807|   135k|                    pi2_scratch += 8;
  808|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  809|   135k|                    pi2_scratch += 8;
  810|       |
  811|   135k|                }
  812|       |
  813|       |
  814|       |                /* eo0[4-7] */
  815|   135k|                {
  816|   135k|                    m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  817|       |
  818|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  819|       |
  820|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_30);
  821|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_30);
  822|       |
  823|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  824|   135k|                    pi2_scratch += 8;
  825|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  826|   135k|                    pi2_scratch += 8;
  827|       |
  828|   135k|                }
  829|       |
  830|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
  831|       |
  832|       |                /* eo1[0-3] */
  833|   135k|                {
  834|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  835|       |
  836|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_30);
  837|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_30);
  838|       |
  839|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  840|   135k|                    pi2_scratch += 8;
  841|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  842|   135k|                    pi2_scratch += 8;
  843|       |
  844|   135k|                }
  845|       |
  846|       |
  847|       |                /* eo1[4-7] */
  848|   135k|                {
  849|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  850|       |
  851|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_30);
  852|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_30);
  853|       |
  854|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  855|   135k|                    pi2_scratch += 8;
  856|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  857|   135k|                    pi2_scratch += 8;
  858|       |
  859|   135k|                }
  860|       |
  861|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
  862|       |
  863|       |                /* eo2[0-3] */
  864|   135k|                {
  865|       |
  866|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  867|       |
  868|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp1, m_temp_reg_30);
  869|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp1, m_temp_reg_30);
  870|       |
  871|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  872|   135k|                    pi2_scratch += 8;
  873|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  874|   135k|                    pi2_scratch += 8;
  875|       |
  876|   135k|                }
  877|       |
  878|       |                /* eo2[4-7] */
  879|   135k|                {
  880|       |
  881|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  882|       |
  883|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp2, m_temp_reg_30);
  884|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp2, m_temp_reg_30);
  885|       |
  886|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  887|   135k|                    pi2_scratch += 8;
  888|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  889|   135k|                    pi2_scratch += 8;
  890|       |
  891|   135k|                }
  892|       |
  893|       |                /**************************************************************************/
  894|       |
  895|       |
  896|       |
  897|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
  898|       |
  899|       |                /* eo3[0-3] */
  900|   135k|                {
  901|       |
  902|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  903|       |
  904|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp3, m_temp_reg_30);
  905|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp3, m_temp_reg_30);
  906|       |
  907|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  908|   135k|                    pi2_scratch += 8;
  909|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  910|   135k|                    pi2_scratch += 8;
  911|       |
  912|   135k|                }
  913|       |
  914|       |
  915|       |                /* eo3[4-7] */
  916|   135k|                {
  917|       |
  918|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  919|       |
  920|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp4, m_temp_reg_30);
  921|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp4, m_temp_reg_30);
  922|       |
  923|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  924|   135k|                    pi2_scratch += 8;
  925|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  926|   135k|                    pi2_scratch += 8;
  927|       |
  928|   135k|                }
  929|       |
  930|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
  931|       |
  932|       |                /* eo4[0-3] */
  933|   135k|                {
  934|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  935|       |
  936|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp5, m_temp_reg_30);
  937|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp5, m_temp_reg_30);
  938|       |
  939|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  940|   135k|                    pi2_scratch += 8;
  941|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  942|   135k|                    pi2_scratch += 8;
  943|       |
  944|   135k|                }
  945|       |                /* eo4[4-7] */
  946|   135k|                {
  947|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  948|       |
  949|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp8, m_temp_reg_30);
  950|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp8, m_temp_reg_30);
  951|       |
  952|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  953|   135k|                    pi2_scratch += 8;
  954|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  955|   135k|                    pi2_scratch += 8;
  956|       |
  957|   135k|                }
  958|       |
  959|       |                /***********************************************************************/
  960|       |
  961|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
  962|       |
  963|       |                /* eo5[0-3] */
  964|   135k|                {
  965|       |
  966|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  967|       |
  968|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp7, m_temp_reg_30);
  969|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp7, m_temp_reg_30);
  970|       |
  971|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  972|   135k|                    pi2_scratch += 8;
  973|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  974|   135k|                    pi2_scratch += 8;
  975|       |
  976|   135k|                }
  977|       |
  978|       |
  979|       |                /* eo5[4-7] */
  980|   135k|                {
  981|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
  982|       |
  983|   135k|                    m_temp_reg_34 = _mm_add_epi32(temp6, m_temp_reg_30);
  984|   135k|                    m_temp_reg_35 = _mm_sub_epi32(temp6, m_temp_reg_30);
  985|       |
  986|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
  987|   135k|                    pi2_scratch += 8;
  988|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
  989|   135k|                    pi2_scratch += 8;
  990|       |
  991|   135k|                }
  992|       |
  993|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
  994|       |
  995|       |                /* eo6[0-3] */
  996|   135k|                {
  997|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
  998|       |
  999|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_30);
 1000|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_30);
 1001|       |
 1002|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1003|   135k|                    pi2_scratch += 8;
 1004|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1005|   135k|                    pi2_scratch += 8;
 1006|       |
 1007|   135k|                }
 1008|       |
 1009|       |
 1010|       |                /* eo6[4-7] */
 1011|   135k|                {
 1012|       |
 1013|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1014|       |
 1015|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_30);
 1016|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_30);
 1017|       |
 1018|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1019|   135k|                    pi2_scratch += 8;
 1020|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1021|   135k|                    pi2_scratch += 8;
 1022|       |
 1023|   135k|                }
 1024|       |
 1025|   135k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 1026|       |
 1027|       |                /* eo7[0-3] */
 1028|   135k|                {
 1029|       |
 1030|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1031|       |
 1032|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_30);
 1033|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_30);
 1034|       |
 1035|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1036|   135k|                    pi2_scratch += 8;
 1037|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1038|   135k|                    pi2_scratch += 8;
 1039|       |
 1040|   135k|                }
 1041|       |
 1042|       |
 1043|       |                /* eo7[4-7] */
 1044|   135k|                {
 1045|   135k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1046|       |
 1047|   135k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_30);
 1048|   135k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_30);
 1049|       |
 1050|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1051|   135k|                    pi2_scratch += 8;
 1052|   135k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1053|   135k|                    pi2_scratch += 8;
 1054|       |
 1055|   135k|                }
 1056|       |
 1057|   135k|            }
 1058|       |
 1059|   135k|        }
 1060|  66.7k|        else
 1061|  66.7k|        {
 1062|       |
 1063|  66.7k|            {
 1064|       |                /* eeo */
 1065|       |                /* eeeo[0] stored in m_temp_reg_20 and m_temp_reg_21 */
 1066|       |                /* eeeo[1] stored in m_temp_reg_22 and m_temp_reg_23 */
 1067|       |
 1068|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83 36
 1069|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36 -83
 1070|       |
 1071|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64 64
 1072|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[3][0]); //64 -64
 1073|       |
 1074|  66.7k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_84);
 1075|       |
 1076|  66.7k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_80);
 1077|       |
 1078|  66.7k|                m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);  /* eeeo[0] */
 1079|  66.7k|                m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);  /* eeeo[1] */
 1080|       |
 1081|  66.7k|                m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);  /* eeee[0] */
 1082|  66.7k|                m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);  /* eeee[1] */
 1083|       |
 1084|       |
 1085|       |                /* eeeo[0]= m_temp_reg_20  */
 1086|       |                /* eeeo[1]= m_temp_reg_21  */
 1087|       |                /* eeee[0]= m_temp_reg_22  */
 1088|       |                /* eeee[1]= m_temp_reg_23  */
 1089|       |
 1090|       |                /* eee[0] = eeee[0] + eeeo[0]; */
 1091|  66.7k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[0] */
 1092|       |
 1093|       |                /* eee[3] = eeee[0] - eeeo[0]; */
 1094|  66.7k|                m_temp_reg_43 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[1] */
 1095|       |
 1096|       |                /* eee[2] = eeee[1] - eeeo[1]; */
 1097|  66.7k|                m_temp_reg_42 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[1] */
 1098|       |
 1099|       |                /* eee[1] = eeee[1] + eeeo[1];*/
 1100|  66.7k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[0] */
 1101|       |
 1102|       |                /* for row 4 to 7 */
 1103|       |
 1104|  66.7k|                m_temp_reg_74 = _mm_srli_si128(m_temp_reg_74, 8);
 1105|  66.7k|                m_temp_reg_84 = _mm_srli_si128(m_temp_reg_84, 8);
 1106|       |
 1107|       |                /* Interleaving row 8 and row 24*/
 1108|  66.7k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_84);
 1109|       |
 1110|  66.7k|                m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 1111|  66.7k|                m_temp_reg_80 = _mm_srli_si128(m_temp_reg_80, 8);
 1112|       |
 1113|  66.7k|                m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_80);
 1114|       |
 1115|  66.7k|                m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);  /* eeeo[0] */
 1116|  66.7k|                m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);  /* eeeo[1] */
 1117|       |
 1118|  66.7k|                m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);  /* eeee[0] */
 1119|  66.7k|                m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);  /* eeee[1] */
 1120|       |
 1121|       |
 1122|       |                /* eeeo[0]= m_temp_reg_20  */
 1123|       |                /* eeeo[1]= m_temp_reg_21  */
 1124|       |                /* eeee[0]= m_temp_reg_22  */
 1125|       |                /* eeee[1]= m_temp_reg_23  */
 1126|       |
 1127|       |                /* eee[0] = eeee[0] + eeeo[0]; */
 1128|  66.7k|                m_temp_reg_44 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[0] */
 1129|       |
 1130|       |                /* eee[3] = eeee[0] - eeeo[0]; */
 1131|  66.7k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[1] */
 1132|       |
 1133|       |                /* eee[2] = eeee[1] - eeeo[1]; */
 1134|  66.7k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[1] */
 1135|       |
 1136|       |                /* eee[1] = eeee[1] + eeeo[1];*/
 1137|  66.7k|                m_temp_reg_45 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[0] */
 1138|       |
 1139|       |
 1140|       |                // eeo[]
 1141|       |                /* for(k = 0; k < 4; k++) */
 1142|       |
 1143|       |
 1144|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
 1145|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[5][0]); //50 18
 1146|       |
 1147|       |                /* eeo */
 1148|  66.7k|                {
 1149|       |                    /* eeo0[0-3] */
 1150|  66.7k|                    {
 1151|  66.7k|                        m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1152|  66.7k|                        m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_86);
 1153|       |
 1154|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1155|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1156|       |
 1157|  66.7k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1158|       |
 1159|  66.7k|                        m_temp_reg_90 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1160|  66.7k|                        m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1161|       |
 1162|  66.7k|                    }
 1163|       |
 1164|  66.7k|                    m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
 1165|  66.7k|                    m_temp_reg_76 = _mm_srli_si128(m_temp_reg_76, 8);
 1166|  66.7k|                    m_temp_reg_82 = _mm_srli_si128(m_temp_reg_82, 8);
 1167|  66.7k|                    m_temp_reg_86 = _mm_srli_si128(m_temp_reg_86, 8);
 1168|       |
 1169|       |                    /* eeo0[4-7] */
 1170|  66.7k|                    {
 1171|  66.7k|                        m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1172|  66.7k|                        m_temp_reg_15 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_86);
 1173|       |
 1174|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1175|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1176|       |
 1177|  66.7k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1178|       |
 1179|  66.7k|                        m_temp_reg_91 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_30);
 1180|  66.7k|                        m_temp_reg_96 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_30);
 1181|       |
 1182|  66.7k|                    }
 1183|       |
 1184|       |
 1185|  66.7k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75 -18
 1186|  66.7k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[7][0]); //89  50
 1187|       |
 1188|       |                    /* eeo1[0-3] */
 1189|  66.7k|                    {
 1190|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1191|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 1192|       |
 1193|  66.7k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_30);
 1194|  66.7k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_30);
 1195|       |
 1196|  66.7k|                        m_temp_reg_92 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_31);
 1197|  66.7k|                        m_temp_reg_95 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_31);
 1198|       |
 1199|  66.7k|                    }
 1200|       |
 1201|       |                    /* eeo1[4-7] */
 1202|  66.7k|                    {
 1203|       |
 1204|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1205|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff4);
 1206|       |
 1207|  66.7k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_30);
 1208|  66.7k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_30);
 1209|       |
 1210|  66.7k|                        m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_34, m_temp_reg_31);
 1211|  66.7k|                        m_temp_reg_94 = _mm_add_epi32(m_temp_reg_35, m_temp_reg_31);
 1212|       |
 1213|       |
 1214|  66.7k|                    }
 1215|       |
 1216|  66.7k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[8][0]); //50 -89
 1217|  66.7k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18  75
 1218|       |
 1219|       |                    /* eeo2[0-3] */
 1220|  66.7k|                    {
 1221|       |
 1222|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1223|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 1224|       |
 1225|       |                        /* e[2][0-3] stored in pi2_tmp[4][0-7] */
 1226|       |                        /* e[5][0-3] stored in pi2_tmp[4][8-15] */
 1227|       |
 1228|  66.7k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_30);
 1229|  66.7k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_30);
 1230|       |
 1231|  66.7k|                        temp1 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1232|  66.7k|                        temp7 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1233|       |
 1234|  66.7k|                    }
 1235|       |
 1236|       |                    /* eeo2[4-7] */
 1237|  66.7k|                    {
 1238|       |
 1239|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1240|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff4);
 1241|       |
 1242|       |                        /* e[2][4-7] stored in pi2_tmp[5][0-7] */
 1243|       |                        /* e[5][4-7] stored in pi2_tmp[5][8-15] */
 1244|       |
 1245|  66.7k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_30);
 1246|  66.7k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_30);
 1247|       |
 1248|  66.7k|                        temp2 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1249|  66.7k|                        temp6 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1250|       |
 1251|  66.7k|                    }
 1252|       |
 1253|  66.7k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[10][0]); //18 -50
 1254|  66.7k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[11][0]); //75  -89
 1255|       |
 1256|       |                    /* eeo3[0-3] */
 1257|  66.7k|                    {
 1258|       |
 1259|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 1260|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 1261|       |
 1262|       |                        /* e[3][0-3] stored in pi2_tmp[6][0-7] */
 1263|       |                        /* e[4][0-3] stored in pi2_tmp[6][8-15] */
 1264|       |
 1265|  66.7k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_30);
 1266|  66.7k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_30);
 1267|       |
 1268|  66.7k|                        temp3 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1269|  66.7k|                        temp5 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1270|       |
 1271|       |
 1272|  66.7k|                    }
 1273|       |
 1274|       |                    /* eeo3[4-7] */
 1275|  66.7k|                    {
 1276|       |
 1277|  66.7k|                        m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff3);
 1278|  66.7k|                        m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff4);
 1279|       |
 1280|       |                        /* e[3][4-7] stored in pi2_tmp[7][0-7] */
 1281|       |                        /* e[4][4-7] stored in pi2_tmp[7][8-15] */
 1282|       |
 1283|  66.7k|                        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_30);
 1284|  66.7k|                        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_30);
 1285|  66.7k|                        temp4 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_31);
 1286|  66.7k|                        temp8 = _mm_sub_epi32(m_temp_reg_35, m_temp_reg_31);
 1287|       |
 1288|  66.7k|                    }
 1289|       |
 1290|       |
 1291|       |                    /* All values of ee[] array in pi2_temp */
 1292|       |
 1293|       |                    /* for(k = 0; k < 8; k++) */
 1294|  66.7k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 1295|  66.7k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[1][0]); //80 70
 1296|  66.7k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57 43
 1297|  66.7k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25 9
 1298|  66.7k|                }
 1299|  66.7k|            }
 1300|       |            /* eo */
 1301|  66.7k|            {
 1302|  66.7k|                WORD16 *pi2_scratch = o_temp_ptr;
 1303|       |
 1304|  66.7k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1305|  66.7k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1306|  66.7k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_81, m_temp_reg_83);
 1307|  66.7k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_85, m_temp_reg_87);
 1308|       |
 1309|  66.7k|                m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 1310|  66.7k|                m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
 1311|  66.7k|                m_temp_reg_75 = _mm_srli_si128(m_temp_reg_75, 8);
 1312|  66.7k|                m_temp_reg_77 = _mm_srli_si128(m_temp_reg_77, 8);
 1313|       |
 1314|  66.7k|                m_temp_reg_81 = _mm_srli_si128(m_temp_reg_81, 8);
 1315|  66.7k|                m_temp_reg_83 = _mm_srli_si128(m_temp_reg_83, 8);
 1316|  66.7k|                m_temp_reg_85 = _mm_srli_si128(m_temp_reg_85, 8);
 1317|  66.7k|                m_temp_reg_87 = _mm_srli_si128(m_temp_reg_87, 8);
 1318|       |
 1319|       |                /* eo0[0-3] */
 1320|  66.7k|                {
 1321|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1322|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1323|       |
 1324|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1325|       |
 1326|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1327|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1328|       |
 1329|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1330|       |
 1331|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1332|       |
 1333|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_30);
 1334|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_30);
 1335|       |
 1336|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1337|  66.7k|                    pi2_scratch += 8;
 1338|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1339|  66.7k|                    pi2_scratch += 8;
 1340|       |
 1341|  66.7k|                }
 1342|       |                /* eo0[4-7] */
 1343|  66.7k|                {
 1344|  66.7k|                    m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1345|  66.7k|                    m_temp_reg_15 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1346|  66.7k|                    m_temp_reg_16 = _mm_unpacklo_epi16(m_temp_reg_81, m_temp_reg_83);
 1347|  66.7k|                    m_temp_reg_17 = _mm_unpacklo_epi16(m_temp_reg_85, m_temp_reg_87);
 1348|       |
 1349|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1350|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1351|       |
 1352|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1353|       |
 1354|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1355|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1356|       |
 1357|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1358|       |
 1359|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1360|       |
 1361|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_30);
 1362|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_30);
 1363|       |
 1364|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1365|  66.7k|                    pi2_scratch += 8;
 1366|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1367|  66.7k|                    pi2_scratch += 8;
 1368|       |
 1369|  66.7k|                }
 1370|       |
 1371|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
 1372|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //0  -43
 1373|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80  90
 1374|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70  25
 1375|       |
 1376|       |                /* eo1[0-3] */
 1377|  66.7k|                {
 1378|       |
 1379|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1380|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1381|       |
 1382|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1383|       |
 1384|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1385|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1386|       |
 1387|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1388|       |
 1389|  66.7k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_32);
 1390|       |
 1391|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_30);
 1392|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_30);
 1393|       |
 1394|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1395|  66.7k|                    pi2_scratch += 8;
 1396|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1397|  66.7k|                    pi2_scratch += 8;
 1398|       |
 1399|  66.7k|                }
 1400|       |
 1401|       |                /* eo1[4-7] */
 1402|  66.7k|                {
 1403|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1404|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1405|       |
 1406|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1407|       |
 1408|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1409|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1410|       |
 1411|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1412|       |
 1413|  66.7k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_32);
 1414|       |
 1415|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_30);
 1416|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_30);
 1417|       |
 1418|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1419|  66.7k|                    pi2_scratch += 8;
 1420|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1421|  66.7k|                    pi2_scratch += 8;
 1422|       |
 1423|  66.7k|                }
 1424|       |
 1425|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
 1426|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[9][0]); //70  87
 1427|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[10][0]); //-25  57
 1428|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[11][0]); //90  43
 1429|       |
 1430|       |                /* eo2[0-3] */
 1431|  66.7k|                {
 1432|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1433|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1434|       |
 1435|  66.7k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 1436|       |
 1437|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1438|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1439|       |
 1440|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1441|       |
 1442|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1443|       |
 1444|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp1, m_temp_reg_30);
 1445|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp1, m_temp_reg_30);
 1446|       |
 1447|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1448|  66.7k|                    pi2_scratch += 8;
 1449|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1450|  66.7k|                    pi2_scratch += 8;
 1451|       |
 1452|  66.7k|                }
 1453|       |
 1454|       |
 1455|       |                /* eo2[4-7] */
 1456|  66.7k|                {
 1457|       |
 1458|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1459|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1460|       |
 1461|  66.7k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 1462|       |
 1463|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1464|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1465|       |
 1466|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1467|       |
 1468|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1469|       |
 1470|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp2, m_temp_reg_30);
 1471|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp2, m_temp_reg_30);
 1472|       |
 1473|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1474|  66.7k|                    pi2_scratch += 8;
 1475|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1476|  66.7k|                    pi2_scratch += 8;
 1477|       |
 1478|  66.7k|                }
 1479|       |                /**************************************************************************/
 1480|       |
 1481|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
 1482|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[13][0]); //-87  9
 1483|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[14][0]); //90  25
 1484|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[15][0]); //80  57
 1485|       |
 1486|       |                /* eo3[0-3] */
 1487|  66.7k|                {
 1488|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1489|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1490|       |
 1491|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1492|       |
 1493|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1494|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1495|       |
 1496|  66.7k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_32, m_temp_reg_33);
 1497|       |
 1498|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1499|       |
 1500|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp3, m_temp_reg_30);
 1501|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp3, m_temp_reg_30);
 1502|       |
 1503|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1504|  66.7k|                    pi2_scratch += 8;
 1505|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1506|  66.7k|                    pi2_scratch += 8;
 1507|       |
 1508|  66.7k|                }
 1509|       |
 1510|       |
 1511|       |                /* eo3[4-7] */
 1512|  66.7k|                {
 1513|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1514|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1515|       |
 1516|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1517|       |
 1518|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1519|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1520|       |
 1521|  66.7k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_32, m_temp_reg_33);
 1522|       |
 1523|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1524|       |
 1525|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp4, m_temp_reg_30);
 1526|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp4, m_temp_reg_30);
 1527|       |
 1528|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1529|  66.7k|                    pi2_scratch += 8;
 1530|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1531|  66.7k|                    pi2_scratch += 8;
 1532|       |
 1533|  66.7k|                }
 1534|       |
 1535|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
 1536|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[17][0]); //-25  90
 1537|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[18][0]); //9  87
 1538|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43  70
 1539|       |
 1540|       |                /* eo4[0-3] */
 1541|  66.7k|                {
 1542|       |
 1543|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1544|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1545|       |
 1546|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1547|       |
 1548|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1549|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1550|       |
 1551|  66.7k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
 1552|       |
 1553|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1554|       |
 1555|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp5, m_temp_reg_30);
 1556|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp5, m_temp_reg_30);
 1557|       |
 1558|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1559|  66.7k|                    pi2_scratch += 8;
 1560|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1561|  66.7k|                    pi2_scratch += 8;
 1562|       |
 1563|  66.7k|                }
 1564|       |
 1565|       |
 1566|       |                /* eo4[4-7] */
 1567|  66.7k|                {
 1568|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1569|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1570|       |
 1571|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1572|       |
 1573|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1574|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1575|       |
 1576|  66.7k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
 1577|       |
 1578|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1579|       |
 1580|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp8, m_temp_reg_30);
 1581|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp8, m_temp_reg_30);
 1582|       |
 1583|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1584|  66.7k|                    pi2_scratch += 8;
 1585|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1586|  66.7k|                    pi2_scratch += 8;
 1587|       |
 1588|  66.7k|                }
 1589|       |
 1590|       |                /***********************************************************************/
 1591|       |
 1592|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
 1593|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[21][0]); //57  25
 1594|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[22][0]); //-87  70
 1595|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[23][0]); //9  -80
 1596|       |
 1597|       |                /* eo5[0-3] */
 1598|  66.7k|                {
 1599|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1600|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1601|       |
 1602|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1603|       |
 1604|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1605|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1606|       |
 1607|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1608|       |
 1609|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1610|       |
 1611|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp7, m_temp_reg_30);
 1612|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp7, m_temp_reg_30);
 1613|       |
 1614|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1615|  66.7k|                    pi2_scratch += 8;
 1616|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1617|  66.7k|                    pi2_scratch += 8;
 1618|       |
 1619|  66.7k|                }
 1620|       |
 1621|       |
 1622|       |                /* eo5[4-7] */
 1623|  66.7k|                {
 1624|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1625|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1626|       |
 1627|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1628|       |
 1629|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1630|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1631|       |
 1632|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1633|       |
 1634|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1635|       |
 1636|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(temp6, m_temp_reg_30);
 1637|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(temp6, m_temp_reg_30);
 1638|       |
 1639|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1640|  66.7k|                    pi2_scratch += 8;
 1641|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1642|  66.7k|                    pi2_scratch += 8;
 1643|       |
 1644|  66.7k|                }
 1645|       |
 1646|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
 1647|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[25][0]); //90  -80
 1648|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[26][0]); //43  9
 1649|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[27][0]); //-57  87
 1650|       |
 1651|       |                /* eo6[0-3] */
 1652|  66.7k|                {
 1653|       |
 1654|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1655|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1656|       |
 1657|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1658|       |
 1659|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1660|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1661|       |
 1662|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1663|       |
 1664|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1665|       |
 1666|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_30);
 1667|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_30);
 1668|       |
 1669|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1670|  66.7k|                    pi2_scratch += 8;
 1671|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1672|  66.7k|                    pi2_scratch += 8;
 1673|       |
 1674|  66.7k|                }
 1675|       |
 1676|       |
 1677|       |                /* eo6[4-7] */
 1678|  66.7k|                {
 1679|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1680|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1681|       |
 1682|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1683|       |
 1684|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1685|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1686|       |
 1687|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1688|       |
 1689|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1690|       |
 1691|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_30);
 1692|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_30);
 1693|       |
 1694|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1695|  66.7k|                    pi2_scratch += 8;
 1696|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1697|  66.7k|                    pi2_scratch += 8;
 1698|       |
 1699|  66.7k|                }
 1700|       |
 1701|  66.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 1702|  66.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[29][0]); //43  -57
 1703|  66.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[30][0]); //70  -80
 1704|  66.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[31][0]); //87  -90
 1705|       |
 1706|       |                /* eo7[0-3] */
 1707|  66.7k|                {
 1708|       |
 1709|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1710|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 1711|       |
 1712|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1713|       |
 1714|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 1715|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 1716|       |
 1717|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1718|       |
 1719|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1720|       |
 1721|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_30);
 1722|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_30);
 1723|       |
 1724|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1725|  66.7k|                    pi2_scratch += 8;
 1726|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1727|  66.7k|                    pi2_scratch += 8;
 1728|       |
 1729|  66.7k|                }
 1730|       |
 1731|       |
 1732|       |                /* eo7[4-7] */
 1733|  66.7k|                {
 1734|       |
 1735|  66.7k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_14, m_coeff1);
 1736|  66.7k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_15, m_coeff2);
 1737|       |
 1738|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 1739|       |
 1740|  66.7k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_16, m_coeff3);
 1741|  66.7k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_17, m_coeff4);
 1742|       |
 1743|  66.7k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 1744|       |
 1745|  66.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 1746|       |
 1747|  66.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_30);
 1748|  66.7k|                    m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_30);
 1749|       |
 1750|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_34);
 1751|  66.7k|                    pi2_scratch += 8;
 1752|  66.7k|                    _mm_store_si128((__m128i *)pi2_scratch, m_temp_reg_35);
 1753|  66.7k|                    pi2_scratch += 8;
 1754|       |
 1755|  66.7k|                }
 1756|       |
 1757|  66.7k|            }
 1758|       |
 1759|  66.7k|        }
 1760|       |        /*  All e[] are done */
 1761|       |        /****************************/
 1762|       |
 1763|       |
 1764|   354k|        {
 1765|       |
 1766|   354k|            WORD16 *pi2_tmp_src = pi2_src + src_strd;
 1767|       |
 1768|   354k|            m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1769|   354k|            pi2_tmp_src += (src_strd << 1);
 1770|   354k|            m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1771|   354k|            pi2_tmp_src += (src_strd << 1);
 1772|   354k|            m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1773|   354k|            pi2_tmp_src += (src_strd << 1);
 1774|   354k|            m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1775|   354k|            pi2_tmp_src += (src_strd << 1);
 1776|   354k|            m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1777|   354k|            pi2_tmp_src += (src_strd << 1);
 1778|   354k|            m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1779|   354k|            pi2_tmp_src += (src_strd << 1);
 1780|   354k|            m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1781|   354k|            pi2_tmp_src += (src_strd << 1);
 1782|   354k|            m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1783|   354k|            pi2_tmp_src += (src_strd << 1);
 1784|       |
 1785|   354k|            m_temp_reg_80 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1786|   354k|            pi2_tmp_src += (src_strd << 1);
 1787|   354k|            m_temp_reg_81 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1788|   354k|            pi2_tmp_src += (src_strd << 1);
 1789|   354k|            m_temp_reg_82 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1790|   354k|            pi2_tmp_src += (src_strd << 1);
 1791|   354k|            m_temp_reg_83 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1792|   354k|            pi2_tmp_src += (src_strd << 1);
 1793|   354k|            m_temp_reg_84 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1794|   354k|            pi2_tmp_src += (src_strd << 1);
 1795|   354k|            m_temp_reg_85 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1796|   354k|            pi2_tmp_src += (src_strd << 1);
 1797|   354k|            m_temp_reg_86 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1798|   354k|            pi2_tmp_src += (src_strd << 1);
 1799|   354k|            m_temp_reg_87 = _mm_load_si128((__m128i *)pi2_tmp_src);
 1800|   354k|        }
 1801|       |
 1802|   354k|        if(zero_last28_rows_stg1)
  ------------------
  |  Branch (1802:12): [True: 151k, False: 202k]
  ------------------
 1803|   151k|        {
 1804|       |            /* o & stage 1 out */
 1805|   151k|            {
 1806|   151k|                WORD32 j;
 1807|   151k|                WORD16 *pi2_src_scratch = o_temp_ptr;
 1808|   151k|                WORD16 *pi2_dst_scratch = temp_ptr;
 1809|   151k|                WORD32 out_stride = (trans_size << 1);
 1810|   151k|                WORD32 in_stride = trans_size;
 1811|       |
 1812|   455k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (1812:28): [True: 303k, False: 151k]
  ------------------
 1813|   303k|                {
 1814|   303k|                    if(j)
  ------------------
  |  Branch (1814:24): [True: 152k, False: 151k]
  ------------------
 1815|   152k|                    {
 1816|   152k|                        m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 1817|   152k|                        m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 1818|   152k|                    }
 1819|       |
 1820|   303k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 1821|       |
 1822|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 1823|       |
 1824|       |                    /* o0[0-3] */
 1825|   303k|                    {
 1826|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1827|       |
 1828|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1829|   303k|                        pi2_src_scratch += in_stride;
 1830|       |
 1831|   303k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1832|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1833|       |
 1834|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1835|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1836|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1837|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1838|       |
 1839|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1840|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1841|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1842|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1843|       |
 1844|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1845|       |
 1846|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1847|   303k|                        pi2_dst_scratch += out_stride;
 1848|       |
 1849|   303k|                    }
 1850|       |
 1851|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 1852|       |
 1853|       |                    /* o1[0-3] */
 1854|   303k|                    {
 1855|       |
 1856|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1857|       |
 1858|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1859|   303k|                        pi2_src_scratch += in_stride;
 1860|       |
 1861|   303k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1862|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1863|       |
 1864|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1865|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1866|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1867|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1868|       |
 1869|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1870|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1871|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1872|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1873|       |
 1874|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1875|       |
 1876|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1877|   303k|                        pi2_dst_scratch += out_stride;
 1878|       |
 1879|   303k|                    }
 1880|       |
 1881|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 1882|       |
 1883|       |                    /* o2[0-3] */
 1884|   303k|                    {
 1885|       |
 1886|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1887|       |
 1888|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1889|   303k|                        pi2_src_scratch += in_stride;
 1890|       |
 1891|   303k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1892|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1893|       |
 1894|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1895|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1896|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1897|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1898|       |
 1899|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1900|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1901|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1902|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1903|       |
 1904|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1905|       |
 1906|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1907|   303k|                        pi2_dst_scratch += out_stride;
 1908|       |
 1909|   303k|                    }
 1910|       |
 1911|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 1912|       |
 1913|       |                    /* o3[0-3] */
 1914|   303k|                    {
 1915|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1916|       |
 1917|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1918|   303k|                        pi2_src_scratch += in_stride;
 1919|       |
 1920|   303k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1921|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1922|       |
 1923|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1924|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1925|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1926|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1927|       |
 1928|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1929|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1930|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1931|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1932|       |
 1933|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1934|       |
 1935|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1936|   303k|                        pi2_dst_scratch += out_stride;
 1937|       |
 1938|   303k|                    }
 1939|       |
 1940|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 1941|       |
 1942|       |                    /* o4[0-3] */
 1943|   303k|                    {
 1944|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1945|       |
 1946|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1947|   303k|                        pi2_src_scratch += in_stride;
 1948|       |
 1949|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1950|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1951|       |
 1952|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1953|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1954|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1955|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1956|       |
 1957|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1958|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1959|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1960|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1961|       |
 1962|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1963|       |
 1964|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1965|   303k|                        pi2_dst_scratch += out_stride;
 1966|       |
 1967|   303k|                    }
 1968|       |
 1969|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 1970|       |
 1971|       |                    /* o5[0-3] */
 1972|   303k|                    {
 1973|       |
 1974|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 1975|       |
 1976|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 1977|   303k|                        pi2_src_scratch += in_stride;
 1978|       |
 1979|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 1980|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 1981|       |
 1982|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1983|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 1984|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 1985|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 1986|       |
 1987|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 1988|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 1989|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 1990|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 1991|       |
 1992|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 1993|       |
 1994|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 1995|   303k|                        pi2_dst_scratch += out_stride;
 1996|       |
 1997|   303k|                    }
 1998|       |
 1999|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 2000|       |
 2001|       |                    /* o6[0-3] */
 2002|   303k|                    {
 2003|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2004|       |
 2005|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2006|   303k|                        pi2_src_scratch += in_stride;
 2007|       |
 2008|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2009|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2010|       |
 2011|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2012|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2013|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2014|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2015|       |
 2016|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2017|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2018|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2019|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2020|       |
 2021|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2022|       |
 2023|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2024|   303k|                        pi2_dst_scratch += out_stride;
 2025|       |
 2026|   303k|                    }
 2027|       |
 2028|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 2029|       |
 2030|       |                    /* o7[0-3] */
 2031|   303k|                    {
 2032|       |
 2033|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2034|       |
 2035|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2036|   303k|                        pi2_src_scratch += 8;
 2037|       |
 2038|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2039|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2040|       |
 2041|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2042|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2043|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2044|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2045|       |
 2046|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2047|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2048|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2049|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2050|       |
 2051|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2052|       |
 2053|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2054|   303k|                        pi2_dst_scratch += 8;
 2055|       |
 2056|   303k|                    }
 2057|       |
 2058|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 2059|       |
 2060|       |                    /* o8[0-3] */
 2061|   303k|                    {
 2062|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2063|       |
 2064|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2065|   303k|                        pi2_src_scratch -= in_stride;
 2066|       |
 2067|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2068|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2069|       |
 2070|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2071|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2072|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2073|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2074|       |
 2075|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2076|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2077|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2078|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2079|       |
 2080|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2081|       |
 2082|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2083|   303k|                        pi2_dst_scratch -= out_stride;
 2084|   303k|                    }
 2085|       |
 2086|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 2087|       |
 2088|       |                    /* o9[0-3] */
 2089|   303k|                    {
 2090|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2091|       |
 2092|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2093|   303k|                        pi2_src_scratch -= in_stride;
 2094|       |
 2095|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2096|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2097|       |
 2098|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2099|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2100|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2101|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2102|       |
 2103|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2104|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2105|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2106|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2107|       |
 2108|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2109|       |
 2110|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2111|   303k|                        pi2_dst_scratch -= out_stride;
 2112|   303k|                    }
 2113|       |
 2114|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 2115|       |
 2116|       |                    /* o10[0-3] */
 2117|   303k|                    {
 2118|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2119|       |
 2120|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2121|   303k|                        pi2_src_scratch -= in_stride;
 2122|       |
 2123|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2124|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2125|       |
 2126|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2127|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2128|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2129|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2130|       |
 2131|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2132|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2133|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2134|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2135|       |
 2136|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2137|       |
 2138|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2139|   303k|                        pi2_dst_scratch -= out_stride;
 2140|   303k|                    }
 2141|       |
 2142|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 2143|       |
 2144|       |                    /* o11[0-3] */
 2145|   303k|                    {
 2146|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2147|       |
 2148|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2149|   303k|                        pi2_src_scratch -= in_stride;
 2150|       |
 2151|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2152|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2153|       |
 2154|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2155|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2156|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2157|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2158|       |
 2159|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2160|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2161|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2162|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2163|       |
 2164|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2165|       |
 2166|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2167|   303k|                        pi2_dst_scratch -= out_stride;
 2168|       |
 2169|   303k|                    }
 2170|       |
 2171|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 2172|       |
 2173|       |                    /* o12[0-3] */
 2174|   303k|                    {
 2175|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2176|       |
 2177|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2178|   303k|                        pi2_src_scratch -= in_stride;
 2179|       |
 2180|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2181|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2182|       |
 2183|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2184|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2185|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2186|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2187|       |
 2188|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2189|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2190|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2191|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2192|       |
 2193|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2194|       |
 2195|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2196|   303k|                        pi2_dst_scratch -= out_stride;
 2197|       |
 2198|   303k|                    }
 2199|       |
 2200|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 2201|       |
 2202|       |                    /* o13[0-3] */
 2203|   303k|                    {
 2204|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2205|       |
 2206|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2207|   303k|                        pi2_src_scratch -= in_stride;
 2208|       |
 2209|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2210|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2211|       |
 2212|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2213|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2214|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2215|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2216|       |
 2217|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2218|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2219|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2220|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2221|       |
 2222|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2223|       |
 2224|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2225|   303k|                        pi2_dst_scratch -= out_stride;
 2226|   303k|                    }
 2227|       |
 2228|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 2229|       |
 2230|       |                    /* o14[0-3] */
 2231|   303k|                    {
 2232|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2233|       |
 2234|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2235|   303k|                        pi2_src_scratch -= in_stride;
 2236|       |
 2237|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2238|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2239|       |
 2240|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2241|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2242|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2243|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2244|       |
 2245|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2246|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2247|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2248|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2249|       |
 2250|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2251|       |
 2252|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2253|   303k|                        pi2_dst_scratch -= out_stride;
 2254|       |
 2255|   303k|                    }
 2256|       |
 2257|   303k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 2258|       |
 2259|       |                    /* o15[0-3] */
 2260|   303k|                    {
 2261|   303k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2262|       |
 2263|   303k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2264|   303k|                        pi2_src_scratch += 8;
 2265|       |
 2266|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2267|   303k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2268|       |
 2269|   303k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2270|   303k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2271|   303k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2272|   303k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2273|       |
 2274|   303k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2275|   303k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2276|   303k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2277|   303k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2278|       |
 2279|   303k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2280|       |
 2281|   303k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2282|   303k|                        pi2_dst_scratch += 8;
 2283|   303k|                    }
 2284|       |
 2285|   303k|                }
 2286|   151k|            }
 2287|   151k|        }
 2288|   202k|        else if(zero_last24_rows_stg1)
  ------------------
  |  Branch (2288:17): [True: 135k, False: 66.6k]
  ------------------
 2289|   135k|        {
 2290|       |            /* o & stage 1 out */
 2291|   135k|            {
 2292|   135k|                WORD32 j;
 2293|   135k|                WORD16 *pi2_src_scratch = o_temp_ptr;
 2294|   135k|                WORD16 *pi2_dst_scratch = temp_ptr;
 2295|   135k|                WORD32 out_stride = (trans_size << 1);
 2296|   135k|                WORD32 in_stride = trans_size;
 2297|       |
 2298|   407k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2298:28): [True: 271k, False: 135k]
  ------------------
 2299|   271k|                {
 2300|   271k|                    if(j)
  ------------------
  |  Branch (2300:24): [True: 136k, False: 134k]
  ------------------
 2301|   136k|                    {
 2302|   136k|                        m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 2303|   136k|                        m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 2304|   136k|                        m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
 2305|   136k|                        m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
 2306|   136k|                    }
 2307|       |
 2308|   271k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 2309|   271k|                    m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 interleaved
 2310|       |
 2311|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 2312|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 2313|       |
 2314|       |                    /* o0[0-3] */
 2315|   271k|                    {
 2316|       |
 2317|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2318|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2319|       |
 2320|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2321|       |
 2322|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2323|   271k|                        pi2_src_scratch += in_stride;
 2324|       |
 2325|   271k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2326|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2327|       |
 2328|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2329|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2330|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2331|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2332|       |
 2333|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2334|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2335|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2336|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2337|       |
 2338|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2339|       |
 2340|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2341|   271k|                        pi2_dst_scratch += out_stride;
 2342|       |
 2343|   271k|                    }
 2344|       |
 2345|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 2346|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 2347|       |
 2348|       |                    /* o1[0-3] */
 2349|   271k|                    {
 2350|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2351|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2352|       |
 2353|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2354|       |
 2355|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2356|   271k|                        pi2_src_scratch += in_stride;
 2357|       |
 2358|   271k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2359|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2360|       |
 2361|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2362|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2363|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2364|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2365|       |
 2366|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2367|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2368|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2369|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2370|       |
 2371|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2372|       |
 2373|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2374|   271k|                        pi2_dst_scratch += out_stride;
 2375|       |
 2376|   271k|                    }
 2377|       |
 2378|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 2379|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 2380|       |
 2381|       |                    /* o2[0-3] */
 2382|   271k|                    {
 2383|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2384|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2385|       |
 2386|   271k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 2387|       |
 2388|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2389|   271k|                        pi2_src_scratch += in_stride;
 2390|       |
 2391|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2392|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2393|       |
 2394|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2395|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2396|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2397|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2398|       |
 2399|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2400|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2401|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2402|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2403|       |
 2404|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2405|       |
 2406|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2407|   271k|                        pi2_dst_scratch += out_stride;
 2408|       |
 2409|   271k|                    }
 2410|       |
 2411|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 2412|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 2413|       |
 2414|       |                    /* o3[0-3] */
 2415|   271k|                    {
 2416|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2417|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2418|       |
 2419|   271k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 2420|       |
 2421|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2422|   271k|                        pi2_src_scratch += in_stride;
 2423|       |
 2424|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2425|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2426|       |
 2427|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2428|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2429|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2430|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2431|       |
 2432|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2433|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2434|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2435|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2436|       |
 2437|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2438|       |
 2439|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2440|   271k|                        pi2_dst_scratch += out_stride;
 2441|       |
 2442|   271k|                    }
 2443|       |
 2444|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 2445|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 2446|       |
 2447|       |                    /* o4[0-3] */
 2448|   271k|                    {
 2449|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2450|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2451|       |
 2452|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2453|       |
 2454|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2455|   271k|                        pi2_src_scratch += in_stride;
 2456|       |
 2457|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2458|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2459|       |
 2460|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2461|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2462|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2463|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2464|       |
 2465|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2466|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2467|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2468|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2469|       |
 2470|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2471|       |
 2472|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2473|   271k|                        pi2_dst_scratch += out_stride;
 2474|       |
 2475|   271k|                    }
 2476|       |
 2477|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 2478|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 2479|       |
 2480|       |                    /* o5[0-3] */
 2481|   271k|                    {
 2482|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2483|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2484|       |
 2485|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2486|       |
 2487|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2488|   271k|                        pi2_src_scratch += in_stride;
 2489|       |
 2490|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2491|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2492|       |
 2493|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2494|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2495|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2496|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2497|       |
 2498|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2499|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2500|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2501|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2502|       |
 2503|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2504|       |
 2505|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2506|   271k|                        pi2_dst_scratch += out_stride;
 2507|       |
 2508|   271k|                    }
 2509|       |
 2510|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 2511|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 2512|       |
 2513|       |                    /* o6[0-3] */
 2514|   271k|                    {
 2515|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2516|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2517|       |
 2518|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2519|       |
 2520|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2521|   271k|                        pi2_src_scratch += in_stride;
 2522|       |
 2523|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2524|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2525|       |
 2526|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2527|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2528|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2529|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2530|       |
 2531|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2532|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2533|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2534|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2535|       |
 2536|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2537|       |
 2538|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2539|   271k|                        pi2_dst_scratch += out_stride;
 2540|       |
 2541|   271k|                    }
 2542|       |
 2543|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 2544|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 2545|       |
 2546|       |                    /* o7[0-3] */
 2547|   271k|                    {
 2548|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2549|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2550|       |
 2551|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2552|       |
 2553|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2554|   271k|                        pi2_src_scratch += 8;
 2555|       |
 2556|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2557|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2558|       |
 2559|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2560|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2561|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2562|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2563|       |
 2564|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2565|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2566|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2567|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2568|       |
 2569|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2570|       |
 2571|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2572|   271k|                        pi2_dst_scratch += 8;
 2573|       |
 2574|   271k|                    }
 2575|       |
 2576|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 2577|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 2578|       |
 2579|       |                    /* o8[0-3] */
 2580|   271k|                    {
 2581|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2582|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2583|       |
 2584|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2585|       |
 2586|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2587|   271k|                        pi2_src_scratch -= in_stride;
 2588|       |
 2589|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2590|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2591|       |
 2592|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2593|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2594|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2595|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2596|       |
 2597|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2598|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2599|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2600|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2601|       |
 2602|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2603|       |
 2604|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2605|   271k|                        pi2_dst_scratch -= out_stride;
 2606|   271k|                    }
 2607|       |
 2608|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 2609|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 2610|       |
 2611|       |                    /* o9[0-3] */
 2612|   271k|                    {
 2613|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2614|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2615|       |
 2616|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2617|       |
 2618|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2619|   271k|                        pi2_src_scratch -= in_stride;
 2620|       |
 2621|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2622|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2623|       |
 2624|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2625|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2626|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2627|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2628|       |
 2629|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2630|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2631|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2632|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2633|       |
 2634|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2635|       |
 2636|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2637|   271k|                        pi2_dst_scratch -= out_stride;
 2638|   271k|                    }
 2639|       |
 2640|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 2641|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 2642|       |
 2643|       |                    /* o10[0-3] */
 2644|   271k|                    {
 2645|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2646|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2647|       |
 2648|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2649|       |
 2650|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2651|   271k|                        pi2_src_scratch -= in_stride;
 2652|       |
 2653|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2654|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2655|       |
 2656|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2657|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2658|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2659|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2660|       |
 2661|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2662|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2663|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2664|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2665|       |
 2666|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2667|       |
 2668|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2669|   271k|                        pi2_dst_scratch -= out_stride;
 2670|   271k|                    }
 2671|       |
 2672|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 2673|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 2674|       |
 2675|       |                    /* o11[0-3] */
 2676|   271k|                    {
 2677|       |
 2678|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2679|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2680|       |
 2681|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2682|       |
 2683|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2684|   271k|                        pi2_src_scratch -= in_stride;
 2685|       |
 2686|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2687|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2688|       |
 2689|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2690|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2691|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2692|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2693|       |
 2694|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2695|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2696|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2697|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2698|       |
 2699|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2700|       |
 2701|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2702|   271k|                        pi2_dst_scratch -= out_stride;
 2703|       |
 2704|   271k|                    }
 2705|       |
 2706|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 2707|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 2708|       |
 2709|       |                    /* o12[0-3] */
 2710|   271k|                    {
 2711|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2712|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2713|       |
 2714|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2715|       |
 2716|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2717|   271k|                        pi2_src_scratch -= in_stride;
 2718|       |
 2719|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2720|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2721|       |
 2722|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2723|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2724|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2725|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2726|       |
 2727|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2728|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2729|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2730|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2731|       |
 2732|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2733|       |
 2734|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2735|   271k|                        pi2_dst_scratch -= out_stride;
 2736|       |
 2737|   271k|                    }
 2738|       |
 2739|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 2740|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 2741|       |
 2742|       |                    /* o13[0-3] */
 2743|   271k|                    {
 2744|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2745|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2746|       |
 2747|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2748|       |
 2749|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2750|   271k|                        pi2_src_scratch -= in_stride;
 2751|       |
 2752|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2753|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2754|       |
 2755|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2756|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2757|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2758|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2759|       |
 2760|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2761|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2762|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2763|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2764|       |
 2765|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2766|       |
 2767|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2768|   271k|                        pi2_dst_scratch -= out_stride;
 2769|   271k|                    }
 2770|       |
 2771|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 2772|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 2773|       |
 2774|       |                    /* o14[0-3] */
 2775|   271k|                    {
 2776|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2777|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2778|       |
 2779|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2780|       |
 2781|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2782|   271k|                        pi2_src_scratch -= in_stride;
 2783|       |
 2784|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2785|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2786|       |
 2787|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2788|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2789|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2790|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2791|       |
 2792|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2793|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2794|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2795|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2796|       |
 2797|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2798|       |
 2799|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2800|   271k|                        pi2_dst_scratch -= out_stride;
 2801|       |
 2802|   271k|                    }
 2803|       |
 2804|   271k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 2805|   271k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 2806|       |
 2807|       |                    /* o15[0-3] */
 2808|   271k|                    {
 2809|   271k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2810|   271k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2811|       |
 2812|   271k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2813|       |
 2814|   271k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2815|   271k|                        pi2_src_scratch += 8;
 2816|       |
 2817|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2818|   271k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2819|       |
 2820|   271k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2821|   271k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2822|   271k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2823|   271k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2824|       |
 2825|   271k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2826|   271k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2827|   271k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2828|   271k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2829|       |
 2830|   271k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2831|       |
 2832|   271k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2833|   271k|                        pi2_dst_scratch += 8;
 2834|   271k|                    }
 2835|       |
 2836|   271k|                }
 2837|   135k|            }
 2838|   135k|        }
 2839|  66.6k|        else
 2840|  66.6k|        {
 2841|       |            /* o & stage 1 out */
 2842|  66.6k|            {
 2843|  66.6k|                WORD32 j;
 2844|  66.6k|                WORD16 *pi2_src_scratch = o_temp_ptr;
 2845|  66.6k|                WORD16 *pi2_dst_scratch = temp_ptr;
 2846|  66.6k|                WORD32 out_stride = (trans_size << 1);
 2847|  66.6k|                WORD32 in_stride = trans_size;
 2848|       |
 2849|       |
 2850|   201k|                for(j = 0; j < 2; j++)
  ------------------
  |  Branch (2850:28): [True: 134k, False: 66.6k]
  ------------------
 2851|   134k|                {
 2852|   134k|                    if(j)
  ------------------
  |  Branch (2852:24): [True: 67.5k, False: 67.2k]
  ------------------
 2853|  67.5k|                    {
 2854|  67.5k|                        m_temp_reg_70 = _mm_srli_si128(m_temp_reg_70, 8);
 2855|  67.5k|                        m_temp_reg_71 = _mm_srli_si128(m_temp_reg_71, 8);
 2856|  67.5k|                        m_temp_reg_72 = _mm_srli_si128(m_temp_reg_72, 8);
 2857|  67.5k|                        m_temp_reg_73 = _mm_srli_si128(m_temp_reg_73, 8);
 2858|  67.5k|                        m_temp_reg_74 = _mm_srli_si128(m_temp_reg_74, 8);
 2859|  67.5k|                        m_temp_reg_75 = _mm_srli_si128(m_temp_reg_75, 8);
 2860|  67.5k|                        m_temp_reg_76 = _mm_srli_si128(m_temp_reg_76, 8);
 2861|  67.5k|                        m_temp_reg_77 = _mm_srli_si128(m_temp_reg_77, 8);
 2862|       |
 2863|  67.5k|                        m_temp_reg_80 = _mm_srli_si128(m_temp_reg_80, 8);
 2864|  67.5k|                        m_temp_reg_81 = _mm_srli_si128(m_temp_reg_81, 8);
 2865|  67.5k|                        m_temp_reg_82 = _mm_srli_si128(m_temp_reg_82, 8);
 2866|  67.5k|                        m_temp_reg_83 = _mm_srli_si128(m_temp_reg_83, 8);
 2867|  67.5k|                        m_temp_reg_84 = _mm_srli_si128(m_temp_reg_84, 8);
 2868|  67.5k|                        m_temp_reg_85 = _mm_srli_si128(m_temp_reg_85, 8);
 2869|  67.5k|                        m_temp_reg_86 = _mm_srli_si128(m_temp_reg_86, 8);
 2870|  67.5k|                        m_temp_reg_87 = _mm_srli_si128(m_temp_reg_87, 8);
 2871|  67.5k|                    }
 2872|       |
 2873|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 2874|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 2875|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[2][0]);
 2876|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[3][0]);
 2877|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[4][0]);
 2878|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[5][0]);
 2879|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[6][0]);
 2880|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[7][0]);
 2881|       |
 2882|   134k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 2883|   134k|                    m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 interleaved
 2884|   134k|                    m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 interleaved
 2885|   134k|                    m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 interleaved
 2886|   134k|                    temp1 = _mm_unpacklo_epi16(m_temp_reg_80, m_temp_reg_81); //row 17 and row 19 interleaved
 2887|   134k|                    temp2 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_83); //row 21 and row 23 interleaved
 2888|   134k|                    temp3 = _mm_unpacklo_epi16(m_temp_reg_84, m_temp_reg_85); //row 25 and row 27 interleaved
 2889|   134k|                    temp4 = _mm_unpacklo_epi16(m_temp_reg_86, m_temp_reg_87); //row 29 and row 31 interleaved
 2890|       |
 2891|       |
 2892|       |                    /* o0[0-3] */
 2893|   134k|                    {
 2894|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2895|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2896|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 2897|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2898|       |
 2899|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2900|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 2901|       |
 2902|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 2903|       |
 2904|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 2905|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 2906|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 2907|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 2908|       |
 2909|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 2910|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 2911|       |
 2912|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 2913|       |
 2914|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 2915|       |
 2916|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2917|   134k|                        pi2_src_scratch += in_stride;
 2918|       |
 2919|   134k|                        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2920|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2921|       |
 2922|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2923|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2924|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2925|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2926|       |
 2927|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2928|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2929|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2930|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2931|       |
 2932|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2933|       |
 2934|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2935|   134k|                        pi2_dst_scratch += out_stride;
 2936|       |
 2937|   134k|                    }
 2938|       |
 2939|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 2940|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 2941|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[10][0]);
 2942|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[11][0]);
 2943|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[12][0]);
 2944|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[13][0]);
 2945|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[14][0]);
 2946|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[15][0]);
 2947|       |
 2948|       |
 2949|       |                    /* o1[0-3] */
 2950|   134k|                    {
 2951|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 2952|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 2953|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 2954|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 2955|       |
 2956|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 2957|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 2958|       |
 2959|   134k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_20);
 2960|       |
 2961|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 2962|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 2963|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 2964|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 2965|       |
 2966|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 2967|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 2968|       |
 2969|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 2970|       |
 2971|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 2972|       |
 2973|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 2974|   134k|                        pi2_src_scratch += in_stride;
 2975|       |
 2976|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 2977|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 2978|       |
 2979|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2980|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 2981|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 2982|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 2983|       |
 2984|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 2985|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 2986|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 2987|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 2988|       |
 2989|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 2990|       |
 2991|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 2992|   134k|                        pi2_dst_scratch += out_stride;
 2993|       |
 2994|   134k|                    }
 2995|       |
 2996|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 2997|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 2998|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[18][0]);
 2999|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[19][0]);
 3000|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[20][0]);
 3001|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[21][0]);
 3002|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[22][0]);
 3003|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[23][0]);
 3004|       |
 3005|       |                    /* o2[0-3] */
 3006|   134k|                    {
 3007|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3008|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3009|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3010|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3011|       |
 3012|   134k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 3013|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3014|       |
 3015|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3016|       |
 3017|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3018|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3019|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3020|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3021|       |
 3022|   134k|                        m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_41);
 3023|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3024|       |
 3025|   134k|                        m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_42);
 3026|       |
 3027|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3028|       |
 3029|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3030|   134k|                        pi2_src_scratch += in_stride;
 3031|       |
 3032|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3033|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3034|       |
 3035|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3036|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3037|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3038|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3039|       |
 3040|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3041|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3042|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3043|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3044|       |
 3045|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3046|       |
 3047|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3048|   134k|                        pi2_dst_scratch += out_stride;
 3049|       |
 3050|   134k|                    }
 3051|       |
 3052|       |
 3053|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 3054|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 3055|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[26][0]);
 3056|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[27][0]);
 3057|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[28][0]);
 3058|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[29][0]);
 3059|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[30][0]);
 3060|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[31][0]);
 3061|       |
 3062|       |                    /* o3[0-3] */
 3063|   134k|                    {
 3064|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3065|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3066|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3067|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3068|       |
 3069|   134k|                        m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 3070|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3071|       |
 3072|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3073|       |
 3074|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3075|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3076|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3077|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3078|       |
 3079|   134k|                        m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_40);
 3080|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3081|       |
 3082|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3083|       |
 3084|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3085|       |
 3086|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3087|   134k|                        pi2_src_scratch += in_stride;
 3088|       |
 3089|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3090|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3091|       |
 3092|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3093|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3094|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3095|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3096|       |
 3097|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3098|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3099|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3100|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3101|       |
 3102|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3103|       |
 3104|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3105|   134k|                        pi2_dst_scratch += out_stride;
 3106|       |
 3107|   134k|                    }
 3108|       |
 3109|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 3110|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 3111|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[34][0]);
 3112|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[35][0]);
 3113|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[36][0]);
 3114|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[37][0]);
 3115|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[38][0]);
 3116|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[39][0]);
 3117|       |
 3118|       |                    /* o4[0-3] */
 3119|   134k|                    {
 3120|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3121|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3122|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3123|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3124|       |
 3125|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3126|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3127|       |
 3128|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3129|       |
 3130|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3131|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3132|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3133|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3134|       |
 3135|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3136|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3137|       |
 3138|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3139|       |
 3140|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3141|       |
 3142|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3143|   134k|                        pi2_src_scratch += in_stride;
 3144|       |
 3145|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3146|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3147|       |
 3148|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3149|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3150|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3151|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3152|       |
 3153|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3154|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3155|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3156|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3157|       |
 3158|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3159|       |
 3160|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3161|   134k|                        pi2_dst_scratch += out_stride;
 3162|       |
 3163|   134k|                    }
 3164|       |
 3165|       |
 3166|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 3167|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 3168|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[42][0]);
 3169|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[43][0]);
 3170|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[44][0]);
 3171|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[45][0]);
 3172|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[46][0]);
 3173|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[47][0]);
 3174|       |
 3175|       |                    /* o5[0-3] */
 3176|   134k|                    {
 3177|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3178|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3179|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3180|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3181|       |
 3182|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3183|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3184|       |
 3185|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3186|       |
 3187|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3188|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3189|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3190|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3191|       |
 3192|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3193|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3194|       |
 3195|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3196|       |
 3197|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3198|       |
 3199|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3200|   134k|                        pi2_src_scratch += in_stride;
 3201|       |
 3202|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3203|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3204|       |
 3205|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3206|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3207|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3208|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3209|       |
 3210|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3211|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3212|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3213|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3214|       |
 3215|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3216|       |
 3217|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3218|   134k|                        pi2_dst_scratch += out_stride;
 3219|       |
 3220|   134k|                    }
 3221|       |
 3222|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 3223|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 3224|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[50][0]);
 3225|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[51][0]);
 3226|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[52][0]);
 3227|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[53][0]);
 3228|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[54][0]);
 3229|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[55][0]);
 3230|       |
 3231|       |
 3232|       |                    /* o6[0-3] */
 3233|   134k|                    {
 3234|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3235|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3236|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3237|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3238|       |
 3239|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3240|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3241|       |
 3242|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3243|       |
 3244|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3245|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3246|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3247|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3248|       |
 3249|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3250|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3251|       |
 3252|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3253|       |
 3254|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3255|       |
 3256|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3257|   134k|                        pi2_src_scratch += in_stride;
 3258|       |
 3259|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3260|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3261|       |
 3262|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3263|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3264|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3265|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3266|       |
 3267|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3268|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3269|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3270|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3271|       |
 3272|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3273|       |
 3274|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3275|   134k|                        pi2_dst_scratch += out_stride;
 3276|       |
 3277|   134k|                    }
 3278|       |
 3279|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 3280|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 3281|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[58][0]);
 3282|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[59][0]);
 3283|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[60][0]);
 3284|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[61][0]);
 3285|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[62][0]);
 3286|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[63][0]);
 3287|       |
 3288|       |                    /* o7[0-3] */
 3289|   134k|                    {
 3290|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3291|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3292|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3293|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3294|       |
 3295|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3296|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3297|       |
 3298|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3299|       |
 3300|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3301|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3302|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3303|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3304|       |
 3305|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3306|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3307|       |
 3308|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3309|       |
 3310|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3311|       |
 3312|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3313|   134k|                        pi2_src_scratch += 8;
 3314|       |
 3315|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3316|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3317|       |
 3318|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3319|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3320|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3321|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3322|       |
 3323|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3324|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3325|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3326|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3327|       |
 3328|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3329|       |
 3330|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3331|   134k|                        pi2_dst_scratch += 8;
 3332|       |
 3333|   134k|                    }
 3334|       |
 3335|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 3336|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 3337|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[66][0]);
 3338|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[67][0]);
 3339|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[68][0]);
 3340|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[69][0]);
 3341|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[70][0]);
 3342|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[71][0]);
 3343|       |
 3344|       |
 3345|       |                    /* o8[0-3] */
 3346|   134k|                    {
 3347|       |
 3348|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3349|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3350|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3351|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3352|       |
 3353|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3354|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3355|       |
 3356|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3357|       |
 3358|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3359|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3360|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3361|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3362|       |
 3363|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3364|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3365|       |
 3366|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3367|       |
 3368|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3369|       |
 3370|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3371|   134k|                        pi2_src_scratch -= in_stride;
 3372|       |
 3373|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3374|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3375|       |
 3376|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3377|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3378|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3379|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3380|       |
 3381|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3382|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3383|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3384|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3385|       |
 3386|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3387|       |
 3388|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3389|   134k|                        pi2_dst_scratch -= out_stride;
 3390|   134k|                    }
 3391|       |
 3392|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 3393|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 3394|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[74][0]);
 3395|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[75][0]);
 3396|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[76][0]);
 3397|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[77][0]);
 3398|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[78][0]);
 3399|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[79][0]);
 3400|       |
 3401|       |
 3402|       |                    /* o9[0-3] */
 3403|   134k|                    {
 3404|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3405|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3406|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3407|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3408|       |
 3409|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3410|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3411|       |
 3412|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3413|       |
 3414|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3415|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3416|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3417|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3418|       |
 3419|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3420|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3421|       |
 3422|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3423|       |
 3424|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3425|       |
 3426|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3427|   134k|                        pi2_src_scratch -= in_stride;
 3428|       |
 3429|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3430|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3431|       |
 3432|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3433|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3434|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3435|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3436|       |
 3437|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3438|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3439|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3440|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3441|       |
 3442|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3443|       |
 3444|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3445|   134k|                        pi2_dst_scratch -= out_stride;
 3446|   134k|                    }
 3447|       |
 3448|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 3449|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 3450|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[82][0]);
 3451|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[83][0]);
 3452|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[84][0]);
 3453|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[85][0]);
 3454|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[86][0]);
 3455|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[87][0]);
 3456|       |
 3457|       |                    /* o10[0-3] */
 3458|   134k|                    {
 3459|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3460|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3461|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3462|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3463|       |
 3464|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3465|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3466|       |
 3467|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3468|       |
 3469|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3470|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3471|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3472|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3473|       |
 3474|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3475|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3476|       |
 3477|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3478|       |
 3479|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3480|       |
 3481|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3482|   134k|                        pi2_src_scratch -= in_stride;
 3483|       |
 3484|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3485|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3486|       |
 3487|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3488|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3489|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3490|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3491|       |
 3492|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3493|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3494|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3495|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3496|       |
 3497|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3498|       |
 3499|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3500|   134k|                        pi2_dst_scratch -= out_stride;
 3501|   134k|                    }
 3502|       |
 3503|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 3504|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 3505|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[90][0]);
 3506|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[91][0]);
 3507|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[92][0]);
 3508|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[93][0]);
 3509|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[94][0]);
 3510|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[95][0]);
 3511|       |
 3512|       |                    /* o11[0-3] */
 3513|   134k|                    {
 3514|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3515|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3516|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3517|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3518|       |
 3519|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3520|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3521|       |
 3522|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3523|       |
 3524|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3525|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3526|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3527|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3528|       |
 3529|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3530|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3531|       |
 3532|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3533|       |
 3534|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3535|       |
 3536|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3537|   134k|                        pi2_src_scratch -= in_stride;
 3538|       |
 3539|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3540|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3541|       |
 3542|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3543|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3544|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3545|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3546|       |
 3547|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3548|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3549|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3550|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3551|       |
 3552|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3553|       |
 3554|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3555|   134k|                        pi2_dst_scratch -= out_stride;
 3556|       |
 3557|   134k|                    }
 3558|       |
 3559|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 3560|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 3561|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[98][0]);
 3562|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[99][0]);
 3563|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[100][0]);
 3564|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[101][0]);
 3565|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[102][0]);
 3566|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[103][0]);
 3567|       |
 3568|       |
 3569|       |                    /* o12[0-3] */
 3570|   134k|                    {
 3571|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3572|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3573|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3574|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3575|       |
 3576|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3577|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3578|       |
 3579|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3580|       |
 3581|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3582|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3583|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3584|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3585|       |
 3586|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3587|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3588|       |
 3589|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3590|       |
 3591|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3592|       |
 3593|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3594|   134k|                        pi2_src_scratch -= in_stride;
 3595|       |
 3596|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3597|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3598|       |
 3599|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3600|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3601|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3602|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3603|       |
 3604|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3605|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3606|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3607|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3608|       |
 3609|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3610|       |
 3611|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3612|   134k|                        pi2_dst_scratch -= out_stride;
 3613|       |
 3614|   134k|                    }
 3615|       |
 3616|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 3617|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 3618|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[106][0]);
 3619|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[107][0]);
 3620|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[108][0]);
 3621|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[109][0]);
 3622|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[110][0]);
 3623|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[111][0]);
 3624|       |
 3625|       |
 3626|       |                    /* o13[0-3] */
 3627|   134k|                    {
 3628|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3629|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3630|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3631|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3632|       |
 3633|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3634|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3635|       |
 3636|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3637|       |
 3638|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3639|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3640|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3641|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3642|       |
 3643|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3644|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3645|       |
 3646|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3647|       |
 3648|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3649|       |
 3650|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3651|   134k|                        pi2_src_scratch -= in_stride;
 3652|       |
 3653|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3654|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3655|       |
 3656|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3657|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3658|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3659|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3660|       |
 3661|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3662|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3663|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3664|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3665|       |
 3666|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3667|       |
 3668|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3669|   134k|                        pi2_dst_scratch -= out_stride;
 3670|   134k|                    }
 3671|       |
 3672|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 3673|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 3674|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[114][0]);
 3675|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[115][0]);
 3676|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[116][0]);
 3677|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[117][0]);
 3678|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[118][0]);
 3679|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[119][0]);
 3680|       |
 3681|       |
 3682|       |                    /* o14[0-3] */
 3683|   134k|                    {
 3684|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3685|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3686|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3687|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3688|       |
 3689|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3690|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3691|       |
 3692|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3693|       |
 3694|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3695|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3696|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3697|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3698|       |
 3699|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3700|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3701|       |
 3702|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3703|       |
 3704|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3705|       |
 3706|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3707|   134k|                        pi2_src_scratch -= in_stride;
 3708|       |
 3709|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3710|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3711|       |
 3712|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3713|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3714|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3715|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3716|       |
 3717|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3718|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3719|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3720|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3721|       |
 3722|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3723|       |
 3724|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3725|   134k|                        pi2_dst_scratch -= out_stride;
 3726|       |
 3727|   134k|                    }
 3728|       |
 3729|   134k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 3730|   134k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 3731|   134k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[122][0]);
 3732|   134k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[123][0]);
 3733|   134k|                    m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[124][0]);
 3734|   134k|                    m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[125][0]);
 3735|   134k|                    m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[126][0]);
 3736|   134k|                    m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[127][0]);
 3737|       |
 3738|       |                    /* o15[0-3] */
 3739|   134k|                    {
 3740|   134k|                        m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 3741|   134k|                        m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 3742|   134k|                        m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 3743|   134k|                        m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 3744|       |
 3745|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 3746|   134k|                        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 3747|       |
 3748|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 3749|       |
 3750|   134k|                        m_temp_reg_40 = _mm_madd_epi16(temp1, m_coeff5);
 3751|   134k|                        m_temp_reg_41 = _mm_madd_epi16(temp2, m_coeff6);
 3752|   134k|                        m_temp_reg_42 = _mm_madd_epi16(temp3, m_coeff7);
 3753|   134k|                        m_temp_reg_43 = _mm_madd_epi16(temp4, m_coeff8);
 3754|       |
 3755|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 3756|   134k|                        m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 3757|       |
 3758|   134k|                        m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 3759|       |
 3760|   134k|                        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 3761|       |
 3762|   134k|                        m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3763|   134k|                        pi2_src_scratch += 8;
 3764|       |
 3765|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_20);
 3766|   134k|                        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_20);
 3767|       |
 3768|   134k|                        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 3769|   134k|                        m_count = _mm_cvtsi32_si128(i4_shift);
 3770|   134k|                        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 3771|   134k|                        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 3772|       |
 3773|   134k|                        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 3774|   134k|                        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 3775|   134k|                        m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 3776|   134k|                        m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 3777|       |
 3778|   134k|                        m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 3779|       |
 3780|   134k|                        _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 3781|   134k|                        pi2_dst_scratch += 8;
 3782|   134k|                    }
 3783|       |
 3784|   134k|                }
 3785|  66.6k|            }
 3786|  66.6k|        }
 3787|       |        /* Transpose */
 3788|   354k|        {
 3789|   354k|            WORD16 *pi2_src_scratch = temp_ptr;
 3790|   354k|            WORD16 *pi2_dst_scratch = pi2_tmp;
 3791|   354k|            WORD32 in_stride = (trans_size << 1);
 3792|       |
 3793|  1.06M|            for(j = 0; j < 2; j++)
  ------------------
  |  Branch (3793:24): [True: 710k, False: 354k]
  ------------------
 3794|   710k|            {
 3795|   710k|                m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3796|   710k|                pi2_src_scratch += in_stride;
 3797|   710k|                m_temp_reg_31 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3798|   710k|                pi2_src_scratch += in_stride;
 3799|   710k|                m_temp_reg_32 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3800|   710k|                pi2_src_scratch += in_stride;
 3801|   710k|                m_temp_reg_33 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3802|   710k|                pi2_src_scratch += in_stride;
 3803|   710k|                m_temp_reg_34 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3804|   710k|                pi2_src_scratch += in_stride;
 3805|   710k|                m_temp_reg_35 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3806|   710k|                pi2_src_scratch += in_stride;
 3807|   710k|                m_temp_reg_36 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3808|   710k|                pi2_src_scratch += in_stride;
 3809|   710k|                m_temp_reg_37 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3810|   710k|                pi2_src_scratch += 8;
 3811|       |
 3812|   710k|                m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3813|   710k|                pi2_src_scratch -= in_stride;
 3814|   710k|                m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3815|   710k|                pi2_src_scratch -= in_stride;
 3816|   710k|                m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3817|   710k|                pi2_src_scratch -= in_stride;
 3818|   710k|                m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3819|   710k|                pi2_src_scratch -= in_stride;
 3820|   710k|                m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3821|   710k|                pi2_src_scratch -= in_stride;
 3822|   710k|                m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3823|   710k|                pi2_src_scratch -= in_stride;
 3824|   710k|                m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3825|   710k|                pi2_src_scratch -= in_stride;
 3826|   710k|                m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_src_scratch);
 3827|   710k|                pi2_src_scratch += 8;
 3828|       |
 3829|       |
 3830|   710k|                m_temp_reg_40 = _mm_unpacklo_epi16(m_temp_reg_30, m_temp_reg_31);
 3831|   710k|                m_temp_reg_41 = _mm_unpackhi_epi16(m_temp_reg_31, m_temp_reg_30);
 3832|       |
 3833|   710k|                m_temp_reg_42 = _mm_unpacklo_epi16(m_temp_reg_32, m_temp_reg_33);
 3834|   710k|                m_temp_reg_43 = _mm_unpackhi_epi16(m_temp_reg_33, m_temp_reg_32);
 3835|       |
 3836|   710k|                m_temp_reg_44 = _mm_unpacklo_epi16(m_temp_reg_34, m_temp_reg_35);
 3837|   710k|                m_temp_reg_45 = _mm_unpackhi_epi16(m_temp_reg_35, m_temp_reg_34);
 3838|       |
 3839|   710k|                m_temp_reg_46 = _mm_unpacklo_epi16(m_temp_reg_36, m_temp_reg_37);
 3840|   710k|                m_temp_reg_47 = _mm_unpackhi_epi16(m_temp_reg_37, m_temp_reg_36);
 3841|       |
 3842|   710k|                m_temp_reg_80 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 3843|   710k|                m_temp_reg_81 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_70);
 3844|       |
 3845|   710k|                m_temp_reg_82 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73);
 3846|   710k|                m_temp_reg_83 = _mm_unpackhi_epi16(m_temp_reg_73, m_temp_reg_72);
 3847|       |
 3848|   710k|                m_temp_reg_84 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75);
 3849|   710k|                m_temp_reg_85 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_74);
 3850|       |
 3851|   710k|                m_temp_reg_86 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77);
 3852|   710k|                m_temp_reg_87 = _mm_unpackhi_epi16(m_temp_reg_77, m_temp_reg_76);
 3853|       |
 3854|       |                /****************/
 3855|       |
 3856|   710k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_40, m_temp_reg_42);
 3857|   710k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_40, m_temp_reg_42);
 3858|       |
 3859|   710k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_44, m_temp_reg_46);
 3860|   710k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_44, m_temp_reg_46);
 3861|       |
 3862|   710k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_80, m_temp_reg_82);
 3863|   710k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_80, m_temp_reg_82);
 3864|       |
 3865|   710k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_84, m_temp_reg_86);
 3866|   710k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_84, m_temp_reg_86);
 3867|       |
 3868|   710k|                m_temp_reg_90 = _mm_unpacklo_epi32(m_temp_reg_43, m_temp_reg_41);
 3869|   710k|                m_temp_reg_91 = _mm_unpackhi_epi32(m_temp_reg_43, m_temp_reg_41);
 3870|       |
 3871|   710k|                m_temp_reg_92 = _mm_unpacklo_epi32(m_temp_reg_47, m_temp_reg_45);
 3872|   710k|                m_temp_reg_93 = _mm_unpackhi_epi32(m_temp_reg_47, m_temp_reg_45);
 3873|       |
 3874|   710k|                m_temp_reg_94 = _mm_unpacklo_epi32(m_temp_reg_83, m_temp_reg_81);
 3875|   710k|                m_temp_reg_95 = _mm_unpackhi_epi32(m_temp_reg_83, m_temp_reg_81);
 3876|       |
 3877|   710k|                m_temp_reg_96 = _mm_unpacklo_epi32(m_temp_reg_87, m_temp_reg_85);
 3878|   710k|                m_temp_reg_97 = _mm_unpackhi_epi32(m_temp_reg_87, m_temp_reg_85);
 3879|       |
 3880|       |                /******************/
 3881|       |
 3882|   710k|                m_temp_reg_30 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_2);
 3883|   710k|                m_temp_reg_31 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_2);
 3884|       |
 3885|   710k|                m_temp_reg_32 = _mm_unpacklo_epi64(m_temp_reg_92, m_temp_reg_90);
 3886|   710k|                m_temp_reg_33 = _mm_unpackhi_epi64(m_temp_reg_92, m_temp_reg_90);
 3887|       |
 3888|   710k|                m_temp_reg_34 = _mm_unpacklo_epi64(m_temp_reg_4, m_temp_reg_6);
 3889|   710k|                m_temp_reg_35 = _mm_unpackhi_epi64(m_temp_reg_4, m_temp_reg_6);
 3890|       |
 3891|   710k|                m_temp_reg_36 = _mm_unpacklo_epi64(m_temp_reg_96, m_temp_reg_94);
 3892|   710k|                m_temp_reg_37 = _mm_unpackhi_epi64(m_temp_reg_96, m_temp_reg_94);
 3893|       |
 3894|   710k|                m_temp_reg_80 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_3);
 3895|   710k|                m_temp_reg_81 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_3);
 3896|       |
 3897|   710k|                m_temp_reg_82 = _mm_unpacklo_epi64(m_temp_reg_93, m_temp_reg_91);
 3898|   710k|                m_temp_reg_83 = _mm_unpackhi_epi64(m_temp_reg_93, m_temp_reg_91);
 3899|       |
 3900|   710k|                m_temp_reg_84 = _mm_unpacklo_epi64(m_temp_reg_5, m_temp_reg_7);
 3901|   710k|                m_temp_reg_85 = _mm_unpackhi_epi64(m_temp_reg_5, m_temp_reg_7);
 3902|       |
 3903|   710k|                m_temp_reg_86 = _mm_unpacklo_epi64(m_temp_reg_97, m_temp_reg_95);
 3904|   710k|                m_temp_reg_87 = _mm_unpackhi_epi64(m_temp_reg_97, m_temp_reg_95);
 3905|       |
 3906|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size), m_temp_reg_30);
 3907|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 8), m_temp_reg_34);
 3908|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 16), m_temp_reg_36);
 3909|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 24), m_temp_reg_32);
 3910|       |
 3911|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size), m_temp_reg_31);
 3912|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 8), m_temp_reg_35);
 3913|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 16), m_temp_reg_37);
 3914|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 24), m_temp_reg_33);
 3915|       |
 3916|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size), m_temp_reg_80);
 3917|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 8), m_temp_reg_84);
 3918|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 16), m_temp_reg_86);
 3919|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 24), m_temp_reg_82);
 3920|       |
 3921|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size), m_temp_reg_81);
 3922|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 8), m_temp_reg_85);
 3923|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 16), m_temp_reg_87);
 3924|   710k|                _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 24), m_temp_reg_83);
 3925|       |
 3926|   710k|                pi2_dst_scratch += 4 * trans_size;
 3927|   710k|            }
 3928|   354k|        }
 3929|   354k|        pi2_src += 8;
 3930|       |//      pi2_dequant_coeff +=8;
 3931|   354k|        pi2_tmp += 8 * trans_size;
 3932|   354k|        zero_cols = zero_cols >> 1;
 3933|   354k|    }
 3934|       |
 3935|   185k|    if(trans_size_stg1 != TRANS_SIZE_32)
  ------------------
  |  |  432|   185k|#define TRANS_SIZE_32 32
  ------------------
  |  Branch (3935:8): [True: 130k, False: 55.1k]
  ------------------
 3936|   130k|    {
 3937|   130k|        m_temp_reg_10 = _mm_setzero_si128();
 3938|       |
 3939|   519k|        for(i = trans_size_stg1; i < 32; i += 8)
  ------------------
  |  Branch (3939:34): [True: 389k, False: 130k]
  ------------------
 3940|   389k|        {
 3941|   389k|            WORD16 *pi2_dst_scratch = pi2_tmp;
 3942|       |
 3943|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size), m_temp_reg_10);
 3944|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 8), m_temp_reg_10);
 3945|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 16), m_temp_reg_10);
 3946|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 0 * trans_size + 24), m_temp_reg_10);
 3947|       |
 3948|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size), m_temp_reg_10);
 3949|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 8), m_temp_reg_10);
 3950|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 16), m_temp_reg_10);
 3951|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 1 * trans_size + 24), m_temp_reg_10);
 3952|       |
 3953|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size), m_temp_reg_10);
 3954|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 8), m_temp_reg_10);
 3955|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 16), m_temp_reg_10);
 3956|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 2 * trans_size + 24), m_temp_reg_10);
 3957|       |
 3958|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size), m_temp_reg_10);
 3959|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 8), m_temp_reg_10);
 3960|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 16), m_temp_reg_10);
 3961|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 3 * trans_size + 24), m_temp_reg_10);
 3962|       |
 3963|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size), m_temp_reg_10);
 3964|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size + 8), m_temp_reg_10);
 3965|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size + 16), m_temp_reg_10);
 3966|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 4 * trans_size + 24), m_temp_reg_10);
 3967|       |
 3968|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size), m_temp_reg_10);
 3969|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size + 8), m_temp_reg_10);
 3970|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size + 16), m_temp_reg_10);
 3971|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 5 * trans_size + 24), m_temp_reg_10);
 3972|       |
 3973|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size), m_temp_reg_10);
 3974|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size + 8), m_temp_reg_10);
 3975|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size + 16), m_temp_reg_10);
 3976|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 6 * trans_size + 24), m_temp_reg_10);
 3977|       |
 3978|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size), m_temp_reg_10);
 3979|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size + 8), m_temp_reg_10);
 3980|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size + 16), m_temp_reg_10);
 3981|   389k|            _mm_store_si128((__m128i *)(pi2_dst_scratch + 7 * trans_size + 24), m_temp_reg_10);
 3982|       |
 3983|   389k|            pi2_tmp += 8 * trans_size;
 3984|   389k|        }
 3985|   130k|    }
 3986|       |
 3987|   185k|    pi2_tmp = pi2_tmp_orig;
 3988|       |
 3989|       |    /* Inverse Transform 2nd stage */
 3990|       |
 3991|  1.65M|    for(j = 0; j < trans_size; j += 4)
  ------------------
  |  Branch (3991:16): [True: 1.47M, False: 185k]
  ------------------
 3992|  1.47M|    {
 3993|  1.47M|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  1.47M|#define IT_SHIFT_STAGE_2 12
  ------------------
 3994|       |
 3995|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 3996|  1.47M|        if(zero_last28_rows_stg2)
  ------------------
  |  Branch (3996:12): [True: 695k, False: 774k]
  ------------------
 3997|   695k|        {
 3998|   695k|            {
 3999|       |
 4000|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 4001|   695k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87
 4002|   695k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80
 4003|   695k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70
 4004|   695k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57
 4005|   695k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43
 4006|   695k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25
 4007|   695k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //9
 4008|       |
 4009|   695k|                m_temp_reg_10 = _mm_loadu_si128((__m128i *)&pi2_tmp[2 * trans_size]);
 4010|       |
 4011|   695k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_10, all_zero_reg);
 4012|       |
 4013|       |                /* eo0[0-3] */
 4014|   695k|                {
 4015|   695k|                    m_temp_reg_90 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4016|       |
 4017|   695k|                }
 4018|       |                /* eo1[0-3] */
 4019|   695k|                {
 4020|   695k|                    m_temp_reg_91 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
 4021|       |
 4022|   695k|                }
 4023|       |                /* eo2[0-3] */
 4024|   695k|                {
 4025|   695k|                    m_temp_reg_92 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 4026|   695k|                }
 4027|       |
 4028|       |                /* eo3[0-3] */
 4029|   695k|                {
 4030|   695k|                    m_temp_reg_93 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
 4031|   695k|                }
 4032|       |                /* eo4[0-3] */
 4033|   695k|                {
 4034|   695k|                    m_temp_reg_94 = _mm_madd_epi16(m_temp_reg_10, m_coeff5);
 4035|   695k|                }
 4036|       |
 4037|       |                /* eo5[0-3] */
 4038|   695k|                {
 4039|   695k|                    m_temp_reg_95 = _mm_madd_epi16(m_temp_reg_10, m_coeff6);
 4040|   695k|                }
 4041|       |
 4042|       |                /* eo6[0-3] */
 4043|   695k|                {
 4044|   695k|                    m_temp_reg_96 = _mm_madd_epi16(m_temp_reg_10, m_coeff7);
 4045|   695k|                }
 4046|       |                /* eo7[0-3] */
 4047|   695k|                {
 4048|   695k|                    m_temp_reg_97 = _mm_madd_epi16(m_temp_reg_10, m_coeff8);
 4049|   695k|                }
 4050|   695k|            }
 4051|       |
 4052|   695k|            m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64
 4053|       |
 4054|   695k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[0 * trans_size]);
 4055|       |
 4056|   695k|            m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
 4057|       |
 4058|   695k|            m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4059|       |
 4060|   695k|            m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4061|       |
 4062|       |            /* e[]*/
 4063|       |
 4064|   695k|            temp1 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_90);  /* ee[0] */
 4065|   695k|            temp2 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_90);  /* ee[15] */
 4066|       |
 4067|   695k|            temp3 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_91);  /* ee[1] */
 4068|   695k|            temp4 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_91);  /* ee[14] */
 4069|       |
 4070|   695k|            temp5 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_92);  /* ee[2] */
 4071|   695k|            temp6 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_92);  /* ee[13] */
 4072|       |
 4073|   695k|            temp7 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_93);  /* ee[3] */
 4074|   695k|            temp8 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_93);  /* ee[12] */
 4075|       |
 4076|   695k|            m_temp_reg_90 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_94);  /* ee[4] */
 4077|   695k|            m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_94);  /* ee[11] */
 4078|       |
 4079|   695k|            m_temp_reg_92 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_95);  /* ee[5] */
 4080|   695k|            m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_95);  /* ee[10] */
 4081|       |
 4082|   695k|            m_temp_reg_94 = _mm_add_epi32(m_temp_reg_16, m_temp_reg_96);  /* ee[6] */
 4083|   695k|            m_temp_reg_95 = _mm_sub_epi32(m_temp_reg_16, m_temp_reg_96);  /* ee[9] */
 4084|       |
 4085|   695k|            m_temp_reg_96 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_97);  /* ee[7] */
 4086|   695k|            m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_14, m_temp_reg_97);  /* ee[8] */
 4087|       |
 4088|       |            /*o[k]*/
 4089|   695k|            {
 4090|       |
 4091|   695k|                WORD16 *pi2_dst_scratch = temp_ptr;
 4092|   695k|                WORD32 out_stride = 8;
 4093|       |
 4094|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 4095|       |
 4096|   695k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[trans_size]);
 4097|   695k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)&pi2_tmp[3 * trans_size]);
 4098|       |
 4099|   695k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 4100|       |
 4101|       |
 4102|       |                /* o0[0-3] */
 4103|   695k|                {
 4104|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4105|       |
 4106|   695k|                    m_temp_reg_31 = _mm_sub_epi32(temp1, m_temp_reg_20);
 4107|   695k|                    m_temp_reg_30 = _mm_add_epi32(temp1, m_temp_reg_20);
 4108|       |
 4109|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4110|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4111|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4112|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4113|       |
 4114|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4115|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4116|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4117|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4118|       |
 4119|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4120|       |
 4121|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4122|   695k|                    pi2_dst_scratch += out_stride;
 4123|       |
 4124|   695k|                }
 4125|       |
 4126|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 4127|       |
 4128|       |                /* o1[0-3] */
 4129|   695k|                {
 4130|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4131|       |
 4132|   695k|                    m_temp_reg_31 = _mm_sub_epi32(temp3, m_temp_reg_20);
 4133|   695k|                    m_temp_reg_30 = _mm_add_epi32(temp3, m_temp_reg_20);
 4134|       |
 4135|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4136|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4137|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4138|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4139|       |
 4140|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4141|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4142|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4143|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4144|       |
 4145|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4146|       |
 4147|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4148|   695k|                    pi2_dst_scratch += out_stride;
 4149|       |
 4150|   695k|                }
 4151|       |
 4152|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 4153|       |
 4154|       |                /* o2[0-3] */
 4155|   695k|                {
 4156|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4157|       |
 4158|   695k|                    m_temp_reg_31 = _mm_sub_epi32(temp5, m_temp_reg_20);
 4159|   695k|                    m_temp_reg_30 = _mm_add_epi32(temp5, m_temp_reg_20);
 4160|       |
 4161|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4162|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4163|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4164|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4165|       |
 4166|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4167|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4168|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4169|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4170|       |
 4171|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4172|       |
 4173|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4174|   695k|                    pi2_dst_scratch += out_stride;
 4175|       |
 4176|   695k|                }
 4177|       |
 4178|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 4179|       |
 4180|       |                /* o3[0-3] */
 4181|   695k|                {
 4182|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4183|       |
 4184|   695k|                    m_temp_reg_31 = _mm_sub_epi32(temp7, m_temp_reg_20);
 4185|   695k|                    m_temp_reg_30 = _mm_add_epi32(temp7, m_temp_reg_20);
 4186|       |
 4187|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4188|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4189|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4190|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4191|       |
 4192|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4193|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4194|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4195|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4196|       |
 4197|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4198|       |
 4199|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4200|   695k|                    pi2_dst_scratch += out_stride;
 4201|       |
 4202|   695k|                }
 4203|       |
 4204|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 4205|       |
 4206|       |                /* o4[0-3] */
 4207|   695k|                {
 4208|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4209|       |
 4210|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_20);
 4211|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_20);
 4212|       |
 4213|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4214|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4215|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4216|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4217|       |
 4218|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4219|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4220|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4221|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4222|       |
 4223|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4224|       |
 4225|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4226|   695k|                    pi2_dst_scratch += out_stride;
 4227|       |
 4228|   695k|                }
 4229|       |
 4230|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 4231|       |
 4232|       |                /* o5[0-3] */
 4233|   695k|                {
 4234|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4235|       |
 4236|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_20);
 4237|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_20);
 4238|       |
 4239|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4240|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4241|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4242|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4243|       |
 4244|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4245|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4246|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4247|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4248|       |
 4249|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4250|       |
 4251|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4252|   695k|                    pi2_dst_scratch += out_stride;
 4253|       |
 4254|   695k|                }
 4255|       |
 4256|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 4257|       |
 4258|       |                /* o6[0-3] */
 4259|   695k|                {
 4260|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4261|       |
 4262|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_20);
 4263|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_20);
 4264|       |
 4265|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4266|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4267|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4268|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4269|       |
 4270|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4271|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4272|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4273|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4274|       |
 4275|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4276|       |
 4277|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4278|   695k|                    pi2_dst_scratch += out_stride;
 4279|       |
 4280|   695k|                }
 4281|       |
 4282|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 4283|       |
 4284|       |                /* o7[0-3] */
 4285|   695k|                {
 4286|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4287|       |
 4288|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_20);
 4289|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_20);
 4290|       |
 4291|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4292|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4293|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4294|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4295|       |
 4296|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4297|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4298|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4299|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4300|       |
 4301|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4302|       |
 4303|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4304|   695k|                    pi2_dst_scratch += 8;
 4305|       |
 4306|   695k|                }
 4307|       |
 4308|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 4309|       |
 4310|       |                /* o8[0-3] */
 4311|   695k|                {
 4312|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4313|       |
 4314|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_20);
 4315|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_20);
 4316|       |
 4317|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4318|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4319|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4320|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4321|       |
 4322|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4323|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4324|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4325|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4326|       |
 4327|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4328|       |
 4329|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4330|   695k|                    pi2_dst_scratch += out_stride;
 4331|   695k|                }
 4332|       |
 4333|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 4334|       |
 4335|       |                /* o9[0-3] */
 4336|   695k|                {
 4337|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4338|       |
 4339|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_20);
 4340|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_20);
 4341|       |
 4342|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4343|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4344|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4345|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4346|       |
 4347|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4348|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4349|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4350|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4351|       |
 4352|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4353|       |
 4354|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4355|   695k|                    pi2_dst_scratch += out_stride;
 4356|       |
 4357|   695k|                }
 4358|       |
 4359|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 4360|       |
 4361|       |                /* o10[0-3] */
 4362|   695k|                {
 4363|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4364|       |
 4365|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_20);
 4366|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_20);
 4367|       |
 4368|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4369|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4370|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4371|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4372|       |
 4373|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4374|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4375|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4376|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4377|       |
 4378|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4379|       |
 4380|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4381|   695k|                    pi2_dst_scratch += out_stride;
 4382|   695k|                }
 4383|       |
 4384|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 4385|       |
 4386|       |                /* o11[0-3] */
 4387|   695k|                {
 4388|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4389|       |
 4390|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_20);
 4391|   695k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_20);
 4392|       |
 4393|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4394|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4395|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4396|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4397|       |
 4398|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4399|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4400|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4401|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4402|       |
 4403|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4404|       |
 4405|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4406|   695k|                    pi2_dst_scratch += out_stride;
 4407|       |
 4408|   695k|                }
 4409|       |
 4410|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 4411|       |
 4412|       |                /* o12[0-3] */
 4413|   695k|                {
 4414|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4415|       |
 4416|   695k|                    m_temp_reg_31 = _mm_add_epi32(temp8, m_temp_reg_20);
 4417|   695k|                    m_temp_reg_30 = _mm_sub_epi32(temp8, m_temp_reg_20);
 4418|       |
 4419|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4420|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4421|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4422|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4423|       |
 4424|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4425|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4426|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4427|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4428|       |
 4429|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4430|       |
 4431|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4432|   695k|                    pi2_dst_scratch += out_stride;
 4433|       |
 4434|   695k|                }
 4435|       |
 4436|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 4437|       |
 4438|       |                /* o13[0-3] */
 4439|   695k|                {
 4440|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4441|       |
 4442|   695k|                    m_temp_reg_31 = _mm_add_epi32(temp6, m_temp_reg_20);
 4443|   695k|                    m_temp_reg_30 = _mm_sub_epi32(temp6, m_temp_reg_20);
 4444|       |
 4445|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4446|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4447|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4448|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4449|       |
 4450|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4451|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4452|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4453|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4454|       |
 4455|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4456|       |
 4457|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4458|   695k|                    pi2_dst_scratch += out_stride;
 4459|   695k|                }
 4460|       |
 4461|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 4462|       |
 4463|       |                /* o14[0-3] */
 4464|   695k|                {
 4465|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4466|       |
 4467|   695k|                    m_temp_reg_31 = _mm_add_epi32(temp4, m_temp_reg_20);
 4468|   695k|                    m_temp_reg_30 = _mm_sub_epi32(temp4, m_temp_reg_20);
 4469|       |
 4470|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4471|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4472|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4473|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4474|       |
 4475|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4476|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4477|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4478|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4479|       |
 4480|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4481|       |
 4482|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4483|   695k|                    pi2_dst_scratch += out_stride;
 4484|       |
 4485|   695k|                }
 4486|       |
 4487|   695k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 4488|       |
 4489|       |                /* o15[0-3] */
 4490|   695k|                {
 4491|   695k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4492|       |
 4493|   695k|                    m_temp_reg_31 = _mm_add_epi32(temp2, m_temp_reg_20);
 4494|   695k|                    m_temp_reg_30 = _mm_sub_epi32(temp2, m_temp_reg_20);
 4495|       |
 4496|   695k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4497|   695k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4498|   695k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4499|   695k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4500|       |
 4501|   695k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4502|   695k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4503|   695k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4504|   695k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4505|       |
 4506|   695k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4507|       |
 4508|   695k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4509|   695k|                    pi2_dst_scratch += 8;
 4510|   695k|                }
 4511|       |
 4512|   695k|            }
 4513|       |
 4514|   695k|        }
 4515|   774k|        else if(zero_last24_rows_stg2)
  ------------------
  |  Branch (4515:17): [True: 337k, False: 437k]
  ------------------
 4516|   337k|        {
 4517|       |            /* eo */
 4518|   337k|            {
 4519|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 4520|       |
 4521|   337k|                m_temp_reg_10 = _mm_loadu_si128((__m128i *)&pi2_tmp[2 * trans_size]);
 4522|   337k|                m_temp_reg_11 = _mm_loadu_si128((__m128i *)&pi2_tmp[6 * trans_size]);
 4523|       |
 4524|   337k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_10, m_temp_reg_11);
 4525|       |
 4526|       |
 4527|       |                /* eo0[0-3] */
 4528|   337k|                {
 4529|   337k|                    m_temp_reg_90 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4530|       |
 4531|   337k|                }
 4532|       |
 4533|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
 4534|       |
 4535|       |                /* eo1[0-3] */
 4536|   337k|                {
 4537|   337k|                    m_temp_reg_91 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4538|       |
 4539|   337k|                }
 4540|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
 4541|       |
 4542|       |                /* eo2[0-3] */
 4543|   337k|                {
 4544|   337k|                    m_temp_reg_92 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4545|       |
 4546|   337k|                }
 4547|       |
 4548|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
 4549|       |
 4550|       |                /* eo3[0-3] */
 4551|   337k|                {
 4552|       |
 4553|   337k|                    m_temp_reg_93 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4554|       |
 4555|   337k|                }
 4556|       |
 4557|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
 4558|       |
 4559|       |                /* eo4[0-3] */
 4560|   337k|                {
 4561|   337k|                    m_temp_reg_94 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4562|       |
 4563|   337k|                }
 4564|       |
 4565|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
 4566|       |
 4567|       |                /* eo5[0-3] */
 4568|   337k|                {
 4569|   337k|                    m_temp_reg_95 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4570|   337k|                }
 4571|       |
 4572|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
 4573|       |                /* eo6[0-3] */
 4574|   337k|                {
 4575|   337k|                    m_temp_reg_96 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4576|   337k|                }
 4577|       |
 4578|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 4579|       |                /* eo7[0-3] */
 4580|   337k|                {
 4581|   337k|                    m_temp_reg_97 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4582|       |
 4583|   337k|                }
 4584|       |
 4585|   337k|            }
 4586|       |
 4587|       |            /* eeo */
 4588|   337k|            {
 4589|       |
 4590|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
 4591|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75
 4592|   337k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18
 4593|   337k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[8][0]); //50
 4594|       |
 4595|   337k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[4 * trans_size]);
 4596|       |
 4597|   337k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, all_zero_reg);
 4598|       |
 4599|       |                /* eeo0[0-3] */
 4600|   337k|                {
 4601|   337k|                    temp1 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4602|       |
 4603|   337k|                }
 4604|       |
 4605|       |                /* eeo1[0-3] */
 4606|   337k|                {
 4607|   337k|                    temp2 = _mm_madd_epi16(m_temp_reg_10, m_coeff2);
 4608|       |
 4609|   337k|                }
 4610|       |
 4611|       |                /* eo2[0-3] */
 4612|   337k|                {
 4613|   337k|                    temp3 = _mm_madd_epi16(m_temp_reg_10, m_coeff4);
 4614|       |
 4615|   337k|                }
 4616|       |
 4617|       |
 4618|       |                /* eo3[0-3] */
 4619|   337k|                {
 4620|   337k|                    temp4 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 4621|       |
 4622|   337k|                }
 4623|       |
 4624|   337k|            }
 4625|       |
 4626|   337k|            m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83
 4627|   337k|            m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36
 4628|   337k|            m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64
 4629|       |
 4630|   337k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[0 * trans_size]);
 4631|       |
 4632|       |            //m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_70);
 4633|   337k|            m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, all_zero_reg);
 4634|       |
 4635|   337k|            m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4636|   337k|            m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 4637|       |
 4638|   337k|            m_temp_reg_70 = _mm_add_epi32(m_temp_reg_14, temp1);  /* ee[0] */
 4639|   337k|            m_temp_reg_71 = _mm_sub_epi32(m_temp_reg_14, temp1);  /* ee[7] */
 4640|       |
 4641|   337k|            m_temp_reg_72 = _mm_add_epi32(m_temp_reg_16, temp2);  /* ee[1] */
 4642|   337k|            m_temp_reg_73 = _mm_sub_epi32(m_temp_reg_16, temp2);  /* ee[6] */
 4643|       |
 4644|   337k|            m_temp_reg_74 = _mm_add_epi32(m_temp_reg_16, temp3);  /* ee[2] */
 4645|   337k|            m_temp_reg_75 = _mm_sub_epi32(m_temp_reg_16, temp3);  /* ee[5] */
 4646|       |
 4647|   337k|            m_temp_reg_76 = _mm_add_epi32(m_temp_reg_14, temp4);  /* ee[3] */
 4648|   337k|            m_temp_reg_77 = _mm_sub_epi32(m_temp_reg_14, temp4);  /* ee[4] */
 4649|       |
 4650|       |            /* e[]*/
 4651|       |
 4652|   337k|            temp1 = _mm_add_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[0] */
 4653|   337k|            temp2 = _mm_sub_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[15] */
 4654|       |
 4655|   337k|            temp3 = _mm_add_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[1] */
 4656|   337k|            temp4 = _mm_sub_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[14] */
 4657|       |
 4658|   337k|            temp5 = _mm_add_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[2] */
 4659|   337k|            temp6 = _mm_sub_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[13] */
 4660|       |
 4661|   337k|            temp7 = _mm_add_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[3] */
 4662|   337k|            temp8 = _mm_sub_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[12] */
 4663|       |
 4664|   337k|            m_temp_reg_90 = _mm_add_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[4] */
 4665|   337k|            m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[11] */
 4666|       |
 4667|   337k|            m_temp_reg_92 = _mm_add_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[5] */
 4668|   337k|            m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[10] */
 4669|       |
 4670|   337k|            m_temp_reg_94 = _mm_add_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[6] */
 4671|   337k|            m_temp_reg_95 = _mm_sub_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[9] */
 4672|       |
 4673|   337k|            m_temp_reg_96 = _mm_add_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[7] */
 4674|   337k|            m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[8] */
 4675|       |
 4676|       |            /*o[k] */
 4677|   337k|            {
 4678|       |
 4679|   337k|                WORD16 *pi2_dst_scratch = temp_ptr;
 4680|   337k|                WORD32 out_stride = 8;
 4681|       |
 4682|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 4683|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 4684|       |
 4685|   337k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[trans_size]);
 4686|   337k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)&pi2_tmp[3 * trans_size]);
 4687|   337k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[5 * trans_size]);
 4688|   337k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)&pi2_tmp[7 * trans_size]);
 4689|       |
 4690|   337k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 4691|   337k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73);
 4692|       |
 4693|       |                /* o0[0-3] */
 4694|   337k|                {
 4695|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4696|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4697|       |
 4698|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 4699|       |
 4700|   337k|                    m_temp_reg_31 = _mm_sub_epi32(temp1, m_temp_reg_20);
 4701|   337k|                    m_temp_reg_30 = _mm_add_epi32(temp1, m_temp_reg_20);
 4702|       |
 4703|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4704|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4705|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4706|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4707|       |
 4708|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4709|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4710|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4711|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4712|       |
 4713|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4714|       |
 4715|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4716|   337k|                    pi2_dst_scratch += out_stride;
 4717|       |
 4718|   337k|                }
 4719|       |
 4720|       |
 4721|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 4722|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 4723|       |
 4724|       |                /* o1[0-3] */
 4725|   337k|                {
 4726|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4727|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4728|       |
 4729|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 4730|       |
 4731|   337k|                    m_temp_reg_31 = _mm_sub_epi32(temp3, m_temp_reg_20);
 4732|   337k|                    m_temp_reg_30 = _mm_add_epi32(temp3, m_temp_reg_20);
 4733|       |
 4734|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4735|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4736|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4737|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4738|       |
 4739|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4740|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4741|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4742|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4743|       |
 4744|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4745|       |
 4746|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4747|   337k|                    pi2_dst_scratch += out_stride;
 4748|       |
 4749|   337k|                }
 4750|       |
 4751|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 4752|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 4753|       |
 4754|       |                /* o2[0-3] */
 4755|   337k|                {
 4756|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4757|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4758|       |
 4759|   337k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 4760|       |
 4761|   337k|                    m_temp_reg_31 = _mm_add_epi32(temp5, m_temp_reg_20);
 4762|   337k|                    m_temp_reg_30 = _mm_sub_epi32(temp5, m_temp_reg_20);
 4763|       |
 4764|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4765|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4766|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4767|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4768|       |
 4769|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4770|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4771|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4772|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4773|       |
 4774|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4775|       |
 4776|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4777|   337k|                    pi2_dst_scratch += out_stride;
 4778|       |
 4779|   337k|                }
 4780|       |
 4781|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 4782|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 4783|       |
 4784|       |                /* o3[0-3] */
 4785|   337k|                {
 4786|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4787|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4788|       |
 4789|   337k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 4790|       |
 4791|   337k|                    m_temp_reg_31 = _mm_add_epi32(temp7, m_temp_reg_20);
 4792|   337k|                    m_temp_reg_30 = _mm_sub_epi32(temp7, m_temp_reg_20);
 4793|       |
 4794|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4795|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4796|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4797|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4798|       |
 4799|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4800|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4801|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4802|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4803|       |
 4804|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4805|       |
 4806|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4807|   337k|                    pi2_dst_scratch += out_stride;
 4808|       |
 4809|   337k|                }
 4810|       |
 4811|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 4812|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 4813|       |
 4814|       |                /* o4[0-3] */
 4815|   337k|                {
 4816|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4817|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4818|       |
 4819|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4820|       |
 4821|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_20);
 4822|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_20);
 4823|       |
 4824|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4825|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4826|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4827|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4828|       |
 4829|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4830|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4831|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4832|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4833|       |
 4834|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4835|       |
 4836|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4837|   337k|                    pi2_dst_scratch += out_stride;
 4838|       |
 4839|   337k|                }
 4840|       |
 4841|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 4842|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 4843|       |
 4844|       |                /* o5[0-3] */
 4845|   337k|                {
 4846|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4847|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4848|       |
 4849|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4850|       |
 4851|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_20);
 4852|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_20);
 4853|       |
 4854|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4855|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4856|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4857|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4858|       |
 4859|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4860|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4861|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4862|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4863|       |
 4864|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4865|       |
 4866|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4867|   337k|                    pi2_dst_scratch += out_stride;
 4868|       |
 4869|   337k|                }
 4870|       |
 4871|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 4872|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 4873|       |
 4874|       |                /* o6[0-3] */
 4875|   337k|                {
 4876|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4877|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4878|       |
 4879|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4880|       |
 4881|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_20);
 4882|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_20);
 4883|       |
 4884|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4885|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4886|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4887|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4888|       |
 4889|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4890|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4891|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4892|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4893|       |
 4894|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4895|       |
 4896|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4897|   337k|                    pi2_dst_scratch += out_stride;
 4898|       |
 4899|   337k|                }
 4900|       |
 4901|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 4902|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 4903|       |
 4904|       |                /* o7[0-3] */
 4905|   337k|                {
 4906|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4907|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4908|       |
 4909|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4910|       |
 4911|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_20);
 4912|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_20);
 4913|       |
 4914|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4915|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4916|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4917|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4918|       |
 4919|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4920|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4921|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4922|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4923|       |
 4924|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4925|       |
 4926|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4927|   337k|                    pi2_dst_scratch += 8;
 4928|       |
 4929|   337k|                }
 4930|       |
 4931|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 4932|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 4933|       |
 4934|       |                /* o8[0-3] */
 4935|   337k|                {
 4936|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4937|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4938|       |
 4939|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4940|       |
 4941|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_20);
 4942|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_20);
 4943|       |
 4944|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4945|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4946|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4947|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4948|       |
 4949|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4950|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4951|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4952|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4953|       |
 4954|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4955|       |
 4956|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4957|   337k|                    pi2_dst_scratch += out_stride;
 4958|   337k|                }
 4959|       |
 4960|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 4961|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 4962|       |
 4963|       |                /* o9[0-3] */
 4964|   337k|                {
 4965|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4966|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4967|       |
 4968|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4969|       |
 4970|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_20);
 4971|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_20);
 4972|       |
 4973|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 4974|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 4975|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 4976|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 4977|       |
 4978|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 4979|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 4980|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 4981|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 4982|       |
 4983|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 4984|       |
 4985|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 4986|   337k|                    pi2_dst_scratch += out_stride;
 4987|   337k|                }
 4988|       |
 4989|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 4990|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 4991|       |
 4992|       |                /* o10[0-3] */
 4993|   337k|                {
 4994|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 4995|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 4996|       |
 4997|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 4998|       |
 4999|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_20);
 5000|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_20);
 5001|       |
 5002|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5003|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5004|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5005|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5006|       |
 5007|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5008|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5009|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5010|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5011|       |
 5012|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5013|       |
 5014|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5015|   337k|                    pi2_dst_scratch += out_stride;
 5016|   337k|                }
 5017|       |
 5018|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 5019|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 5020|       |
 5021|       |                /* o11[0-3] */
 5022|   337k|                {
 5023|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5024|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5025|       |
 5026|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5027|       |
 5028|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_20);
 5029|   337k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_20);
 5030|       |
 5031|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5032|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5033|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5034|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5035|       |
 5036|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5037|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5038|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5039|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5040|       |
 5041|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5042|       |
 5043|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5044|   337k|                    pi2_dst_scratch += out_stride;
 5045|       |
 5046|   337k|                }
 5047|       |
 5048|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 5049|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 5050|       |
 5051|       |                /* o12[0-3] */
 5052|   337k|                {
 5053|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5054|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5055|       |
 5056|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5057|       |
 5058|   337k|                    m_temp_reg_31 = _mm_add_epi32(temp8, m_temp_reg_20);
 5059|   337k|                    m_temp_reg_30 = _mm_sub_epi32(temp8, m_temp_reg_20);
 5060|       |
 5061|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5062|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5063|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5064|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5065|       |
 5066|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5067|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5068|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5069|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5070|       |
 5071|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5072|       |
 5073|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5074|   337k|                    pi2_dst_scratch += out_stride;
 5075|       |
 5076|   337k|                }
 5077|       |
 5078|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 5079|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 5080|       |
 5081|       |                /* o13[0-3] */
 5082|   337k|                {
 5083|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5084|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5085|       |
 5086|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5087|       |
 5088|   337k|                    m_temp_reg_31 = _mm_add_epi32(temp6, m_temp_reg_20);
 5089|   337k|                    m_temp_reg_30 = _mm_sub_epi32(temp6, m_temp_reg_20);
 5090|       |
 5091|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5092|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5093|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5094|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5095|       |
 5096|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5097|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5098|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5099|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5100|       |
 5101|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5102|       |
 5103|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5104|   337k|                    pi2_dst_scratch += out_stride;
 5105|   337k|                }
 5106|       |
 5107|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 5108|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 5109|       |
 5110|       |                /* o14[0-3] */
 5111|   337k|                {
 5112|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5113|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5114|       |
 5115|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5116|       |
 5117|   337k|                    m_temp_reg_31 = _mm_add_epi32(temp4, m_temp_reg_20);
 5118|   337k|                    m_temp_reg_30 = _mm_sub_epi32(temp4, m_temp_reg_20);
 5119|       |
 5120|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5121|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5122|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5123|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5124|       |
 5125|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5126|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5127|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5128|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5129|       |
 5130|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5131|       |
 5132|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5133|   337k|                    pi2_dst_scratch += out_stride;
 5134|   337k|                }
 5135|       |
 5136|   337k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 5137|   337k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 5138|       |
 5139|       |                /* o15[0-3] */
 5140|   337k|                {
 5141|   337k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5142|   337k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5143|       |
 5144|   337k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);
 5145|       |
 5146|   337k|                    m_temp_reg_31 = _mm_add_epi32(temp2, m_temp_reg_20);
 5147|   337k|                    m_temp_reg_30 = _mm_sub_epi32(temp2, m_temp_reg_20);
 5148|       |
 5149|   337k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5150|   337k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5151|   337k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5152|   337k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5153|       |
 5154|   337k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5155|   337k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5156|   337k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5157|   337k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5158|       |
 5159|   337k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5160|       |
 5161|   337k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5162|   337k|                    pi2_dst_scratch += 8;
 5163|   337k|                }
 5164|       |
 5165|   337k|            }
 5166|   337k|        }
 5167|   437k|        else
 5168|   437k|        {
 5169|       |            /* eo */
 5170|   437k|            {
 5171|       |
 5172|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[0][0]); //90 87
 5173|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[1][0]); //80 70
 5174|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[2][0]); //57 43
 5175|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[3][0]); //25 9
 5176|       |
 5177|       |
 5178|   437k|                m_temp_reg_10 = _mm_loadu_si128((__m128i *)&pi2_tmp[2 * trans_size]);
 5179|   437k|                m_temp_reg_11 = _mm_loadu_si128((__m128i *)&pi2_tmp[6 * trans_size]);
 5180|   437k|                m_temp_reg_12 = _mm_loadu_si128((__m128i *)&pi2_tmp[10 * trans_size]);
 5181|   437k|                m_temp_reg_13 = _mm_loadu_si128((__m128i *)&pi2_tmp[14 * trans_size]);
 5182|   437k|                m_temp_reg_18 = _mm_loadu_si128((__m128i *)&pi2_tmp[18 * trans_size]);
 5183|   437k|                m_temp_reg_19 = _mm_loadu_si128((__m128i *)&pi2_tmp[22 * trans_size]);
 5184|   437k|                m_temp_reg_20 = _mm_loadu_si128((__m128i *)&pi2_tmp[26 * trans_size]);
 5185|   437k|                m_temp_reg_21 = _mm_loadu_si128((__m128i *)&pi2_tmp[30 * trans_size]);
 5186|       |
 5187|   437k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_10, m_temp_reg_11);
 5188|   437k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_12, m_temp_reg_13);
 5189|   437k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_18, m_temp_reg_19);
 5190|   437k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_21);
 5191|       |
 5192|       |                /* eo0[0-3] */
 5193|   437k|                {
 5194|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5195|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5196|       |
 5197|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5198|       |
 5199|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5200|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5201|       |
 5202|   437k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5203|       |
 5204|   437k|                    m_temp_reg_90 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5205|       |
 5206|   437k|                }
 5207|       |
 5208|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[4][0]); //87  57
 5209|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[5][0]); //0  -43
 5210|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[6][0]); //80  90
 5211|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[7][0]); //70  25
 5212|       |
 5213|       |                /* eo1[0-3] */
 5214|   437k|                {
 5215|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5216|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5217|       |
 5218|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5219|       |
 5220|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5221|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5222|       |
 5223|   437k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5224|       |
 5225|   437k|                    m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_32);
 5226|       |
 5227|   437k|                }
 5228|       |
 5229|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[8][0]); //80  9
 5230|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[9][0]); //70  87
 5231|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[10][0]); //-25  57
 5232|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[11][0]); //90  43
 5233|       |
 5234|       |                /* eo2[0-3] */
 5235|   437k|                {
 5236|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5237|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5238|       |
 5239|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 5240|       |
 5241|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5242|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5243|       |
 5244|   437k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5245|       |
 5246|   437k|                    m_temp_reg_92 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5247|       |
 5248|   437k|                }
 5249|       |
 5250|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[12][0]); //70  -43
 5251|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[13][0]); //-87  9
 5252|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[14][0]); //90  25
 5253|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[15][0]); //80  57
 5254|       |
 5255|       |                /* eo3[0-3] */
 5256|   437k|                {
 5257|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5258|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5259|       |
 5260|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5261|       |
 5262|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5263|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5264|       |
 5265|   437k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_32, m_temp_reg_33);
 5266|       |
 5267|   437k|                    m_temp_reg_93 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5268|       |
 5269|   437k|                }
 5270|       |
 5271|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[16][0]); //57  -80
 5272|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[17][0]); //-25  90
 5273|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[18][0]); //9  87
 5274|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[19][0]); //43  70
 5275|       |
 5276|       |
 5277|       |                /* eo4[0-3] */
 5278|   437k|                {
 5279|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5280|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5281|       |
 5282|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5283|       |
 5284|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5285|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5286|       |
 5287|   437k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
 5288|       |
 5289|   437k|                    m_temp_reg_94 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5290|       |
 5291|   437k|                }
 5292|       |
 5293|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[20][0]); //43  -90
 5294|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[21][0]); //57  25
 5295|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[22][0]); //-87  70
 5296|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[23][0]); //9  -80
 5297|       |
 5298|       |                /* eo5[0-3] */
 5299|   437k|                {
 5300|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5301|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5302|       |
 5303|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5304|       |
 5305|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5306|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5307|       |
 5308|   437k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5309|       |
 5310|   437k|                    m_temp_reg_95 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5311|   437k|                }
 5312|       |
 5313|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[24][0]); //25  -70
 5314|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[25][0]); //90  -80
 5315|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[26][0]); //43  9
 5316|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[27][0]); //-57  87
 5317|       |
 5318|       |                /* eo6[0-3] */
 5319|   437k|                {
 5320|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5321|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5322|       |
 5323|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5324|       |
 5325|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5326|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5327|       |
 5328|   437k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5329|       |
 5330|   437k|                    m_temp_reg_96 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5331|       |
 5332|   437k|                }
 5333|       |
 5334|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[28][0]); //9  -25
 5335|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[29][0]); //43  -57
 5336|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[30][0]); //70  -80
 5337|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_packed[31][0]); //87  -90
 5338|       |
 5339|       |                /* eo7[0-3] */
 5340|   437k|                {
 5341|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5342|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5343|       |
 5344|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5345|       |
 5346|   437k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5347|   437k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5348|       |
 5349|   437k|                    m_temp_reg_32 = _mm_add_epi32(m_temp_reg_32, m_temp_reg_33);
 5350|       |
 5351|   437k|                    m_temp_reg_97 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_32);
 5352|       |
 5353|       |
 5354|   437k|                }
 5355|       |
 5356|   437k|            }
 5357|       |
 5358|       |            /* eeo */
 5359|   437k|            {
 5360|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[4][0]); //89 75
 5361|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[5][0]); //50 18
 5362|       |
 5363|   437k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[4 * trans_size]);
 5364|   437k|                m_temp_reg_76 = _mm_loadu_si128((__m128i *)&pi2_tmp[12 * trans_size]);
 5365|   437k|                m_temp_reg_82 = _mm_loadu_si128((__m128i *)&pi2_tmp[20 * trans_size]);
 5366|   437k|                m_temp_reg_86 = _mm_loadu_si128((__m128i *)&pi2_tmp[28 * trans_size]);
 5367|       |
 5368|       |                /* eeo0[0-3] */
 5369|   437k|                {
 5370|       |
 5371|   437k|                    m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 5372|   437k|                    m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_86);
 5373|       |
 5374|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5375|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5376|       |
 5377|   437k|                    temp1 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5378|       |
 5379|   437k|                }
 5380|       |
 5381|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[6][0]); //75 -18
 5382|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[7][0]); //89  50
 5383|       |
 5384|       |                /* eeo1[0-3] */
 5385|   437k|                {
 5386|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 5387|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 5388|       |
 5389|   437k|                    temp2 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_31);
 5390|       |
 5391|   437k|                }
 5392|       |
 5393|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[8][0]); //50 -89
 5394|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[9][0]); //18  75
 5395|       |
 5396|       |                /* eo2[0-3] */
 5397|   437k|                {
 5398|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 5399|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 5400|       |
 5401|   437k|                    temp3 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5402|       |
 5403|   437k|                }
 5404|       |
 5405|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[10][0]); //18 -50
 5406|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[11][0]); //75  -89
 5407|       |
 5408|       |                /* eo3[0-3] */
 5409|   437k|                {
 5410|   437k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_10, m_coeff3);
 5411|   437k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_11, m_coeff4);
 5412|       |
 5413|   437k|                    temp4 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
 5414|       |
 5415|   437k|                }
 5416|       |
 5417|       |
 5418|   437k|            }
 5419|       |
 5420|   437k|            m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[0][0]); //83 36
 5421|   437k|            m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[1][0]); //36 -83
 5422|       |
 5423|   437k|            m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[2][0]); //64 64
 5424|   437k|            m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_16_even_packed[3][0]); //64 -64
 5425|       |
 5426|   437k|            m_temp_reg_74 = _mm_loadu_si128((__m128i *)&pi2_tmp[8 * trans_size]);
 5427|   437k|            m_temp_reg_84 = _mm_loadu_si128((__m128i *)&pi2_tmp[24 * trans_size]);
 5428|       |
 5429|   437k|            m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_84);
 5430|       |
 5431|   437k|            m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[0 * trans_size]);
 5432|   437k|            m_temp_reg_80 = _mm_loadu_si128((__m128i *)&pi2_tmp[16 * trans_size]);
 5433|       |
 5434|   437k|            m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_80);
 5435|       |
 5436|   437k|            m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);  /* eeeo[0] */
 5437|   437k|            m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);  /* eeeo[1] */
 5438|       |
 5439|   437k|            m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);  /* eeee[0] */
 5440|   437k|            m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff4);  /* eeee[1] */
 5441|       |
 5442|       |/* eeeo[0]= m_temp_reg_20  */
 5443|       |/* eeeo[1]= m_temp_reg_21  */
 5444|       |/* eeee[0]= m_temp_reg_22  */
 5445|       |/* eeee[1]= m_temp_reg_23  */
 5446|       |
 5447|       |            /* eee[0] = eeee[0] + eeeo[0]; */
 5448|   437k|            m_temp_reg_40 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[0] */
 5449|       |
 5450|       |            /* eee[3] = eeee[0] - eeeo[0]; */
 5451|   437k|            m_temp_reg_43 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);  /* eeeo[1] */
 5452|       |
 5453|       |            /* eee[2] = eeee[1] - eeeo[1]; */
 5454|   437k|            m_temp_reg_42 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[1] */
 5455|       |
 5456|       |            /* eee[1] = eeee[1] + eeeo[1];*/
 5457|   437k|            m_temp_reg_41 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_22);  /* eeee[0] */
 5458|       |
 5459|   437k|            m_temp_reg_70 = _mm_add_epi32(m_temp_reg_40, temp1);  /* ee[0] */
 5460|   437k|            m_temp_reg_71 = _mm_sub_epi32(m_temp_reg_40, temp1);  /* ee[7] */
 5461|       |
 5462|   437k|            m_temp_reg_72 = _mm_add_epi32(m_temp_reg_41, temp2);  /* ee[1] */
 5463|   437k|            m_temp_reg_73 = _mm_sub_epi32(m_temp_reg_41, temp2);  /* ee[6] */
 5464|       |
 5465|   437k|            m_temp_reg_74 = _mm_add_epi32(m_temp_reg_42, temp3);  /* ee[2] */
 5466|   437k|            m_temp_reg_75 = _mm_sub_epi32(m_temp_reg_42, temp3);  /* ee[5] */
 5467|       |
 5468|   437k|            m_temp_reg_76 = _mm_add_epi32(m_temp_reg_43, temp4);  /* ee[3] */
 5469|   437k|            m_temp_reg_77 = _mm_sub_epi32(m_temp_reg_43, temp4);  /* ee[4] */
 5470|       |
 5471|       |/* e[]*/
 5472|       |
 5473|   437k|            temp1 = _mm_add_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[0] */
 5474|   437k|            temp2 = _mm_sub_epi32(m_temp_reg_70, m_temp_reg_90);  /* ee[15] */
 5475|       |
 5476|   437k|            temp3 = _mm_add_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[1] */
 5477|   437k|            temp4 = _mm_sub_epi32(m_temp_reg_72, m_temp_reg_91);  /* ee[14] */
 5478|       |
 5479|   437k|            temp5 = _mm_add_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[2] */
 5480|   437k|            temp6 = _mm_sub_epi32(m_temp_reg_74, m_temp_reg_92);  /* ee[13] */
 5481|       |
 5482|   437k|            temp7 = _mm_add_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[3] */
 5483|   437k|            temp8 = _mm_sub_epi32(m_temp_reg_76, m_temp_reg_93);  /* ee[12] */
 5484|       |
 5485|   437k|            m_temp_reg_90 = _mm_add_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[4] */
 5486|   437k|            m_temp_reg_91 = _mm_sub_epi32(m_temp_reg_77, m_temp_reg_94);  /* ee[11] */
 5487|       |
 5488|   437k|            m_temp_reg_92 = _mm_add_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[5] */
 5489|   437k|            m_temp_reg_93 = _mm_sub_epi32(m_temp_reg_75, m_temp_reg_95);  /* ee[10] */
 5490|       |
 5491|   437k|            m_temp_reg_94 = _mm_add_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[6] */
 5492|   437k|            m_temp_reg_95 = _mm_sub_epi32(m_temp_reg_73, m_temp_reg_96);  /* ee[9] */
 5493|       |
 5494|   437k|            m_temp_reg_96 = _mm_add_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[7] */
 5495|   437k|            m_temp_reg_97 = _mm_sub_epi32(m_temp_reg_71, m_temp_reg_97);  /* ee[8] */
 5496|       |
 5497|       |/*o[k] */
 5498|   437k|            {
 5499|       |
 5500|   437k|                WORD16 *pi2_dst_scratch = temp_ptr;
 5501|   437k|                WORD32 out_stride = 8;
 5502|       |
 5503|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[0][0]);
 5504|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[1][0]);
 5505|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[2][0]);
 5506|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[3][0]);
 5507|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[4][0]);
 5508|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[5][0]);
 5509|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[6][0]);
 5510|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[7][0]);
 5511|       |
 5512|       |
 5513|   437k|                m_temp_reg_70 = _mm_loadu_si128((__m128i *)&pi2_tmp[trans_size]);
 5514|   437k|                m_temp_reg_71 = _mm_loadu_si128((__m128i *)&pi2_tmp[3 * trans_size]);
 5515|   437k|                m_temp_reg_72 = _mm_loadu_si128((__m128i *)&pi2_tmp[5 * trans_size]);
 5516|   437k|                m_temp_reg_73 = _mm_loadu_si128((__m128i *)&pi2_tmp[7 * trans_size]);
 5517|   437k|                m_temp_reg_74 = _mm_loadu_si128((__m128i *)&pi2_tmp[9 * trans_size]);
 5518|   437k|                m_temp_reg_75 = _mm_loadu_si128((__m128i *)&pi2_tmp[11 * trans_size]);
 5519|   437k|                m_temp_reg_76 = _mm_loadu_si128((__m128i *)&pi2_tmp[13 * trans_size]);
 5520|   437k|                m_temp_reg_77 = _mm_loadu_si128((__m128i *)&pi2_tmp[15 * trans_size]);
 5521|       |
 5522|   437k|                m_temp_reg_80 = _mm_loadu_si128((__m128i *)&pi2_tmp[17 * trans_size]);
 5523|   437k|                m_temp_reg_81 = _mm_loadu_si128((__m128i *)&pi2_tmp[19 * trans_size]);
 5524|   437k|                m_temp_reg_82 = _mm_loadu_si128((__m128i *)&pi2_tmp[21 * trans_size]);
 5525|   437k|                m_temp_reg_83 = _mm_loadu_si128((__m128i *)&pi2_tmp[23 * trans_size]);
 5526|   437k|                m_temp_reg_84 = _mm_loadu_si128((__m128i *)&pi2_tmp[25 * trans_size]);
 5527|   437k|                m_temp_reg_85 = _mm_loadu_si128((__m128i *)&pi2_tmp[27 * trans_size]);
 5528|   437k|                m_temp_reg_86 = _mm_loadu_si128((__m128i *)&pi2_tmp[29 * trans_size]);
 5529|   437k|                m_temp_reg_87 = _mm_loadu_si128((__m128i *)&pi2_tmp[31 * trans_size]);
 5530|       |
 5531|   437k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71); //row 1 and row 3 interleaved
 5532|   437k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73); //row 5 and row 7 interleaved
 5533|   437k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75); //row 9 and row 11 interleaved
 5534|   437k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77); //row 13 and row 15 interleaved
 5535|   437k|                m_temp_reg_14 = _mm_unpacklo_epi16(m_temp_reg_80, m_temp_reg_81); //row 17 and row 19 interleaved
 5536|   437k|                m_temp_reg_15 = _mm_unpacklo_epi16(m_temp_reg_82, m_temp_reg_83); //row 21 and row 23 interleaved
 5537|   437k|                m_temp_reg_16 = _mm_unpacklo_epi16(m_temp_reg_84, m_temp_reg_85); //row 25 and row 27 interleaved
 5538|   437k|                m_temp_reg_17 = _mm_unpacklo_epi16(m_temp_reg_86, m_temp_reg_87); //row 29 and row 31 interleaved
 5539|       |
 5540|       |                /* o0[0-3] */
 5541|   437k|                {
 5542|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5543|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5544|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5545|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5546|       |
 5547|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5548|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5549|       |
 5550|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5551|       |
 5552|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5553|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5554|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5555|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5556|       |
 5557|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5558|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5559|       |
 5560|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5561|       |
 5562|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5563|       |
 5564|   437k|                    m_temp_reg_31 = _mm_sub_epi32(temp1, m_temp_reg_20);
 5565|   437k|                    m_temp_reg_30 = _mm_add_epi32(temp1, m_temp_reg_20);
 5566|       |
 5567|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5568|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5569|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5570|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5571|       |
 5572|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5573|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5574|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5575|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5576|       |
 5577|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5578|       |
 5579|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5580|   437k|                    pi2_dst_scratch += out_stride;
 5581|       |
 5582|   437k|                }
 5583|       |
 5584|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[8][0]);
 5585|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[9][0]);
 5586|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[10][0]);
 5587|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[11][0]);
 5588|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[12][0]);
 5589|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[13][0]);
 5590|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[14][0]);
 5591|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[15][0]);
 5592|       |
 5593|       |                /* o1[0-3] */
 5594|   437k|                {
 5595|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5596|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5597|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5598|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5599|       |
 5600|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5601|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5602|       |
 5603|   437k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_20);
 5604|       |
 5605|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5606|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5607|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5608|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5609|       |
 5610|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5611|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5612|       |
 5613|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5614|       |
 5615|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5616|       |
 5617|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp3, m_temp_reg_20);
 5618|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp3, m_temp_reg_20);
 5619|       |
 5620|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5621|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5622|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5623|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5624|       |
 5625|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5626|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5627|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5628|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5629|       |
 5630|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5631|       |
 5632|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5633|   437k|                    pi2_dst_scratch += out_stride;
 5634|       |
 5635|   437k|                }
 5636|       |
 5637|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[16][0]);
 5638|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[17][0]);
 5639|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[18][0]);
 5640|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[19][0]);
 5641|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[20][0]);
 5642|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[21][0]);
 5643|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[22][0]);
 5644|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[23][0]);
 5645|       |
 5646|       |                /* o2[0-3] */
 5647|   437k|                {
 5648|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5649|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5650|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5651|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5652|       |
 5653|   437k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 5654|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5655|       |
 5656|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5657|       |
 5658|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5659|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5660|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5661|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5662|       |
 5663|   437k|                    m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_41);
 5664|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5665|       |
 5666|   437k|                    m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_42);
 5667|       |
 5668|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5669|       |
 5670|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp5, m_temp_reg_20);
 5671|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp5, m_temp_reg_20);
 5672|       |
 5673|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5674|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5675|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5676|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5677|       |
 5678|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5679|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5680|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5681|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5682|       |
 5683|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5684|       |
 5685|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5686|   437k|                    pi2_dst_scratch += out_stride;
 5687|       |
 5688|   437k|                }
 5689|       |
 5690|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[24][0]);
 5691|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[25][0]);
 5692|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[26][0]);
 5693|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[27][0]);
 5694|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[28][0]);
 5695|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[29][0]);
 5696|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[30][0]);
 5697|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[31][0]);
 5698|       |
 5699|       |                /* o3[0-3] */
 5700|   437k|                {
 5701|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5702|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5703|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5704|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5705|       |
 5706|   437k|                    m_temp_reg_20 = _mm_sub_epi32(m_temp_reg_21, m_temp_reg_20);
 5707|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5708|       |
 5709|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5710|       |
 5711|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5712|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5713|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5714|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5715|       |
 5716|   437k|                    m_temp_reg_40 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_40);
 5717|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5718|       |
 5719|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5720|       |
 5721|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5722|       |
 5723|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp7, m_temp_reg_20);
 5724|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp7, m_temp_reg_20);
 5725|       |
 5726|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5727|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5728|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5729|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5730|       |
 5731|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5732|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5733|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5734|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5735|       |
 5736|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5737|       |
 5738|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5739|   437k|                    pi2_dst_scratch += out_stride;
 5740|       |
 5741|   437k|                }
 5742|       |
 5743|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[32][0]);
 5744|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[33][0]);
 5745|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[34][0]);
 5746|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[35][0]);
 5747|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[36][0]);
 5748|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[37][0]);
 5749|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[38][0]);
 5750|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[39][0]);
 5751|       |
 5752|       |                /* o4[0-3] */
 5753|   437k|                {
 5754|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5755|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5756|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5757|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5758|       |
 5759|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5760|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5761|       |
 5762|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5763|       |
 5764|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5765|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5766|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5767|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5768|       |
 5769|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5770|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5771|       |
 5772|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5773|       |
 5774|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5775|       |
 5776|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_90, m_temp_reg_20);
 5777|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_90, m_temp_reg_20);
 5778|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5779|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5780|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5781|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5782|       |
 5783|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5784|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5785|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5786|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5787|       |
 5788|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5789|       |
 5790|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5791|   437k|                    pi2_dst_scratch += out_stride;
 5792|       |
 5793|   437k|                }
 5794|       |
 5795|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[40][0]);
 5796|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[41][0]);
 5797|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[42][0]);
 5798|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[43][0]);
 5799|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[44][0]);
 5800|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[45][0]);
 5801|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[46][0]);
 5802|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[47][0]);
 5803|       |
 5804|       |                /* o5[0-3] */
 5805|   437k|                {
 5806|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5807|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5808|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5809|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5810|       |
 5811|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5812|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5813|       |
 5814|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5815|       |
 5816|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5817|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5818|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5819|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5820|       |
 5821|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5822|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5823|       |
 5824|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5825|       |
 5826|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5827|       |
 5828|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_92, m_temp_reg_20);
 5829|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_92, m_temp_reg_20);
 5830|       |
 5831|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5832|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5833|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5834|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5835|       |
 5836|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5837|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5838|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5839|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5840|       |
 5841|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5842|       |
 5843|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5844|   437k|                    pi2_dst_scratch += out_stride;
 5845|       |
 5846|   437k|                }
 5847|       |
 5848|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[48][0]);
 5849|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[49][0]);
 5850|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[50][0]);
 5851|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[51][0]);
 5852|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[52][0]);
 5853|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[53][0]);
 5854|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[54][0]);
 5855|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[55][0]);
 5856|       |
 5857|       |                /* o6[0-3] */
 5858|   437k|                {
 5859|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5860|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5861|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5862|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5863|       |
 5864|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5865|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5866|       |
 5867|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5868|       |
 5869|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5870|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5871|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5872|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5873|       |
 5874|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5875|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5876|       |
 5877|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5878|       |
 5879|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5880|       |
 5881|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_94, m_temp_reg_20);
 5882|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_94, m_temp_reg_20);
 5883|       |
 5884|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5885|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5886|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5887|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5888|       |
 5889|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5890|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5891|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5892|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5893|       |
 5894|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5895|       |
 5896|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5897|   437k|                    pi2_dst_scratch += out_stride;
 5898|       |
 5899|   437k|                }
 5900|       |
 5901|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[56][0]);
 5902|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[57][0]);
 5903|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[58][0]);
 5904|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[59][0]);
 5905|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[60][0]);
 5906|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[61][0]);
 5907|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[62][0]);
 5908|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[63][0]);
 5909|       |
 5910|       |                /* o7[0-3] */
 5911|   437k|                {
 5912|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5913|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5914|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5915|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5916|       |
 5917|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5918|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5919|       |
 5920|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5921|       |
 5922|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5923|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5924|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5925|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5926|       |
 5927|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5928|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5929|       |
 5930|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5931|       |
 5932|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5933|       |
 5934|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_96, m_temp_reg_20);
 5935|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_96, m_temp_reg_20);
 5936|       |
 5937|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5938|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5939|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5940|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5941|       |
 5942|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5943|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5944|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5945|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5946|       |
 5947|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 5948|       |
 5949|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 5950|   437k|                    pi2_dst_scratch += 8;
 5951|       |
 5952|   437k|                }
 5953|       |
 5954|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[64][0]);
 5955|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[65][0]);
 5956|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[66][0]);
 5957|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[67][0]);
 5958|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[68][0]);
 5959|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[69][0]);
 5960|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[70][0]);
 5961|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[71][0]);
 5962|       |
 5963|       |                /* o8[0-3] */
 5964|   437k|                {
 5965|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 5966|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 5967|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 5968|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 5969|       |
 5970|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 5971|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 5972|       |
 5973|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 5974|       |
 5975|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 5976|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 5977|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 5978|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 5979|       |
 5980|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 5981|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 5982|       |
 5983|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 5984|       |
 5985|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 5986|       |
 5987|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_97, m_temp_reg_20);
 5988|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_97, m_temp_reg_20);
 5989|       |
 5990|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 5991|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 5992|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 5993|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 5994|       |
 5995|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 5996|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 5997|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 5998|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 5999|       |
 6000|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6001|       |
 6002|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6003|   437k|                    pi2_dst_scratch += out_stride;
 6004|   437k|                }
 6005|       |
 6006|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[72][0]);
 6007|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[73][0]);
 6008|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[74][0]);
 6009|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[75][0]);
 6010|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[76][0]);
 6011|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[77][0]);
 6012|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[78][0]);
 6013|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[79][0]);
 6014|       |
 6015|       |                /* o9[0-3] */
 6016|   437k|                {
 6017|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6018|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6019|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6020|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6021|       |
 6022|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6023|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6024|       |
 6025|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6026|       |
 6027|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6028|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6029|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6030|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6031|       |
 6032|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6033|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6034|       |
 6035|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6036|       |
 6037|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6038|       |
 6039|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_95, m_temp_reg_20);
 6040|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_95, m_temp_reg_20);
 6041|       |
 6042|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6043|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6044|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6045|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6046|       |
 6047|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6048|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6049|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6050|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6051|       |
 6052|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6053|       |
 6054|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6055|   437k|                    pi2_dst_scratch += out_stride;
 6056|   437k|                }
 6057|       |
 6058|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[80][0]);
 6059|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[81][0]);
 6060|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[82][0]);
 6061|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[83][0]);
 6062|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[84][0]);
 6063|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[85][0]);
 6064|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[86][0]);
 6065|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[87][0]);
 6066|       |
 6067|       |                /* o10[0-3] */
 6068|   437k|                {
 6069|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6070|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6071|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6072|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6073|       |
 6074|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6075|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6076|       |
 6077|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6078|       |
 6079|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6080|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6081|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6082|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6083|       |
 6084|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6085|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6086|       |
 6087|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6088|       |
 6089|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6090|       |
 6091|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_93, m_temp_reg_20);
 6092|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_93, m_temp_reg_20);
 6093|       |
 6094|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6095|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6096|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6097|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6098|       |
 6099|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6100|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6101|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6102|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6103|       |
 6104|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6105|       |
 6106|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6107|   437k|                    pi2_dst_scratch += out_stride;
 6108|   437k|                }
 6109|       |
 6110|       |
 6111|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[88][0]);
 6112|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[89][0]);
 6113|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[90][0]);
 6114|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[91][0]);
 6115|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[92][0]);
 6116|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[93][0]);
 6117|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[94][0]);
 6118|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[95][0]);
 6119|       |
 6120|       |                /* o11[0-3] */
 6121|   437k|                {
 6122|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6123|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6124|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6125|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6126|       |
 6127|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6128|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6129|       |
 6130|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6131|       |
 6132|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6133|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6134|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6135|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6136|       |
 6137|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6138|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6139|       |
 6140|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6141|       |
 6142|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6143|       |
 6144|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_91, m_temp_reg_20);
 6145|   437k|                    m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_91, m_temp_reg_20);
 6146|       |
 6147|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6148|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6149|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6150|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6151|       |
 6152|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6153|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6154|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6155|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6156|       |
 6157|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6158|       |
 6159|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6160|   437k|                    pi2_dst_scratch += out_stride;
 6161|       |
 6162|   437k|                }
 6163|       |
 6164|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[96][0]);
 6165|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[97][0]);
 6166|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[98][0]);
 6167|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[99][0]);
 6168|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[100][0]);
 6169|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[101][0]);
 6170|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[102][0]);
 6171|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[103][0]);
 6172|       |
 6173|       |                /* o12[0-3] */
 6174|   437k|                {
 6175|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6176|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6177|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6178|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6179|       |
 6180|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6181|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6182|       |
 6183|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6184|       |
 6185|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6186|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6187|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6188|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6189|       |
 6190|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6191|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6192|       |
 6193|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6194|       |
 6195|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6196|       |
 6197|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp8, m_temp_reg_20);
 6198|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp8, m_temp_reg_20);
 6199|       |
 6200|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6201|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6202|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6203|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6204|       |
 6205|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6206|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6207|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6208|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6209|       |
 6210|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6211|       |
 6212|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6213|   437k|                    pi2_dst_scratch += out_stride;
 6214|       |
 6215|   437k|                }
 6216|       |
 6217|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[104][0]);
 6218|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[105][0]);
 6219|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[106][0]);
 6220|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[107][0]);
 6221|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[108][0]);
 6222|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[109][0]);
 6223|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[110][0]);
 6224|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[111][0]);
 6225|       |
 6226|       |                /* o13[0-3] */
 6227|   437k|                {
 6228|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6229|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6230|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6231|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6232|       |
 6233|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6234|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6235|       |
 6236|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6237|       |
 6238|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6239|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6240|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6241|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6242|       |
 6243|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6244|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6245|       |
 6246|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6247|       |
 6248|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6249|       |
 6250|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp6, m_temp_reg_20);
 6251|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp6, m_temp_reg_20);
 6252|       |
 6253|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6254|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6255|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6256|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6257|       |
 6258|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6259|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6260|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6261|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6262|       |
 6263|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6264|       |
 6265|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6266|   437k|                    pi2_dst_scratch += out_stride;
 6267|   437k|                }
 6268|       |
 6269|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[112][0]);
 6270|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[113][0]);
 6271|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[114][0]);
 6272|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[115][0]);
 6273|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[116][0]);
 6274|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[117][0]);
 6275|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[118][0]);
 6276|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[119][0]);
 6277|       |
 6278|       |                /* o14[0-3] */
 6279|   437k|                {
 6280|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6281|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6282|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6283|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6284|       |
 6285|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6286|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6287|       |
 6288|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6289|       |
 6290|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6291|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6292|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6293|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6294|       |
 6295|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6296|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6297|       |
 6298|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6299|       |
 6300|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6301|       |
 6302|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp4, m_temp_reg_20);
 6303|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp4, m_temp_reg_20);
 6304|       |
 6305|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6306|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6307|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6308|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6309|       |
 6310|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6311|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6312|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6313|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6314|       |
 6315|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6316|       |
 6317|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6318|   437k|                    pi2_dst_scratch += out_stride;
 6319|       |
 6320|   437k|                }
 6321|       |
 6322|   437k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[120][0]);
 6323|   437k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[121][0]);
 6324|   437k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[122][0]);
 6325|   437k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[123][0]);
 6326|   437k|                m_coeff5 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[124][0]);
 6327|   437k|                m_coeff6 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[125][0]);
 6328|   437k|                m_coeff7 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[126][0]);
 6329|   437k|                m_coeff8 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_32_intr_odd_packed[127][0]);
 6330|       |
 6331|       |                /* o15[0-3] */
 6332|   437k|                {
 6333|   437k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_10, m_coeff1);
 6334|   437k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_11, m_coeff2);
 6335|   437k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_12, m_coeff3);
 6336|   437k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_13, m_coeff4);
 6337|       |
 6338|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
 6339|   437k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
 6340|       |
 6341|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_22);
 6342|       |
 6343|   437k|                    m_temp_reg_40 = _mm_madd_epi16(m_temp_reg_14, m_coeff5);
 6344|   437k|                    m_temp_reg_41 = _mm_madd_epi16(m_temp_reg_15, m_coeff6);
 6345|   437k|                    m_temp_reg_42 = _mm_madd_epi16(m_temp_reg_16, m_coeff7);
 6346|   437k|                    m_temp_reg_43 = _mm_madd_epi16(m_temp_reg_17, m_coeff8);
 6347|       |
 6348|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_41);
 6349|   437k|                    m_temp_reg_42 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_43);
 6350|       |
 6351|   437k|                    m_temp_reg_40 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_42);
 6352|       |
 6353|   437k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_40);
 6354|       |
 6355|   437k|                    m_temp_reg_31 = _mm_add_epi32(temp2, m_temp_reg_20);
 6356|   437k|                    m_temp_reg_30 = _mm_sub_epi32(temp2, m_temp_reg_20);
 6357|       |
 6358|   437k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 6359|   437k|                    m_count = _mm_cvtsi32_si128(i4_shift);
 6360|   437k|                    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
 6361|   437k|                    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
 6362|       |
 6363|   437k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
 6364|   437k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
 6365|   437k|                    m_temp_reg_31 = _mm_sra_epi32(m_temp_reg_31, m_count);
 6366|   437k|                    m_temp_reg_30 = _mm_sra_epi32(m_temp_reg_30, m_count);
 6367|       |
 6368|   437k|                    m_temp_reg_30 = _mm_packs_epi32(m_temp_reg_30, m_temp_reg_31);
 6369|       |
 6370|   437k|                    _mm_store_si128((__m128i *)pi2_dst_scratch, m_temp_reg_30);
 6371|   437k|                    pi2_dst_scratch += 8;
 6372|   437k|                }
 6373|       |
 6374|   437k|            }
 6375|       |
 6376|   437k|        }
 6377|       |
 6378|       |        /* Transpose */
 6379|  1.47M|        {
 6380|       |
 6381|  1.47M|            WORD16 *pi2_src_scratch = temp_ptr;
 6382|  1.47M|            WORD32 out_stride = dst_strd;
 6383|  1.47M|            WORD32 in_stride = 8;
 6384|       |
 6385|  1.47M|            m_temp_reg_30 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6386|  1.47M|            pi2_src_scratch += in_stride;
 6387|  1.47M|            m_temp_reg_31 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6388|  1.47M|            pi2_src_scratch += in_stride;
 6389|  1.47M|            m_temp_reg_32 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6390|  1.47M|            pi2_src_scratch += in_stride;
 6391|  1.47M|            m_temp_reg_33 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6392|  1.47M|            pi2_src_scratch += in_stride;
 6393|  1.47M|            m_temp_reg_34 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6394|  1.47M|            pi2_src_scratch += in_stride;
 6395|  1.47M|            m_temp_reg_35 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6396|  1.47M|            pi2_src_scratch += in_stride;
 6397|  1.47M|            m_temp_reg_36 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6398|  1.47M|            pi2_src_scratch += in_stride;
 6399|  1.47M|            m_temp_reg_37 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6400|  1.47M|            pi2_src_scratch += 8;
 6401|       |
 6402|  1.47M|            m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6403|  1.47M|            pi2_src_scratch += in_stride;
 6404|  1.47M|            m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6405|  1.47M|            pi2_src_scratch += in_stride;
 6406|  1.47M|            m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6407|  1.47M|            pi2_src_scratch += in_stride;
 6408|  1.47M|            m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6409|  1.47M|            pi2_src_scratch += in_stride;
 6410|  1.47M|            m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6411|  1.47M|            pi2_src_scratch += in_stride;
 6412|  1.47M|            m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6413|  1.47M|            pi2_src_scratch += in_stride;
 6414|  1.47M|            m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6415|  1.47M|            pi2_src_scratch += in_stride;
 6416|  1.47M|            m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_src_scratch);
 6417|  1.47M|            pi2_src_scratch += 8;
 6418|       |
 6419|       |
 6420|  1.47M|            m_temp_reg_40 = _mm_unpacklo_epi16(m_temp_reg_30, m_temp_reg_31);
 6421|  1.47M|            m_temp_reg_41 = _mm_unpackhi_epi16(m_temp_reg_31, m_temp_reg_30);
 6422|       |
 6423|  1.47M|            m_temp_reg_42 = _mm_unpacklo_epi16(m_temp_reg_32, m_temp_reg_33);
 6424|  1.47M|            m_temp_reg_43 = _mm_unpackhi_epi16(m_temp_reg_33, m_temp_reg_32);
 6425|       |
 6426|  1.47M|            m_temp_reg_44 = _mm_unpacklo_epi16(m_temp_reg_34, m_temp_reg_35);
 6427|  1.47M|            m_temp_reg_45 = _mm_unpackhi_epi16(m_temp_reg_35, m_temp_reg_34);
 6428|       |
 6429|  1.47M|            m_temp_reg_46 = _mm_unpacklo_epi16(m_temp_reg_36, m_temp_reg_37);
 6430|  1.47M|            m_temp_reg_47 = _mm_unpackhi_epi16(m_temp_reg_37, m_temp_reg_36);
 6431|       |
 6432|  1.47M|            m_temp_reg_80 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_71);
 6433|  1.47M|            m_temp_reg_81 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_70);
 6434|       |
 6435|  1.47M|            m_temp_reg_82 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_73);
 6436|  1.47M|            m_temp_reg_83 = _mm_unpackhi_epi16(m_temp_reg_73, m_temp_reg_72);
 6437|       |
 6438|  1.47M|            m_temp_reg_84 = _mm_unpacklo_epi16(m_temp_reg_74, m_temp_reg_75);
 6439|  1.47M|            m_temp_reg_85 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_74);
 6440|       |
 6441|  1.47M|            m_temp_reg_86 = _mm_unpacklo_epi16(m_temp_reg_76, m_temp_reg_77);
 6442|  1.47M|            m_temp_reg_87 = _mm_unpackhi_epi16(m_temp_reg_77, m_temp_reg_76);
 6443|       |
 6444|       |
 6445|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_40, m_temp_reg_42);
 6446|  1.47M|            m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_40, m_temp_reg_42);
 6447|       |
 6448|  1.47M|            m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_44, m_temp_reg_46);
 6449|  1.47M|            m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_44, m_temp_reg_46);
 6450|       |
 6451|  1.47M|            m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_80, m_temp_reg_82);
 6452|  1.47M|            m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_80, m_temp_reg_82);
 6453|       |
 6454|  1.47M|            m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_84, m_temp_reg_86);
 6455|  1.47M|            m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_84, m_temp_reg_86);
 6456|       |
 6457|  1.47M|            m_temp_reg_90 = _mm_unpacklo_epi32(m_temp_reg_43, m_temp_reg_41);
 6458|  1.47M|            m_temp_reg_91 = _mm_unpackhi_epi32(m_temp_reg_43, m_temp_reg_41);
 6459|       |
 6460|  1.47M|            m_temp_reg_92 = _mm_unpacklo_epi32(m_temp_reg_47, m_temp_reg_45);
 6461|  1.47M|            m_temp_reg_93 = _mm_unpackhi_epi32(m_temp_reg_47, m_temp_reg_45);
 6462|       |
 6463|  1.47M|            m_temp_reg_94 = _mm_unpacklo_epi32(m_temp_reg_83, m_temp_reg_81);
 6464|  1.47M|            m_temp_reg_95 = _mm_unpackhi_epi32(m_temp_reg_83, m_temp_reg_81);
 6465|       |
 6466|  1.47M|            m_temp_reg_96 = _mm_unpacklo_epi32(m_temp_reg_87, m_temp_reg_85);
 6467|  1.47M|            m_temp_reg_97 = _mm_unpackhi_epi32(m_temp_reg_87, m_temp_reg_85);
 6468|       |
 6469|       |
 6470|  1.47M|            m_temp_reg_30 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_2);       // row0 = 0-7
 6471|  1.47M|            m_temp_reg_31 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_2);       // row1 = 0-7
 6472|       |
 6473|  1.47M|            m_temp_reg_32 = _mm_unpacklo_epi64(m_temp_reg_92, m_temp_reg_90);     // row0=24-31
 6474|  1.47M|            m_temp_reg_33 = _mm_unpackhi_epi64(m_temp_reg_92, m_temp_reg_90);     // row1=24-31
 6475|       |
 6476|  1.47M|            m_temp_reg_34 = _mm_unpacklo_epi64(m_temp_reg_4, m_temp_reg_6);       // row0=8-15
 6477|  1.47M|            m_temp_reg_35 = _mm_unpackhi_epi64(m_temp_reg_4, m_temp_reg_6);       // row1=8-15
 6478|       |
 6479|  1.47M|            m_temp_reg_36 = _mm_unpacklo_epi64(m_temp_reg_96, m_temp_reg_94);     // row0=16-23
 6480|  1.47M|            m_temp_reg_37 = _mm_unpackhi_epi64(m_temp_reg_96, m_temp_reg_94);     // row1=16-23
 6481|       |
 6482|  1.47M|            m_temp_reg_80 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_3);      // row2 =0-7
 6483|  1.47M|            m_temp_reg_81 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_3);      // row3 =0-7
 6484|       |
 6485|  1.47M|            m_temp_reg_82 = _mm_unpacklo_epi64(m_temp_reg_93, m_temp_reg_91);    // row2=24-31
 6486|  1.47M|            m_temp_reg_83 = _mm_unpackhi_epi64(m_temp_reg_93, m_temp_reg_91);    // row3=24-31
 6487|       |
 6488|  1.47M|            m_temp_reg_84 = _mm_unpacklo_epi64(m_temp_reg_5, m_temp_reg_7);      // row2=8-15
 6489|  1.47M|            m_temp_reg_85 = _mm_unpackhi_epi64(m_temp_reg_5, m_temp_reg_7);      // row3=8-15
 6490|       |
 6491|  1.47M|            m_temp_reg_86 = _mm_unpacklo_epi64(m_temp_reg_97, m_temp_reg_95);    // row2=16-23
 6492|  1.47M|            m_temp_reg_87 = _mm_unpackhi_epi64(m_temp_reg_97, m_temp_reg_95);    // row3=16-23
 6493|       |
 6494|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6495|       |
 6496|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6497|       |
 6498|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_30, m_temp_reg_0);
 6499|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6500|       |
 6501|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6502|       |
 6503|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_34, m_temp_reg_0);
 6504|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6505|       |
 6506|  1.47M|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6507|       |
 6508|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6509|       |
 6510|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6511|       |
 6512|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_36, m_temp_reg_0);
 6513|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6514|       |
 6515|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6516|       |
 6517|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_32, m_temp_reg_0);
 6518|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6519|       |
 6520|  1.47M|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6521|  1.47M|            pu1_dst += out_stride;
 6522|  1.47M|            pu1_pred += pred_strd;
 6523|       |
 6524|       |
 6525|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6526|       |
 6527|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6528|       |
 6529|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_31, m_temp_reg_0);
 6530|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6531|       |
 6532|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6533|       |
 6534|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_35, m_temp_reg_0);
 6535|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6536|       |
 6537|  1.47M|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6538|       |
 6539|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6540|       |
 6541|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6542|       |
 6543|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_37, m_temp_reg_0);
 6544|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6545|       |
 6546|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6547|       |
 6548|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_33, m_temp_reg_0);
 6549|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6550|       |
 6551|  1.47M|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6552|  1.47M|            pu1_dst += out_stride;
 6553|  1.47M|            pu1_pred += pred_strd;
 6554|       |
 6555|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6556|       |
 6557|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6558|       |
 6559|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_80, m_temp_reg_0);
 6560|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6561|       |
 6562|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6563|       |
 6564|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_84, m_temp_reg_0);
 6565|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6566|       |
 6567|  1.47M|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6568|       |
 6569|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6570|       |
 6571|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6572|       |
 6573|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_86, m_temp_reg_0);
 6574|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6575|       |
 6576|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6577|       |
 6578|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_82, m_temp_reg_0);
 6579|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6580|       |
 6581|  1.47M|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6582|  1.47M|            pu1_dst += out_stride;
 6583|  1.47M|            pu1_pred += pred_strd;
 6584|       |
 6585|       |
 6586|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)pu1_pred);
 6587|       |
 6588|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6589|       |
 6590|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_81, m_temp_reg_0);
 6591|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6592|       |
 6593|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6594|       |
 6595|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_85, m_temp_reg_0);
 6596|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6597|       |
 6598|  1.47M|            _mm_storeu_si128((__m128i *)pu1_dst, m_temp_reg_20);
 6599|       |
 6600|  1.47M|            m_temp_reg_20 = _mm_loadu_si128((__m128i *)(pu1_pred + 16));
 6601|       |
 6602|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_20, all_zero_reg);
 6603|       |
 6604|  1.47M|            m_temp_reg_40 = _mm_add_epi16(m_temp_reg_87, m_temp_reg_0);
 6605|  1.47M|            m_temp_reg_0 = _mm_srli_si128(m_temp_reg_20, 8);
 6606|       |
 6607|  1.47M|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, all_zero_reg);
 6608|       |
 6609|  1.47M|            m_temp_reg_44 = _mm_add_epi16(m_temp_reg_83, m_temp_reg_0);
 6610|  1.47M|            m_temp_reg_20 = _mm_packus_epi16(m_temp_reg_40, m_temp_reg_44);
 6611|       |
 6612|  1.47M|            _mm_storeu_si128((__m128i *)(pu1_dst + 16), m_temp_reg_20);
 6613|  1.47M|            pu1_dst += out_stride;
 6614|  1.47M|            pu1_pred += pred_strd;
 6615|       |
 6616|  1.47M|        }
 6617|  1.47M|        pi2_tmp += 4;
 6618|  1.47M|    }
 6619|   185k|}

ihevc_itrans_recon_4x4_ttype1_sse42:
  119|   126k|{
  120|   126k|    __m128i m_temp_reg_0;
  121|   126k|    __m128i m_temp_reg_1;
  122|   126k|    __m128i m_temp_reg_2;
  123|   126k|    __m128i m_temp_reg_3;
  124|   126k|    __m128i m_temp_reg_4;
  125|   126k|    __m128i m_temp_reg_10;
  126|   126k|    __m128i m_temp_reg_11;
  127|   126k|    __m128i m_temp_reg_12;
  128|   126k|    __m128i m_temp_reg_13;
  129|   126k|    __m128i m_temp_reg_14;
  130|   126k|    __m128i m_temp_reg_20;
  131|   126k|    __m128i m_temp_reg_21;
  132|   126k|    __m128i m_temp_reg_22;
  133|   126k|    __m128i m_temp_reg_23;
  134|   126k|    __m128i m_temp_reg_24;
  135|   126k|    __m128i m_temp_reg_25;
  136|   126k|    __m128i m_temp_reg_30;
  137|   126k|    __m128i m_temp_reg_31;
  138|   126k|    __m128i m_temp_reg_32;
  139|   126k|    __m128i m_temp_reg_33;
  140|   126k|    __m128i m_temp_reg_34;
  141|   126k|    __m128i m_temp_reg_35;
  142|   126k|    __m128i m_temp_reg_36;
  143|   126k|    __m128i m_coeff1, m_coeff2, m_coeff3;
  144|   126k|    __m128i m_rdng_factor;
  145|   126k|    __m128i m_count;
  146|       |
  147|   126k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   126k|#define IT_SHIFT_STAGE_1 7
  ------------------
  148|   126k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   126k|#define UNUSED(x) ((void)(x))
  ------------------
  149|   126k|    UNUSED(zero_cols);
  ------------------
  |  |   38|   126k|#define UNUSED(x) ((void)(x))
  ------------------
  150|   126k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|   126k|#define UNUSED(x) ((void)(x))
  ------------------
  151|       |
  152|   126k|    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype1[2][0]); //74
  153|       |
  154|   126k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  155|   126k|    pi2_src += src_strd;
  156|   126k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  157|   126k|    pi2_src += src_strd;
  158|   126k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  159|   126k|    pi2_src += src_strd;
  160|   126k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  161|       |
  162|   126k|    m_temp_reg_0 = _mm_cvtepi16_epi32(m_temp_reg_0);
  163|   126k|    m_temp_reg_2 = _mm_cvtepi16_epi32(m_temp_reg_2);
  164|       |
  165|   126k|    m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
  166|   126k|    m_temp_reg_3 = _mm_cvtepi16_epi32(m_temp_reg_3);
  167|       |
  168|       |    /* c[4] in m_temp_reg_14 */
  169|       |    /* c[4] = src[0] - src[2] + src[3] */
  170|   126k|    {
  171|   126k|        m_temp_reg_14 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_2);
  172|   126k|    }
  173|       |
  174|       |    /* c[3] in m_temp_reg_13 */
  175|   126k|    {
  176|   126k|        m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3);
  177|   126k|    }
  178|       |
  179|       |    /* c[0] in m_temp_reg_10 */
  180|   126k|    {
  181|   126k|        m_temp_reg_10 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_2);
  182|   126k|    }
  183|       |
  184|       |    /* c[1] in m_temp_reg_11 */
  185|   126k|    {
  186|   126k|        m_temp_reg_11 = _mm_add_epi32(m_temp_reg_2, m_temp_reg_3);
  187|   126k|    }
  188|       |
  189|       |    /* c[2] in m_temp_reg_12 */
  190|   126k|    {
  191|   126k|        m_temp_reg_12 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_3);
  192|   126k|    }
  193|       |
  194|       |    /* c[4] in m_temp_reg_14 */
  195|       |    /* c[4] = src[0] - src[2] + src[3] */
  196|   126k|    {
  197|   126k|        m_temp_reg_14 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_3);
  198|   126k|    }
  199|       |
  200|   126k|    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype1[1][0]); //29
  201|   126k|    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype1[0][0]); //55
  202|       |
  203|       |    /* Stage 1 outputs stored in m_temp_reg_20-23 */
  204|   126k|    {
  205|   126k|        m_temp_reg_30 = _mm_mullo_epi32(m_temp_reg_10, m_coeff1); //29*c0
  206|   126k|        m_temp_reg_31 = _mm_mullo_epi32(m_temp_reg_11, m_coeff2); //55*c1
  207|       |
  208|   126k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  209|       |
  210|   126k|        m_temp_reg_32 = _mm_mullo_epi32(m_temp_reg_11, m_coeff1); //29*c1
  211|   126k|        m_temp_reg_33 = _mm_mullo_epi32(m_temp_reg_12, m_coeff2); //55*c2
  212|       |
  213|   126k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  214|       |
  215|   126k|        m_temp_reg_34 = _mm_mullo_epi32(m_temp_reg_10, m_coeff2); //55*c0
  216|   126k|        m_temp_reg_35 = _mm_mullo_epi32(m_temp_reg_12, m_coeff1); //29*c2
  217|   126k|        m_temp_reg_36 = _mm_mullo_epi32(m_temp_reg_14, m_coeff3); //74*c4
  218|       |
  219|   126k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  220|   126k|        m_count = _mm_cvtsi32_si128(i4_shift);
  221|       |
  222|   126k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  223|   126k|        m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_13);
  224|   126k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  225|       |
  226|   126k|        m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  227|   126k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  228|       |
  229|   126k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  230|   126k|        m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_13);
  231|   126k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  232|       |
  233|   126k|        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  234|       |
  235|   126k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  236|   126k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  237|   126k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  238|   126k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  239|       |
  240|   126k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  241|   126k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  242|   126k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  243|   126k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  244|       |
  245|   126k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  246|   126k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  247|       |
  248|   126k|        m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  249|   126k|        m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  250|       |
  251|   126k|    }
  252|       |
  253|       |    /* Stage 2 */
  254|   126k|    {
  255|   126k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   126k|#define IT_SHIFT_STAGE_2 12
  ------------------
  256|       |
  257|   126k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  258|   126k|        m_temp_reg_20 = _mm_cvtepi16_epi32(m_temp_reg_20);
  259|   126k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  260|   126k|        m_temp_reg_21 = _mm_cvtepi16_epi32(m_temp_reg_21);
  261|   126k|        m_temp_reg_22 = _mm_cvtepi16_epi32(m_temp_reg_22);
  262|   126k|        m_temp_reg_23 = _mm_cvtepi16_epi32(m_temp_reg_23);
  263|       |
  264|       |        /* c[4] stored in m_temp_reg_4 */
  265|   126k|        {
  266|   126k|            m_temp_reg_4 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
  267|   126k|        }
  268|       |
  269|       |        /* c[3] stored in m_temp_reg_3 */
  270|   126k|        {
  271|   126k|            m_temp_reg_3 = _mm_mullo_epi32(m_temp_reg_22, m_coeff3);
  272|   126k|        }
  273|       |
  274|       |        /* c[0] stored in m_temp_reg_0 */
  275|   126k|        {
  276|   126k|            m_temp_reg_0 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  277|   126k|        }
  278|       |
  279|       |        /* c[1] stored in m_temp_reg_1 */
  280|   126k|        {
  281|   126k|            m_temp_reg_1 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_21);
  282|   126k|        }
  283|       |
  284|       |        /* c[2] stored in m_temp_reg_2 */
  285|   126k|        {
  286|   126k|            m_temp_reg_2 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_23);
  287|   126k|        }
  288|       |
  289|       |        /* c[4] stored in m_temp_reg_4 */
  290|   126k|        {
  291|   126k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_4, m_temp_reg_23);
  292|   126k|        }
  293|       |
  294|       |        /* Stage 2 output generation */
  295|   126k|        {
  296|   126k|            m_temp_reg_30 = _mm_mullo_epi32(m_temp_reg_0, m_coeff1); //29*c0
  297|   126k|            m_temp_reg_31 = _mm_mullo_epi32(m_temp_reg_1, m_coeff2); //55*c1
  298|       |
  299|   126k|            m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  300|       |
  301|   126k|            m_temp_reg_32 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1); //29*c1
  302|   126k|            m_temp_reg_33 = _mm_mullo_epi32(m_temp_reg_2, m_coeff2); //55*c2
  303|       |
  304|   126k|            m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  305|       |
  306|   126k|            m_temp_reg_34 = _mm_mullo_epi32(m_temp_reg_0, m_coeff2); //55*c0
  307|   126k|            m_temp_reg_35 = _mm_mullo_epi32(m_temp_reg_2, m_coeff1); //29*c2
  308|   126k|            m_temp_reg_36 = _mm_mullo_epi32(m_temp_reg_4, m_coeff3); //74*c4
  309|       |
  310|   126k|            m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  311|   126k|            m_count = _mm_cvtsi32_si128(i4_shift);
  312|       |
  313|   126k|            m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_3);
  314|   126k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  315|   126k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  316|       |
  317|   126k|            m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  318|   126k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  319|       |
  320|   126k|            m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_3);
  321|   126k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  322|   126k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  323|       |
  324|   126k|            m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  325|       |
  326|   126k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  327|   126k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  328|   126k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  329|   126k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  330|       |
  331|   126k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  332|   126k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  333|   126k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  334|   126k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  335|       |
  336|   126k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  337|   126k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  338|       |
  339|   126k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  340|   126k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  341|   126k|        }
  342|       |
  343|       |        /* Recon and store */
  344|   126k|        {
  345|   126k|            WORD32 *pi4_dst = (WORD32 *)pu1_dst;
  346|       |
  347|   126k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  348|   126k|            pu1_pred += pred_strd;
  349|   126k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  350|   126k|            pu1_pred += pred_strd;
  351|   126k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  352|   126k|            pu1_pred += pred_strd;
  353|   126k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  354|       |
  355|   126k|            m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
  356|   126k|            m_temp_reg_1 = _mm_cvtepu8_epi16(m_temp_reg_1);
  357|   126k|            m_temp_reg_2 = _mm_cvtepu8_epi16(m_temp_reg_2);
  358|   126k|            m_temp_reg_3 = _mm_cvtepu8_epi16(m_temp_reg_3);
  359|   126k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  360|   126k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  361|       |
  362|   126k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  363|   126k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  364|       |
  365|   126k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  366|       |
  367|   126k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  368|   126k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  369|   126k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  370|   126k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  371|   126k|            pu1_dst += dst_strd;
  372|   126k|            pi4_dst = (WORD32 *)(pu1_dst);
  373|       |
  374|   126k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  375|   126k|            pu1_dst += dst_strd;
  376|   126k|            pi4_dst = (WORD32 *)(pu1_dst);
  377|       |
  378|   126k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  379|   126k|            pu1_dst += dst_strd;
  380|   126k|            pi4_dst = (WORD32 *)(pu1_dst);
  381|       |
  382|   126k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  383|   126k|        }
  384|   126k|    }
  385|   126k|}
ihevc_itrans_recon_4x4_sse42:
  449|  32.2k|{
  450|       |
  451|       |
  452|  32.2k|    __m128i m_temp_reg_0;
  453|  32.2k|    __m128i m_temp_reg_1;
  454|  32.2k|    __m128i m_temp_reg_2;
  455|  32.2k|    __m128i m_temp_reg_3;
  456|  32.2k|    __m128i m_temp_reg_10;
  457|  32.2k|    __m128i m_temp_reg_11;
  458|  32.2k|    __m128i m_temp_reg_12;
  459|  32.2k|    __m128i m_temp_reg_13;
  460|  32.2k|    __m128i m_temp_reg_14;
  461|  32.2k|    __m128i m_temp_reg_15;
  462|  32.2k|    __m128i m_temp_reg_20;
  463|  32.2k|    __m128i m_temp_reg_21;
  464|  32.2k|    __m128i m_temp_reg_22;
  465|  32.2k|    __m128i m_temp_reg_23;
  466|  32.2k|    __m128i m_temp_reg_24;
  467|  32.2k|    __m128i m_temp_reg_25;
  468|  32.2k|    __m128i m_temp_reg_30;
  469|  32.2k|    __m128i m_temp_reg_31;
  470|  32.2k|    __m128i m_temp_reg_33;
  471|  32.2k|    __m128i m_temp_reg_34;
  472|  32.2k|    __m128i m_coeff1, m_coeff3;
  473|  32.2k|    __m128i m_rdng_factor;
  474|  32.2k|    __m128i m_count;
  475|       |
  476|       |
  477|  32.2k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  32.2k|#define IT_SHIFT_STAGE_1 7
  ------------------
  478|  32.2k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  32.2k|#define UNUSED(x) ((void)(x))
  ------------------
  479|  32.2k|    UNUSED(zero_cols);
  ------------------
  |  |   38|  32.2k|#define UNUSED(x) ((void)(x))
  ------------------
  480|  32.2k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|  32.2k|#define UNUSED(x) ((void)(x))
  ------------------
  481|       |
  482|       |
  483|  32.2k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  484|  32.2k|    pi2_src += src_strd;
  485|  32.2k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  486|  32.2k|    pi2_src += src_strd;
  487|  32.2k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  488|  32.2k|    pi2_src += src_strd;
  489|  32.2k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  490|       |
  491|  32.2k|    m_temp_reg_0 = _mm_cvtepi16_epi32(m_temp_reg_0);
  492|  32.2k|    m_temp_reg_2 = _mm_cvtepi16_epi32(m_temp_reg_2);
  493|       |
  494|  32.2k|    m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
  495|  32.2k|    m_temp_reg_3 = _mm_cvtepi16_epi32(m_temp_reg_3);
  496|       |
  497|       |
  498|  32.2k|    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype0[0][0]); //36
  499|  32.2k|    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai4_ihevc_trans_4_ttype0[2][0]); //83
  500|       |
  501|       |    /* e */
  502|  32.2k|    {
  503|  32.2k|        m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 6);
  504|  32.2k|        m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 6);
  505|  32.2k|    }
  506|       |
  507|       |    /* o */
  508|  32.2k|    {
  509|  32.2k|        m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1); //src[1]*36
  510|  32.2k|        m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_3, m_coeff3); //src[3]*83
  511|  32.2k|        m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3); //src[1]*83
  512|  32.2k|        m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_3, m_coeff1); //src[3]*36
  513|  32.2k|    }
  514|       |
  515|  32.2k|    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  516|       |
  517|       |    /* e1 stored in m_temp_reg_31 */
  518|  32.2k|    {
  519|  32.2k|        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  520|  32.2k|    }
  521|       |
  522|  32.2k|    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  523|       |
  524|       |    /* e0 stored in m_temp_reg_30 */
  525|  32.2k|    {
  526|  32.2k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  527|  32.2k|    }
  528|       |
  529|  32.2k|    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  530|  32.2k|    m_count = _mm_cvtsi32_si128(i4_shift);
  531|       |
  532|       |    /* o1 stored in m_temp_reg_33 */
  533|  32.2k|    {
  534|  32.2k|        m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  535|  32.2k|    }
  536|       |
  537|       |    /* e1 + add */
  538|  32.2k|    {
  539|  32.2k|        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  540|  32.2k|    }
  541|       |
  542|       |    /* e0 + add */
  543|  32.2k|    {
  544|  32.2k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  545|  32.2k|    }
  546|       |
  547|       |    /* o0 stored in m_temp_reg_34 */
  548|  32.2k|    {
  549|  32.2k|        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  550|  32.2k|    }
  551|       |
  552|       |    /* Stage 1 outputs */
  553|  32.2k|    {
  554|  32.2k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  555|  32.2k|        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  556|       |
  557|  32.2k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  558|  32.2k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  559|       |
  560|       |
  561|  32.2k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  562|  32.2k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  563|  32.2k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  564|  32.2k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  565|       |
  566|  32.2k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  567|  32.2k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  568|  32.2k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  569|  32.2k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  570|       |
  571|  32.2k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  572|  32.2k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  573|       |
  574|  32.2k|        m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  575|  32.2k|        m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  576|  32.2k|    }
  577|       |
  578|       |    /* Stage 2 */
  579|  32.2k|    {
  580|  32.2k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  32.2k|#define IT_SHIFT_STAGE_2 12
  ------------------
  581|       |
  582|  32.2k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  583|  32.2k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  584|       |
  585|  32.2k|        m_temp_reg_20 = _mm_cvtepi16_epi32(m_temp_reg_20);
  586|  32.2k|        m_temp_reg_21 = _mm_cvtepi16_epi32(m_temp_reg_21);
  587|       |
  588|  32.2k|        m_temp_reg_22 = _mm_cvtepi16_epi32(m_temp_reg_22);
  589|  32.2k|        m_temp_reg_23 = _mm_cvtepi16_epi32(m_temp_reg_23);
  590|       |
  591|       |        /* e */
  592|  32.2k|        {
  593|  32.2k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_20, 6);
  594|  32.2k|        }
  595|       |
  596|       |        /* o */
  597|  32.2k|        {
  598|  32.2k|            m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_22, m_coeff1); //src[1]*36
  599|  32.2k|            m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_22, m_coeff3); //src[1]*83
  600|  32.2k|            m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_23, m_coeff3); //src[3]*83
  601|  32.2k|            m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_23, m_coeff1); //src[3]*36
  602|  32.2k|        }
  603|       |
  604|       |        /* e */
  605|  32.2k|        {
  606|  32.2k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_21, 6);
  607|  32.2k|        }
  608|       |
  609|  32.2k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  610|       |
  611|       |        /* e1 stored in m_temp_reg_31 */
  612|  32.2k|        {
  613|  32.2k|            m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  614|  32.2k|        }
  615|       |
  616|  32.2k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  617|       |
  618|       |        /* e0 stored in m_temp_reg_30 */
  619|  32.2k|        {
  620|  32.2k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  621|  32.2k|        }
  622|       |
  623|  32.2k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  624|  32.2k|        m_count = _mm_cvtsi32_si128(i4_shift);
  625|       |
  626|       |        /* o1 stored in m_temp_reg_33 */
  627|  32.2k|        {
  628|  32.2k|            m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  629|  32.2k|        }
  630|       |
  631|       |        /* e1 + add */
  632|  32.2k|        {
  633|  32.2k|            m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  634|  32.2k|        }
  635|       |
  636|       |        /* e0 + add */
  637|  32.2k|        {
  638|  32.2k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  639|  32.2k|        }
  640|       |
  641|       |        /* o0 stored in m_temp_reg_34 */
  642|  32.2k|        {
  643|  32.2k|            m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  644|  32.2k|        }
  645|       |
  646|       |        /* Stage 2 outputs */
  647|  32.2k|        {
  648|  32.2k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  649|  32.2k|            m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  650|  32.2k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  651|  32.2k|            m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  652|       |
  653|  32.2k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  654|  32.2k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  655|  32.2k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  656|  32.2k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  657|       |
  658|  32.2k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  659|  32.2k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  660|  32.2k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  661|  32.2k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  662|       |
  663|  32.2k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  664|  32.2k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  665|       |
  666|  32.2k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  667|  32.2k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  668|  32.2k|        }
  669|       |
  670|       |        /* Recon and store */
  671|  32.2k|        {
  672|  32.2k|            UWORD32 *pu4_dst = (UWORD32 *)pu1_dst;
  673|       |
  674|  32.2k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  675|  32.2k|            pu1_pred += pred_strd;
  676|  32.2k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  677|  32.2k|            pu1_pred += pred_strd;
  678|  32.2k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  679|  32.2k|            pu1_pred += pred_strd;
  680|  32.2k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  681|       |
  682|  32.2k|            m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
  683|  32.2k|            m_temp_reg_1 = _mm_cvtepu8_epi16(m_temp_reg_1);
  684|  32.2k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  685|  32.2k|            m_temp_reg_2 = _mm_cvtepu8_epi16(m_temp_reg_2);
  686|  32.2k|            m_temp_reg_3 = _mm_cvtepu8_epi16(m_temp_reg_3);
  687|  32.2k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  688|       |
  689|  32.2k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  690|  32.2k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  691|       |
  692|  32.2k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  693|       |
  694|  32.2k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  695|  32.2k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  696|  32.2k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  697|  32.2k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  698|  32.2k|            pu1_dst += dst_strd;
  699|  32.2k|            pu4_dst = (UWORD32 *)(pu1_dst);
  700|       |
  701|  32.2k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  702|  32.2k|            pu1_dst += dst_strd;
  703|  32.2k|            pu4_dst = (UWORD32 *)(pu1_dst);
  704|       |
  705|  32.2k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  706|  32.2k|            pu1_dst += dst_strd;
  707|  32.2k|            pu4_dst = (UWORD32 *)(pu1_dst);
  708|       |
  709|  32.2k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  710|  32.2k|        }
  711|  32.2k|    }
  712|  32.2k|}
ihevc_itrans_recon_8x8_sse42:
  779|  56.3k|{
  780|  56.3k|    __m128i m_temp_reg_0;
  781|  56.3k|    __m128i m_temp_reg_1;
  782|  56.3k|    __m128i m_temp_reg_2;
  783|  56.3k|    __m128i m_temp_reg_3;
  784|  56.3k|    __m128i m_temp_reg_5;
  785|  56.3k|    __m128i m_temp_reg_6;
  786|  56.3k|    __m128i m_temp_reg_7;
  787|  56.3k|    __m128i m_temp_reg_4;
  788|  56.3k|    __m128i m_temp_reg_10;
  789|  56.3k|    __m128i m_temp_reg_11;
  790|  56.3k|    __m128i m_temp_reg_12;
  791|  56.3k|    __m128i m_temp_reg_13;
  792|  56.3k|    __m128i m_temp_reg_14;
  793|  56.3k|    __m128i m_temp_reg_15;
  794|  56.3k|    __m128i m_temp_reg_16;
  795|  56.3k|    __m128i m_temp_reg_17;
  796|  56.3k|    __m128i m_temp_reg_20;
  797|  56.3k|    __m128i m_temp_reg_21;
  798|  56.3k|    __m128i m_temp_reg_22;
  799|  56.3k|    __m128i m_temp_reg_23;
  800|  56.3k|    __m128i m_temp_reg_24;
  801|  56.3k|    __m128i m_temp_reg_25;
  802|  56.3k|    __m128i m_temp_reg_26;
  803|  56.3k|    __m128i m_temp_reg_27;
  804|  56.3k|    __m128i m_temp_reg_30;
  805|  56.3k|    __m128i m_temp_reg_31;
  806|  56.3k|    __m128i m_temp_reg_32;
  807|  56.3k|    __m128i m_temp_reg_33;
  808|  56.3k|    __m128i m_temp_reg_34;
  809|  56.3k|    __m128i m_temp_reg_35;
  810|  56.3k|    __m128i m_temp_reg_36;
  811|  56.3k|    __m128i m_temp_reg_37;
  812|  56.3k|    __m128i m_temp_reg_40;
  813|  56.3k|    __m128i m_temp_reg_41;
  814|  56.3k|    __m128i m_temp_reg_42;
  815|  56.3k|    __m128i m_temp_reg_43;
  816|  56.3k|    __m128i m_temp_reg_44;
  817|  56.3k|    __m128i m_temp_reg_45;
  818|  56.3k|    __m128i m_temp_reg_46;
  819|  56.3k|    __m128i m_temp_reg_47;
  820|  56.3k|    __m128i m_temp_reg_50;
  821|  56.3k|    __m128i m_temp_reg_51;
  822|  56.3k|    __m128i m_temp_reg_52;
  823|  56.3k|    __m128i m_temp_reg_53;
  824|  56.3k|    __m128i m_temp_reg_54;
  825|  56.3k|    __m128i m_temp_reg_55;
  826|  56.3k|    __m128i m_temp_reg_56;
  827|  56.3k|    __m128i m_temp_reg_57;
  828|  56.3k|    __m128i m_temp_reg_60;
  829|  56.3k|    __m128i m_temp_reg_61;
  830|  56.3k|    __m128i m_temp_reg_62;
  831|  56.3k|    __m128i m_temp_reg_63;
  832|  56.3k|    __m128i m_temp_reg_64;
  833|  56.3k|    __m128i m_temp_reg_65;
  834|  56.3k|    __m128i m_temp_reg_66;
  835|  56.3k|    __m128i m_temp_reg_67;
  836|  56.3k|    __m128i m_temp_reg_70;
  837|  56.3k|    __m128i m_temp_reg_71;
  838|  56.3k|    __m128i m_temp_reg_72;
  839|  56.3k|    __m128i m_temp_reg_73;
  840|  56.3k|    __m128i m_temp_reg_74;
  841|  56.3k|    __m128i m_temp_reg_75;
  842|  56.3k|    __m128i m_temp_reg_76;
  843|  56.3k|    __m128i m_temp_reg_77;
  844|  56.3k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
  845|       |
  846|  56.3k|    WORD32 check_row_stage_1;   /* Lokesh */
  847|  56.3k|    WORD32 check_row_stage_2;   /* Lokesh */
  848|       |
  849|  56.3k|    __m128i m_rdng_factor;
  850|  56.3k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  56.3k|#define IT_SHIFT_STAGE_1 7
  ------------------
  851|  56.3k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|  56.3k|#define UNUSED(x) ((void)(x))
  ------------------
  852|  56.3k|    check_row_stage_1   = ((zero_rows & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (852:27): [True: 19.4k, False: 36.8k]
  ------------------
  853|  56.3k|    check_row_stage_2   = ((zero_cols & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (853:27): [True: 22.2k, False: 34.1k]
  ------------------
  854|       |
  855|  56.3k|    m_temp_reg_70 = _mm_loadu_si128((__m128i *)pi2_src);
  856|  56.3k|    pi2_src += src_strd;
  857|  56.3k|    m_temp_reg_71 = _mm_loadu_si128((__m128i *)pi2_src);
  858|  56.3k|    pi2_src += src_strd;
  859|  56.3k|    m_temp_reg_72 = _mm_loadu_si128((__m128i *)pi2_src);
  860|  56.3k|    pi2_src += src_strd;
  861|  56.3k|    m_temp_reg_73 = _mm_loadu_si128((__m128i *)pi2_src);
  862|  56.3k|    pi2_src += src_strd;
  863|       |
  864|  56.3k|    m_temp_reg_74 = _mm_loadu_si128((__m128i *)pi2_src);
  865|  56.3k|    pi2_src += src_strd;
  866|  56.3k|    m_temp_reg_75 = _mm_loadu_si128((__m128i *)pi2_src);
  867|  56.3k|    pi2_src += src_strd;
  868|  56.3k|    m_temp_reg_76 = _mm_loadu_si128((__m128i *)pi2_src);
  869|  56.3k|    pi2_src += src_strd;
  870|  56.3k|    m_temp_reg_77 = _mm_loadu_si128((__m128i *)pi2_src);
  871|       |
  872|  56.3k|    if(!check_row_stage_2)
  ------------------
  |  Branch (872:8): [True: 34.1k, False: 22.2k]
  ------------------
  873|  34.1k|    {
  874|  34.1k|        if(!check_row_stage_1)
  ------------------
  |  Branch (874:12): [True: 28.5k, False: 5.58k]
  ------------------
  875|  28.5k|        {
  876|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
  877|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
  878|  28.5k|            {
  879|       |                //Interleaving 0,4 row in 0 , 1 Rishab
  880|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
  881|  28.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
  882|  28.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
  883|       |
  884|  28.5k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
  885|       |
  886|  28.5k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
  887|  28.5k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
  888|       |
  889|  28.5k|            }
  890|       |
  891|       |
  892|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
  893|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
  894|       |            /* as upper 8 bytes are zeros so m_temp_reg_15 and m_temp_reg_17 are not used*/
  895|  28.5k|            {
  896|       |
  897|  28.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
  898|  28.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
  899|       |
  900|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
  901|       |                //Interleaving 2,6 row in 4, 5 Rishab
  902|  28.5k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
  903|       |
  904|  28.5k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
  905|  28.5k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
  906|       |
  907|       |
  908|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
  909|       |
  910|  28.5k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
  911|  28.5k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
  912|       |
  913|  28.5k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
  914|  28.5k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
  915|       |
  916|       |
  917|       |
  918|       |                /* e */
  919|       |
  920|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
  921|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
  922|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
  923|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
  924|  28.5k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
  925|  28.5k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
  926|       |
  927|  28.5k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
  928|  28.5k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
  929|       |
  930|  28.5k|            }
  931|       |
  932|       |            /* o */
  933|  28.5k|            {
  934|       |
  935|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
  936|  28.5k|                {
  937|       |
  938|  28.5k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
  939|       |                    //o0:1B*89+3B*75,5B*50+7B*18
  940|  28.5k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
  941|       |
  942|  28.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  943|  28.5k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
  944|       |
  945|       |
  946|       |
  947|       |                    /* Column 0 of destination computed here */
  948|       |                    /* It is stored in m_temp_reg_50 */
  949|       |                    /* Column 7 of destination computed here */
  950|       |                    /* It is stored in m_temp_reg_57 */
  951|       |                    /* Upper 8 bytes of both registers are zero due to zero_cols*/
  952|       |
  953|       |
  954|       |
  955|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
  956|  28.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
  957|       |
  958|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
  959|  28.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
  960|       |
  961|  28.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
  962|  28.5k|                    m_temp_reg_63 = _mm_setzero_si128();
  963|  28.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
  964|       |
  965|       |                    //o1:1B*75-3B*18,5B*89+7B*50
  966|  28.5k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
  967|       |
  968|  28.5k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
  969|  28.5k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
  970|       |
  971|       |                    /* Loading coeff for computing o2  in the next block */
  972|       |
  973|  28.5k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
  974|  28.5k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
  975|       |
  976|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
  977|       |
  978|       |
  979|       |
  980|       |                    /* Column 1 of destination computed here */
  981|       |                    /* It is stored in m_temp_reg_51 */
  982|       |                    /* Column 6 of destination computed here */
  983|       |                    /* It is stored in m_temp_reg_56 */
  984|       |
  985|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
  986|  28.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
  987|       |
  988|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
  989|  28.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
  990|       |
  991|  28.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
  992|  28.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
  993|       |
  994|       |                    //o2:1B*50-3B*89,5B*18+7B*75
  995|  28.5k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
  996|       |
  997|  28.5k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
  998|  28.5k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
  999|       |
 1000|       |
 1001|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1002|       |
 1003|       |                    /* Loading coeff for computing o3  in the next block */
 1004|       |
 1005|  28.5k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1006|  28.5k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 1007|       |
 1008|       |
 1009|       |
 1010|       |                    /* Column 2 of destination computed here */
 1011|       |                    /* It is stored in m_temp_reg_52 */
 1012|       |                    /* Column 5 of destination computed here */
 1013|       |                    /* It is stored in m_temp_reg_55 */
 1014|       |
 1015|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1016|  28.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1017|       |
 1018|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1019|  28.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1020|       |
 1021|  28.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1022|  28.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1023|       |
 1024|       |                    //o3:1B*18-3B*50,5B*75-7B*89
 1025|  28.5k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1026|       |
 1027|  28.5k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1028|  28.5k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1029|       |
 1030|       |
 1031|       |
 1032|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1033|       |
 1034|       |
 1035|       |
 1036|       |                    /* Column 3 of destination computed here */
 1037|       |                    /* It is stored in m_temp_reg_53 */
 1038|       |                    /* Column 4 of destination computed here */
 1039|       |                    /* It is stored in m_temp_reg_54 */
 1040|       |
 1041|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1042|  28.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1043|       |
 1044|  28.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1045|  28.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1046|       |
 1047|  28.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1048|  28.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1049|       |
 1050|       |
 1051|  28.5k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1052|  28.5k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1053|  28.5k|                }
 1054|  28.5k|            }
 1055|       |
 1056|       |            /* Transpose of the destination 8x8 matrix done here */
 1057|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1058|       |            /* respectively */
 1059|  28.5k|            {
 1060|  28.5k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1061|  28.5k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1062|  28.5k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1063|  28.5k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1064|       |
 1065|  28.5k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1066|  28.5k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1067|       |
 1068|  28.5k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1069|  28.5k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1070|       |
 1071|  28.5k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1072|  28.5k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1073|  28.5k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1074|  28.5k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1075|       |
 1076|  28.5k|                m_temp_reg_54 = _mm_setzero_si128();
 1077|  28.5k|                m_temp_reg_55 = _mm_setzero_si128();
 1078|  28.5k|                m_temp_reg_56 = _mm_setzero_si128();
 1079|  28.5k|                m_temp_reg_57 = _mm_setzero_si128();
 1080|  28.5k|            }
 1081|  28.5k|        }
 1082|  5.58k|        else
 1083|  5.58k|        {
 1084|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1085|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1086|  5.58k|            {
 1087|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 1088|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 1089|  5.58k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1090|  5.58k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1091|       |
 1092|  5.58k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1093|       |
 1094|  5.58k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1095|  5.58k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1096|       |
 1097|  5.58k|            }
 1098|       |
 1099|       |
 1100|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1101|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1102|       |            /* as upper 8 bytes are zeros so m_temp_reg_15 and m_temp_reg_17 are not used*/
 1103|  5.58k|            {
 1104|       |
 1105|  5.58k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 1106|  5.58k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 1107|       |
 1108|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1109|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1110|  5.58k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1111|       |
 1112|  5.58k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1113|  5.58k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1114|       |
 1115|       |
 1116|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 1117|       |
 1118|  5.58k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1119|  5.58k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1120|       |
 1121|  5.58k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1122|  5.58k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1123|       |
 1124|       |
 1125|       |
 1126|       |                /* e */
 1127|       |
 1128|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1129|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1130|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1131|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1132|  5.58k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1133|  5.58k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1134|       |
 1135|  5.58k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1136|  5.58k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1137|       |
 1138|  5.58k|            }
 1139|       |
 1140|       |            /* o */
 1141|  5.58k|            {
 1142|       |
 1143|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1144|  5.58k|                {
 1145|       |
 1146|  5.58k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1147|  5.58k|                    m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1148|       |                    //o0:1B*89+3B*75,5B*50+7B*18
 1149|  5.58k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1150|  5.58k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1151|       |
 1152|  5.58k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1153|  5.58k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1154|       |
 1155|  5.58k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1156|       |
 1157|       |
 1158|       |
 1159|       |                    /* Column 0 of destination computed here */
 1160|       |                    /* It is stored in m_temp_reg_50 */
 1161|       |                    /* Column 7 of destination computed here */
 1162|       |                    /* It is stored in m_temp_reg_57 */
 1163|       |                    /* Upper 8 bytes of both registers are zero due to zero_cols*/
 1164|       |
 1165|       |
 1166|       |
 1167|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1168|  5.58k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1169|       |
 1170|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1171|  5.58k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1172|       |
 1173|  5.58k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1174|  5.58k|                    m_temp_reg_63 = _mm_setzero_si128();
 1175|  5.58k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1176|       |
 1177|       |                    //o1:1B*75-3B*18,5B*89+7B*50
 1178|  5.58k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1179|  5.58k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1180|       |
 1181|  5.58k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1182|  5.58k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1183|       |
 1184|       |                    /* Loading coeff for computing o2  in the next block */
 1185|       |
 1186|  5.58k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1187|  5.58k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 1188|       |
 1189|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 1190|  5.58k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 1191|       |
 1192|       |
 1193|       |
 1194|       |                    /* Column 1 of destination computed here */
 1195|       |                    /* It is stored in m_temp_reg_51 */
 1196|       |                    /* Column 6 of destination computed here */
 1197|       |                    /* It is stored in m_temp_reg_56 */
 1198|       |
 1199|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1200|  5.58k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1201|       |
 1202|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1203|  5.58k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1204|       |
 1205|  5.58k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1206|  5.58k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1207|       |
 1208|       |                    //o2:1B*50-3B*89,5B*18+7B*75
 1209|  5.58k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1210|  5.58k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1211|       |
 1212|  5.58k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1213|  5.58k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1214|       |
 1215|       |
 1216|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1217|       |
 1218|       |                    /* Loading coeff for computing o3  in the next block */
 1219|       |
 1220|  5.58k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1221|  5.58k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 1222|       |
 1223|  5.58k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1224|       |
 1225|       |
 1226|       |                    /* Column 2 of destination computed here */
 1227|       |                    /* It is stored in m_temp_reg_52 */
 1228|       |                    /* Column 5 of destination computed here */
 1229|       |                    /* It is stored in m_temp_reg_55 */
 1230|       |
 1231|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1232|  5.58k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1233|       |
 1234|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1235|  5.58k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1236|       |
 1237|  5.58k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1238|  5.58k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1239|       |
 1240|       |                    //o3:1B*18-3B*50,5B*75-7B*89
 1241|  5.58k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1242|  5.58k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1243|       |
 1244|  5.58k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1245|  5.58k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1246|       |
 1247|       |
 1248|       |
 1249|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1250|       |
 1251|  5.58k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 1252|       |
 1253|       |
 1254|       |                    /* Column 3 of destination computed here */
 1255|       |                    /* It is stored in m_temp_reg_53 */
 1256|       |                    /* Column 4 of destination computed here */
 1257|       |                    /* It is stored in m_temp_reg_54 */
 1258|       |
 1259|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1260|  5.58k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1261|       |
 1262|  5.58k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1263|  5.58k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1264|       |
 1265|  5.58k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1266|  5.58k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1267|       |
 1268|       |
 1269|  5.58k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1270|  5.58k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1271|  5.58k|                }
 1272|  5.58k|            }
 1273|       |
 1274|       |            /* Transpose of the destination 8x8 matrix done here */
 1275|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1276|       |            /* respectively */
 1277|  5.58k|            {
 1278|  5.58k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1279|  5.58k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1280|  5.58k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1281|  5.58k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1282|       |
 1283|  5.58k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1284|  5.58k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1285|  5.58k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1286|  5.58k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1287|       |
 1288|  5.58k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1289|  5.58k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1290|  5.58k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1291|  5.58k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1292|       |
 1293|  5.58k|                m_temp_reg_54 = _mm_setzero_si128();
 1294|  5.58k|                m_temp_reg_55 = _mm_setzero_si128();
 1295|  5.58k|                m_temp_reg_56 = _mm_setzero_si128();
 1296|  5.58k|                m_temp_reg_57 = _mm_setzero_si128();
 1297|  5.58k|            }
 1298|  5.58k|        }
 1299|       |
 1300|       |        /* Stage 2 */
 1301|  34.1k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  34.1k|#define IT_SHIFT_STAGE_2 12
  ------------------
 1302|  34.1k|        {
 1303|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1304|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1305|  34.1k|            {
 1306|  34.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 1307|  34.1k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 1308|       |
 1309|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 1310|  34.1k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 1311|       |
 1312|  34.1k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1313|  34.1k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1314|  34.1k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1315|  34.1k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1316|       |
 1317|       |
 1318|  34.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 1319|  34.1k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 1320|  34.1k|            }
 1321|       |
 1322|       |
 1323|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1324|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1325|  34.1k|            {
 1326|       |
 1327|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 1328|  34.1k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 1329|       |
 1330|       |
 1331|  34.1k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1332|  34.1k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1333|  34.1k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1334|  34.1k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1335|       |
 1336|       |                /* Loading coeff for computing o0 in the next block */
 1337|  34.1k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1338|       |
 1339|       |
 1340|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 1341|  34.1k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_51, m_temp_reg_53);
 1342|       |
 1343|       |
 1344|       |
 1345|       |                /* e */
 1346|       |
 1347|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1348|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1349|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1350|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1351|  34.1k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1352|  34.1k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1353|       |
 1354|  34.1k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1355|  34.1k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1356|       |
 1357|  34.1k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1358|  34.1k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1359|       |
 1360|  34.1k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1361|  34.1k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1362|       |
 1363|  34.1k|            }
 1364|       |
 1365|       |            /* o */
 1366|  34.1k|            {
 1367|       |
 1368|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1369|  34.1k|                {
 1370|       |                    //o0:1B*89+3B*75,1T*89+3T*75
 1371|  34.1k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1372|  34.1k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1373|       |
 1374|  34.1k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1375|  34.1k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1376|       |                    /* Loading coeff for computing o1 in the next block */
 1377|  34.1k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1378|       |
 1379|       |
 1380|       |
 1381|       |                    /* Column 0 of destination computed here */
 1382|       |                    /* It is stored in m_temp_reg_50 */
 1383|       |                    /* Column 7 of destination computed here */
 1384|       |                    /* It is stored in m_temp_reg_57 */
 1385|       |
 1386|  34.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1387|  34.1k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1388|       |
 1389|  34.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1390|  34.1k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1391|       |
 1392|  34.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1393|  34.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1394|  34.1k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1395|  34.1k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 1396|       |
 1397|       |                    //o1:1B*75-3B*18,1T*75-3T*18
 1398|  34.1k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1399|  34.1k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1400|       |
 1401|  34.1k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1402|  34.1k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1403|  34.1k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1404|  34.1k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1405|       |
 1406|  34.1k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1407|  34.1k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 1408|       |
 1409|       |
 1410|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 1411|       |
 1412|       |
 1413|       |                    /* Loading coeff for computing o2  in the next block */
 1414|  34.1k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1415|       |
 1416|       |
 1417|       |
 1418|       |                    /* Column 1 of destination computed here */
 1419|       |                    /* It is stored in m_temp_reg_51 */
 1420|       |                    /* Column 6 of destination computed here */
 1421|       |                    /* It is stored in m_temp_reg_56 */
 1422|       |
 1423|  34.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1424|  34.1k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1425|       |
 1426|  34.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1427|  34.1k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1428|       |
 1429|  34.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1430|  34.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1431|  34.1k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1432|  34.1k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 1433|       |
 1434|       |                    //o2:1B*50-3B*89,5T*18+7T*75.
 1435|  34.1k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1436|  34.1k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1437|       |
 1438|  34.1k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1439|  34.1k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1440|  34.1k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1441|  34.1k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1442|       |
 1443|  34.1k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1444|  34.1k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 1445|       |
 1446|       |
 1447|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1448|       |
 1449|       |                    /* Loading coeff for computing o3  in the next block */
 1450|       |
 1451|  34.1k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1452|       |
 1453|       |
 1454|       |                    /* Column 2 of destination computed here */
 1455|       |                    /* It is stored in m_temp_reg_52 */
 1456|       |                    /* Column 5 of destination computed here */
 1457|       |                    /* It is stored in m_temp_reg_55 */
 1458|       |
 1459|  34.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1460|  34.1k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1461|       |
 1462|  34.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 1463|  34.1k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 1464|       |
 1465|  34.1k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1466|  34.1k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1467|  34.1k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1468|  34.1k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 1469|       |
 1470|       |                    //o3:1B*18-3B*50,1T*18-3T*50
 1471|  34.1k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1472|  34.1k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1473|       |
 1474|  34.1k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1475|  34.1k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1476|  34.1k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1477|  34.1k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1478|       |
 1479|       |
 1480|  34.1k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1481|  34.1k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 1482|       |
 1483|       |
 1484|       |
 1485|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1486|       |
 1487|       |
 1488|       |                    /* Column 3 of destination computed here */
 1489|       |                    /* It is stored in m_temp_reg_53 */
 1490|       |                    /* Column 4 of destination computed here */
 1491|       |                    /* It is stored in m_temp_reg_54 */
 1492|       |
 1493|  34.1k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1494|  34.1k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1495|       |
 1496|  34.1k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 1497|  34.1k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 1498|       |
 1499|  34.1k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 1500|  34.1k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 1501|  34.1k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 1502|  34.1k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 1503|       |
 1504|  34.1k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 1505|  34.1k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 1506|  34.1k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 1507|  34.1k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 1508|       |
 1509|  34.1k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 1510|  34.1k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 1511|  34.1k|                }
 1512|  34.1k|            }
 1513|       |
 1514|       |            /* Transpose of the destination 8x8 matrix done here */
 1515|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1516|       |            /* respectively */
 1517|  34.1k|            {
 1518|  34.1k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1519|  34.1k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1520|  34.1k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1521|  34.1k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1522|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1523|  34.1k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1524|  34.1k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1525|  34.1k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1526|       |
 1527|  34.1k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1528|  34.1k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1529|  34.1k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1530|  34.1k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1531|  34.1k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1532|  34.1k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1533|  34.1k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1534|  34.1k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1535|  34.1k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1536|  34.1k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1537|  34.1k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1538|  34.1k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1539|       |
 1540|  34.1k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1541|  34.1k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1542|  34.1k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1543|  34.1k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1544|  34.1k|            }
 1545|       |
 1546|       |            /* Recon and store */
 1547|  34.1k|            {
 1548|  34.1k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1549|  34.1k|                pu1_pred += pred_strd;
 1550|  34.1k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1551|  34.1k|                pu1_pred += pred_strd;
 1552|  34.1k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1553|  34.1k|                pu1_pred += pred_strd;
 1554|  34.1k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1555|  34.1k|                pu1_pred += pred_strd;
 1556|  34.1k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1557|  34.1k|                pu1_pred += pred_strd;
 1558|  34.1k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1559|  34.1k|                pu1_pred += pred_strd;
 1560|  34.1k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1561|  34.1k|                pu1_pred += pred_strd;
 1562|  34.1k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1563|       |
 1564|  34.1k|                m_temp_reg_50 = _mm_setzero_si128();
 1565|  34.1k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 1566|  34.1k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 1567|  34.1k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 1568|  34.1k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 1569|  34.1k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 1570|  34.1k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 1571|  34.1k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 1572|  34.1k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 1573|       |
 1574|  34.1k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 1575|  34.1k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 1576|  34.1k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 1577|  34.1k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 1578|  34.1k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 1579|  34.1k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 1580|  34.1k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 1581|  34.1k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 1582|       |
 1583|  34.1k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 1584|  34.1k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 1585|  34.1k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 1586|  34.1k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 1587|  34.1k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 1588|  34.1k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 1589|  34.1k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 1590|  34.1k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 1591|       |
 1592|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 1593|  34.1k|                pu1_dst += dst_strd;
 1594|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 1595|  34.1k|                pu1_dst += dst_strd;
 1596|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 1597|  34.1k|                pu1_dst += dst_strd;
 1598|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 1599|  34.1k|                pu1_dst += dst_strd;
 1600|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 1601|  34.1k|                pu1_dst += dst_strd;
 1602|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 1603|  34.1k|                pu1_dst += dst_strd;
 1604|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 1605|  34.1k|                pu1_dst += dst_strd;
 1606|  34.1k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 1607|  34.1k|                pu1_dst += dst_strd;
 1608|  34.1k|            }
 1609|  34.1k|        }
 1610|  34.1k|    }
 1611|  22.2k|    else
 1612|       |
 1613|  22.2k|    {
 1614|       |
 1615|       |        /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1616|       |        /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1617|  22.2k|        if(!check_row_stage_1)
  ------------------
  |  Branch (1617:12): [True: 8.36k, False: 13.8k]
  ------------------
 1618|  8.36k|        {
 1619|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1620|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1621|  8.36k|            {
 1622|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 1623|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 1624|  8.36k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1625|  8.36k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1626|       |
 1627|  8.36k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1628|  8.36k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 1629|       |
 1630|  8.36k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1631|  8.36k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1632|       |
 1633|       |
 1634|  8.36k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1635|  8.36k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1636|  8.36k|            }
 1637|       |
 1638|       |
 1639|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1640|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1641|  8.36k|            {
 1642|       |
 1643|  8.36k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 1644|  8.36k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 1645|       |
 1646|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1647|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1648|  8.36k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1649|  8.36k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 1650|       |
 1651|  8.36k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1652|  8.36k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1653|       |
 1654|  8.36k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 1655|  8.36k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 1656|       |
 1657|       |
 1658|       |
 1659|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 1660|       |
 1661|  8.36k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1662|       |                //m_coeff4 = _mm_loadu_si128((__m128i *) &g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1663|       |
 1664|  8.36k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1665|       |                //m_coeff2 = _mm_loadu_si128((__m128i *) &g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1666|       |
 1667|  8.36k|            }
 1668|       |
 1669|       |            /* e */
 1670|  8.36k|            {
 1671|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1672|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1673|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1674|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1675|  8.36k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1676|  8.36k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1677|       |
 1678|  8.36k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1679|  8.36k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1680|       |
 1681|  8.36k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1682|  8.36k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1683|       |
 1684|  8.36k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1685|  8.36k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1686|       |
 1687|  8.36k|            }
 1688|       |
 1689|       |            /* o */
 1690|  8.36k|            {
 1691|       |
 1692|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1693|  8.36k|                {
 1694|       |
 1695|  8.36k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1696|  8.36k|                    m_temp_reg_61 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 1697|       |                    //o0:1B*89+3B*75,1T*89+3T*75
 1698|  8.36k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1699|  8.36k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1700|       |
 1701|  8.36k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1702|  8.36k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1703|       |
 1704|  8.36k|                }
 1705|       |
 1706|       |                /* Column 0 of destination computed here */
 1707|       |                /* It is stored in m_temp_reg_50 */
 1708|       |                /* Column 7 of destination computed here */
 1709|       |                /* It is stored in m_temp_reg_57 */
 1710|  8.36k|                {
 1711|       |
 1712|       |
 1713|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1714|  8.36k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1715|       |
 1716|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1717|  8.36k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1718|       |
 1719|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1720|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1721|  8.36k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1722|  8.36k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1723|       |
 1724|  8.36k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1725|  8.36k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1726|  8.36k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1727|  8.36k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1728|       |
 1729|       |                    //o1:1B*75-3B*18,1T*75-3T*18,5B*89+7B*50,5T*89+7T*50
 1730|  8.36k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1731|  8.36k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 1732|       |
 1733|  8.36k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1734|  8.36k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1735|       |
 1736|       |                    /* Loading coeff for computing o2  in the next block */
 1737|       |
 1738|  8.36k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1739|       |
 1740|  8.36k|                }
 1741|       |
 1742|       |                /* Column 1 of destination computed here */
 1743|       |                /* It is stored in m_temp_reg_51 */
 1744|       |                /* Column 6 of destination computed here */
 1745|       |                /* It is stored in m_temp_reg_56 */
 1746|  8.36k|                {
 1747|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1748|  8.36k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1749|       |
 1750|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1751|  8.36k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1752|       |
 1753|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1754|  8.36k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1755|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1756|  8.36k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1757|       |
 1758|  8.36k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1759|  8.36k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1760|  8.36k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1761|  8.36k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1762|       |
 1763|       |                    //o2:1B*50-3B*89,1T*50-3T*89
 1764|  8.36k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1765|  8.36k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1766|       |
 1767|  8.36k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1768|  8.36k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1769|       |
 1770|       |
 1771|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1772|       |
 1773|       |
 1774|       |                    /* Loading coeff for computing o3  in the next block */
 1775|       |
 1776|  8.36k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1777|       |
 1778|  8.36k|                }
 1779|       |
 1780|       |                /* Column 2 of destination computed here */
 1781|       |                /* It is stored in m_temp_reg_52 */
 1782|       |                /* Column 5 of destination computed here */
 1783|       |                /* It is stored in m_temp_reg_55 */
 1784|  8.36k|                {
 1785|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1786|  8.36k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1787|       |
 1788|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 1789|  8.36k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 1790|       |
 1791|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1792|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1793|  8.36k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1794|  8.36k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1795|       |
 1796|  8.36k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1797|  8.36k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1798|  8.36k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1799|  8.36k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1800|       |
 1801|       |                    //o3:1B*18-3B*50,1T*18-3T*50
 1802|  8.36k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1803|  8.36k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 1804|       |
 1805|  8.36k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1806|  8.36k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1807|       |
 1808|       |
 1809|       |
 1810|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1811|       |
 1812|       |
 1813|  8.36k|                }
 1814|       |
 1815|       |                /* Column 3 of destination computed here */
 1816|       |                /* It is stored in m_temp_reg_53 */
 1817|       |                /* Column 4 of destination computed here */
 1818|       |                /* It is stored in m_temp_reg_54 */
 1819|  8.36k|                {
 1820|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1821|  8.36k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1822|       |
 1823|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 1824|  8.36k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 1825|       |
 1826|  8.36k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1827|  8.36k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1828|  8.36k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1829|  8.36k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1830|       |
 1831|  8.36k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1832|  8.36k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1833|  8.36k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1834|  8.36k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1835|       |
 1836|  8.36k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1837|  8.36k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1838|  8.36k|                }
 1839|  8.36k|            }
 1840|       |
 1841|       |            /* Transpose of the destination 8x8 matrix done here */
 1842|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1843|       |            /* respectively */
 1844|  8.36k|            {
 1845|       |
 1846|       |
 1847|  8.36k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1848|  8.36k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1849|  8.36k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1850|  8.36k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1851|  8.36k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1852|  8.36k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1853|  8.36k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1854|  8.36k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1855|       |
 1856|  8.36k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1857|  8.36k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1858|  8.36k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1859|  8.36k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1860|  8.36k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1861|  8.36k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1862|  8.36k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1863|  8.36k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1864|       |
 1865|  8.36k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1866|  8.36k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1867|  8.36k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1868|  8.36k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1869|       |
 1870|  8.36k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1871|  8.36k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1872|  8.36k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1873|  8.36k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1874|  8.36k|            }
 1875|  8.36k|        }
 1876|  13.8k|        else
 1877|  13.8k|        {
 1878|       |
 1879|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1880|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1881|  13.8k|            {
 1882|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 1883|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 1884|  13.8k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1885|  13.8k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1886|       |
 1887|  13.8k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1888|  13.8k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 1889|       |
 1890|  13.8k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1891|  13.8k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1892|       |
 1893|       |
 1894|  13.8k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1895|  13.8k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1896|  13.8k|            }
 1897|       |
 1898|       |
 1899|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1900|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1901|  13.8k|            {
 1902|       |
 1903|  13.8k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 1904|  13.8k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 1905|       |
 1906|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1907|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1908|  13.8k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1909|  13.8k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 1910|       |
 1911|  13.8k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1912|  13.8k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1913|       |
 1914|  13.8k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 1915|  13.8k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 1916|       |
 1917|       |
 1918|       |
 1919|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 1920|       |
 1921|  13.8k|                m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1922|  13.8k|                m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1923|       |
 1924|  13.8k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1925|  13.8k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1926|       |
 1927|  13.8k|            }
 1928|       |
 1929|       |            /* e */
 1930|  13.8k|            {
 1931|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1932|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1933|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1934|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1935|  13.8k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1936|  13.8k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1937|       |
 1938|  13.8k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1939|  13.8k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1940|       |
 1941|  13.8k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1942|  13.8k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1943|       |
 1944|  13.8k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1945|  13.8k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1946|       |
 1947|  13.8k|            }
 1948|       |
 1949|       |            /* o */
 1950|  13.8k|            {
 1951|       |
 1952|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1953|  13.8k|                {
 1954|       |
 1955|  13.8k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1956|  13.8k|                    m_temp_reg_61 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 1957|  13.8k|                    m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1958|  13.8k|                    m_temp_reg_65 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_77);
 1959|       |                    //o0:1B*89+3B*75,1T*89+3T*75,5B*50+7B*18,5T*50+7T*18
 1960|  13.8k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1961|  13.8k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1962|  13.8k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1963|  13.8k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 1964|       |
 1965|       |
 1966|  13.8k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1967|  13.8k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1968|       |
 1969|  13.8k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1970|  13.8k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 1971|  13.8k|                }
 1972|       |
 1973|       |                /* Column 0 of destination computed here */
 1974|       |                /* It is stored in m_temp_reg_50 */
 1975|       |                /* Column 7 of destination computed here */
 1976|       |                /* It is stored in m_temp_reg_57 */
 1977|  13.8k|                {
 1978|       |
 1979|       |
 1980|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1981|  13.8k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1982|       |
 1983|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1984|  13.8k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1985|       |
 1986|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1987|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1988|  13.8k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1989|  13.8k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1990|       |
 1991|  13.8k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1992|  13.8k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1993|  13.8k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1994|  13.8k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1995|       |
 1996|       |                    //o1:1B*75-3B*18,1T*75-3T*18,5B*89+7B*50,5T*89+7T*50
 1997|  13.8k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1998|  13.8k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1999|  13.8k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2000|  13.8k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2001|       |
 2002|  13.8k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2003|  13.8k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2004|       |
 2005|       |                    /* Loading coeff for computing o2  in the next block */
 2006|       |
 2007|  13.8k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2008|  13.8k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 2009|       |
 2010|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 2011|  13.8k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2012|  13.8k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2013|  13.8k|                }
 2014|       |
 2015|       |                /* Column 1 of destination computed here */
 2016|       |                /* It is stored in m_temp_reg_51 */
 2017|       |                /* Column 6 of destination computed here */
 2018|       |                /* It is stored in m_temp_reg_56 */
 2019|  13.8k|                {
 2020|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2021|  13.8k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2022|       |
 2023|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2024|  13.8k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2025|       |
 2026|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2027|  13.8k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2028|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2029|  13.8k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2030|       |
 2031|  13.8k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2032|  13.8k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2033|  13.8k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2034|  13.8k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2035|       |
 2036|       |                    //o2:1B*50-3B*89,1T*50-3T*89,5B*18+7B*75,5T*18+7T*75
 2037|  13.8k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 2038|  13.8k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 2039|  13.8k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 2040|  13.8k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 2041|       |
 2042|  13.8k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2043|  13.8k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2044|       |
 2045|       |
 2046|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 2047|       |
 2048|       |
 2049|       |                    /* Loading coeff for computing o3  in the next block */
 2050|       |
 2051|  13.8k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2052|  13.8k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2053|       |
 2054|  13.8k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2055|  13.8k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2056|  13.8k|                }
 2057|       |
 2058|       |                /* Column 2 of destination computed here */
 2059|       |                /* It is stored in m_temp_reg_52 */
 2060|       |                /* Column 5 of destination computed here */
 2061|       |                /* It is stored in m_temp_reg_55 */
 2062|  13.8k|                {
 2063|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2064|  13.8k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2065|       |
 2066|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2067|  13.8k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2068|       |
 2069|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2070|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2071|  13.8k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2072|  13.8k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2073|       |
 2074|  13.8k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2075|  13.8k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2076|  13.8k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2077|  13.8k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2078|       |
 2079|       |                    //o3:1B*18-3B*50,1T*18-3T*50,5B*75-7B*89,5T*75-7T*89
 2080|  13.8k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2081|  13.8k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 2082|  13.8k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2083|  13.8k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2084|       |
 2085|  13.8k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2086|  13.8k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2087|       |
 2088|       |
 2089|       |
 2090|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 2091|       |
 2092|       |
 2093|  13.8k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2094|  13.8k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2095|  13.8k|                }
 2096|       |
 2097|       |                /* Column 3 of destination computed here */
 2098|       |                /* It is stored in m_temp_reg_53 */
 2099|       |                /* Column 4 of destination computed here */
 2100|       |                /* It is stored in m_temp_reg_54 */
 2101|  13.8k|                {
 2102|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2103|  13.8k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2104|       |
 2105|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2106|  13.8k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2107|       |
 2108|  13.8k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2109|  13.8k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2110|  13.8k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2111|  13.8k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2112|       |
 2113|  13.8k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2114|  13.8k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2115|  13.8k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2116|  13.8k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2117|       |
 2118|  13.8k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2119|  13.8k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2120|  13.8k|                }
 2121|  13.8k|            }
 2122|       |
 2123|       |            /* Transpose of the destination 8x8 matrix done here */
 2124|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 2125|       |            /* respectively */
 2126|  13.8k|            {
 2127|       |
 2128|       |
 2129|  13.8k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2130|  13.8k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2131|  13.8k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2132|  13.8k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2133|  13.8k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2134|  13.8k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2135|  13.8k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2136|  13.8k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2137|       |
 2138|  13.8k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2139|  13.8k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2140|  13.8k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2141|  13.8k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2142|  13.8k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2143|  13.8k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2144|  13.8k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2145|  13.8k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2146|       |
 2147|  13.8k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2148|  13.8k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2149|  13.8k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2150|  13.8k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2151|       |
 2152|  13.8k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2153|  13.8k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2154|  13.8k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2155|  13.8k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2156|  13.8k|            }
 2157|  13.8k|        }
 2158|       |        /* Stage 2 */
 2159|       |
 2160|  22.2k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  22.2k|#define IT_SHIFT_STAGE_2 12
  ------------------
 2161|       |
 2162|  22.2k|        {
 2163|       |
 2164|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 2165|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 2166|  22.2k|            {
 2167|  22.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 2168|  22.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 2169|       |
 2170|  22.2k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 2171|  22.2k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 2172|       |
 2173|  22.2k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2174|  22.2k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2175|  22.2k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2176|  22.2k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2177|       |
 2178|       |
 2179|  22.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 2180|  22.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 2181|  22.2k|            }
 2182|       |
 2183|       |
 2184|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 2185|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 2186|  22.2k|            {
 2187|  22.2k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 2188|  22.2k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 2189|       |
 2190|       |
 2191|  22.2k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2192|  22.2k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2193|  22.2k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2194|  22.2k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2195|       |
 2196|       |                /* Loading coeff for computing o0 in the next block */
 2197|  22.2k|                m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 2198|  22.2k|                m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 2199|       |
 2200|       |
 2201|  22.2k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 2202|  22.2k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_51, m_temp_reg_53);
 2203|  22.2k|            }
 2204|       |
 2205|       |            /* e */
 2206|  22.2k|            {
 2207|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 2208|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 2209|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 2210|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 2211|  22.2k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 2212|  22.2k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 2213|       |
 2214|  22.2k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 2215|  22.2k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 2216|       |
 2217|  22.2k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 2218|  22.2k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 2219|       |
 2220|  22.2k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 2221|  22.2k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 2222|       |
 2223|  22.2k|            }
 2224|       |
 2225|       |            /* o */
 2226|  22.2k|            {
 2227|  22.2k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_55, m_temp_reg_57);
 2228|  22.2k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_55, m_temp_reg_57);
 2229|       |
 2230|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 2231|  22.2k|                {
 2232|       |                    //o0:1B*89+3B*75,1T*89+3T*75,5B*50+7B*18,5T*50+7T*18
 2233|  22.2k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2234|  22.2k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2235|  22.2k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2236|  22.2k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2237|       |
 2238|  22.2k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2239|  22.2k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 2240|       |                    /* Loading coeff for computing o1 in the next block */
 2241|  22.2k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 2242|  22.2k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 2243|       |
 2244|  22.2k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2245|  22.2k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2246|  22.2k|                }
 2247|       |
 2248|       |                /* Column 0 of destination computed here */
 2249|       |                /* It is stored in m_temp_reg_50 */
 2250|       |                /* Column 7 of destination computed here */
 2251|       |                /* It is stored in m_temp_reg_57 */
 2252|  22.2k|                {
 2253|  22.2k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2254|  22.2k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2255|       |
 2256|  22.2k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2257|  22.2k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2258|       |
 2259|  22.2k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2260|  22.2k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2261|  22.2k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2262|  22.2k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2263|       |
 2264|  22.2k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2265|  22.2k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2266|  22.2k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2267|  22.2k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 2268|       |
 2269|       |                    //o1:1B*75-3B*18,1T*75-3T*18,5B*89+7B*50,5T*89+7T*50
 2270|  22.2k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2271|  22.2k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2272|  22.2k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2273|  22.2k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2274|       |
 2275|  22.2k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2276|  22.2k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 2277|       |
 2278|       |
 2279|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 2280|       |
 2281|       |
 2282|       |                    /* Loading coeff for computing o2  in the next block */
 2283|  22.2k|                    m_coeff1 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2284|  22.2k|                    m_coeff2 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 2285|       |
 2286|  22.2k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2287|  22.2k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2288|  22.2k|                }
 2289|       |
 2290|       |                /* Column 1 of destination computed here */
 2291|       |                /* It is stored in m_temp_reg_51 */
 2292|       |                /* Column 6 of destination computed here */
 2293|       |                /* It is stored in m_temp_reg_56 */
 2294|  22.2k|                {
 2295|  22.2k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2296|  22.2k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2297|       |
 2298|  22.2k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2299|  22.2k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2300|       |
 2301|  22.2k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2302|  22.2k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2303|  22.2k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2304|  22.2k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2305|       |
 2306|  22.2k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2307|  22.2k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2308|  22.2k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2309|  22.2k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 2310|       |
 2311|       |                    //o2:1B*50-3B*89,1T*50-3T*89,5B*18+7B*75,5T*18+7T*75
 2312|  22.2k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2313|  22.2k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2314|  22.2k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2315|  22.2k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2316|       |
 2317|  22.2k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2318|  22.2k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 2319|       |
 2320|       |
 2321|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 2322|       |
 2323|       |                    /* Loading coeff for computing o3  in the next block */
 2324|       |
 2325|  22.2k|                    m_coeff3 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2326|  22.2k|                    m_coeff4 = _mm_loadu_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2327|       |
 2328|  22.2k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2329|  22.2k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2330|  22.2k|                }
 2331|       |
 2332|       |                /* Column 2 of destination computed here */
 2333|       |                /* It is stored in m_temp_reg_52 */
 2334|       |                /* Column 5 of destination computed here */
 2335|       |                /* It is stored in m_temp_reg_55 */
 2336|  22.2k|                {
 2337|  22.2k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2338|  22.2k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2339|       |
 2340|  22.2k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2341|  22.2k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2342|       |
 2343|  22.2k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2344|  22.2k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2345|  22.2k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2346|  22.2k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2347|       |
 2348|  22.2k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2349|  22.2k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2350|  22.2k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2351|  22.2k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 2352|       |
 2353|       |                    //o3:1B*18-3B*50,1T*18-3T*50,5B*75-7B*89,5T*75-7T*89
 2354|  22.2k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2355|  22.2k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2356|  22.2k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2357|  22.2k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2358|       |
 2359|  22.2k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2360|  22.2k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 2361|       |
 2362|       |
 2363|       |
 2364|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 2365|       |
 2366|       |
 2367|  22.2k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2368|  22.2k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2369|  22.2k|                }
 2370|       |
 2371|       |                /* Column 3 of destination computed here */
 2372|       |                /* It is stored in m_temp_reg_53 */
 2373|       |                /* Column 4 of destination computed here */
 2374|       |                /* It is stored in m_temp_reg_54 */
 2375|  22.2k|                {
 2376|  22.2k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2377|  22.2k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2378|       |
 2379|  22.2k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2380|  22.2k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2381|       |
 2382|  22.2k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 2383|  22.2k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 2384|  22.2k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 2385|  22.2k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 2386|       |
 2387|  22.2k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 2388|  22.2k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 2389|  22.2k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 2390|  22.2k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 2391|       |
 2392|  22.2k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 2393|  22.2k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 2394|  22.2k|                }
 2395|  22.2k|            }
 2396|       |
 2397|       |            /* Transpose of the destination 8x8 matrix done here */
 2398|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 2399|       |            /* respectively */
 2400|  22.2k|            {
 2401|  22.2k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2402|  22.2k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2403|  22.2k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2404|  22.2k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2405|  22.2k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2406|  22.2k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2407|  22.2k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2408|  22.2k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2409|       |
 2410|  22.2k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2411|  22.2k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2412|  22.2k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2413|  22.2k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2414|  22.2k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2415|  22.2k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2416|  22.2k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2417|  22.2k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2418|  22.2k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2419|  22.2k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2420|  22.2k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2421|  22.2k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2422|       |
 2423|  22.2k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2424|  22.2k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2425|  22.2k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2426|  22.2k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2427|  22.2k|            }
 2428|       |
 2429|       |            /* Recon and store */
 2430|  22.2k|            {
 2431|  22.2k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2432|  22.2k|                pu1_pred += pred_strd;
 2433|  22.2k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2434|  22.2k|                pu1_pred += pred_strd;
 2435|  22.2k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2436|  22.2k|                pu1_pred += pred_strd;
 2437|  22.2k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2438|  22.2k|                pu1_pred += pred_strd;
 2439|  22.2k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2440|  22.2k|                pu1_pred += pred_strd;
 2441|  22.2k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2442|  22.2k|                pu1_pred += pred_strd;
 2443|  22.2k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2444|  22.2k|                pu1_pred += pred_strd;
 2445|  22.2k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2446|       |
 2447|       |
 2448|  22.2k|                m_temp_reg_50 = _mm_setzero_si128();
 2449|  22.2k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 2450|  22.2k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 2451|  22.2k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 2452|  22.2k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 2453|  22.2k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 2454|  22.2k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 2455|  22.2k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 2456|  22.2k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 2457|       |
 2458|  22.2k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 2459|  22.2k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 2460|  22.2k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 2461|  22.2k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 2462|  22.2k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 2463|  22.2k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 2464|  22.2k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 2465|  22.2k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 2466|       |
 2467|  22.2k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 2468|  22.2k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 2469|  22.2k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 2470|  22.2k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 2471|  22.2k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 2472|  22.2k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 2473|  22.2k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 2474|  22.2k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 2475|       |
 2476|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 2477|  22.2k|                pu1_dst += dst_strd;
 2478|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 2479|  22.2k|                pu1_dst += dst_strd;
 2480|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 2481|  22.2k|                pu1_dst += dst_strd;
 2482|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 2483|  22.2k|                pu1_dst += dst_strd;
 2484|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 2485|  22.2k|                pu1_dst += dst_strd;
 2486|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 2487|  22.2k|                pu1_dst += dst_strd;
 2488|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 2489|  22.2k|                pu1_dst += dst_strd;
 2490|  22.2k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 2491|  22.2k|                pu1_dst += dst_strd;
 2492|       |
 2493|  22.2k|            }
 2494|       |
 2495|       |
 2496|  22.2k|        }
 2497|       |
 2498|       |
 2499|  22.2k|    }
 2500|  56.3k|}

ihevc_itrans_recon_4x4_ttype1_ssse3:
  120|   435k|{
  121|   435k|    __m128i m_temp_reg_0;
  122|   435k|    __m128i m_temp_reg_1;
  123|   435k|    __m128i m_temp_reg_2;
  124|   435k|    __m128i m_temp_reg_3;
  125|   435k|    __m128i m_temp_reg_4;
  126|   435k|    __m128i m_temp_reg_10;
  127|   435k|    __m128i m_temp_reg_11;
  128|   435k|    __m128i m_temp_reg_12;
  129|   435k|    __m128i m_temp_reg_13;
  130|   435k|    __m128i m_temp_reg_14;
  131|   435k|    __m128i m_temp_reg_20;
  132|   435k|    __m128i m_temp_reg_21;
  133|   435k|    __m128i m_temp_reg_22;
  134|   435k|    __m128i m_temp_reg_23;
  135|   435k|    __m128i m_temp_reg_24;
  136|   435k|    __m128i m_temp_reg_25;
  137|   435k|    __m128i m_temp_reg_30;
  138|   435k|    __m128i m_temp_reg_31;
  139|   435k|    __m128i m_temp_reg_32;
  140|   435k|    __m128i m_temp_reg_33;
  141|   435k|    __m128i m_temp_reg_34;
  142|   435k|    __m128i m_temp_reg_35;
  143|   435k|    __m128i m_temp_reg_36;
  144|   435k|    __m128i m_rdng_factor;
  145|   435k|    __m128i m_count;
  146|       |
  147|   435k|    __m128i m_ge_zero16b_flag_row0;
  148|   435k|    __m128i m_ge_zero16b_flag_row1;
  149|   435k|    __m128i m_ge_zero16b_flag_row2;
  150|   435k|    __m128i m_ge_zero16b_flag_row3;
  151|       |
  152|   435k|    __m128i m_zero = _mm_setzero_si128();
  153|       |
  154|   435k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   435k|#define IT_SHIFT_STAGE_1 7
  ------------------
  155|   435k|    UNUSED(zero_cols);
  ------------------
  |  |   38|   435k|#define UNUSED(x) ((void)(x))
  ------------------
  156|   435k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   435k|#define UNUSED(x) ((void)(x))
  ------------------
  157|   435k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|   435k|#define UNUSED(x) ((void)(x))
  ------------------
  158|   435k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  159|   435k|    pi2_src += src_strd;
  160|   435k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  161|   435k|    pi2_src += src_strd;
  162|   435k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  163|   435k|    pi2_src += src_strd;
  164|   435k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  165|       |
  166|   435k|    m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_0);
  167|   435k|    m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_1);
  168|   435k|    m_ge_zero16b_flag_row2 = _mm_cmpgt_epi16(m_zero, m_temp_reg_2);
  169|   435k|    m_ge_zero16b_flag_row3 = _mm_cmpgt_epi16(m_zero, m_temp_reg_3);
  170|       |
  171|   435k|    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_0, m_ge_zero16b_flag_row0);
  172|   435k|    m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_1, m_ge_zero16b_flag_row1);
  173|   435k|    m_temp_reg_2 = _mm_unpacklo_epi16(m_temp_reg_2, m_ge_zero16b_flag_row2);
  174|   435k|    m_temp_reg_3 = _mm_unpacklo_epi16(m_temp_reg_3, m_ge_zero16b_flag_row3);
  175|       |
  176|       |    /*m_temp_reg_0 = _mm_cvtepi16_epi32(m_temp_reg_0);
  177|       |    m_temp_reg_2 = _mm_cvtepi16_epi32(m_temp_reg_2);
  178|       |
  179|       |    m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
  180|       |    m_temp_reg_3 = _mm_cvtepi16_epi32(m_temp_reg_3);*/
  181|       |
  182|       |    /* c[4] in m_temp_reg_14 */
  183|       |    /* c[4] = src[0] - src[2] + src[3] */
  184|   435k|    {
  185|   435k|        m_temp_reg_14 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_2);
  186|   435k|    }
  187|       |
  188|       |    /* c[3] in m_temp_reg_13 */
  189|   435k|    {
  190|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_1, 6);
  191|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_1, 3);
  192|   435k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_1, 1);
  193|   435k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  194|   435k|        m_temp_reg_13 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
  195|       |        //m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3);
  196|   435k|    }
  197|       |
  198|       |    /* c[0] in m_temp_reg_10 */
  199|   435k|    {
  200|   435k|        m_temp_reg_10 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_2);
  201|   435k|    }
  202|       |
  203|       |    /* c[1] in m_temp_reg_11 */
  204|   435k|    {
  205|   435k|        m_temp_reg_11 = _mm_add_epi32(m_temp_reg_2, m_temp_reg_3);
  206|   435k|    }
  207|       |
  208|       |    /* c[2] in m_temp_reg_12 */
  209|   435k|    {
  210|   435k|        m_temp_reg_12 = _mm_sub_epi32(m_temp_reg_0, m_temp_reg_3);
  211|   435k|    }
  212|       |
  213|       |    /* c[4] in m_temp_reg_14 */
  214|       |    /* c[4] = src[0] - src[2] + src[3] */
  215|   435k|    {
  216|   435k|        m_temp_reg_14 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_3);
  217|   435k|    }
  218|       |
  219|       |    /* Stage 1 outputs stored in m_temp_reg_20-23 */
  220|   435k|    {
  221|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_10, 5);
  222|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_10, 1);
  223|   435k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_10);
  224|   435k|        m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_21);
  225|       |        //m_temp_reg_30 = _mm_mullo_epi32(m_temp_reg_10, m_coeff1);//29*c0
  226|       |
  227|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_11, 6);
  228|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_11, 3);
  229|   435k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_11);
  230|   435k|        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_21);
  231|       |        //m_temp_reg_31 = _mm_mullo_epi32(m_temp_reg_11, m_coeff2);//55*c1
  232|       |
  233|   435k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  234|       |
  235|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_11, 5);
  236|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_11, 1);
  237|   435k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_11);
  238|   435k|        m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_21);
  239|       |        //m_temp_reg_32 = _mm_mullo_epi32(m_temp_reg_11, m_coeff1);//29*c1
  240|       |
  241|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_12, 6);
  242|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_12, 3);
  243|   435k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_12);
  244|   435k|        m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_21);
  245|       |        //m_temp_reg_33 = _mm_mullo_epi32(m_temp_reg_12, m_coeff2);//55*c2
  246|       |
  247|   435k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  248|       |
  249|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_10, 6);
  250|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_10, 3);
  251|   435k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_10);
  252|   435k|        m_temp_reg_34 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_21);
  253|       |        //m_temp_reg_34 = _mm_mullo_epi32(m_temp_reg_10, m_coeff2);//55*c0
  254|       |
  255|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_12, 5);
  256|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_12, 1);
  257|   435k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_12);
  258|   435k|        m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_21);
  259|       |        //m_temp_reg_35 = _mm_mullo_epi32(m_temp_reg_12, m_coeff1);//29*c2
  260|       |
  261|   435k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_14, 6);
  262|   435k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_14, 3);
  263|   435k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_14, 1);
  264|   435k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  265|   435k|        m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_23);
  266|       |        //m_temp_reg_36 = _mm_mullo_epi32(m_temp_reg_14, m_coeff3);//74*c4
  267|       |
  268|   435k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  269|   435k|        m_count = _mm_cvtsi32_si128(i4_shift);
  270|       |
  271|   435k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  272|   435k|        m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_13);
  273|   435k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  274|       |
  275|   435k|        m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  276|   435k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  277|       |
  278|   435k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  279|   435k|        m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_13);
  280|   435k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  281|       |
  282|   435k|        m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  283|       |
  284|   435k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  285|   435k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  286|   435k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  287|   435k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  288|       |
  289|   435k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  290|   435k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  291|   435k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  292|   435k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  293|       |
  294|   435k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  295|   435k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  296|       |
  297|   435k|        m_temp_reg_30 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  298|   435k|        m_temp_reg_31 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  299|       |
  300|   435k|    }
  301|       |
  302|       |    /* Stage 2 */
  303|   435k|    {
  304|   435k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   435k|#define IT_SHIFT_STAGE_2 12
  ------------------
  305|       |
  306|       |        /*m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  307|       |        m_temp_reg_20 = _mm_cvtepi16_epi32(m_temp_reg_20);
  308|       |        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  309|       |        m_temp_reg_21 = _mm_cvtepi16_epi32(m_temp_reg_21);
  310|       |        m_temp_reg_22 = _mm_cvtepi16_epi32(m_temp_reg_22);
  311|       |        m_temp_reg_23 = _mm_cvtepi16_epi32(m_temp_reg_23);*/
  312|       |
  313|   435k|        m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_30);
  314|   435k|        m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_31);
  315|       |
  316|   435k|        m_temp_reg_20 = _mm_unpacklo_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  317|   435k|        m_temp_reg_21 = _mm_unpacklo_epi16(m_temp_reg_31, m_ge_zero16b_flag_row1);
  318|   435k|        m_temp_reg_22 = _mm_unpackhi_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  319|   435k|        m_temp_reg_23 = _mm_unpackhi_epi16(m_temp_reg_31, m_ge_zero16b_flag_row1);
  320|       |
  321|       |
  322|       |        /* c[4] stored in m_temp_reg_4 */
  323|   435k|        {
  324|   435k|            m_temp_reg_4 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_21);
  325|   435k|        }
  326|       |
  327|       |        /* c[3] stored in m_temp_reg_3 */
  328|   435k|        {
  329|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_22, 6);
  330|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_22, 3);
  331|   435k|            m_temp_reg_12 = _mm_slli_epi32(m_temp_reg_22, 1);
  332|   435k|            m_temp_reg_13 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  333|   435k|            m_temp_reg_3 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_13);
  334|       |            //m_temp_reg_3 = _mm_mullo_epi32(m_temp_reg_22, m_coeff3);
  335|   435k|        }
  336|       |
  337|       |        /* c[0] stored in m_temp_reg_0 */
  338|   435k|        {
  339|   435k|            m_temp_reg_0 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  340|   435k|        }
  341|       |
  342|       |        /* c[1] stored in m_temp_reg_1 */
  343|   435k|        {
  344|   435k|            m_temp_reg_1 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_21);
  345|   435k|        }
  346|       |
  347|       |        /* c[2] stored in m_temp_reg_2 */
  348|   435k|        {
  349|   435k|            m_temp_reg_2 = _mm_sub_epi32(m_temp_reg_20, m_temp_reg_23);
  350|   435k|        }
  351|       |
  352|       |        /* c[4] stored in m_temp_reg_4 */
  353|   435k|        {
  354|   435k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_4, m_temp_reg_23);
  355|   435k|        }
  356|       |
  357|       |        /* Stage 2 output generation */
  358|   435k|        {
  359|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 5);
  360|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_0, 1);
  361|   435k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_0);
  362|   435k|            m_temp_reg_30 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_11);
  363|       |            //m_temp_reg_30 = _mm_mullo_epi32(m_temp_reg_0, m_coeff1);//29*c0
  364|       |
  365|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_1, 6);
  366|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_1, 3);
  367|   435k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_1);
  368|   435k|            m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_11);
  369|       |            //m_temp_reg_31 = _mm_mullo_epi32(m_temp_reg_1, m_coeff2);//55*c1
  370|       |
  371|   435k|            m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  372|       |
  373|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_1, 5);
  374|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_1, 1);
  375|   435k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_1);
  376|   435k|            m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_11);
  377|       |            //m_temp_reg_32 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1);//29*c1
  378|       |
  379|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_2, 6);
  380|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 3);
  381|   435k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_2);
  382|   435k|            m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_11);
  383|       |            //m_temp_reg_33 = _mm_mullo_epi32(m_temp_reg_2, m_coeff2);//55*c2
  384|       |
  385|   435k|            m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  386|       |
  387|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 6);
  388|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_0, 3);
  389|   435k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_0);
  390|   435k|            m_temp_reg_34 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_11);
  391|       |            //m_temp_reg_34 = _mm_mullo_epi32(m_temp_reg_0, m_coeff2);//55*c0
  392|       |
  393|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_2, 5);
  394|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 1);
  395|   435k|            m_temp_reg_13 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_2);
  396|   435k|            m_temp_reg_35 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_11);
  397|       |            //m_temp_reg_35 = _mm_mullo_epi32(m_temp_reg_2, m_coeff1);//29*c2
  398|       |
  399|   435k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_4, 6);
  400|   435k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_4, 3);
  401|   435k|            m_temp_reg_12 = _mm_slli_epi32(m_temp_reg_4, 1);
  402|   435k|            m_temp_reg_13 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  403|   435k|            m_temp_reg_36 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_13);
  404|       |            //m_temp_reg_36 = _mm_mullo_epi32(m_temp_reg_4, m_coeff3);//74*c4
  405|       |
  406|   435k|            m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  407|   435k|            m_count = _mm_cvtsi32_si128(i4_shift);
  408|       |
  409|   435k|            m_temp_reg_4 = _mm_add_epi32(m_rdng_factor, m_temp_reg_3);
  410|   435k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_31);
  411|   435k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_4);
  412|       |
  413|   435k|            m_temp_reg_21 = _mm_sub_epi32(m_temp_reg_33, m_temp_reg_32);
  414|   435k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_4);
  415|       |
  416|   435k|            m_temp_reg_4 = _mm_sub_epi32(m_rdng_factor, m_temp_reg_3);
  417|   435k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_34, m_temp_reg_35);
  418|   435k|            m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_4);
  419|       |
  420|   435k|            m_temp_reg_22 = _mm_add_epi32(m_temp_reg_36, m_rdng_factor);
  421|       |
  422|   435k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  423|   435k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  424|   435k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  425|   435k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  426|       |
  427|   435k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  428|   435k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  429|   435k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  430|   435k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  431|       |
  432|   435k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  433|   435k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  434|       |
  435|   435k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  436|   435k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  437|   435k|        }
  438|       |
  439|       |        /* Recon and store */
  440|   435k|        {
  441|   435k|            WORD32 *pi4_dst = (WORD32 *)pu1_dst;
  442|       |
  443|   435k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  444|   435k|            pu1_pred += pred_strd;
  445|   435k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  446|   435k|            pu1_pred += pred_strd;
  447|   435k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  448|   435k|            pu1_pred += pred_strd;
  449|   435k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  450|       |
  451|   435k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_zero);
  452|   435k|            m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_zero);
  453|   435k|            m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_zero);
  454|   435k|            m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_zero);
  455|       |
  456|       |            /*m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
  457|       |            m_temp_reg_1 = _mm_cvtepu8_epi16(m_temp_reg_1);
  458|       |            m_temp_reg_2 = _mm_cvtepu8_epi16(m_temp_reg_2);
  459|       |            m_temp_reg_3 = _mm_cvtepu8_epi16(m_temp_reg_3);*/
  460|       |
  461|   435k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  462|   435k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  463|       |
  464|   435k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  465|   435k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  466|       |
  467|   435k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  468|       |
  469|   435k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  470|   435k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  471|   435k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  472|   435k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  473|   435k|            pu1_dst += dst_strd;
  474|   435k|            pi4_dst = (WORD32 *)(pu1_dst);
  475|       |
  476|   435k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  477|   435k|            pu1_dst += dst_strd;
  478|   435k|            pi4_dst = (WORD32 *)(pu1_dst);
  479|       |
  480|   435k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  481|   435k|            pu1_dst += dst_strd;
  482|   435k|            pi4_dst = (WORD32 *)(pu1_dst);
  483|       |
  484|   435k|            *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  485|   435k|        }
  486|   435k|    }
  487|   435k|}
ihevc_itrans_recon_4x4_ssse3:
  552|  27.6k|{
  553|  27.6k|    __m128i m_temp_reg_0;
  554|  27.6k|    __m128i m_temp_reg_1;
  555|  27.6k|    __m128i m_temp_reg_2;
  556|  27.6k|    __m128i m_temp_reg_3;
  557|  27.6k|    __m128i m_temp_reg_4;
  558|  27.6k|    __m128i m_temp_reg_10;
  559|  27.6k|    __m128i m_temp_reg_11;
  560|  27.6k|    __m128i m_temp_reg_12;
  561|  27.6k|    __m128i m_temp_reg_13;
  562|  27.6k|    __m128i m_temp_reg_14;
  563|  27.6k|    __m128i m_temp_reg_15;
  564|  27.6k|    __m128i m_temp_reg_20;
  565|  27.6k|    __m128i m_temp_reg_21;
  566|  27.6k|    __m128i m_temp_reg_22;
  567|  27.6k|    __m128i m_temp_reg_23;
  568|  27.6k|    __m128i m_temp_reg_24;
  569|  27.6k|    __m128i m_temp_reg_25;
  570|  27.6k|    __m128i m_temp_reg_30;
  571|  27.6k|    __m128i m_temp_reg_31;
  572|  27.6k|    __m128i m_temp_reg_33;
  573|  27.6k|    __m128i m_temp_reg_34;
  574|  27.6k|    __m128i m_rdng_factor;
  575|  27.6k|    __m128i m_count;
  576|       |
  577|  27.6k|    __m128i m_ge_zero16b_flag_row0;
  578|  27.6k|    __m128i m_ge_zero16b_flag_row1;
  579|  27.6k|    __m128i m_ge_zero16b_flag_row2;
  580|  27.6k|    __m128i m_ge_zero16b_flag_row3;
  581|       |
  582|  27.6k|    __m128i m_zero = _mm_setzero_si128();
  583|       |
  584|  27.6k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  27.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  585|  27.6k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  27.6k|#define UNUSED(x) ((void)(x))
  ------------------
  586|  27.6k|    UNUSED(zero_cols);
  ------------------
  |  |   38|  27.6k|#define UNUSED(x) ((void)(x))
  ------------------
  587|  27.6k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|  27.6k|#define UNUSED(x) ((void)(x))
  ------------------
  588|       |
  589|  27.6k|    m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pi2_src);
  590|  27.6k|    pi2_src += src_strd;
  591|  27.6k|    m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pi2_src);
  592|  27.6k|    pi2_src += src_strd;
  593|  27.6k|    m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pi2_src);
  594|  27.6k|    pi2_src += src_strd;
  595|  27.6k|    m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pi2_src);
  596|       |
  597|  27.6k|    m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_0);
  598|  27.6k|    m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_1);
  599|  27.6k|    m_ge_zero16b_flag_row2 = _mm_cmpgt_epi16(m_zero, m_temp_reg_2);
  600|  27.6k|    m_ge_zero16b_flag_row3 = _mm_cmpgt_epi16(m_zero, m_temp_reg_3);
  601|       |
  602|  27.6k|    m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_0, m_ge_zero16b_flag_row0);
  603|  27.6k|    m_temp_reg_1 = _mm_unpacklo_epi16(m_temp_reg_1, m_ge_zero16b_flag_row1);
  604|  27.6k|    m_temp_reg_2 = _mm_unpacklo_epi16(m_temp_reg_2, m_ge_zero16b_flag_row2);
  605|  27.6k|    m_temp_reg_3 = _mm_unpacklo_epi16(m_temp_reg_3, m_ge_zero16b_flag_row3);
  606|       |
  607|       |    /*m_temp_reg_0 = _mm_cvtepi16_epi32(m_temp_reg_0);
  608|       |    m_temp_reg_2 = _mm_cvtepi16_epi32(m_temp_reg_2);
  609|       |
  610|       |    m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
  611|       |    m_temp_reg_3 = _mm_cvtepi16_epi32(m_temp_reg_3);*/
  612|       |
  613|       |    /* e */
  614|  27.6k|    {
  615|  27.6k|        m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_0, 6);
  616|  27.6k|        m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_2, 6);
  617|  27.6k|    }
  618|       |
  619|       |    /* o */
  620|  27.6k|    {
  621|  27.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_1, 5);
  622|  27.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_1, 2);
  623|  27.6k|        m_temp_reg_12 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  624|       |        //m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1);//src[1]*36
  625|       |
  626|  27.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_3, 6);
  627|  27.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_3, 4);
  628|  27.6k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_3, 1);
  629|  27.6k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_3);
  630|  27.6k|        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_22);
  631|  27.6k|        m_temp_reg_13 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_24);
  632|       |        //m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_3, m_coeff3);//src[3]*83
  633|       |
  634|  27.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_1, 6);
  635|  27.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_1, 4);
  636|  27.6k|        m_temp_reg_22 = _mm_slli_epi32(m_temp_reg_1, 1);
  637|  27.6k|        m_temp_reg_23 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_1);
  638|  27.6k|        m_temp_reg_24 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_22);
  639|  27.6k|        m_temp_reg_14 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_24);
  640|       |        //m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3);//src[1]*83
  641|       |
  642|  27.6k|        m_temp_reg_20 = _mm_slli_epi32(m_temp_reg_3, 5);
  643|  27.6k|        m_temp_reg_21 = _mm_slli_epi32(m_temp_reg_3, 2);
  644|  27.6k|        m_temp_reg_15 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_21);
  645|       |        //m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_3, m_coeff1);//src[3]*36
  646|  27.6k|    }
  647|       |
  648|  27.6k|    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  649|       |
  650|       |    /* e1 stored in m_temp_reg_31 */
  651|  27.6k|    {
  652|  27.6k|        m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  653|  27.6k|    }
  654|       |
  655|  27.6k|    m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  656|       |
  657|       |    /* e0 stored in m_temp_reg_30 */
  658|  27.6k|    {
  659|  27.6k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  660|  27.6k|    }
  661|       |
  662|  27.6k|    m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  663|  27.6k|    m_count = _mm_cvtsi32_si128(i4_shift);
  664|       |
  665|       |    /* o1 stored in m_temp_reg_33 */
  666|  27.6k|    {
  667|  27.6k|        m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  668|  27.6k|    }
  669|       |
  670|       |    /* e1 + add */
  671|  27.6k|    {
  672|  27.6k|        m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  673|  27.6k|    }
  674|       |
  675|       |    /* e0 + add */
  676|  27.6k|    {
  677|  27.6k|        m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  678|  27.6k|    }
  679|       |
  680|       |    /* o0 stored in m_temp_reg_34 */
  681|  27.6k|    {
  682|  27.6k|        m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  683|  27.6k|    }
  684|       |
  685|       |    /* Stage 1 outputs */
  686|  27.6k|    {
  687|  27.6k|        m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  688|  27.6k|        m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  689|       |
  690|  27.6k|        m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  691|  27.6k|        m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  692|       |
  693|       |
  694|  27.6k|        m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  695|  27.6k|        m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  696|  27.6k|        m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  697|  27.6k|        m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  698|       |
  699|  27.6k|        m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  700|  27.6k|        m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  701|  27.6k|        m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  702|  27.6k|        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  703|       |
  704|  27.6k|        m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  705|  27.6k|        m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  706|       |
  707|  27.6k|        m_temp_reg_30 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  708|  27.6k|        m_temp_reg_31 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  709|  27.6k|    }
  710|       |
  711|       |    /* Stage 2 */
  712|  27.6k|    {
  713|  27.6k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  27.6k|#define IT_SHIFT_STAGE_2 12
  ------------------
  714|       |
  715|       |        /*m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  716|       |        m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);*/
  717|       |
  718|  27.6k|        m_ge_zero16b_flag_row0 = _mm_cmpgt_epi16(m_zero, m_temp_reg_30);
  719|  27.6k|        m_ge_zero16b_flag_row1 = _mm_cmpgt_epi16(m_zero, m_temp_reg_31);
  720|       |
  721|  27.6k|        m_temp_reg_20 = _mm_unpacklo_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  722|  27.6k|        m_temp_reg_21 = _mm_unpacklo_epi16(m_temp_reg_31, m_ge_zero16b_flag_row1);
  723|  27.6k|        m_temp_reg_22 = _mm_unpackhi_epi16(m_temp_reg_30, m_ge_zero16b_flag_row0);
  724|  27.6k|        m_temp_reg_23 = _mm_unpackhi_epi16(m_temp_reg_31, m_ge_zero16b_flag_row1);
  725|       |
  726|       |        /*m_temp_reg_20 = _mm_cvtepi16_epi32(m_temp_reg_20);
  727|       |        m_temp_reg_21 = _mm_cvtepi16_epi32(m_temp_reg_21);
  728|       |
  729|       |        m_temp_reg_22 = _mm_cvtepi16_epi32(m_temp_reg_22);
  730|       |        m_temp_reg_23 = _mm_cvtepi16_epi32(m_temp_reg_23);*/
  731|       |
  732|       |        /* e */
  733|  27.6k|        {
  734|  27.6k|            m_temp_reg_10 = _mm_slli_epi32(m_temp_reg_20, 6);
  735|  27.6k|        }
  736|       |
  737|       |        /* o */
  738|       |        /*{
  739|       |            m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_22, m_coeff1);//src[1]*36
  740|       |            m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_22, m_coeff3);//src[1]*83
  741|       |            m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_23, m_coeff3);//src[3]*83
  742|       |            m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_23, m_coeff1);//src[3]*36
  743|       |        }*/
  744|  27.6k|        {
  745|  27.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_22, 5);
  746|  27.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_22, 2);
  747|  27.6k|            m_temp_reg_12 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_1);
  748|       |            //m_temp_reg_12 = _mm_mullo_epi32(m_temp_reg_1, m_coeff1);//src[1]*36
  749|       |
  750|  27.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_23, 6);
  751|  27.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_23, 4);
  752|  27.6k|            m_temp_reg_2 = _mm_slli_epi32(m_temp_reg_23, 1);
  753|  27.6k|            m_temp_reg_3 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_23);
  754|  27.6k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_1, m_temp_reg_2);
  755|  27.6k|            m_temp_reg_13 = _mm_add_epi32(m_temp_reg_3, m_temp_reg_4);
  756|       |            //m_temp_reg_13 = _mm_mullo_epi32(m_temp_reg_3, m_coeff3);//src[3]*83
  757|       |
  758|  27.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_22, 6);
  759|  27.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_22, 4);
  760|  27.6k|            m_temp_reg_2 = _mm_slli_epi32(m_temp_reg_22, 1);
  761|  27.6k|            m_temp_reg_3 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_22);
  762|  27.6k|            m_temp_reg_4 = _mm_add_epi32(m_temp_reg_1, m_temp_reg_2);
  763|  27.6k|            m_temp_reg_14 = _mm_add_epi32(m_temp_reg_3, m_temp_reg_4);
  764|       |            //m_temp_reg_14 = _mm_mullo_epi32(m_temp_reg_1, m_coeff3);//src[1]*83
  765|       |
  766|  27.6k|            m_temp_reg_0 = _mm_slli_epi32(m_temp_reg_23, 5);
  767|  27.6k|            m_temp_reg_1 = _mm_slli_epi32(m_temp_reg_23, 2);
  768|  27.6k|            m_temp_reg_15 = _mm_add_epi32(m_temp_reg_0, m_temp_reg_1);
  769|       |            //m_temp_reg_15 = _mm_mullo_epi32(m_temp_reg_3, m_coeff1);//src[3]*36
  770|  27.6k|        }
  771|       |
  772|       |        /* e */
  773|  27.6k|        {
  774|  27.6k|            m_temp_reg_11 = _mm_slli_epi32(m_temp_reg_21, 6);
  775|  27.6k|        }
  776|       |
  777|  27.6k|        m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
  778|       |
  779|       |        /* e1 stored in m_temp_reg_31 */
  780|  27.6k|        {
  781|  27.6k|            m_temp_reg_31 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_11);
  782|  27.6k|        }
  783|       |
  784|  27.6k|        m_rdng_factor = _mm_unpacklo_epi32(m_rdng_factor, m_rdng_factor);
  785|       |
  786|       |        /* e0 stored in m_temp_reg_30 */
  787|  27.6k|        {
  788|  27.6k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_11);
  789|  27.6k|        }
  790|       |
  791|  27.6k|        m_rdng_factor = _mm_unpacklo_epi64(m_rdng_factor, m_rdng_factor);
  792|  27.6k|        m_count = _mm_cvtsi32_si128(i4_shift);
  793|       |
  794|       |        /* o1 stored in m_temp_reg_33 */
  795|  27.6k|        {
  796|  27.6k|            m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_13);
  797|  27.6k|        }
  798|       |
  799|       |        /* e1 + add */
  800|  27.6k|        {
  801|  27.6k|            m_temp_reg_31 = _mm_add_epi32(m_temp_reg_31, m_rdng_factor);
  802|  27.6k|        }
  803|       |
  804|       |        /* e0 + add */
  805|  27.6k|        {
  806|  27.6k|            m_temp_reg_30 = _mm_add_epi32(m_temp_reg_30, m_rdng_factor);
  807|  27.6k|        }
  808|       |
  809|       |        /* o0 stored in m_temp_reg_34 */
  810|  27.6k|        {
  811|  27.6k|            m_temp_reg_34 = _mm_add_epi32(m_temp_reg_14, m_temp_reg_15);
  812|  27.6k|        }
  813|       |
  814|       |        /* Stage 2 outputs */
  815|  27.6k|        {
  816|  27.6k|            m_temp_reg_21 = _mm_add_epi32(m_temp_reg_31, m_temp_reg_33);
  817|  27.6k|            m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_31, m_temp_reg_33);
  818|  27.6k|            m_temp_reg_20 = _mm_add_epi32(m_temp_reg_30, m_temp_reg_34);
  819|  27.6k|            m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_30, m_temp_reg_34);
  820|       |
  821|  27.6k|            m_temp_reg_21 = _mm_sra_epi32(m_temp_reg_21, m_count);
  822|  27.6k|            m_temp_reg_22 = _mm_sra_epi32(m_temp_reg_22, m_count);
  823|  27.6k|            m_temp_reg_20 = _mm_sra_epi32(m_temp_reg_20, m_count);
  824|  27.6k|            m_temp_reg_23 = _mm_sra_epi32(m_temp_reg_23, m_count);
  825|       |
  826|  27.6k|            m_temp_reg_20 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
  827|  27.6k|            m_temp_reg_21 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
  828|  27.6k|            m_temp_reg_22 = _mm_srli_si128(m_temp_reg_20, 8);
  829|  27.6k|            m_temp_reg_23 = _mm_srli_si128(m_temp_reg_21, 8);
  830|       |
  831|  27.6k|            m_temp_reg_24 = _mm_unpacklo_epi16(m_temp_reg_20, m_temp_reg_22);
  832|  27.6k|            m_temp_reg_25 = _mm_unpacklo_epi16(m_temp_reg_21, m_temp_reg_23);
  833|       |
  834|  27.6k|            m_temp_reg_20 = _mm_unpacklo_epi32(m_temp_reg_24, m_temp_reg_25);
  835|  27.6k|            m_temp_reg_21 = _mm_unpackhi_epi32(m_temp_reg_24, m_temp_reg_25);
  836|  27.6k|        }
  837|       |
  838|       |        /* Recon and store */
  839|  27.6k|        {
  840|  27.6k|            UWORD32 *pu4_dst = (UWORD32 *)pu1_dst;
  841|       |
  842|  27.6k|            m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  843|  27.6k|            pu1_pred += pred_strd;
  844|  27.6k|            m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
  845|  27.6k|            pu1_pred += pred_strd;
  846|  27.6k|            m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
  847|  27.6k|            pu1_pred += pred_strd;
  848|  27.6k|            m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
  849|       |
  850|       |            //m_temp_reg_0 = _mm_cvtepu8_epi16(m_temp_reg_0);
  851|       |            //m_temp_reg_1 = _mm_cvtepu8_epi16(m_temp_reg_1);
  852|       |
  853|       |            //m_temp_reg_2 = _mm_cvtepu8_epi16(m_temp_reg_2);
  854|       |            //m_temp_reg_3 = _mm_cvtepu8_epi16(m_temp_reg_3);
  855|       |
  856|  27.6k|            m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_zero);
  857|  27.6k|            m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_zero);
  858|  27.6k|            m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_zero);
  859|  27.6k|            m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_zero);
  860|       |
  861|  27.6k|            m_temp_reg_0 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_1);
  862|  27.6k|            m_temp_reg_1 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_3);
  863|       |
  864|  27.6k|            m_temp_reg_20 = _mm_add_epi16(m_temp_reg_20, m_temp_reg_0);
  865|  27.6k|            m_temp_reg_21 = _mm_add_epi16(m_temp_reg_21, m_temp_reg_1);
  866|       |
  867|  27.6k|            m_temp_reg_0 = _mm_packus_epi16(m_temp_reg_20, m_temp_reg_21);
  868|       |
  869|  27.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_0);
  870|  27.6k|            m_temp_reg_1 = _mm_srli_si128(m_temp_reg_0, 4);
  871|  27.6k|            m_temp_reg_2 = _mm_srli_si128(m_temp_reg_0, 8);
  872|  27.6k|            m_temp_reg_3 = _mm_srli_si128(m_temp_reg_0, 12);
  873|  27.6k|            pu1_dst += dst_strd;
  874|  27.6k|            pu4_dst = (UWORD32 *)(pu1_dst);
  875|       |
  876|  27.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  877|  27.6k|            pu1_dst += dst_strd;
  878|  27.6k|            pu4_dst = (UWORD32 *)(pu1_dst);
  879|       |
  880|  27.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  881|  27.6k|            pu1_dst += dst_strd;
  882|  27.6k|            pu4_dst = (UWORD32 *)(pu1_dst);
  883|       |
  884|  27.6k|            *pu4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  885|  27.6k|        }
  886|  27.6k|    }
  887|  27.6k|}
ihevc_itrans_recon_8x8_ssse3:
  954|   102k|{
  955|   102k|    __m128i m_temp_reg_0;
  956|   102k|    __m128i m_temp_reg_1;
  957|   102k|    __m128i m_temp_reg_2;
  958|   102k|    __m128i m_temp_reg_3;
  959|   102k|    __m128i m_temp_reg_5;
  960|   102k|    __m128i m_temp_reg_6;
  961|   102k|    __m128i m_temp_reg_7;
  962|   102k|    __m128i m_temp_reg_4;
  963|   102k|    __m128i m_temp_reg_10;
  964|   102k|    __m128i m_temp_reg_11;
  965|   102k|    __m128i m_temp_reg_12;
  966|   102k|    __m128i m_temp_reg_13;
  967|   102k|    __m128i m_temp_reg_14;
  968|   102k|    __m128i m_temp_reg_15;
  969|   102k|    __m128i m_temp_reg_16;
  970|   102k|    __m128i m_temp_reg_17;
  971|   102k|    __m128i m_temp_reg_20;
  972|   102k|    __m128i m_temp_reg_21;
  973|   102k|    __m128i m_temp_reg_22;
  974|   102k|    __m128i m_temp_reg_23;
  975|   102k|    __m128i m_temp_reg_24;
  976|   102k|    __m128i m_temp_reg_25;
  977|   102k|    __m128i m_temp_reg_26;
  978|   102k|    __m128i m_temp_reg_27;
  979|   102k|    __m128i m_temp_reg_30;
  980|   102k|    __m128i m_temp_reg_31;
  981|   102k|    __m128i m_temp_reg_32;
  982|   102k|    __m128i m_temp_reg_33;
  983|   102k|    __m128i m_temp_reg_34;
  984|   102k|    __m128i m_temp_reg_35;
  985|   102k|    __m128i m_temp_reg_36;
  986|   102k|    __m128i m_temp_reg_37;
  987|   102k|    __m128i m_temp_reg_40;
  988|   102k|    __m128i m_temp_reg_41;
  989|   102k|    __m128i m_temp_reg_42;
  990|   102k|    __m128i m_temp_reg_43;
  991|   102k|    __m128i m_temp_reg_44;
  992|   102k|    __m128i m_temp_reg_45;
  993|   102k|    __m128i m_temp_reg_46;
  994|   102k|    __m128i m_temp_reg_47;
  995|   102k|    __m128i m_temp_reg_50;
  996|   102k|    __m128i m_temp_reg_51;
  997|   102k|    __m128i m_temp_reg_52;
  998|   102k|    __m128i m_temp_reg_53;
  999|   102k|    __m128i m_temp_reg_54;
 1000|   102k|    __m128i m_temp_reg_55;
 1001|   102k|    __m128i m_temp_reg_56;
 1002|   102k|    __m128i m_temp_reg_57;
 1003|   102k|    __m128i m_temp_reg_60;
 1004|   102k|    __m128i m_temp_reg_61;
 1005|   102k|    __m128i m_temp_reg_62;
 1006|   102k|    __m128i m_temp_reg_63;
 1007|   102k|    __m128i m_temp_reg_64;
 1008|   102k|    __m128i m_temp_reg_65;
 1009|   102k|    __m128i m_temp_reg_66;
 1010|   102k|    __m128i m_temp_reg_67;
 1011|   102k|    __m128i m_temp_reg_70;
 1012|   102k|    __m128i m_temp_reg_71;
 1013|   102k|    __m128i m_temp_reg_72;
 1014|   102k|    __m128i m_temp_reg_73;
 1015|   102k|    __m128i m_temp_reg_74;
 1016|   102k|    __m128i m_temp_reg_75;
 1017|   102k|    __m128i m_temp_reg_76;
 1018|   102k|    __m128i m_temp_reg_77;
 1019|   102k|    __m128i m_coeff1, m_coeff2, m_coeff3, m_coeff4;
 1020|       |
 1021|   102k|    WORD32 check_row_stage_1;   /* Lokesh */
 1022|   102k|    WORD32 check_row_stage_2;   /* Lokesh */
 1023|       |
 1024|   102k|    __m128i m_rdng_factor;
 1025|       |    //__m128i m_count;
 1026|   102k|    WORD32 i4_shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   102k|#define IT_SHIFT_STAGE_1 7
  ------------------
 1027|   102k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   102k|#define UNUSED(x) ((void)(x))
  ------------------
 1028|   102k|    UNUSED(zero_cols);
  ------------------
  |  |   38|   102k|#define UNUSED(x) ((void)(x))
  ------------------
 1029|   102k|    UNUSED(pi2_tmp);
  ------------------
  |  |   38|   102k|#define UNUSED(x) ((void)(x))
  ------------------
 1030|       |
 1031|   102k|    check_row_stage_1   = ((zero_rows & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (1031:27): [True: 37.3k, False: 65.2k]
  ------------------
 1032|   102k|    check_row_stage_2   = ((zero_cols & 0xF0) != 0xF0) ? 1 : 0;
  ------------------
  |  Branch (1032:27): [True: 31.0k, False: 71.6k]
  ------------------
 1033|       |
 1034|   102k|    m_temp_reg_70 = _mm_load_si128((__m128i *)pi2_src);
 1035|   102k|    pi2_src += src_strd;
 1036|   102k|    m_temp_reg_71 = _mm_load_si128((__m128i *)pi2_src);
 1037|   102k|    pi2_src += src_strd;
 1038|   102k|    m_temp_reg_72 = _mm_load_si128((__m128i *)pi2_src);
 1039|   102k|    pi2_src += src_strd;
 1040|   102k|    m_temp_reg_73 = _mm_load_si128((__m128i *)pi2_src);
 1041|   102k|    pi2_src += src_strd;
 1042|       |
 1043|   102k|    m_temp_reg_74 = _mm_load_si128((__m128i *)pi2_src);
 1044|   102k|    pi2_src += src_strd;
 1045|   102k|    m_temp_reg_75 = _mm_load_si128((__m128i *)pi2_src);
 1046|   102k|    pi2_src += src_strd;
 1047|   102k|    m_temp_reg_76 = _mm_load_si128((__m128i *)pi2_src);
 1048|   102k|    pi2_src += src_strd;
 1049|   102k|    m_temp_reg_77 = _mm_load_si128((__m128i *)pi2_src);
 1050|       |
 1051|   102k|    if(!check_row_stage_2)
  ------------------
  |  Branch (1051:8): [True: 71.6k, False: 31.0k]
  ------------------
 1052|  71.6k|    {
 1053|  71.6k|        if(!check_row_stage_1)
  ------------------
  |  Branch (1053:12): [True: 58.0k, False: 13.5k]
  ------------------
 1054|  58.0k|        {
 1055|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1056|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1057|  58.0k|            {
 1058|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 1059|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 1060|  58.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1061|  58.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1062|       |
 1063|  58.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1064|       |
 1065|  58.0k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1066|  58.0k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1067|       |
 1068|  58.0k|            }
 1069|       |
 1070|       |
 1071|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1072|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1073|       |            /* as upper 8 bytes are zeros so m_temp_reg_15 and m_temp_reg_17 are not used*/
 1074|  58.0k|            {
 1075|       |
 1076|  58.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 1077|  58.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 1078|       |
 1079|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1080|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1081|  58.0k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1082|       |
 1083|  58.0k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1084|  58.0k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1085|       |
 1086|       |
 1087|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 1088|       |
 1089|  58.0k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1090|  58.0k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1091|       |
 1092|  58.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1093|  58.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1094|       |
 1095|       |
 1096|       |
 1097|       |                /* e */
 1098|       |
 1099|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1100|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1101|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1102|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1103|  58.0k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1104|  58.0k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1105|       |
 1106|  58.0k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1107|  58.0k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1108|       |
 1109|  58.0k|            }
 1110|       |
 1111|       |            /* o */
 1112|  58.0k|            {
 1113|       |
 1114|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1115|  58.0k|                {
 1116|       |
 1117|  58.0k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1118|       |                    //o0:1B*89+3B*75,5B*50+7B*18
 1119|  58.0k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1120|       |
 1121|  58.0k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1122|  58.0k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1123|       |
 1124|       |
 1125|       |
 1126|       |                    /* Column 0 of destination computed here */
 1127|       |                    /* It is stored in m_temp_reg_50 */
 1128|       |                    /* Column 7 of destination computed here */
 1129|       |                    /* It is stored in m_temp_reg_57 */
 1130|       |                    /* Upper 8 bytes of both registers are zero due to zero_cols*/
 1131|       |
 1132|       |
 1133|       |
 1134|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1135|  58.0k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1136|       |
 1137|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1138|  58.0k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1139|       |
 1140|  58.0k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1141|  58.0k|                    m_temp_reg_63 = _mm_setzero_si128();
 1142|  58.0k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1143|       |
 1144|       |                    //o1:1B*75-3B*18,5B*89+7B*50
 1145|  58.0k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1146|       |
 1147|  58.0k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1148|  58.0k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1149|       |
 1150|       |                    /* Loading coeff for computing o2  in the next block */
 1151|       |
 1152|  58.0k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1153|  58.0k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 1154|       |
 1155|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 1156|       |
 1157|       |
 1158|       |
 1159|       |                    /* Column 1 of destination computed here */
 1160|       |                    /* It is stored in m_temp_reg_51 */
 1161|       |                    /* Column 6 of destination computed here */
 1162|       |                    /* It is stored in m_temp_reg_56 */
 1163|       |
 1164|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1165|  58.0k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1166|       |
 1167|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1168|  58.0k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1169|       |
 1170|  58.0k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1171|  58.0k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1172|       |
 1173|       |                    //o2:1B*50-3B*89,5B*18+7B*75
 1174|  58.0k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1175|       |
 1176|  58.0k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1177|  58.0k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1178|       |
 1179|       |
 1180|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1181|       |
 1182|       |                    /* Loading coeff for computing o3  in the next block */
 1183|       |
 1184|  58.0k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1185|  58.0k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 1186|       |
 1187|       |
 1188|       |
 1189|       |                    /* Column 2 of destination computed here */
 1190|       |                    /* It is stored in m_temp_reg_52 */
 1191|       |                    /* Column 5 of destination computed here */
 1192|       |                    /* It is stored in m_temp_reg_55 */
 1193|       |
 1194|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1195|  58.0k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1196|       |
 1197|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1198|  58.0k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1199|       |
 1200|  58.0k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1201|  58.0k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1202|       |
 1203|       |                    //o3:1B*18-3B*50,5B*75-7B*89
 1204|  58.0k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1205|       |
 1206|  58.0k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1207|  58.0k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1208|       |
 1209|       |
 1210|       |
 1211|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1212|       |
 1213|       |
 1214|       |
 1215|       |                    /* Column 3 of destination computed here */
 1216|       |                    /* It is stored in m_temp_reg_53 */
 1217|       |                    /* Column 4 of destination computed here */
 1218|       |                    /* It is stored in m_temp_reg_54 */
 1219|       |
 1220|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1221|  58.0k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1222|       |
 1223|  58.0k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1224|  58.0k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1225|       |
 1226|  58.0k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1227|  58.0k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1228|       |
 1229|       |
 1230|  58.0k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1231|  58.0k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1232|  58.0k|                }
 1233|  58.0k|            }
 1234|       |
 1235|       |            /* Transpose of the destination 8x8 matrix done here */
 1236|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1237|       |            /* respectively */
 1238|  58.0k|            {
 1239|  58.0k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1240|  58.0k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1241|       |                //m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1242|       |                //m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1243|  58.0k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1244|  58.0k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1245|       |                //m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1246|       |                //m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1247|       |
 1248|  58.0k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1249|  58.0k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1250|       |                //m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1251|       |                //m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1252|  58.0k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1253|  58.0k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1254|       |                //m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1255|       |                //m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1256|       |
 1257|  58.0k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1258|  58.0k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1259|  58.0k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1260|  58.0k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1261|       |
 1262|       |                /*m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1263|       |                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1264|       |                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1265|       |                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1266|       |                */
 1267|  58.0k|                m_temp_reg_54 = _mm_setzero_si128();
 1268|  58.0k|                m_temp_reg_55 = _mm_setzero_si128();
 1269|  58.0k|                m_temp_reg_56 = _mm_setzero_si128();
 1270|  58.0k|                m_temp_reg_57 = _mm_setzero_si128();
 1271|  58.0k|            }
 1272|  58.0k|        }
 1273|  13.5k|        else
 1274|  13.5k|        {
 1275|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1276|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1277|  13.5k|            {
 1278|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 1279|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 1280|  13.5k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1281|  13.5k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1282|       |
 1283|  13.5k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1284|       |
 1285|  13.5k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1286|  13.5k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1287|       |
 1288|  13.5k|            }
 1289|       |
 1290|       |
 1291|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1292|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1293|       |            /* as upper 8 bytes are zeros so m_temp_reg_15 and m_temp_reg_17 are not used*/
 1294|  13.5k|            {
 1295|       |
 1296|  13.5k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 1297|  13.5k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 1298|       |
 1299|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1300|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1301|  13.5k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1302|       |
 1303|  13.5k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1304|  13.5k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1305|       |
 1306|       |
 1307|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 1308|       |
 1309|  13.5k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1310|  13.5k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1311|       |
 1312|  13.5k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1313|  13.5k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1314|       |
 1315|       |
 1316|       |
 1317|       |                /* e */
 1318|       |
 1319|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1320|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1321|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1322|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1323|  13.5k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1324|  13.5k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1325|       |
 1326|  13.5k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1327|  13.5k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1328|       |
 1329|  13.5k|            }
 1330|       |
 1331|       |            /* o */
 1332|  13.5k|            {
 1333|       |
 1334|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1335|  13.5k|                {
 1336|       |
 1337|  13.5k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1338|  13.5k|                    m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 1339|       |                    //o0:1B*89+3B*75,5B*50+7B*18
 1340|  13.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1341|  13.5k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1342|       |
 1343|  13.5k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1344|  13.5k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1345|       |
 1346|  13.5k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1347|       |
 1348|       |
 1349|       |
 1350|       |                    /* Column 0 of destination computed here */
 1351|       |                    /* It is stored in m_temp_reg_50 */
 1352|       |                    /* Column 7 of destination computed here */
 1353|       |                    /* It is stored in m_temp_reg_57 */
 1354|       |                    /* Upper 8 bytes of both registers are zero due to zero_cols*/
 1355|       |
 1356|       |
 1357|       |
 1358|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1359|  13.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1360|       |
 1361|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1362|  13.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1363|       |
 1364|  13.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1365|  13.5k|                    m_temp_reg_63 = _mm_setzero_si128();
 1366|  13.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1367|       |
 1368|       |                    //o1:1B*75-3B*18,5B*89+7B*50
 1369|  13.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1370|  13.5k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1371|       |
 1372|  13.5k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1373|  13.5k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1374|       |
 1375|       |                    /* Loading coeff for computing o2  in the next block */
 1376|       |
 1377|  13.5k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1378|  13.5k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 1379|       |
 1380|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 1381|  13.5k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 1382|       |
 1383|       |
 1384|       |
 1385|       |                    /* Column 1 of destination computed here */
 1386|       |                    /* It is stored in m_temp_reg_51 */
 1387|       |                    /* Column 6 of destination computed here */
 1388|       |                    /* It is stored in m_temp_reg_56 */
 1389|       |
 1390|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1391|  13.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1392|       |
 1393|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1394|  13.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1395|       |
 1396|  13.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1397|  13.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1398|       |
 1399|       |                    //o2:1B*50-3B*89,5B*18+7B*75
 1400|  13.5k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1401|  13.5k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1402|       |
 1403|  13.5k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1404|  13.5k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1405|       |
 1406|       |
 1407|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1408|       |
 1409|       |                    /* Loading coeff for computing o3  in the next block */
 1410|       |
 1411|  13.5k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1412|  13.5k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 1413|       |
 1414|  13.5k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1415|       |
 1416|       |
 1417|       |                    /* Column 2 of destination computed here */
 1418|       |                    /* It is stored in m_temp_reg_52 */
 1419|       |                    /* Column 5 of destination computed here */
 1420|       |                    /* It is stored in m_temp_reg_55 */
 1421|       |
 1422|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1423|  13.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1424|       |
 1425|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1426|  13.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1427|       |
 1428|  13.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1429|  13.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1430|       |
 1431|       |                    //o3:1B*18-3B*50,5B*75-7B*89
 1432|  13.5k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1433|  13.5k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1434|       |
 1435|  13.5k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1436|  13.5k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1437|       |
 1438|       |
 1439|       |
 1440|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1441|       |
 1442|  13.5k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 1443|       |
 1444|       |
 1445|       |                    /* Column 3 of destination computed here */
 1446|       |                    /* It is stored in m_temp_reg_53 */
 1447|       |                    /* Column 4 of destination computed here */
 1448|       |                    /* It is stored in m_temp_reg_54 */
 1449|       |
 1450|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1451|  13.5k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1452|       |
 1453|  13.5k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1454|  13.5k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1455|       |
 1456|  13.5k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1457|  13.5k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1458|       |
 1459|       |
 1460|  13.5k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1461|  13.5k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_63);
 1462|  13.5k|                }
 1463|  13.5k|            }
 1464|       |
 1465|       |            /* Transpose of the destination 8x8 matrix done here */
 1466|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1467|       |            /* respectively */
 1468|  13.5k|            {
 1469|  13.5k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1470|  13.5k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1471|       |                //m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1472|       |                //m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1473|  13.5k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1474|  13.5k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1475|       |                //m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1476|       |                //m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1477|       |
 1478|  13.5k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1479|  13.5k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1480|       |                //m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1481|       |                //m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1482|  13.5k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1483|  13.5k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1484|       |                //m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1485|       |                //m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1486|       |
 1487|  13.5k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1488|  13.5k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1489|  13.5k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1490|  13.5k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1491|       |
 1492|       |                /*m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1493|       |                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1494|       |                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1495|       |                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1496|       |                */
 1497|  13.5k|                m_temp_reg_54 = _mm_setzero_si128();
 1498|  13.5k|                m_temp_reg_55 = _mm_setzero_si128();
 1499|  13.5k|                m_temp_reg_56 = _mm_setzero_si128();
 1500|  13.5k|                m_temp_reg_57 = _mm_setzero_si128();
 1501|  13.5k|            }
 1502|  13.5k|        }
 1503|       |
 1504|       |        /* Stage 2 */
 1505|  71.6k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  71.6k|#define IT_SHIFT_STAGE_2 12
  ------------------
 1506|  71.6k|        {
 1507|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1508|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1509|  71.6k|            {
 1510|  71.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 1511|  71.6k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 1512|       |
 1513|  71.6k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 1514|  71.6k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 1515|       |
 1516|  71.6k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1517|  71.6k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1518|  71.6k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1519|  71.6k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1520|       |
 1521|       |
 1522|  71.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 1523|  71.6k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 1524|  71.6k|            }
 1525|       |
 1526|       |
 1527|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1528|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1529|  71.6k|            {
 1530|       |
 1531|  71.6k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 1532|  71.6k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 1533|       |
 1534|       |
 1535|  71.6k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1536|  71.6k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1537|  71.6k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1538|  71.6k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1539|       |
 1540|       |                /* Loading coeff for computing o0 in the next block */
 1541|  71.6k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1542|       |
 1543|       |
 1544|  71.6k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 1545|  71.6k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_51, m_temp_reg_53);
 1546|       |
 1547|       |
 1548|       |
 1549|       |                /* e */
 1550|       |
 1551|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1552|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1553|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1554|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1555|  71.6k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1556|  71.6k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1557|       |
 1558|  71.6k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1559|  71.6k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1560|       |
 1561|  71.6k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1562|  71.6k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1563|       |
 1564|  71.6k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1565|  71.6k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1566|       |
 1567|  71.6k|            }
 1568|       |
 1569|       |            /* o */
 1570|  71.6k|            {
 1571|       |
 1572|       |                //m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_55,m_temp_reg_57);
 1573|       |                //m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_55,m_temp_reg_57);
 1574|       |
 1575|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1576|  71.6k|                {
 1577|       |                    //o0:1B*89+3B*75,1T*89+3T*75
 1578|  71.6k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1579|  71.6k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1580|       |
 1581|  71.6k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1582|  71.6k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1583|       |                    /* Loading coeff for computing o1 in the next block */
 1584|  71.6k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1585|       |
 1586|       |
 1587|       |
 1588|       |                    /* Column 0 of destination computed here */
 1589|       |                    /* It is stored in m_temp_reg_50 */
 1590|       |                    /* Column 7 of destination computed here */
 1591|       |                    /* It is stored in m_temp_reg_57 */
 1592|       |
 1593|  71.6k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1594|  71.6k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1595|       |
 1596|  71.6k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1597|  71.6k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1598|       |
 1599|  71.6k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1600|  71.6k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1601|  71.6k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1602|  71.6k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 1603|       |
 1604|       |                    //o1:1B*75-3B*18,1T*75-3T*18
 1605|  71.6k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1606|  71.6k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1607|       |
 1608|  71.6k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1609|  71.6k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1610|  71.6k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1611|  71.6k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1612|       |
 1613|  71.6k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1614|  71.6k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 1615|       |
 1616|       |
 1617|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 1618|       |
 1619|       |
 1620|       |                    /* Loading coeff for computing o2  in the next block */
 1621|  71.6k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1622|       |
 1623|       |
 1624|       |
 1625|       |                    /* Column 1 of destination computed here */
 1626|       |                    /* It is stored in m_temp_reg_51 */
 1627|       |                    /* Column 6 of destination computed here */
 1628|       |                    /* It is stored in m_temp_reg_56 */
 1629|       |
 1630|  71.6k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1631|  71.6k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1632|       |
 1633|  71.6k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1634|  71.6k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1635|       |
 1636|  71.6k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1637|  71.6k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1638|  71.6k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1639|  71.6k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 1640|       |
 1641|       |                    //o2:1B*50-3B*89,5T*18+7T*75.
 1642|  71.6k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1643|  71.6k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1644|       |
 1645|  71.6k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1646|  71.6k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1647|  71.6k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1648|  71.6k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1649|       |
 1650|  71.6k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1651|  71.6k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 1652|       |
 1653|       |
 1654|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1655|       |
 1656|       |                    /* Loading coeff for computing o3  in the next block */
 1657|       |
 1658|  71.6k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1659|       |
 1660|       |
 1661|       |                    /* Column 2 of destination computed here */
 1662|       |                    /* It is stored in m_temp_reg_52 */
 1663|       |                    /* Column 5 of destination computed here */
 1664|       |                    /* It is stored in m_temp_reg_55 */
 1665|       |
 1666|  71.6k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 1667|  71.6k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 1668|       |
 1669|  71.6k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 1670|  71.6k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 1671|       |
 1672|  71.6k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 1673|  71.6k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 1674|  71.6k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 1675|  71.6k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 1676|       |
 1677|       |                    //o3:1B*18-3B*50,1T*18-3T*50
 1678|  71.6k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 1679|  71.6k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 1680|       |
 1681|  71.6k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 1682|  71.6k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 1683|  71.6k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 1684|  71.6k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 1685|       |
 1686|       |
 1687|  71.6k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 1688|  71.6k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 1689|       |
 1690|       |
 1691|       |
 1692|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 1693|       |
 1694|       |
 1695|       |                    /* Column 3 of destination computed here */
 1696|       |                    /* It is stored in m_temp_reg_53 */
 1697|       |                    /* Column 4 of destination computed here */
 1698|       |                    /* It is stored in m_temp_reg_54 */
 1699|       |
 1700|  71.6k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 1701|  71.6k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 1702|       |
 1703|  71.6k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 1704|  71.6k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 1705|       |
 1706|  71.6k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 1707|  71.6k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 1708|  71.6k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 1709|  71.6k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 1710|       |
 1711|  71.6k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 1712|  71.6k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 1713|  71.6k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 1714|  71.6k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 1715|       |
 1716|  71.6k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 1717|  71.6k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 1718|  71.6k|                }
 1719|  71.6k|            }
 1720|       |
 1721|       |            /* Transpose of the destination 8x8 matrix done here */
 1722|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 1723|       |            /* respectively */
 1724|  71.6k|            {
 1725|  71.6k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 1726|  71.6k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 1727|  71.6k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 1728|  71.6k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 1729|  71.6k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 1730|  71.6k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 1731|  71.6k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 1732|  71.6k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 1733|       |
 1734|  71.6k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 1735|  71.6k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 1736|  71.6k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 1737|  71.6k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 1738|  71.6k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 1739|  71.6k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 1740|  71.6k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 1741|  71.6k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 1742|  71.6k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 1743|  71.6k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 1744|  71.6k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 1745|  71.6k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 1746|       |
 1747|  71.6k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 1748|  71.6k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 1749|  71.6k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 1750|  71.6k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 1751|  71.6k|            }
 1752|       |
 1753|       |            /* Recon and store */
 1754|  71.6k|            {
 1755|  71.6k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1756|  71.6k|                pu1_pred += pred_strd;
 1757|  71.6k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1758|  71.6k|                pu1_pred += pred_strd;
 1759|  71.6k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1760|  71.6k|                pu1_pred += pred_strd;
 1761|  71.6k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1762|  71.6k|                pu1_pred += pred_strd;
 1763|  71.6k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1764|  71.6k|                pu1_pred += pred_strd;
 1765|  71.6k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1766|  71.6k|                pu1_pred += pred_strd;
 1767|  71.6k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1768|  71.6k|                pu1_pred += pred_strd;
 1769|  71.6k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 1770|       |
 1771|  71.6k|                m_temp_reg_50 = _mm_setzero_si128();
 1772|  71.6k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 1773|  71.6k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 1774|  71.6k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 1775|  71.6k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 1776|  71.6k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 1777|  71.6k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 1778|  71.6k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 1779|  71.6k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 1780|       |
 1781|  71.6k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 1782|  71.6k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 1783|  71.6k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 1784|  71.6k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 1785|  71.6k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 1786|  71.6k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 1787|  71.6k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 1788|  71.6k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 1789|       |
 1790|  71.6k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 1791|  71.6k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 1792|  71.6k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 1793|  71.6k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 1794|  71.6k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 1795|  71.6k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 1796|  71.6k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 1797|  71.6k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 1798|       |
 1799|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 1800|  71.6k|                pu1_dst += dst_strd;
 1801|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 1802|  71.6k|                pu1_dst += dst_strd;
 1803|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 1804|  71.6k|                pu1_dst += dst_strd;
 1805|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 1806|  71.6k|                pu1_dst += dst_strd;
 1807|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 1808|  71.6k|                pu1_dst += dst_strd;
 1809|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 1810|  71.6k|                pu1_dst += dst_strd;
 1811|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 1812|  71.6k|                pu1_dst += dst_strd;
 1813|  71.6k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 1814|  71.6k|                pu1_dst += dst_strd;
 1815|  71.6k|            }
 1816|  71.6k|        }
 1817|  71.6k|    }
 1818|  31.0k|    else
 1819|       |
 1820|  31.0k|    {
 1821|       |
 1822|       |        /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1823|       |        /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1824|  31.0k|        if(!check_row_stage_1)
  ------------------
  |  Branch (1824:12): [True: 7.25k, False: 23.7k]
  ------------------
 1825|  7.25k|        {
 1826|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 1827|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 1828|  7.25k|            {
 1829|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 1830|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 1831|  7.25k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 1832|  7.25k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 1833|       |
 1834|  7.25k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 1835|  7.25k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 1836|       |
 1837|  7.25k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 1838|  7.25k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 1839|       |
 1840|       |
 1841|  7.25k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 1842|  7.25k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 1843|  7.25k|            }
 1844|       |
 1845|       |
 1846|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 1847|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 1848|  7.25k|            {
 1849|       |
 1850|  7.25k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 1851|  7.25k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 1852|       |
 1853|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 1854|       |                //Interleaving 2,6 row in 4, 5 Rishab
 1855|  7.25k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 1856|  7.25k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 1857|       |
 1858|  7.25k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 1859|  7.25k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 1860|       |
 1861|  7.25k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 1862|  7.25k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 1863|       |
 1864|       |
 1865|       |
 1866|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 1867|       |
 1868|  7.25k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 1869|       |                //m_coeff4 = _mm_loadu_si128((__m128i *) &g_ai2_ihevc_trans_intr_odd_8[3][0]);
 1870|       |
 1871|  7.25k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 1872|       |                //m_coeff2 = _mm_loadu_si128((__m128i *) &g_ai2_ihevc_trans_intr_odd_8[1][0]);
 1873|       |
 1874|  7.25k|            }
 1875|       |
 1876|       |            /* e */
 1877|  7.25k|            {
 1878|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 1879|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 1880|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 1881|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 1882|  7.25k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 1883|  7.25k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 1884|       |
 1885|  7.25k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 1886|  7.25k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 1887|       |
 1888|  7.25k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 1889|  7.25k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 1890|       |
 1891|  7.25k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 1892|  7.25k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 1893|       |
 1894|  7.25k|            }
 1895|       |
 1896|       |            /* o */
 1897|  7.25k|            {
 1898|       |
 1899|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 1900|  7.25k|                {
 1901|       |
 1902|  7.25k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 1903|  7.25k|                    m_temp_reg_61 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 1904|       |                    //  m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75,m_temp_reg_77);
 1905|       |                    //   m_temp_reg_65 = _mm_unpackhi_epi16(m_temp_reg_75,m_temp_reg_77);
 1906|       |                    //o0:1B*89+3B*75,1T*89+3T*75
 1907|  7.25k|                    m_temp_reg_30 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1908|  7.25k|                    m_temp_reg_31 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1909|       |                    //m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 1910|       |                    //m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 1911|       |
 1912|       |
 1913|  7.25k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 1914|  7.25k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 1915|       |
 1916|       |                    //m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1917|       |                    //m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 1918|  7.25k|                }
 1919|       |
 1920|       |                /* Column 0 of destination computed here */
 1921|       |                /* It is stored in m_temp_reg_50 */
 1922|       |                /* Column 7 of destination computed here */
 1923|       |                /* It is stored in m_temp_reg_57 */
 1924|  7.25k|                {
 1925|       |
 1926|       |
 1927|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 1928|  7.25k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 1929|       |
 1930|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 1931|  7.25k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 1932|       |
 1933|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1934|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1935|  7.25k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1936|  7.25k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1937|       |
 1938|  7.25k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1939|  7.25k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1940|  7.25k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1941|  7.25k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1942|       |
 1943|       |                    //o1:1B*75-3B*18,1T*75-3T*18,5B*89+7B*50,5T*89+7T*50
 1944|  7.25k|                    m_temp_reg_32 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 1945|       |                    //m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 1946|  7.25k|                    m_temp_reg_33 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 1947|       |                    //m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 1948|       |
 1949|  7.25k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1950|  7.25k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1951|       |
 1952|       |                    /* Loading coeff for computing o2  in the next block */
 1953|       |
 1954|  7.25k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 1955|       |
 1956|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 1957|       |                    //m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 1958|       |                    //m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 1959|  7.25k|                }
 1960|       |
 1961|       |                /* Column 1 of destination computed here */
 1962|       |                /* It is stored in m_temp_reg_51 */
 1963|       |                /* Column 6 of destination computed here */
 1964|       |                /* It is stored in m_temp_reg_56 */
 1965|  7.25k|                {
 1966|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 1967|  7.25k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 1968|       |
 1969|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 1970|  7.25k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 1971|       |
 1972|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 1973|  7.25k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 1974|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 1975|  7.25k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 1976|       |
 1977|  7.25k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 1978|  7.25k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 1979|  7.25k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 1980|  7.25k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 1981|       |
 1982|       |                    //o2:1B*50-3B*89,1T*50-3T*89
 1983|  7.25k|                    m_temp_reg_34 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 1984|  7.25k|                    m_temp_reg_35 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 1985|       |
 1986|  7.25k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 1987|  7.25k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 1988|       |
 1989|       |
 1990|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 1991|       |
 1992|       |
 1993|       |                    /* Loading coeff for computing o3  in the next block */
 1994|       |
 1995|  7.25k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 1996|       |
 1997|       |                    //m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 1998|       |                    //m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 1999|  7.25k|                }
 2000|       |
 2001|       |                /* Column 2 of destination computed here */
 2002|       |                /* It is stored in m_temp_reg_52 */
 2003|       |                /* Column 5 of destination computed here */
 2004|       |                /* It is stored in m_temp_reg_55 */
 2005|  7.25k|                {
 2006|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2007|  7.25k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2008|       |
 2009|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2010|  7.25k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2011|       |
 2012|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2013|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2014|  7.25k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2015|  7.25k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2016|       |
 2017|  7.25k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2018|  7.25k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2019|  7.25k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2020|  7.25k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2021|       |
 2022|       |                    //o3:1B*18-3B*50,1T*18-3T*50
 2023|  7.25k|                    m_temp_reg_36 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2024|  7.25k|                    m_temp_reg_37 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2025|       |
 2026|  7.25k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2027|  7.25k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2028|       |
 2029|       |
 2030|       |
 2031|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 2032|       |
 2033|       |
 2034|  7.25k|                }
 2035|       |
 2036|       |                /* Column 3 of destination computed here */
 2037|       |                /* It is stored in m_temp_reg_53 */
 2038|       |                /* Column 4 of destination computed here */
 2039|       |                /* It is stored in m_temp_reg_54 */
 2040|  7.25k|                {
 2041|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2042|  7.25k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2043|       |
 2044|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2045|  7.25k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2046|       |
 2047|  7.25k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2048|  7.25k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2049|  7.25k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2050|  7.25k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2051|       |
 2052|  7.25k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2053|  7.25k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2054|  7.25k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2055|  7.25k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2056|       |
 2057|  7.25k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2058|  7.25k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2059|  7.25k|                }
 2060|  7.25k|            }
 2061|       |
 2062|       |            /* Transpose of the destination 8x8 matrix done here */
 2063|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 2064|       |            /* respectively */
 2065|  7.25k|            {
 2066|       |
 2067|       |
 2068|  7.25k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2069|  7.25k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2070|  7.25k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2071|  7.25k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2072|  7.25k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2073|  7.25k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2074|  7.25k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2075|  7.25k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2076|       |
 2077|  7.25k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2078|  7.25k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2079|  7.25k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2080|  7.25k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2081|  7.25k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2082|  7.25k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2083|  7.25k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2084|  7.25k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2085|       |
 2086|  7.25k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2087|  7.25k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2088|  7.25k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2089|  7.25k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2090|       |
 2091|  7.25k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2092|  7.25k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2093|  7.25k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2094|  7.25k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2095|  7.25k|            }
 2096|  7.25k|        }
 2097|  23.7k|        else
 2098|  23.7k|        {
 2099|       |
 2100|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 2101|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 2102|  23.7k|            {
 2103|       |                //Interleaving 0,4 row in 0 , 1 Rishab
 2104|       |                /*coef2 for m_temp_reg_12 and m_temp_reg_13 , coef1 for m_temp_reg_10 and m_temp_reg_11*/
 2105|  23.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]);
 2106|  23.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]);
 2107|       |
 2108|  23.7k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_70, m_temp_reg_74);
 2109|  23.7k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_70, m_temp_reg_74);
 2110|       |
 2111|  23.7k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2112|  23.7k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2113|       |
 2114|       |
 2115|  23.7k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2116|  23.7k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2117|  23.7k|            }
 2118|       |
 2119|       |
 2120|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 2121|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 2122|  23.7k|            {
 2123|       |
 2124|  23.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]); //sub 2B*36-6B*83 ,2T*36-6T*83
 2125|  23.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]); //add 2B*83+6B*36 ,2T*83+6T*36
 2126|       |
 2127|       |                /* Combining instructions to eliminate them based on zero_rows : Lokesh */
 2128|       |                //Interleaving 2,6 row in 4, 5 Rishab
 2129|  23.7k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_72, m_temp_reg_76);
 2130|  23.7k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_72, m_temp_reg_76);
 2131|       |
 2132|  23.7k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_4, m_coeff1);
 2133|  23.7k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2134|       |
 2135|  23.7k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_5, m_coeff1);
 2136|  23.7k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2137|       |
 2138|       |
 2139|       |
 2140|       |                /* Loading coeff for computing o0, o1, o2 and o3 in the next block */
 2141|       |
 2142|  23.7k|                m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 2143|  23.7k|                m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 2144|       |
 2145|  23.7k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 2146|  23.7k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 2147|       |
 2148|  23.7k|            }
 2149|       |
 2150|       |            /* e */
 2151|  23.7k|            {
 2152|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 2153|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 2154|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 2155|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 2156|  23.7k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 2157|  23.7k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 2158|       |
 2159|  23.7k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 2160|  23.7k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 2161|       |
 2162|  23.7k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 2163|  23.7k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 2164|       |
 2165|  23.7k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 2166|  23.7k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 2167|       |
 2168|  23.7k|            }
 2169|       |
 2170|       |            /* o */
 2171|  23.7k|            {
 2172|       |
 2173|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 2174|  23.7k|                {
 2175|       |
 2176|  23.7k|                    m_temp_reg_60 = _mm_unpacklo_epi16(m_temp_reg_71, m_temp_reg_73);
 2177|  23.7k|                    m_temp_reg_61 = _mm_unpackhi_epi16(m_temp_reg_71, m_temp_reg_73);
 2178|  23.7k|                    m_temp_reg_64 = _mm_unpacklo_epi16(m_temp_reg_75, m_temp_reg_77);
 2179|  23.7k|                    m_temp_reg_65 = _mm_unpackhi_epi16(m_temp_reg_75, m_temp_reg_77);
 2180|       |                    //o0:1B*89+3B*75,1T*89+3T*75,5B*50+7B*18,5T*50+7T*18
 2181|  23.7k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 2182|  23.7k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 2183|  23.7k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 2184|  23.7k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 2185|       |
 2186|       |
 2187|  23.7k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2188|  23.7k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 2189|       |
 2190|  23.7k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2191|  23.7k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2192|  23.7k|                }
 2193|       |
 2194|       |                /* Column 0 of destination computed here */
 2195|       |                /* It is stored in m_temp_reg_50 */
 2196|       |                /* Column 7 of destination computed here */
 2197|       |                /* It is stored in m_temp_reg_57 */
 2198|  23.7k|                {
 2199|       |
 2200|       |
 2201|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2202|  23.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2203|       |
 2204|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2205|  23.7k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2206|       |
 2207|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2208|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2209|  23.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2210|  23.7k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2211|       |
 2212|  23.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2213|  23.7k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2214|  23.7k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2215|  23.7k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2216|       |
 2217|       |                    //o1:1B*75-3B*18,1T*75-3T*18,5B*89+7B*50,5T*89+7T*50
 2218|  23.7k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2219|  23.7k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 2220|  23.7k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2221|  23.7k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2222|       |
 2223|  23.7k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2224|  23.7k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2225|       |
 2226|       |                    /* Loading coeff for computing o2  in the next block */
 2227|       |
 2228|  23.7k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2229|  23.7k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 2230|       |
 2231|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 2232|  23.7k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2233|  23.7k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2234|  23.7k|                }
 2235|       |
 2236|       |                /* Column 1 of destination computed here */
 2237|       |                /* It is stored in m_temp_reg_51 */
 2238|       |                /* Column 6 of destination computed here */
 2239|       |                /* It is stored in m_temp_reg_56 */
 2240|  23.7k|                {
 2241|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2242|  23.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2243|       |
 2244|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2245|  23.7k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2246|       |
 2247|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2248|  23.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2249|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2250|  23.7k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2251|       |
 2252|  23.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2253|  23.7k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2254|  23.7k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2255|  23.7k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2256|       |
 2257|       |                    //o2:1B*50-3B*89,1T*50-3T*89,5B*18+7B*75,5T*18+7T*75
 2258|  23.7k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_60, m_coeff1);
 2259|  23.7k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_64, m_coeff2);
 2260|  23.7k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_61, m_coeff1);
 2261|  23.7k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_65, m_coeff2);
 2262|       |
 2263|  23.7k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2264|  23.7k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2265|       |
 2266|       |
 2267|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 2268|       |
 2269|       |
 2270|       |                    /* Loading coeff for computing o3  in the next block */
 2271|       |
 2272|  23.7k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2273|  23.7k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2274|       |
 2275|  23.7k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2276|  23.7k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2277|  23.7k|                }
 2278|       |
 2279|       |                /* Column 2 of destination computed here */
 2280|       |                /* It is stored in m_temp_reg_52 */
 2281|       |                /* Column 5 of destination computed here */
 2282|       |                /* It is stored in m_temp_reg_55 */
 2283|  23.7k|                {
 2284|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2285|  23.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2286|       |
 2287|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2288|  23.7k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2289|       |
 2290|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2291|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2292|  23.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2293|  23.7k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2294|       |
 2295|  23.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2296|  23.7k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2297|  23.7k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2298|  23.7k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2299|       |
 2300|       |                    //o3:1B*18-3B*50,1T*18-3T*50,5B*75-7B*89,5T*75-7T*89
 2301|  23.7k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_60, m_coeff3);
 2302|  23.7k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_64, m_coeff4);
 2303|  23.7k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_61, m_coeff3);
 2304|  23.7k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_65, m_coeff4);
 2305|       |
 2306|  23.7k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2307|  23.7k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2308|       |
 2309|       |
 2310|       |
 2311|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 2312|       |
 2313|       |
 2314|  23.7k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2315|  23.7k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2316|  23.7k|                }
 2317|       |
 2318|       |                /* Column 3 of destination computed here */
 2319|       |                /* It is stored in m_temp_reg_53 */
 2320|       |                /* Column 4 of destination computed here */
 2321|       |                /* It is stored in m_temp_reg_54 */
 2322|  23.7k|                {
 2323|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2324|  23.7k|                    m_temp_reg_66 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2325|       |
 2326|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2327|  23.7k|                    m_temp_reg_67 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2328|       |
 2329|  23.7k|                    m_temp_reg_62 = _mm_add_epi32(m_temp_reg_62, m_rdng_factor);
 2330|  23.7k|                    m_temp_reg_63 = _mm_add_epi32(m_temp_reg_63, m_rdng_factor);
 2331|  23.7k|                    m_temp_reg_66 = _mm_add_epi32(m_temp_reg_66, m_rdng_factor);
 2332|  23.7k|                    m_temp_reg_67 = _mm_add_epi32(m_temp_reg_67, m_rdng_factor);
 2333|       |
 2334|  23.7k|                    m_temp_reg_62 = _mm_srai_epi32(m_temp_reg_62, i4_shift);
 2335|  23.7k|                    m_temp_reg_63 = _mm_srai_epi32(m_temp_reg_63, i4_shift);
 2336|  23.7k|                    m_temp_reg_66 = _mm_srai_epi32(m_temp_reg_66, i4_shift);
 2337|  23.7k|                    m_temp_reg_67 = _mm_srai_epi32(m_temp_reg_67, i4_shift);
 2338|       |
 2339|  23.7k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_62, m_temp_reg_63);
 2340|  23.7k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_66, m_temp_reg_67);
 2341|  23.7k|                }
 2342|  23.7k|            }
 2343|       |
 2344|       |            /* Transpose of the destination 8x8 matrix done here */
 2345|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 2346|       |            /* respectively */
 2347|  23.7k|            {
 2348|       |
 2349|       |
 2350|  23.7k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2351|  23.7k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2352|  23.7k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2353|  23.7k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2354|  23.7k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2355|  23.7k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2356|  23.7k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2357|  23.7k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2358|       |
 2359|  23.7k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2360|  23.7k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2361|  23.7k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2362|  23.7k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2363|  23.7k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2364|  23.7k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2365|  23.7k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2366|  23.7k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2367|       |
 2368|  23.7k|                m_temp_reg_50 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2369|  23.7k|                m_temp_reg_51 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2370|  23.7k|                m_temp_reg_52 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2371|  23.7k|                m_temp_reg_53 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2372|       |
 2373|  23.7k|                m_temp_reg_54 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2374|  23.7k|                m_temp_reg_55 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2375|  23.7k|                m_temp_reg_56 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2376|  23.7k|                m_temp_reg_57 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2377|  23.7k|            }
 2378|  23.7k|        }
 2379|       |        /* Stage 2 */
 2380|       |
 2381|  31.0k|        i4_shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  31.0k|#define IT_SHIFT_STAGE_2 12
  ------------------
 2382|       |
 2383|  31.0k|        {
 2384|       |
 2385|       |            /* ee0 is present in the registers m_temp_reg_10 and m_temp_reg_11 */
 2386|       |            /* ee1 is present in the registers m_temp_reg_12 and m_temp_reg_13 */
 2387|  31.0k|            {
 2388|  31.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[0][0]); //add
 2389|  31.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[3][0]); //sub
 2390|       |
 2391|  31.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_54);
 2392|  31.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_54);
 2393|       |
 2394|  31.0k|                m_temp_reg_10 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2395|  31.0k|                m_temp_reg_12 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2396|  31.0k|                m_temp_reg_11 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2397|  31.0k|                m_temp_reg_13 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2398|       |
 2399|       |
 2400|  31.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[1][0]);
 2401|  31.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_even_8[2][0]);
 2402|  31.0k|            }
 2403|       |
 2404|       |
 2405|       |            /* eo0 is present in the registers m_temp_reg_14 and m_temp_reg_15 */
 2406|       |            /* eo1 is present in the registers m_temp_reg_16 and m_temp_reg_17 */
 2407|  31.0k|            {
 2408|       |                //m_temp_reg_66 = _mm_mullo_epi32(m_temp_reg_2, m_coeff1);
 2409|       |                //m_temp_reg_64 = _mm_mullo_epi32(m_temp_reg_0, m_coeff2);
 2410|       |                //m_temp_reg_62 = _mm_mullo_epi32(m_temp_reg_2, m_coeff2);
 2411|       |                //m_temp_reg_60 = _mm_mullo_epi32(m_temp_reg_0, m_coeff1);
 2412|  31.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_56);
 2413|  31.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_56);
 2414|       |
 2415|       |
 2416|  31.0k|                m_temp_reg_16 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2417|  31.0k|                m_temp_reg_14 = _mm_madd_epi16(m_temp_reg_0, m_coeff2);
 2418|  31.0k|                m_temp_reg_17 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2419|  31.0k|                m_temp_reg_15 = _mm_madd_epi16(m_temp_reg_1, m_coeff2);
 2420|       |
 2421|       |                //m_temp_reg_16 = _mm_sub_epi32(m_temp_reg_64, m_temp_reg_66);
 2422|       |                //m_temp_reg_14 = _mm_add_epi32(m_temp_reg_60, m_temp_reg_62);
 2423|       |
 2424|       |                /* Loading coeff for computing o0 in the next block */
 2425|  31.0k|                m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[0][0]);
 2426|  31.0k|                m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[1][0]);
 2427|       |
 2428|       |
 2429|  31.0k|                m_temp_reg_0 = _mm_unpacklo_epi16(m_temp_reg_51, m_temp_reg_53);
 2430|  31.0k|                m_temp_reg_1 = _mm_unpackhi_epi16(m_temp_reg_51, m_temp_reg_53);
 2431|       |                /*m_temp_reg_3 = _mm_srli_si128(m_temp_reg_53, 8);
 2432|       |                m_temp_reg_1 = _mm_cvtepi16_epi32(m_temp_reg_1);
 2433|       |                m_temp_reg_3 = _mm_cvtepi16_epi32(m_temp_reg_3);
 2434|       |                */
 2435|       |
 2436|  31.0k|            }
 2437|       |
 2438|       |            /* e */
 2439|  31.0k|            {
 2440|       |                /* e0 stored in m_temp_reg_40 and m_temp_reg_41 */
 2441|       |                /* e1 stored in m_temp_reg_42 and m_temp_reg_43 */
 2442|       |                /* e3 stored in m_temp_reg_46 and m_temp_reg_47 */
 2443|       |                /* e2 stored in m_temp_reg_44 and m_temp_reg_45 */
 2444|  31.0k|                m_temp_reg_42 = _mm_add_epi32(m_temp_reg_12, m_temp_reg_16);
 2445|  31.0k|                m_temp_reg_44 = _mm_sub_epi32(m_temp_reg_12, m_temp_reg_16);
 2446|       |
 2447|  31.0k|                m_temp_reg_40 = _mm_add_epi32(m_temp_reg_10, m_temp_reg_14);
 2448|  31.0k|                m_temp_reg_46 = _mm_sub_epi32(m_temp_reg_10, m_temp_reg_14);
 2449|       |
 2450|  31.0k|                m_temp_reg_43 = _mm_add_epi32(m_temp_reg_13, m_temp_reg_17);
 2451|  31.0k|                m_temp_reg_45 = _mm_sub_epi32(m_temp_reg_13, m_temp_reg_17);
 2452|       |
 2453|  31.0k|                m_temp_reg_41 = _mm_add_epi32(m_temp_reg_11, m_temp_reg_15);
 2454|  31.0k|                m_temp_reg_47 = _mm_sub_epi32(m_temp_reg_11, m_temp_reg_15);
 2455|       |
 2456|  31.0k|            }
 2457|       |
 2458|       |            /* o */
 2459|  31.0k|            {
 2460|       |                /*  m_temp_reg_4 = _mm_cvtepi16_epi32(m_temp_reg_55);
 2461|       |                    m_temp_reg_5 = _mm_srli_si128(m_temp_reg_55, 8);
 2462|       |                    m_temp_reg_6 = _mm_cvtepi16_epi32(m_temp_reg_57);
 2463|       |                    m_temp_reg_7 = _mm_srli_si128(m_temp_reg_57, 8);
 2464|       |                    m_temp_reg_5 = _mm_cvtepi16_epi32(m_temp_reg_5);
 2465|       |                    m_temp_reg_7 = _mm_cvtepi16_epi32(m_temp_reg_7);
 2466|       |                    */
 2467|  31.0k|                m_temp_reg_4 = _mm_unpacklo_epi16(m_temp_reg_55, m_temp_reg_57);
 2468|  31.0k|                m_temp_reg_5 = _mm_unpackhi_epi16(m_temp_reg_55, m_temp_reg_57);
 2469|       |
 2470|       |                /* o0 stored in m_temp_reg_30 and m_temp_reg_31 */
 2471|  31.0k|                {
 2472|       |                    //o0:1B*89+3B*75,1T*89+3T*75,5B*50+7B*18,5T*50+7T*18
 2473|  31.0k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2474|  31.0k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2475|  31.0k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2476|  31.0k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2477|       |
 2478|  31.0k|                    m_rdng_factor = _mm_cvtsi32_si128((1 << (i4_shift - 1)));
 2479|  31.0k|                    m_rdng_factor = _mm_shuffle_epi32(m_rdng_factor, 0x0000);
 2480|       |                    /* Loading coeff for computing o1 in the next block */
 2481|  31.0k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[2][0]);
 2482|  31.0k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[3][0]);
 2483|       |
 2484|  31.0k|                    m_temp_reg_30 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2485|  31.0k|                    m_temp_reg_31 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2486|  31.0k|                }
 2487|       |
 2488|       |                /* Column 0 of destination computed here */
 2489|       |                /* It is stored in m_temp_reg_50 */
 2490|       |                /* Column 7 of destination computed here */
 2491|       |                /* It is stored in m_temp_reg_57 */
 2492|  31.0k|                {
 2493|  31.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_40, m_temp_reg_30);
 2494|  31.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_40, m_temp_reg_30);
 2495|       |
 2496|  31.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_41, m_temp_reg_31);
 2497|  31.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_41, m_temp_reg_31);
 2498|       |
 2499|  31.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2500|  31.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2501|  31.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2502|  31.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2503|       |
 2504|  31.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2505|  31.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2506|  31.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2507|  31.0k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 2508|       |
 2509|       |                    //o1:1B*75-3B*18,1T*75-3T*18,5B*89+7B*50,5T*89+7T*50
 2510|  31.0k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2511|  31.0k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2512|  31.0k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2513|  31.0k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2514|       |
 2515|  31.0k|                    m_temp_reg_50 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2516|  31.0k|                    m_temp_reg_57 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 2517|       |
 2518|       |
 2519|       |                    /* o1 stored in m_temp_reg_32 and m_temp_reg_33 */
 2520|       |
 2521|       |
 2522|       |                    /* Loading coeff for computing o2  in the next block */
 2523|  31.0k|                    m_coeff1 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[4][0]);
 2524|  31.0k|                    m_coeff2 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[5][0]);
 2525|       |
 2526|  31.0k|                    m_temp_reg_32 = _mm_sub_epi32(m_temp_reg_22, m_temp_reg_26);
 2527|  31.0k|                    m_temp_reg_33 = _mm_sub_epi32(m_temp_reg_23, m_temp_reg_27);
 2528|  31.0k|                }
 2529|       |
 2530|       |                /* Column 1 of destination computed here */
 2531|       |                /* It is stored in m_temp_reg_51 */
 2532|       |                /* Column 6 of destination computed here */
 2533|       |                /* It is stored in m_temp_reg_56 */
 2534|  31.0k|                {
 2535|  31.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_42, m_temp_reg_32);
 2536|  31.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_42, m_temp_reg_32);
 2537|       |
 2538|  31.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_43, m_temp_reg_33);
 2539|  31.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_43, m_temp_reg_33);
 2540|       |
 2541|  31.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2542|  31.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2543|  31.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2544|  31.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2545|       |
 2546|  31.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2547|  31.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2548|  31.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2549|  31.0k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 2550|       |
 2551|       |                    //o2:1B*50-3B*89,1T*50-3T*89,5B*18+7B*75,5T*18+7T*75
 2552|  31.0k|                    m_temp_reg_20 = _mm_madd_epi16(m_temp_reg_0, m_coeff1);
 2553|  31.0k|                    m_temp_reg_24 = _mm_madd_epi16(m_temp_reg_4, m_coeff2);
 2554|  31.0k|                    m_temp_reg_21 = _mm_madd_epi16(m_temp_reg_1, m_coeff1);
 2555|  31.0k|                    m_temp_reg_25 = _mm_madd_epi16(m_temp_reg_5, m_coeff2);
 2556|       |
 2557|  31.0k|                    m_temp_reg_51 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2558|  31.0k|                    m_temp_reg_56 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 2559|       |
 2560|       |
 2561|       |                    /* o2 stored in m_temp_reg_34 and m_temp_reg_35 */
 2562|       |
 2563|       |                    /* Loading coeff for computing o3  in the next block */
 2564|       |
 2565|  31.0k|                    m_coeff3 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[6][0]);
 2566|  31.0k|                    m_coeff4 = _mm_load_si128((__m128i *)&g_ai2_ihevc_trans_intr_odd_8[7][0]);
 2567|       |
 2568|  31.0k|                    m_temp_reg_34 = _mm_add_epi32(m_temp_reg_20, m_temp_reg_24);
 2569|  31.0k|                    m_temp_reg_35 = _mm_add_epi32(m_temp_reg_21, m_temp_reg_25);
 2570|  31.0k|                }
 2571|       |
 2572|       |                /* Column 2 of destination computed here */
 2573|       |                /* It is stored in m_temp_reg_52 */
 2574|       |                /* Column 5 of destination computed here */
 2575|       |                /* It is stored in m_temp_reg_55 */
 2576|  31.0k|                {
 2577|  31.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_44, m_temp_reg_34);
 2578|  31.0k|                    m_temp_reg_6 = _mm_sub_epi32(m_temp_reg_44, m_temp_reg_34);
 2579|       |
 2580|  31.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_45, m_temp_reg_35);
 2581|  31.0k|                    m_temp_reg_7 = _mm_sub_epi32(m_temp_reg_45, m_temp_reg_35);
 2582|       |
 2583|  31.0k|                    m_temp_reg_2 = _mm_add_epi32(m_temp_reg_2, m_rdng_factor);
 2584|  31.0k|                    m_temp_reg_3 = _mm_add_epi32(m_temp_reg_3, m_rdng_factor);
 2585|  31.0k|                    m_temp_reg_6 = _mm_add_epi32(m_temp_reg_6, m_rdng_factor);
 2586|  31.0k|                    m_temp_reg_7 = _mm_add_epi32(m_temp_reg_7, m_rdng_factor);
 2587|       |
 2588|  31.0k|                    m_temp_reg_2 = _mm_srai_epi32(m_temp_reg_2, i4_shift);
 2589|  31.0k|                    m_temp_reg_3 = _mm_srai_epi32(m_temp_reg_3, i4_shift);
 2590|  31.0k|                    m_temp_reg_6 = _mm_srai_epi32(m_temp_reg_6, i4_shift);
 2591|  31.0k|                    m_temp_reg_7 = _mm_srai_epi32(m_temp_reg_7, i4_shift);
 2592|       |
 2593|       |                    //o3:1B*18-3B*50,1T*18-3T*50,5B*75-7B*89,5T*75-7T*89
 2594|  31.0k|                    m_temp_reg_22 = _mm_madd_epi16(m_temp_reg_0, m_coeff3);
 2595|  31.0k|                    m_temp_reg_26 = _mm_madd_epi16(m_temp_reg_4, m_coeff4);
 2596|  31.0k|                    m_temp_reg_23 = _mm_madd_epi16(m_temp_reg_1, m_coeff3);
 2597|  31.0k|                    m_temp_reg_27 = _mm_madd_epi16(m_temp_reg_5, m_coeff4);
 2598|       |
 2599|  31.0k|                    m_temp_reg_52 = _mm_packs_epi32(m_temp_reg_2, m_temp_reg_3);
 2600|  31.0k|                    m_temp_reg_55 = _mm_packs_epi32(m_temp_reg_6, m_temp_reg_7);
 2601|       |
 2602|       |
 2603|       |
 2604|       |                    /* o3 stored in m_temp_reg_36 and m_temp_reg_37 */
 2605|       |
 2606|       |
 2607|  31.0k|                    m_temp_reg_36 = _mm_add_epi32(m_temp_reg_22, m_temp_reg_26);
 2608|  31.0k|                    m_temp_reg_37 = _mm_add_epi32(m_temp_reg_23, m_temp_reg_27);
 2609|  31.0k|                }
 2610|       |
 2611|       |                /* Column 3 of destination computed here */
 2612|       |                /* It is stored in m_temp_reg_53 */
 2613|       |                /* Column 4 of destination computed here */
 2614|       |                /* It is stored in m_temp_reg_54 */
 2615|  31.0k|                {
 2616|  31.0k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_46, m_temp_reg_36);
 2617|  31.0k|                    m_temp_reg_22 = _mm_sub_epi32(m_temp_reg_46, m_temp_reg_36);
 2618|       |
 2619|  31.0k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_47, m_temp_reg_37);
 2620|  31.0k|                    m_temp_reg_23 = _mm_sub_epi32(m_temp_reg_47, m_temp_reg_37);
 2621|       |
 2622|  31.0k|                    m_temp_reg_20 = _mm_add_epi32(m_temp_reg_20, m_rdng_factor);
 2623|  31.0k|                    m_temp_reg_21 = _mm_add_epi32(m_temp_reg_21, m_rdng_factor);
 2624|  31.0k|                    m_temp_reg_22 = _mm_add_epi32(m_temp_reg_22, m_rdng_factor);
 2625|  31.0k|                    m_temp_reg_23 = _mm_add_epi32(m_temp_reg_23, m_rdng_factor);
 2626|       |
 2627|  31.0k|                    m_temp_reg_20 = _mm_srai_epi32(m_temp_reg_20, i4_shift);
 2628|  31.0k|                    m_temp_reg_21 = _mm_srai_epi32(m_temp_reg_21, i4_shift);
 2629|  31.0k|                    m_temp_reg_22 = _mm_srai_epi32(m_temp_reg_22, i4_shift);
 2630|  31.0k|                    m_temp_reg_23 = _mm_srai_epi32(m_temp_reg_23, i4_shift);
 2631|       |
 2632|  31.0k|                    m_temp_reg_53 = _mm_packs_epi32(m_temp_reg_20, m_temp_reg_21);
 2633|  31.0k|                    m_temp_reg_54 = _mm_packs_epi32(m_temp_reg_22, m_temp_reg_23);
 2634|  31.0k|                }
 2635|  31.0k|            }
 2636|       |
 2637|       |            /* Transpose of the destination 8x8 matrix done here */
 2638|       |            /* and ultimately stored in registers m_temp_reg_50 to m_temp_reg_57 */
 2639|       |            /* respectively */
 2640|  31.0k|            {
 2641|  31.0k|                m_temp_reg_10 = _mm_unpacklo_epi16(m_temp_reg_50, m_temp_reg_51);
 2642|  31.0k|                m_temp_reg_11 = _mm_unpacklo_epi16(m_temp_reg_52, m_temp_reg_53);
 2643|  31.0k|                m_temp_reg_14 = _mm_unpackhi_epi16(m_temp_reg_50, m_temp_reg_51);
 2644|  31.0k|                m_temp_reg_15 = _mm_unpackhi_epi16(m_temp_reg_52, m_temp_reg_53);
 2645|  31.0k|                m_temp_reg_0 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
 2646|  31.0k|                m_temp_reg_1 = _mm_unpackhi_epi32(m_temp_reg_10, m_temp_reg_11);
 2647|  31.0k|                m_temp_reg_2 = _mm_unpacklo_epi32(m_temp_reg_14, m_temp_reg_15);
 2648|  31.0k|                m_temp_reg_3 = _mm_unpackhi_epi32(m_temp_reg_14, m_temp_reg_15);
 2649|       |
 2650|  31.0k|                m_temp_reg_12 = _mm_unpacklo_epi16(m_temp_reg_54, m_temp_reg_55);
 2651|  31.0k|                m_temp_reg_13 = _mm_unpacklo_epi16(m_temp_reg_56, m_temp_reg_57);
 2652|  31.0k|                m_temp_reg_16 = _mm_unpackhi_epi16(m_temp_reg_54, m_temp_reg_55);
 2653|  31.0k|                m_temp_reg_17 = _mm_unpackhi_epi16(m_temp_reg_56, m_temp_reg_57);
 2654|  31.0k|                m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
 2655|  31.0k|                m_temp_reg_5 = _mm_unpackhi_epi32(m_temp_reg_12, m_temp_reg_13);
 2656|  31.0k|                m_temp_reg_6 = _mm_unpacklo_epi32(m_temp_reg_16, m_temp_reg_17);
 2657|  31.0k|                m_temp_reg_7 = _mm_unpackhi_epi32(m_temp_reg_16, m_temp_reg_17);
 2658|  31.0k|                m_temp_reg_10 = _mm_unpacklo_epi64(m_temp_reg_0, m_temp_reg_4);
 2659|  31.0k|                m_temp_reg_11 = _mm_unpackhi_epi64(m_temp_reg_0, m_temp_reg_4);
 2660|  31.0k|                m_temp_reg_12 = _mm_unpacklo_epi64(m_temp_reg_1, m_temp_reg_5);
 2661|  31.0k|                m_temp_reg_13 = _mm_unpackhi_epi64(m_temp_reg_1, m_temp_reg_5);
 2662|       |
 2663|  31.0k|                m_temp_reg_14 = _mm_unpacklo_epi64(m_temp_reg_2, m_temp_reg_6);
 2664|  31.0k|                m_temp_reg_15 = _mm_unpackhi_epi64(m_temp_reg_2, m_temp_reg_6);
 2665|  31.0k|                m_temp_reg_16 = _mm_unpacklo_epi64(m_temp_reg_3, m_temp_reg_7);
 2666|  31.0k|                m_temp_reg_17 = _mm_unpackhi_epi64(m_temp_reg_3, m_temp_reg_7);
 2667|  31.0k|            }
 2668|       |
 2669|       |            /* Recon and store */
 2670|  31.0k|            {
 2671|  31.0k|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2672|  31.0k|                pu1_pred += pred_strd;
 2673|  31.0k|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2674|  31.0k|                pu1_pred += pred_strd;
 2675|  31.0k|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2676|  31.0k|                pu1_pred += pred_strd;
 2677|  31.0k|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2678|  31.0k|                pu1_pred += pred_strd;
 2679|  31.0k|                m_temp_reg_4 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2680|  31.0k|                pu1_pred += pred_strd;
 2681|  31.0k|                m_temp_reg_5 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2682|  31.0k|                pu1_pred += pred_strd;
 2683|  31.0k|                m_temp_reg_6 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2684|  31.0k|                pu1_pred += pred_strd;
 2685|  31.0k|                m_temp_reg_7 = _mm_loadl_epi64((__m128i *)pu1_pred);
 2686|       |
 2687|       |
 2688|  31.0k|                m_temp_reg_50 = _mm_setzero_si128();
 2689|  31.0k|                m_temp_reg_0 = _mm_unpacklo_epi8(m_temp_reg_0, m_temp_reg_50);
 2690|  31.0k|                m_temp_reg_1 = _mm_unpacklo_epi8(m_temp_reg_1, m_temp_reg_50);
 2691|  31.0k|                m_temp_reg_2 = _mm_unpacklo_epi8(m_temp_reg_2, m_temp_reg_50);
 2692|  31.0k|                m_temp_reg_3 = _mm_unpacklo_epi8(m_temp_reg_3, m_temp_reg_50);
 2693|  31.0k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_50);
 2694|  31.0k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_50);
 2695|  31.0k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, m_temp_reg_50);
 2696|  31.0k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, m_temp_reg_50);
 2697|       |
 2698|  31.0k|                m_temp_reg_50 = _mm_add_epi16(m_temp_reg_10, m_temp_reg_0);
 2699|  31.0k|                m_temp_reg_51 = _mm_add_epi16(m_temp_reg_11, m_temp_reg_1);
 2700|  31.0k|                m_temp_reg_52 = _mm_add_epi16(m_temp_reg_12, m_temp_reg_2);
 2701|  31.0k|                m_temp_reg_53 = _mm_add_epi16(m_temp_reg_13, m_temp_reg_3);
 2702|  31.0k|                m_temp_reg_54 = _mm_add_epi16(m_temp_reg_14, m_temp_reg_4);
 2703|  31.0k|                m_temp_reg_55 = _mm_add_epi16(m_temp_reg_15, m_temp_reg_5);
 2704|  31.0k|                m_temp_reg_56 = _mm_add_epi16(m_temp_reg_16, m_temp_reg_6);
 2705|  31.0k|                m_temp_reg_57 = _mm_add_epi16(m_temp_reg_17, m_temp_reg_7);
 2706|       |
 2707|  31.0k|                m_temp_reg_50 = _mm_packus_epi16(m_temp_reg_50, m_temp_reg_50);
 2708|  31.0k|                m_temp_reg_51 = _mm_packus_epi16(m_temp_reg_51, m_temp_reg_51);
 2709|  31.0k|                m_temp_reg_52 = _mm_packus_epi16(m_temp_reg_52, m_temp_reg_52);
 2710|  31.0k|                m_temp_reg_53 = _mm_packus_epi16(m_temp_reg_53, m_temp_reg_53);
 2711|  31.0k|                m_temp_reg_54 = _mm_packus_epi16(m_temp_reg_54, m_temp_reg_54);
 2712|  31.0k|                m_temp_reg_55 = _mm_packus_epi16(m_temp_reg_55, m_temp_reg_55);
 2713|  31.0k|                m_temp_reg_56 = _mm_packus_epi16(m_temp_reg_56, m_temp_reg_56);
 2714|  31.0k|                m_temp_reg_57 = _mm_packus_epi16(m_temp_reg_57, m_temp_reg_57);
 2715|       |
 2716|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_50);
 2717|  31.0k|                pu1_dst += dst_strd;
 2718|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_51);
 2719|  31.0k|                pu1_dst += dst_strd;
 2720|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_52);
 2721|  31.0k|                pu1_dst += dst_strd;
 2722|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_53);
 2723|  31.0k|                pu1_dst += dst_strd;
 2724|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_54);
 2725|  31.0k|                pu1_dst += dst_strd;
 2726|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_55);
 2727|  31.0k|                pu1_dst += dst_strd;
 2728|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_56);
 2729|  31.0k|                pu1_dst += dst_strd;
 2730|  31.0k|                _mm_storel_epi64((__m128i *)pu1_dst, m_temp_reg_57);
 2731|  31.0k|                pu1_dst += dst_strd;
 2732|       |
 2733|  31.0k|            }
 2734|       |
 2735|       |
 2736|  31.0k|        }
 2737|       |
 2738|       |
 2739|  31.0k|    }
 2740|   102k|}

ihevcd_bitstream.c:CLZ:
   76|  4.21M|{
   77|  4.21M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 4.14M, False: 74.2k]
  ------------------
   78|  4.14M|        return (__builtin_clz(u4_word));
   79|  74.2k|    else
   80|  74.2k|        return 31;
   81|  4.21M|}
ihevcd_parse_slice_header.c:CLZ:
   76|  56.2k|{
   77|  56.2k|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 54.6k, False: 1.63k]
  ------------------
   78|  54.6k|        return (__builtin_clz(u4_word));
   79|  1.63k|    else
   80|  1.63k|        return 31;
   81|  56.2k|}
ihevcd_parse_residual.c:CLZ:
   76|   279M|{
   77|   279M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 258M, False: 21.4M]
  ------------------
   78|   258M|        return (__builtin_clz(u4_word));
   79|  21.4M|    else
   80|  21.4M|        return 31;
   81|   279M|}
ihevcd_parse_residual.c:CTZ:
   89|  11.7M|{
   90|  11.7M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 11.7M]
  ------------------
   91|      0|        return 31;
   92|  11.7M|    else
   93|  11.7M|    {
   94|  11.7M|        unsigned int index;
   95|  11.7M|        index = __builtin_ctz(u4_word);
   96|  11.7M|        return (UWORD32)index;
   97|  11.7M|    }
   98|  11.7M|}
ihevcd_cabac.c:CLZ:
   76|  91.5M|{
   77|  91.5M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 91.5M, False: 0]
  ------------------
   78|  91.5M|        return (__builtin_clz(u4_word));
   79|      0|    else
   80|      0|        return 31;
   81|  91.5M|}
ihevcd_iquant_itrans_recon_ctb.c:CLZ:
   76|  49.2M|{
   77|  49.2M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 49.2M, False: 18.4E]
  ------------------
   78|  49.2M|        return (__builtin_clz(u4_word));
   79|  18.4E|    else
   80|  18.4E|        return 31;
   81|  49.2M|}
ihevcd_iquant_itrans_recon_ctb.c:CTZ:
   89|  8.07k|{
   90|  8.07k|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 8.07k]
  ------------------
   91|      0|        return 31;
   92|  8.07k|    else
   93|  8.07k|    {
   94|  8.07k|        unsigned int index;
   95|  8.07k|        index = __builtin_ctz(u4_word);
   96|  8.07k|        return (UWORD32)index;
   97|  8.07k|    }
   98|  8.07k|}
ihevcd_deblk.c:CTZ:
   89|   464M|{
   90|   464M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 233M, False: 230M]
  ------------------
   91|   233M|        return 31;
   92|   230M|    else
   93|   230M|    {
   94|   230M|        unsigned int index;
   95|   230M|        index = __builtin_ctz(u4_word);
   96|   230M|        return (UWORD32)index;
   97|   230M|    }
   98|   464M|}
ihevcd_sao.c:CTZ:
   89|   700M|{
   90|   700M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 2.52M, False: 698M]
  ------------------
   91|  2.52M|        return 31;
   92|   698M|    else
   93|   698M|    {
   94|   698M|        unsigned int index;
   95|   698M|        index = __builtin_ctz(u4_word);
   96|   698M|        return (UWORD32)index;
   97|   698M|    }
   98|   700M|}
ihevc_intra_pred_filters.c:CTZ:
   89|  3.71M|{
   90|  3.71M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 3.71M]
  ------------------
   91|      0|        return 31;
   92|  3.71M|    else
   93|  3.71M|    {
   94|  3.71M|        unsigned int index;
   95|  3.71M|        index = __builtin_ctz(u4_word);
   96|  3.71M|        return (UWORD32)index;
   97|  3.71M|    }
   98|  3.71M|}
ihevc_chroma_intra_pred_filters.c:CTZ:
   89|  2.14M|{
   90|  2.14M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 2.14M]
  ------------------
   91|      0|        return 31;
   92|  2.14M|    else
   93|  2.14M|    {
   94|  2.14M|        unsigned int index;
   95|  2.14M|        index = __builtin_ctz(u4_word);
   96|  2.14M|        return (UWORD32)index;
   97|  2.14M|    }
   98|  2.14M|}
ihevc_intra_pred_filters_ssse3_intr.c:CTZ:
   89|  2.48M|{
   90|  2.48M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 2.48M]
  ------------------
   91|      0|        return 31;
   92|  2.48M|    else
   93|  2.48M|    {
   94|  2.48M|        unsigned int index;
   95|  2.48M|        index = __builtin_ctz(u4_word);
   96|  2.48M|        return (UWORD32)index;
   97|  2.48M|    }
   98|  2.48M|}
ihevc_intra_pred_filters_sse42_intr.c:CTZ:
   89|   545k|{
   90|   545k|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 545k]
  ------------------
   91|      0|        return 31;
   92|   545k|    else
   93|   545k|    {
   94|   545k|        unsigned int index;
   95|   545k|        index = __builtin_ctz(u4_word);
   96|   545k|        return (UWORD32)index;
   97|   545k|    }
   98|   545k|}
ihevc_hbd_chroma_intra_pred_filters.c:CTZ:
   89|  1.19M|{
   90|  1.19M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 1.19M]
  ------------------
   91|      0|        return 31;
   92|  1.19M|    else
   93|  1.19M|    {
   94|  1.19M|        unsigned int index;
   95|  1.19M|        index = __builtin_ctz(u4_word);
   96|  1.19M|        return (UWORD32)index;
   97|  1.19M|    }
   98|  1.19M|}
ihevc_hbd_intra_pred_filters.c:CTZ:
   89|  2.98M|{
   90|  2.98M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 2.98M]
  ------------------
   91|      0|        return 31;
   92|  2.98M|    else
   93|  2.98M|    {
   94|  2.98M|        unsigned int index;
   95|  2.98M|        index = __builtin_ctz(u4_word);
   96|  2.98M|        return (UWORD32)index;
   97|  2.98M|    }
   98|  2.98M|}

ihevc_sao_band_offset_luma_ssse3:
  129|   151k|{
  130|   151k|    WORD32 row, col;
  131|   151k|    UWORD8 *pu1_src_cpy;
  132|   151k|    WORD32 wd_rem;
  133|   151k|    WORD8 offset = 0;
  134|       |
  135|   151k|    __m128i src_temp0_8x16b, src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b;
  136|   151k|    __m128i band_table0_8x16b, band_table1_8x16b, band_table2_8x16b, band_table3_8x16b;
  137|   151k|    __m128i tmp_set_128i_1, tmp_set_128i_2, tmp_set_128i_3, tmp_set_128i_4;
  138|   151k|    __m128i band_pos_16x8b;
  139|   151k|    __m128i sao_offset;
  140|   151k|    __m128i cmp_mask, cmp_store;
  141|       |
  142|       |    /* Updating left and top-left and top */
  143|  3.87M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (143:18): [True: 3.72M, False: 151k]
  ------------------
  144|  3.72M|    {
  145|  3.72M|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
  146|  3.72M|    }
  147|   151k|    pu1_src_top_left[0] = pu1_src_top[wd - 1];
  148|   622k|    for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (148:18): [True: 471k, False: 151k]
  ------------------
  149|   471k|    {
  150|   471k|        tmp_set_128i_1 = _mm_loadl_epi64((__m128i *)(pu1_src + (ht - 1) * src_strd + offset));
  151|   471k|        _mm_storel_epi64((__m128i *)(pu1_src_top + offset), tmp_set_128i_1);
  152|   471k|        offset += 8;
  153|   471k|    }
  154|       |
  155|       |    //replicating sao_band_pos as 8 bit value 16 times
  156|       |
  157|       |
  158|   151k|    band_pos_16x8b = _mm_set1_epi16((WORD16)(sao_band_pos << 3));
  159|       |    //value set for sao_offset extraction
  160|   151k|    tmp_set_128i_1  = _mm_set_epi8(-128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1);
  161|   151k|    tmp_set_128i_2  = _mm_set_epi8(-128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2);
  162|   151k|    tmp_set_128i_3  = _mm_set_epi8(-128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3);
  163|   151k|    tmp_set_128i_4  = _mm_set_epi8(-128, 4, -128, 4, -128, 4, -128, 4, -128, 4, -128, 4, -128, 4, -128, 4);
  164|       |
  165|       |    //loaded sao offset values
  166|   151k|    sao_offset      = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
  167|       |
  168|       |    //loading 16bit 32values of gu2_table_band_idx consecutively in 4 registers
  169|   151k|    band_table0_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx));
  170|   151k|    band_table1_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 8));
  171|   151k|    band_table2_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 16));
  172|   151k|    band_table3_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 24));
  173|       |
  174|       |    //band_position addition
  175|   151k|    band_table0_8x16b = _mm_add_epi16(band_table0_8x16b, band_pos_16x8b);
  176|   151k|    band_table1_8x16b = _mm_add_epi16(band_table1_8x16b, band_pos_16x8b);
  177|   151k|    band_table2_8x16b = _mm_add_epi16(band_table2_8x16b, band_pos_16x8b);
  178|   151k|    band_table3_8x16b = _mm_add_epi16(band_table3_8x16b, band_pos_16x8b);
  179|       |    //sao_offset duplication
  180|   151k|    tmp_set_128i_1  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_1);
  181|   151k|    tmp_set_128i_2  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_2);
  182|   151k|    tmp_set_128i_3  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_3);
  183|   151k|    tmp_set_128i_4  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_4);
  184|       |    //settng for comparision
  185|   151k|    cmp_mask = _mm_set1_epi16(16);
  186|   151k|    cmp_store = _mm_set1_epi16(0x00ff);
  187|       |
  188|       |    //sao_offset addition
  189|   151k|    band_table0_8x16b = _mm_add_epi16(band_table0_8x16b, tmp_set_128i_1);
  190|   151k|    band_table1_8x16b = _mm_add_epi16(band_table1_8x16b, tmp_set_128i_2);
  191|   151k|    band_table2_8x16b = _mm_add_epi16(band_table2_8x16b, tmp_set_128i_3);
  192|   151k|    band_table3_8x16b = _mm_add_epi16(band_table3_8x16b, tmp_set_128i_4);
  193|       |    //masking upper 8bit values of each  16 bit band table value
  194|   151k|    band_table0_8x16b = _mm_and_si128(band_table0_8x16b, cmp_store);
  195|   151k|    band_table1_8x16b = _mm_and_si128(band_table1_8x16b, cmp_store);
  196|   151k|    band_table2_8x16b = _mm_and_si128(band_table2_8x16b, cmp_store);
  197|   151k|    band_table3_8x16b = _mm_and_si128(band_table3_8x16b, cmp_store);
  198|       |
  199|   151k|    switch(sao_band_pos)
  200|   151k|    {
  201|  15.2k|        case 0:
  ------------------
  |  Branch (201:9): [True: 15.2k, False: 135k]
  ------------------
  202|  15.2k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table0_8x16b);
  203|  15.2k|            band_table0_8x16b = _mm_and_si128(band_table0_8x16b, tmp_set_128i_2);
  204|  15.2k|            break;
  205|  4.65k|        case 28:
  ------------------
  |  Branch (205:9): [True: 4.65k, False: 146k]
  ------------------
  206|  4.65k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table3_8x16b);
  207|  4.65k|            band_table3_8x16b = _mm_or_si128(band_table3_8x16b, tmp_set_128i_2);
  208|  4.65k|            break;
  209|  11.6k|        case 29:
  ------------------
  |  Branch (209:9): [True: 11.6k, False: 139k]
  ------------------
  210|  11.6k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table2_8x16b);
  211|  11.6k|            band_table2_8x16b = _mm_or_si128(band_table2_8x16b, tmp_set_128i_2);
  212|  11.6k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table3_8x16b);
  213|  11.6k|            band_table3_8x16b = _mm_and_si128(band_table3_8x16b, tmp_set_128i_2);
  214|  11.6k|            break;
  215|  7.01k|        case 30:
  ------------------
  |  Branch (215:9): [True: 7.01k, False: 144k]
  ------------------
  216|  7.01k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table1_8x16b);
  217|  7.01k|            band_table1_8x16b = _mm_or_si128(band_table1_8x16b, tmp_set_128i_2);
  218|  7.01k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table2_8x16b);
  219|  7.01k|            band_table2_8x16b = _mm_and_si128(band_table2_8x16b, tmp_set_128i_2);
  220|  7.01k|            break;
  221|  2.78k|        case 31:
  ------------------
  |  Branch (221:9): [True: 2.78k, False: 148k]
  ------------------
  222|  2.78k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table0_8x16b);
  223|  2.78k|            band_table0_8x16b = _mm_or_si128(band_table0_8x16b, tmp_set_128i_2);
  224|  2.78k|            tmp_set_128i_2 = _mm_cmpgt_epi16(cmp_mask, band_table1_8x16b);
  225|  2.78k|            band_table1_8x16b = _mm_and_si128(band_table1_8x16b, tmp_set_128i_2);
  226|  2.78k|            break;
  227|   109k|        default:
  ------------------
  |  Branch (227:9): [True: 109k, False: 41.3k]
  ------------------
  228|   109k|            break;
  229|   151k|    }
  230|       |    //sao_offset is reused for zero cmp mask.
  231|   151k|    sao_offset = _mm_setzero_si128();
  232|   151k|    tmp_set_128i_1 = _mm_set1_epi8(1);
  233|       |    //tmp_set_128i_2 = _mm_set_epi8 (128,7,128,6,128,5,128,4,128,3,128,2,128,1,128,0);
  234|   151k|    cmp_mask = _mm_packus_epi16(cmp_mask, cmp_mask); //cmp_msk=dup16(16);
  235|       |
  236|       |    //masking upper 8bit values of each  16 bit band table value
  237|   151k|    band_table0_8x16b = _mm_and_si128(band_table0_8x16b, cmp_store);
  238|   151k|    band_table1_8x16b = _mm_and_si128(band_table1_8x16b, cmp_store);
  239|   151k|    band_table2_8x16b = _mm_and_si128(band_table2_8x16b, cmp_store);
  240|   151k|    band_table3_8x16b = _mm_and_si128(band_table3_8x16b, cmp_store);
  241|       |
  242|       |    //band table 8x16 four registers are packed into 16x8 two registers:  band_table0_8x16b and band_table2_8x16b
  243|   151k|    band_table0_8x16b = _mm_packus_epi16(band_table0_8x16b, band_table1_8x16b);
  244|   151k|    band_table2_8x16b = _mm_packus_epi16(band_table2_8x16b, band_table3_8x16b);
  245|       |
  246|   151k|    band_table3_8x16b = _mm_slli_epi16(cmp_mask, 1); // to compare if value is greater than 31
  247|   151k|    band_pos_16x8b = _mm_packus_epi16(band_pos_16x8b, band_pos_16x8b); //band_pos is now 8 bit aligned
  248|   151k|    band_table3_8x16b = _mm_sub_epi8(band_table3_8x16b, tmp_set_128i_1); // to compare if value is greater than 31
  249|       |
  250|   151k|    cmp_mask = _mm_sub_epi8(cmp_mask, tmp_set_128i_1);
  251|       |    //  band_pos_16x8b = _mm_or_si128(band_pos_16x8b,cmp_store);
  252|       |
  253|   313k|    for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (253:19): [True: 162k, False: 151k]
  ------------------
  254|   162k|    {
  255|   162k|        pu1_src_cpy = pu1_src;
  256|  2.58M|        for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (256:23): [True: 2.42M, False: 162k]
  ------------------
  257|  2.42M|        {
  258|       |
  259|       |
  260|       |            //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  261|  2.42M|            src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
  262|       |            // row = 1
  263|  2.42M|            src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
  264|       |
  265|       |
  266|       |
  267|       |            //saturated substract 8 bit
  268|  2.42M|            tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_16x8b);
  269|  2.42M|            tmp_set_128i_3 = _mm_sub_epi8(src_temp2_8x16b, band_pos_16x8b);
  270|       |            //if the values less than 0 put ff
  271|  2.42M|            tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  272|  2.42M|            tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  273|  2.42M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  274|  2.42M|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  275|       |            //if the values gret=ater than 31 put ff
  276|  2.42M|            tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, band_table3_8x16b);
  277|  2.42M|            tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, band_table3_8x16b);
  278|  2.42M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  279|  2.42M|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  280|       |
  281|       |
  282|       |            //row 0 and row1
  283|       |            //if the values >16 then put ff ,cmp_mask = dup16(15)
  284|  2.42M|            cmp_store = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_mask);
  285|       |            //values 16 to 31 for row 0 & 1 but values <16 ==0
  286|  2.42M|            tmp_set_128i_2 = _mm_and_si128(tmp_set_128i_1, cmp_store);
  287|       |            // values 0 to 15 for row 0 & 1
  288|  2.42M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, cmp_store);
  289|       |            //values 16 to 31 for row 0 & 1 but values <16 masked to ff
  290|  2.42M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_2, sao_offset);
  291|  2.42M|            tmp_set_128i_2 = _mm_or_si128(tmp_set_128i_2, cmp_store);
  292|       |            //row 2 and  row 3
  293|       |            //if the values >16 then put ff ,cmp_mask = dup16(15)
  294|  2.42M|            cmp_store = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_mask);
  295|       |            //values 16 to 31 for row 2 & 3 but values <16 ==0
  296|  2.42M|            tmp_set_128i_4 = _mm_and_si128(tmp_set_128i_3, cmp_store);
  297|       |            // values 0 to 15 for row 2 & 3
  298|  2.42M|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, cmp_store);
  299|       |            //values 16 to 31 for row 2 & 3 but values <16 masked to ff
  300|  2.42M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  301|  2.42M|            tmp_set_128i_4 = _mm_or_si128(tmp_set_128i_4, cmp_store);
  302|       |
  303|       |            //row 0 and row 1
  304|       |            //to preserve pixel values in which no offset needs to be added.
  305|  2.42M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_1, tmp_set_128i_2);
  306|  2.42M|            src_temp0_8x16b = _mm_and_si128(src_temp0_8x16b, cmp_store);
  307|       |
  308|       |            //row 2 and row 3
  309|       |            //to preserve pixel values in which no offset needs to be added.
  310|  2.42M|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_3, tmp_set_128i_4);
  311|  2.42M|            src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, cmp_store);
  312|       |
  313|       |            //indexing 0 - 15 bandtable indexes
  314|  2.42M|            tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_1);
  315|  2.42M|            tmp_set_128i_3 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_3);
  316|  2.42M|            tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_2);
  317|  2.42M|            tmp_set_128i_4 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_4);
  318|       |            // combining all offsets results
  319|  2.42M|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  320|  2.42M|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  321|       |            // combing results woth the pixel values
  322|  2.42M|            src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  323|  2.42M|            src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  324|       |
  325|       |
  326|       |            //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
  327|  2.42M|            _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_8x16b);
  328|       |            // row = 1
  329|  2.42M|            _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp2_8x16b);
  330|       |
  331|  2.42M|            pu1_src_cpy += (src_strd << 1);
  332|  2.42M|        }
  333|   162k|        pu1_src += 16;
  334|   162k|    }
  335|   151k|    wd_rem = wd & 0xF;
  336|   151k|    if(wd_rem)
  ------------------
  |  Branch (336:8): [True: 145k, False: 5.18k]
  ------------------
  337|   145k|    {pu1_src_cpy = pu1_src;
  338|  1.04M|        for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (338:23): [True: 899k, False: 145k]
  ------------------
  339|   899k|        {
  340|       |
  341|       |
  342|       |            //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  343|   899k|            src_temp0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
  344|       |            // row = 1
  345|   899k|            src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
  346|       |            // row = 2
  347|   899k|            src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
  348|       |            // row = 3
  349|   899k|            src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
  350|       |            //row0 and row1 packed and row2 and row3 packed
  351|       |
  352|   899k|            src_temp0_8x16b = _mm_unpacklo_epi64(src_temp0_8x16b, src_temp1_8x16b);
  353|   899k|            src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp3_8x16b);
  354|       |
  355|       |            //saturated substract 8 bit
  356|   899k|            tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_16x8b);
  357|   899k|            tmp_set_128i_3 = _mm_sub_epi8(src_temp2_8x16b, band_pos_16x8b);
  358|       |            //if the values less than 0 put ff
  359|   899k|            tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  360|   899k|            tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  361|   899k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  362|   899k|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  363|       |            //if the values gret=ater than 31 put ff
  364|   899k|            tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, band_table3_8x16b);
  365|   899k|            tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, band_table3_8x16b);
  366|   899k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  367|   899k|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  368|       |
  369|       |
  370|       |
  371|       |            //row 0 and row1
  372|       |            //if the values >16 then put ff ,cmp_mask = dup16(15)
  373|   899k|            cmp_store = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_mask);
  374|       |            //values 16 to 31 for row 0 & 1 but values <16 ==0
  375|   899k|            tmp_set_128i_2 = _mm_and_si128(tmp_set_128i_1, cmp_store);
  376|       |            // values 0 to 15 for row 0 & 1
  377|   899k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, cmp_store);
  378|       |            //values 16 to 31 for row 0 & 1 but values <16 masked to ff
  379|   899k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_2, sao_offset);
  380|   899k|            tmp_set_128i_2 = _mm_or_si128(tmp_set_128i_2, cmp_store);
  381|       |            //row 2 and  row 3
  382|       |            //if the values >16 then put ff ,cmp_mask = dup16(15)
  383|   899k|            cmp_store = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_mask);
  384|       |            //values 16 to 31 for row 2 & 3 but values <16 ==0
  385|   899k|            tmp_set_128i_4 = _mm_and_si128(tmp_set_128i_3, cmp_store);
  386|       |            // values 0 to 15 for row 2 & 3
  387|   899k|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, cmp_store);
  388|       |            //values 16 to 31 for row 2 & 3 but values <16 masked to ff
  389|   899k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  390|   899k|            tmp_set_128i_4 = _mm_or_si128(tmp_set_128i_4, cmp_store);
  391|       |
  392|       |            //row 0 and row 1
  393|       |            //to preserve pixel values in which no offset needs to be added.
  394|   899k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_1, tmp_set_128i_2);
  395|   899k|            src_temp0_8x16b = _mm_and_si128(src_temp0_8x16b, cmp_store);
  396|       |
  397|       |            //row 2 and row 3
  398|       |            //to preserve pixel values in which no offset needs to be added.
  399|   899k|            cmp_store = _mm_cmpeq_epi8(tmp_set_128i_3, tmp_set_128i_4);
  400|   899k|            src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, cmp_store);
  401|       |
  402|       |            //indexing 0 - 15 bandtable indexes
  403|   899k|            tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_1);
  404|   899k|            tmp_set_128i_3 = _mm_shuffle_epi8(band_table0_8x16b, tmp_set_128i_3);
  405|   899k|            tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_2);
  406|   899k|            tmp_set_128i_4 = _mm_shuffle_epi8(band_table2_8x16b, tmp_set_128i_4);
  407|       |            // combining all offsets results
  408|   899k|            tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  409|   899k|            tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  410|       |            // combing results woth the pixel values
  411|   899k|            src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  412|   899k|            src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  413|       |
  414|       |            //Getting row1 separately
  415|   899k|            src_temp1_8x16b = _mm_srli_si128(src_temp0_8x16b, 8);
  416|       |            //Getting row3 separately
  417|   899k|            src_temp3_8x16b = _mm_srli_si128(src_temp2_8x16b, 8);
  418|       |
  419|       |            //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
  420|   899k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_8x16b);
  421|       |            // row = 1
  422|   899k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), src_temp1_8x16b);
  423|       |            // row = 2
  424|   899k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp2_8x16b);
  425|       |            // row = 3
  426|   899k|            _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), src_temp3_8x16b);
  427|       |
  428|   899k|            pu1_src_cpy += (src_strd << 2);
  429|       |
  430|   899k|        }
  431|   145k|        pu1_src += 8;
  432|   145k|    }
  433|       |
  434|       |
  435|   151k|}
ihevc_sao_band_offset_chroma_ssse3:
  448|  88.7k|{
  449|  88.7k|    WORD32 row, col;
  450|  88.7k|    WORD8 offset = 0;
  451|       |
  452|       |
  453|  88.7k|    __m128i src_temp0_8x16b, src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b;
  454|  88.7k|    __m128i cmp_msk2;
  455|  88.7k|    __m128i band_table0_16x8b, band_table1_16x8b, band_table2_16x8b, band_table3_16x8b;
  456|  88.7k|    __m128i tmp_set_128i_1, tmp_set_128i_2, tmp_set_128i_3, tmp_set_128i_4;
  457|  88.7k|    __m128i band_pos_u_16x8b, band_pos_v_16x8b;
  458|  88.7k|    __m128i sao_offset;
  459|  88.7k|    __m128i cmp_mask;
  460|       |
  461|       |
  462|       |    /* Updating left and top and top-left */
  463|  1.29M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (463:18): [True: 1.20M, False: 88.7k]
  ------------------
  464|  1.20M|    {
  465|  1.20M|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
  466|  1.20M|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
  467|  1.20M|    }
  468|  88.7k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  469|  88.7k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  470|   378k|    for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (470:18): [True: 290k, False: 88.7k]
  ------------------
  471|   290k|    {
  472|   290k|        tmp_set_128i_1 = _mm_loadl_epi64((__m128i *)(pu1_src + (ht - 1) * src_strd + offset));
  473|   290k|        _mm_storel_epi64((__m128i *)(pu1_src_top + offset), tmp_set_128i_1);
  474|   290k|        offset += 8;
  475|   290k|    }
  476|       |
  477|  88.7k|    { // band _table creation
  478|  88.7k|        __m128i temp0_8x16b, temp1_8x16b, temp2_8x16b, temp3_8x16b;
  479|       |        // Band table for U component : band_table0_16x8b and band_table2_16x8b
  480|       |        //replicating sao_band_pos as 8 bit value 16 times
  481|  88.7k|        band_pos_u_16x8b = _mm_set1_epi16((WORD16)(sao_band_pos_u << 3));
  482|       |        //value set for sao_offset extraction
  483|  88.7k|        tmp_set_128i_1  = _mm_set_epi8(-128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1, -128, 1);
  484|  88.7k|        tmp_set_128i_2  = _mm_set_epi8(-128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2, -128, 2);
  485|  88.7k|        tmp_set_128i_3  = _mm_set_epi8(-128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3, -128, 3);
  486|  88.7k|        tmp_set_128i_4  = _mm_set_epi8(-128, 4, -128, 4, -128, 4, -128, 4, -128, 4, -128, 4, -128, 4, -128, 4);
  487|       |
  488|       |        //loaded sao offset values
  489|  88.7k|        sao_offset      = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
  490|       |
  491|       |        //loading 16bit 32values of gu2_table_band_idx consecutively in 4 registers
  492|  88.7k|        band_table0_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx));
  493|  88.7k|        band_table1_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 8));
  494|  88.7k|        band_table2_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 16));
  495|  88.7k|        band_table3_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 24));
  496|       |
  497|       |        //band_position addition
  498|  88.7k|        band_table0_16x8b = _mm_add_epi16(band_table0_16x8b, band_pos_u_16x8b);
  499|  88.7k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, band_pos_u_16x8b);
  500|  88.7k|        band_table2_16x8b = _mm_add_epi16(band_table2_16x8b, band_pos_u_16x8b);
  501|  88.7k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, band_pos_u_16x8b);
  502|       |        //sao_offset duplication
  503|  88.7k|        temp0_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_1);
  504|  88.7k|        temp1_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_2);
  505|  88.7k|        temp2_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_3);
  506|  88.7k|        temp3_8x16b = _mm_shuffle_epi8(sao_offset, tmp_set_128i_4);
  507|       |
  508|       |        //sao_offset addition
  509|  88.7k|        band_table0_16x8b = _mm_add_epi16(band_table0_16x8b, temp0_8x16b);
  510|  88.7k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, temp1_8x16b);
  511|  88.7k|        band_table2_16x8b = _mm_add_epi16(band_table2_16x8b, temp2_8x16b);
  512|  88.7k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, temp3_8x16b);
  513|       |        //reuse for clipping
  514|  88.7k|        temp1_8x16b = _mm_set1_epi16(0x00ff);
  515|       |        //settng for comparision
  516|  88.7k|        cmp_mask = _mm_set1_epi16(16);
  517|       |
  518|       |        //masking upper 8bit values of each  16 bit band table value
  519|  88.7k|        band_table0_16x8b = _mm_and_si128(band_table0_16x8b, temp1_8x16b);
  520|  88.7k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  521|  88.7k|        band_table2_16x8b = _mm_and_si128(band_table2_16x8b, temp1_8x16b);
  522|  88.7k|        band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp1_8x16b);
  523|       |
  524|       |        //temp1_8x16b reuse for compare storage
  525|  88.7k|        switch(sao_band_pos_u)
  526|  88.7k|        {
  527|  15.6k|            case 0:
  ------------------
  |  Branch (527:13): [True: 15.6k, False: 73.0k]
  ------------------
  528|  15.6k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table0_16x8b);
  529|  15.6k|                band_table0_16x8b = _mm_and_si128(band_table0_16x8b, temp3_8x16b);
  530|  15.6k|                break;
  531|  3.50k|            case 28:
  ------------------
  |  Branch (531:13): [True: 3.50k, False: 85.2k]
  ------------------
  532|  3.50k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  533|  3.50k|                band_table3_16x8b = _mm_or_si128(band_table3_16x8b, temp3_8x16b);
  534|  3.50k|                break;
  535|  2.81k|            case 29:
  ------------------
  |  Branch (535:13): [True: 2.81k, False: 85.9k]
  ------------------
  536|  2.81k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table2_16x8b);
  537|  2.81k|                band_table2_16x8b = _mm_or_si128(band_table2_16x8b, temp3_8x16b);
  538|  2.81k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  539|  2.81k|                band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp3_8x16b);
  540|  2.81k|                break;
  541|  2.46k|            case 30:
  ------------------
  |  Branch (541:13): [True: 2.46k, False: 86.2k]
  ------------------
  542|  2.46k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  543|  2.46k|                band_table1_16x8b = _mm_or_si128(band_table1_16x8b, temp3_8x16b);
  544|  2.46k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table2_16x8b);
  545|  2.46k|                band_table2_16x8b = _mm_and_si128(band_table2_16x8b, temp3_8x16b);
  546|  2.46k|                break;
  547|  1.35k|            case 31:
  ------------------
  |  Branch (547:13): [True: 1.35k, False: 87.3k]
  ------------------
  548|  1.35k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table0_16x8b);
  549|  1.35k|                band_table0_16x8b = _mm_or_si128(band_table0_16x8b, temp3_8x16b);
  550|  1.35k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  551|  1.35k|                band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp3_8x16b);
  552|  1.35k|                break;
  553|  62.9k|            default:
  ------------------
  |  Branch (553:13): [True: 62.9k, False: 25.7k]
  ------------------
  554|  62.9k|                break;
  555|  88.7k|        }
  556|       |        //masking upper 8bit values of each  16 bit band table value
  557|  88.7k|        band_table0_16x8b = _mm_and_si128(band_table0_16x8b, temp1_8x16b);
  558|  88.7k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  559|  88.7k|        band_table2_16x8b = _mm_and_si128(band_table2_16x8b, temp1_8x16b);
  560|  88.7k|        band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp1_8x16b);
  561|       |        //band table 8x16 four registers are packed into 16x8 two registers:  band_table0_8x16b and band_table2_8x16b
  562|  88.7k|        band_table0_16x8b = _mm_packus_epi16(band_table0_16x8b, band_table1_16x8b);
  563|  88.7k|        band_table2_16x8b = _mm_packus_epi16(band_table2_16x8b, band_table3_16x8b);
  564|       |        // Band table for U component over
  565|       |
  566|       |        // Band table for V component : band_table1_16x8b and band_table3_16x8b
  567|       |        // replicating sao_band_pos as 8 bit value 16 times
  568|  88.7k|        band_pos_v_16x8b = _mm_set1_epi16((WORD16)(sao_band_pos_v << 3));
  569|       |
  570|       |        //loaded sao offset values
  571|  88.7k|        sao_offset      = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
  572|       |
  573|       |        //loading 16bit 32values of gu2_table_band_idx consecutively in 4 registers
  574|  88.7k|        temp0_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx));
  575|  88.7k|        band_table1_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 8));
  576|  88.7k|        temp2_8x16b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 16));
  577|  88.7k|        band_table3_16x8b = _mm_load_si128((__m128i *)(gu2_table_band_idx + 24));
  578|       |
  579|       |        //band_position addition
  580|  88.7k|        temp0_8x16b = _mm_add_epi16(temp0_8x16b, band_pos_v_16x8b);
  581|  88.7k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, band_pos_v_16x8b);
  582|  88.7k|        temp2_8x16b = _mm_add_epi16(temp2_8x16b, band_pos_v_16x8b);
  583|  88.7k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, band_pos_v_16x8b);
  584|       |        //sao_offset duplication
  585|  88.7k|        tmp_set_128i_1  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_1);
  586|  88.7k|        tmp_set_128i_2  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_2);
  587|  88.7k|        tmp_set_128i_3  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_3);
  588|  88.7k|        tmp_set_128i_4  = _mm_shuffle_epi8(sao_offset, tmp_set_128i_4);
  589|       |
  590|       |        //sao_offset addition
  591|  88.7k|        temp0_8x16b = _mm_add_epi16(temp0_8x16b, tmp_set_128i_1);
  592|  88.7k|        band_table1_16x8b = _mm_add_epi16(band_table1_16x8b, tmp_set_128i_2);
  593|  88.7k|        temp2_8x16b = _mm_add_epi16(temp2_8x16b, tmp_set_128i_3);
  594|  88.7k|        band_table3_16x8b = _mm_add_epi16(band_table3_16x8b, tmp_set_128i_4);
  595|       |
  596|       |        //masking upper 8bit values of 16 bit band table value
  597|  88.7k|        temp0_8x16b = _mm_and_si128(temp0_8x16b, temp1_8x16b);
  598|  88.7k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  599|  88.7k|        temp2_8x16b = _mm_and_si128(temp2_8x16b, temp1_8x16b);
  600|  88.7k|        band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp1_8x16b);
  601|       |        //temp1_8x16b reuse for compare storage
  602|       |
  603|  88.7k|        switch(sao_band_pos_v)
  604|  88.7k|        {
  605|  16.2k|            case 0:
  ------------------
  |  Branch (605:13): [True: 16.2k, False: 72.4k]
  ------------------
  606|  16.2k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp0_8x16b);
  607|  16.2k|                temp0_8x16b = _mm_and_si128(temp0_8x16b, temp3_8x16b);
  608|  16.2k|                break;
  609|  2.64k|            case 28:
  ------------------
  |  Branch (609:13): [True: 2.64k, False: 86.0k]
  ------------------
  610|  2.64k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  611|  2.64k|                band_table3_16x8b = _mm_or_si128(band_table3_16x8b, temp3_8x16b);
  612|  2.64k|                break;
  613|  3.01k|            case 29:
  ------------------
  |  Branch (613:13): [True: 3.01k, False: 85.7k]
  ------------------
  614|  3.01k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp2_8x16b);
  615|  3.01k|                temp2_8x16b = _mm_or_si128(temp2_8x16b, temp3_8x16b);
  616|  3.01k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table3_16x8b);
  617|  3.01k|                band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp3_8x16b);
  618|  3.01k|                break;
  619|  2.95k|            case 30:
  ------------------
  |  Branch (619:13): [True: 2.95k, False: 85.7k]
  ------------------
  620|  2.95k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  621|  2.95k|                band_table1_16x8b = _mm_or_si128(band_table1_16x8b, temp3_8x16b);
  622|  2.95k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp2_8x16b);
  623|  2.95k|                temp2_8x16b = _mm_and_si128(temp2_8x16b, temp3_8x16b);
  624|  2.95k|                break;
  625|  2.38k|            case 31:
  ------------------
  |  Branch (625:13): [True: 2.38k, False: 86.3k]
  ------------------
  626|  2.38k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, temp0_8x16b);
  627|  2.38k|                temp0_8x16b = _mm_or_si128(temp0_8x16b, temp3_8x16b);
  628|  2.38k|                temp3_8x16b = _mm_cmpgt_epi16(cmp_mask, band_table1_16x8b);
  629|  2.38k|                band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp3_8x16b);
  630|  2.38k|                break;
  631|  61.5k|            default:
  ------------------
  |  Branch (631:13): [True: 61.5k, False: 27.2k]
  ------------------
  632|  61.5k|                break;
  633|  88.7k|        }
  634|       |        //masking upper 8bit values of each  16 bit band table value
  635|  88.6k|        temp0_8x16b = _mm_and_si128(temp0_8x16b, temp1_8x16b);
  636|  88.6k|        band_table1_16x8b = _mm_and_si128(band_table1_16x8b, temp1_8x16b);
  637|  88.6k|        temp2_8x16b = _mm_and_si128(temp2_8x16b, temp1_8x16b);
  638|  88.6k|        band_table3_16x8b = _mm_and_si128(band_table3_16x8b, temp1_8x16b);
  639|       |        //band table 8x16 four registers are packed into 16x8 two registers:  band_table0_8x16b and band_table2_8x16b
  640|  88.6k|        band_table1_16x8b = _mm_packus_epi16(temp0_8x16b, band_table1_16x8b);
  641|  88.6k|        band_table3_16x8b = _mm_packus_epi16(temp2_8x16b, band_table3_16x8b);
  642|       |        //band table for u and v created
  643|  88.6k|    }
  644|      0|    {
  645|  88.6k|        UWORD8 *pu1_src_cpy;
  646|  88.6k|        WORD32 wd_rem;
  647|       |
  648|       |
  649|       |        //sao_offset is reused for zero cmp mask.
  650|  88.6k|        sao_offset = _mm_setzero_si128();
  651|  88.6k|        tmp_set_128i_1 = _mm_set1_epi8(1);
  652|       |        //tmp_set_128i_2 = _mm_set_epi8 (128,7,128,6,128,5,128,4,128,3,128,2,128,1,128,0);
  653|  88.6k|        cmp_mask = _mm_packus_epi16(cmp_mask, cmp_mask); //cmp_msk=dup16(16);
  654|       |        //to avoid ffff to be saturated to 0 instead it should be to ff
  655|       |
  656|  88.6k|        cmp_msk2 = _mm_slli_epi16(cmp_mask, 1); // to compare if value is greater than 31
  657|  88.6k|        band_pos_u_16x8b = _mm_packus_epi16(band_pos_u_16x8b, band_pos_u_16x8b); //band_pos_u is now 8 bit aligned
  658|  88.6k|        band_pos_v_16x8b = _mm_packus_epi16(band_pos_v_16x8b, band_pos_v_16x8b); //band_pos_v is now 8 bit aligned
  659|  88.6k|        cmp_msk2 = _mm_sub_epi8(cmp_msk2, tmp_set_128i_1); // to compare if value is greater than 31
  660|       |
  661|  88.6k|        cmp_mask = _mm_sub_epi8(cmp_mask, tmp_set_128i_1);
  662|       |
  663|   231k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (663:23): [True: 142k, False: 88.6k]
  ------------------
  664|   142k|        {
  665|   142k|            pu1_src_cpy = pu1_src;
  666|  1.23M|            for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (666:27): [True: 1.08M, False: 142k]
  ------------------
  667|  1.08M|            {
  668|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  669|  1.08M|                src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
  670|       |                // row = 1
  671|  1.08M|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
  672|       |
  673|       |
  674|       |                //odd values
  675|  1.08M|                src_temp1_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  676|  1.08M|                src_temp2_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  677|       |                //even values
  678|  1.08M|                src_temp0_8x16b = _mm_slli_epi16(src_temp0_8x16b, 8);
  679|  1.08M|                src_temp3_8x16b = _mm_slli_epi16(src_temp3_8x16b, 8);
  680|  1.08M|                src_temp0_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  681|  1.08M|                src_temp3_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  682|       |                //combining odd values
  683|  1.08M|                src_temp2_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp2_8x16b);
  684|       |                //combining even values
  685|  1.08M|                src_temp0_8x16b = _mm_packus_epi16(src_temp0_8x16b, src_temp3_8x16b);
  686|       |
  687|       |                //saturated substract 8 bit
  688|  1.08M|                tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_u_16x8b);
  689|  1.08M|                tmp_set_128i_3 = _mm_sub_epi8(src_temp2_8x16b, band_pos_v_16x8b);
  690|       |                //if the values less than 0 put ff
  691|  1.08M|                tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  692|  1.08M|                tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  693|  1.08M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  694|  1.08M|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  695|       |                //if the values greater than 31 put ff
  696|  1.08M|                tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_msk2);
  697|  1.08M|                tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_msk2);
  698|  1.08M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  699|  1.08M|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  700|       |                // registers reused to increase performance
  701|       |                //if the values >16 then put ff ,cmp_mask = dup16(15) row 0 and row1
  702|  1.08M|                src_temp1_8x16b = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_mask);
  703|       |                //if the values >16 then put ff ,cmp_mask = dup16(15) row 2 and  row 3
  704|  1.08M|                src_temp3_8x16b = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_mask);
  705|       |
  706|       |                //values 16 to 31 for row 0 & 1 but values <16 ==0
  707|  1.08M|                tmp_set_128i_2 = _mm_and_si128(tmp_set_128i_1, src_temp1_8x16b);
  708|       |                // values 0 to 15 for row 0 & 1
  709|  1.08M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, src_temp1_8x16b);
  710|       |                //values 16 to 31 for row 2 & 3 but values <16 ==0
  711|  1.08M|                tmp_set_128i_4 = _mm_and_si128(tmp_set_128i_3, src_temp3_8x16b);
  712|       |                // values 0 to 15 for row 2 & 3
  713|  1.08M|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, src_temp3_8x16b);
  714|       |
  715|       |                //values 16 to 31 for row 0 & 1 but values <16 masked to ff row 0 and row1
  716|  1.08M|                src_temp1_8x16b = _mm_cmpeq_epi8(tmp_set_128i_2, sao_offset);
  717|       |                //values 16 to 31 for row 0 & 1 but values <16 masked to ff row 2 and  row 3
  718|  1.08M|                src_temp3_8x16b = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  719|  1.08M|                tmp_set_128i_2 = _mm_or_si128(tmp_set_128i_2, src_temp1_8x16b);
  720|  1.08M|                tmp_set_128i_4 = _mm_or_si128(tmp_set_128i_4, src_temp3_8x16b);
  721|       |
  722|       |
  723|       |                //to choose which pixel values to preserve in row 0 and row 1
  724|  1.08M|                src_temp1_8x16b = _mm_cmpeq_epi8(tmp_set_128i_1, tmp_set_128i_2);
  725|       |                //to choose which pixel values to preserve in row 2 and row 3
  726|  1.08M|                src_temp3_8x16b = _mm_cmpeq_epi8(tmp_set_128i_3, tmp_set_128i_4);
  727|       |                //values of all rows to which no offset needs to be added preserved.
  728|  1.08M|                src_temp0_8x16b = _mm_and_si128(src_temp0_8x16b, src_temp1_8x16b);
  729|  1.08M|                src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, src_temp3_8x16b);
  730|       |
  731|       |                //indexing 0 - 15 bandtable indexes
  732|  1.08M|                tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_16x8b, tmp_set_128i_1); //U low
  733|  1.08M|                tmp_set_128i_3 = _mm_shuffle_epi8(band_table1_16x8b, tmp_set_128i_3); //V low
  734|       |                //indexing 16 -31 bandtable indexes
  735|  1.08M|                tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_16x8b, tmp_set_128i_2); //U high
  736|  1.08M|                tmp_set_128i_4 = _mm_shuffle_epi8(band_table3_16x8b, tmp_set_128i_4); //V high
  737|       |                // combining all offsets results
  738|  1.08M|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2); //U
  739|  1.08M|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4); //V
  740|       |                // combing results with the pixel values
  741|  1.08M|                src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  742|  1.08M|                src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  743|       |                //reorganising even and odd values
  744|  1.08M|                src_temp1_8x16b = _mm_unpacklo_epi8(src_temp0_8x16b, src_temp2_8x16b);
  745|  1.08M|                src_temp3_8x16b = _mm_unpackhi_epi8(src_temp0_8x16b, src_temp2_8x16b);
  746|       |
  747|       |
  748|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
  749|  1.08M|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp1_8x16b);
  750|       |                // row = 1
  751|  1.08M|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp3_8x16b);
  752|       |
  753|       |
  754|  1.08M|                pu1_src_cpy += (src_strd << 1);
  755|       |
  756|  1.08M|            }
  757|   142k|            pu1_src += 16;
  758|   142k|        }
  759|       |
  760|  88.6k|        wd_rem = wd & 0xF;
  761|  88.6k|        if(wd_rem)
  ------------------
  |  Branch (761:12): [True: 4.97k, False: 83.7k]
  ------------------
  762|  4.97k|        {
  763|  4.97k|            pu1_src_cpy = pu1_src;
  764|  17.1k|            for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (764:27): [True: 12.1k, False: 4.97k]
  ------------------
  765|  12.1k|            {
  766|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  767|  12.1k|                src_temp0_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
  768|       |                // row = 1
  769|  12.1k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
  770|       |                // row = 2
  771|  12.1k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
  772|       |                // row = 3
  773|  12.1k|                src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
  774|       |                //row0 and row1 packed and row2 and row3 packed
  775|       |
  776|  12.1k|                src_temp0_8x16b = _mm_unpacklo_epi64(src_temp0_8x16b, src_temp1_8x16b);
  777|  12.1k|                src_temp3_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp3_8x16b);
  778|       |                //odd values
  779|  12.1k|                src_temp1_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  780|  12.1k|                src_temp2_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  781|       |                //even values
  782|  12.1k|                src_temp0_8x16b = _mm_slli_epi16(src_temp0_8x16b, 8);
  783|  12.1k|                src_temp3_8x16b = _mm_slli_epi16(src_temp3_8x16b, 8);
  784|  12.1k|                src_temp0_8x16b = _mm_srli_epi16(src_temp0_8x16b, 8);
  785|  12.1k|                src_temp3_8x16b = _mm_srli_epi16(src_temp3_8x16b, 8);
  786|       |                //combining odd values
  787|  12.1k|                src_temp2_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp2_8x16b);
  788|       |                //combining even values
  789|  12.1k|                src_temp0_8x16b = _mm_packus_epi16(src_temp0_8x16b, src_temp3_8x16b);
  790|       |
  791|       |                //saturated substract 8 bit
  792|  12.1k|                tmp_set_128i_1 = _mm_sub_epi8(src_temp0_8x16b, band_pos_u_16x8b);
  793|  12.1k|                tmp_set_128i_3 = _mm_sub_epi8(src_temp2_8x16b, band_pos_v_16x8b);
  794|       |                //if the values less than 0 put ff
  795|  12.1k|                tmp_set_128i_2 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_1);
  796|  12.1k|                tmp_set_128i_4 = _mm_cmpgt_epi8(sao_offset, tmp_set_128i_3);
  797|  12.1k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  798|  12.1k|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  799|       |                //if the values greater than 31 put ff
  800|  12.1k|                tmp_set_128i_2 = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_msk2);
  801|  12.1k|                tmp_set_128i_4 = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_msk2);
  802|  12.1k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2);
  803|  12.1k|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4);
  804|       |                // registers reused to increase performance
  805|       |                //if the values >16 then put ff ,cmp_mask = dup16(15) row 0 and row1
  806|  12.1k|                src_temp1_8x16b = _mm_cmpgt_epi8(tmp_set_128i_1, cmp_mask);
  807|       |                //if the values >16 then put ff ,cmp_mask = dup16(15) row 2 and  row 3
  808|  12.1k|                src_temp3_8x16b = _mm_cmpgt_epi8(tmp_set_128i_3, cmp_mask);
  809|       |
  810|       |                //values 16 to 31 for row 0 & 1 but values <16 ==0
  811|  12.1k|                tmp_set_128i_2 = _mm_and_si128(tmp_set_128i_1, src_temp1_8x16b);
  812|       |                // values 0 to 15 for row 0 & 1
  813|  12.1k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, src_temp1_8x16b);
  814|       |                //values 16 to 31 for row 2 & 3 but values <16 ==0
  815|  12.1k|                tmp_set_128i_4 = _mm_and_si128(tmp_set_128i_3, src_temp3_8x16b);
  816|       |                // values 0 to 15 for row 2 & 3
  817|  12.1k|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, src_temp3_8x16b);
  818|       |
  819|       |                //values 16 to 31 for row 0 & 1 but values <16 masked to ff row 0 and row1
  820|  12.1k|                src_temp1_8x16b = _mm_cmpeq_epi8(tmp_set_128i_2, sao_offset);
  821|       |                //values 16 to 31 for row 0 & 1 but values <16 masked to ff row 2 and  row 3
  822|  12.1k|                src_temp3_8x16b = _mm_cmpeq_epi8(tmp_set_128i_4, sao_offset);
  823|  12.1k|                tmp_set_128i_2 = _mm_or_si128(tmp_set_128i_2, src_temp1_8x16b);
  824|  12.1k|                tmp_set_128i_4 = _mm_or_si128(tmp_set_128i_4, src_temp3_8x16b);
  825|       |
  826|       |
  827|       |                //to choose which pixel values to preserve in row 0 and row 1
  828|  12.1k|                src_temp1_8x16b = _mm_cmpeq_epi8(tmp_set_128i_1, tmp_set_128i_2);
  829|       |                //to choose which pixel values to preserve in row 2 and row 3
  830|  12.1k|                src_temp3_8x16b = _mm_cmpeq_epi8(tmp_set_128i_3, tmp_set_128i_4);
  831|       |                //values of all rows to which no offset needs to be added preserved.
  832|  12.1k|                src_temp0_8x16b = _mm_and_si128(src_temp0_8x16b, src_temp1_8x16b);
  833|  12.1k|                src_temp2_8x16b = _mm_and_si128(src_temp2_8x16b, src_temp3_8x16b);
  834|       |
  835|       |                //indexing 0 - 15 bandtable indexes
  836|  12.1k|                tmp_set_128i_1 = _mm_shuffle_epi8(band_table0_16x8b, tmp_set_128i_1); //U low
  837|  12.1k|                tmp_set_128i_3 = _mm_shuffle_epi8(band_table1_16x8b, tmp_set_128i_3); //V low
  838|       |                //indexing 16 -31 bandtable indexes
  839|  12.1k|                tmp_set_128i_2 = _mm_shuffle_epi8(band_table2_16x8b, tmp_set_128i_2); //U high
  840|  12.1k|                tmp_set_128i_4 = _mm_shuffle_epi8(band_table3_16x8b, tmp_set_128i_4); //V high
  841|       |                // combining all offsets results
  842|  12.1k|                tmp_set_128i_1 = _mm_or_si128(tmp_set_128i_1, tmp_set_128i_2); //U
  843|  12.1k|                tmp_set_128i_3 = _mm_or_si128(tmp_set_128i_3, tmp_set_128i_4); //V
  844|       |                // combing results with the pixel values
  845|  12.1k|                src_temp0_8x16b = _mm_or_si128(src_temp0_8x16b, tmp_set_128i_1);
  846|  12.1k|                src_temp2_8x16b = _mm_or_si128(src_temp2_8x16b, tmp_set_128i_3);
  847|       |                //reorganising even and odd values
  848|  12.1k|                src_temp1_8x16b = _mm_unpacklo_epi8(src_temp0_8x16b, src_temp2_8x16b);
  849|  12.1k|                src_temp3_8x16b = _mm_unpackhi_epi8(src_temp0_8x16b, src_temp2_8x16b);
  850|       |                //Getting row1 separately
  851|  12.1k|                src_temp0_8x16b = _mm_srli_si128(src_temp1_8x16b, 8);
  852|       |                //Getting row3 separately
  853|  12.1k|                src_temp2_8x16b = _mm_srli_si128(src_temp3_8x16b, 8);
  854|       |
  855|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
  856|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp1_8x16b);
  857|       |                // row = 1
  858|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), src_temp0_8x16b);
  859|       |                // row = 2
  860|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp3_8x16b);
  861|       |                // row = 3
  862|  12.1k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), src_temp2_8x16b);
  863|       |
  864|  12.1k|                pu1_src_cpy += (src_strd << 2);
  865|       |
  866|  12.1k|            }
  867|  4.97k|            pu1_src += 16;
  868|  4.97k|        }
  869|       |
  870|       |
  871|  88.6k|    }
  872|  88.6k|}
ihevc_sao_edge_offset_class0_ssse3:
  887|  47.1k|{
  888|  47.1k|    WORD32 row, col;
  889|  47.1k|    UWORD8 *pu1_src_cpy, *pu1_src_left_cpy, *pu1_src_left_str, *pu1_left_tmp;
  890|  47.1k|    UWORD8 au1_mask[MAX_CTB_SIZE], *au1_mask_cpy;
  891|  47.1k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE + 8];
  892|  47.1k|    UWORD8 au1_src_left_tmp1[MAX_CTB_SIZE + 8];
  893|  47.1k|    UWORD8 u1_avail0, u1_avail1;
  894|  47.1k|    WORD32 wd_rem;
  895|  47.1k|    WORD32 offset = 0;
  896|  47.1k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
  897|  47.1k|    __m128i left0_16x8b, left1_16x8b;
  898|  47.1k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b, cmp_gt1_16x8b, cmp_lt1_16x8b;
  899|  47.1k|    __m128i edge0_16x8b, edge1_16x8b;
  900|  47.1k|    __m128i au1_mask8x16b;
  901|  47.1k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
  902|  47.1k|    __m128i const2_16x8b, const0_16x8b;
  903|  47.1k|    __m128i left_store_16x8b;
  904|  47.1k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  47.1k|#define UNUSED(x) ((void)(x))
  ------------------
  905|  47.1k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  47.1k|#define UNUSED(x) ((void)(x))
  ------------------
  906|       |
  907|  47.1k|    au1_mask8x16b = _mm_set1_epi8(0xff);
  908|       |
  909|       |    /* Update  top and top-left arrays */
  910|       |
  911|  47.1k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  912|       |
  913|  95.8k|    for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (913:19): [True: 48.6k, False: 47.1k]
  ------------------
  914|  48.6k|    {
  915|  48.6k|        const0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + offset + (ht - 1) * src_strd));
  916|  48.6k|        _mm_storeu_si128((__m128i *)(pu1_src_top + offset), const0_16x8b);
  917|  48.6k|        offset += 16;
  918|  48.6k|    }
  919|       |
  920|       |    //setting availability mask to ff size MAX_CTB_SIZE
  921|   235k|    for(col = 0; col < MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   235k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (921:18): [True: 188k, False: 47.1k]
  ------------------
  922|   188k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
  923|  1.18M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (923:18): [True: 1.14M, False: 47.1k]
  ------------------
  924|  1.14M|    {
  925|  1.14M|        au1_src_left_tmp[row] = pu1_src_left[row];
  926|  1.14M|    }
  927|  47.1k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
  928|  47.1k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
  929|       |
  930|       |    //availability mask creation
  931|  47.1k|    u1_avail0 = pu1_avail[0];
  932|  47.1k|    u1_avail1 = pu1_avail[1];
  933|  47.1k|    au1_mask[0] = u1_avail0;
  934|  47.1k|    au1_mask[wd - 1] = u1_avail1;
  935|       |
  936|  47.1k|    const2_16x8b = _mm_set1_epi8(2);
  937|  47.1k|    const0_16x8b = _mm_setzero_si128();
  938|  47.1k|    pu1_src_left_cpy = au1_src_left_tmp;
  939|  47.1k|    pu1_src_left_str = au1_src_left_tmp1;
  940|  47.1k|    {
  941|  47.1k|        au1_mask_cpy = au1_mask;
  942|  95.8k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (942:23): [True: 48.6k, False: 47.1k]
  ------------------
  943|  48.6k|        {
  944|  48.6k|            pu1_src_cpy = pu1_src;
  945|  48.6k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
  946|       |            //pu1_src_left_cpy =au1_src_left_tmp;
  947|   755k|            for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (947:27): [True: 706k, False: 48.6k]
  ------------------
  948|   706k|            {
  949|       |
  950|   706k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
  951|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
  952|   706k|                src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
  953|       |                // row = 1
  954|   706k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
  955|       |
  956|   706k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 2);
  957|       |                //row 1 left
  958|   706k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 15);
  959|   706k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 15);
  960|       |                //row 0 left
  961|   706k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 15);
  962|   706k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
  963|       |
  964|       |
  965|       |                //separating +ve and and -ve values.
  966|   706k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
  967|   706k|                cmp_lt0_16x8b = _mm_subs_epu8(left0_16x8b, src_temp0_16x8b);
  968|   706k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
  969|   706k|                cmp_lt1_16x8b = _mm_subs_epu8(left1_16x8b, src_temp1_16x8b);
  970|       |                //creating mask 00 for +ve and -ve values and FF for zero.
  971|   706k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
  972|   706k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
  973|   706k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
  974|   706k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
  975|       |                //combining the appropriate sign change
  976|   706k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
  977|   706k|                left1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
  978|       |
  979|       |                //row = 0 right
  980|   706k|                edge0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 1));
  981|       |                // row = 1 right
  982|   706k|                edge1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
  983|       |                //separating +ve and and -ve values.
  984|   706k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
  985|   706k|                cmp_lt0_16x8b = _mm_subs_epu8(edge0_16x8b, src_temp0_16x8b);
  986|   706k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
  987|   706k|                cmp_lt1_16x8b = _mm_subs_epu8(edge1_16x8b, src_temp1_16x8b);
  988|       |                //creating mask 00 for +ve and -ve values and FF for zero.
  989|   706k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
  990|   706k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
  991|   706k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
  992|   706k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
  993|       |                //combining the appropriate sign change
  994|   706k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
  995|   706k|                edge1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
  996|       |
  997|       |                //combining sign-left and sign_right
  998|   706k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
  999|   706k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1000|       |                //adding constant 2
 1001|   706k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1002|   706k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1003|       |                //shuffle to get sao index
 1004|   706k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1005|   706k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1006|       |                //using availability mask
 1007|   706k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1008|   706k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1009|       |
 1010|       |                //shuffle to get sao offset
 1011|   706k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1012|   706k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1013|       |                //cnvert to 16 bit then add and then saturated pack
 1014|   706k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1015|   706k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1016|   706k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1017|   706k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1018|   706k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1019|   706k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1020|   706k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1021|   706k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1022|       |
 1023|   706k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1024|   706k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1025|   706k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1026|   706k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1027|   706k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1028|   706k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1029|   706k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1030|   706k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1031|       |
 1032|       |
 1033|   706k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 1034|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1035|   706k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1036|       |                // row = 1
 1037|   706k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 1038|       |
 1039|   706k|                pu1_src_cpy += (src_strd << 1);
 1040|   706k|                pu1_src_left_cpy += 2;
 1041|   706k|                pu1_src_left_str += 2;
 1042|   706k|            }
 1043|  48.6k|            au1_mask_cpy += 16;
 1044|  48.6k|            pu1_src += 16;
 1045|  48.6k|            pu1_src_left_cpy -= ht;
 1046|  48.6k|            pu1_src_left_str -= ht;
 1047|       |
 1048|  48.6k|            pu1_left_tmp = pu1_src_left_cpy;
 1049|  48.6k|            pu1_src_left_cpy = pu1_src_left_str;
 1050|  48.6k|            pu1_src_left_str = pu1_left_tmp;
 1051|  48.6k|        }
 1052|       |
 1053|  47.1k|        wd_rem = wd & 0xF;
 1054|  47.1k|        if(wd_rem)
  ------------------
  |  Branch (1054:12): [True: 45.2k, False: 1.92k]
  ------------------
 1055|  45.2k|        {
 1056|       |
 1057|  45.2k|            cmp_gt1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + (ht - 1) * src_strd));
 1058|  45.2k|            _mm_storel_epi64((__m128i *)(pu1_src_top + offset), cmp_gt1_16x8b);
 1059|       |
 1060|  45.2k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy);
 1061|  45.2k|            pu1_src_cpy = pu1_src;
 1062|  45.2k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 1063|       |            //pu1_src_left_cpy =au1_src_left_tmp;
 1064|   320k|            for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (1064:27): [True: 275k, False: 45.2k]
  ------------------
 1065|   275k|            {
 1066|   275k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 1067|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1068|   275k|                src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 1069|       |                // row = 1
 1070|   275k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1071|       |                // row  = 2
 1072|   275k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1073|       |                // row = 3
 1074|   275k|                cmp_gt1_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 1075|       |
 1076|       |
 1077|   275k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 4);
 1078|       |                //row 3 left
 1079|   275k|                edge0_16x8b = _mm_slli_si128(cmp_gt1_16x8b, 8);
 1080|   275k|                cmp_lt1_16x8b = _mm_alignr_epi8(cmp_gt1_16x8b, left_store_16x8b, 15);
 1081|   275k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1082|       |                //row 2 left
 1083|   275k|                edge0_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 1084|   275k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 15);
 1085|   275k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1086|       |                //row 1 left
 1087|   275k|                edge0_16x8b = _mm_slli_si128(cmp_gt0_16x8b, 8);
 1088|   275k|                cmp_lt0_16x8b = _mm_alignr_epi8(cmp_gt0_16x8b, left_store_16x8b, 15);
 1089|   275k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1090|       |                //row 0 left
 1091|   275k|                edge0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 1092|   275k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 15);
 1093|   275k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 15);
 1094|       |
 1095|       |                // packing rows together for 16 SIMD operations
 1096|   275k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, cmp_gt0_16x8b);
 1097|   275k|                src_temp1_16x8b = _mm_unpacklo_epi64(src_temp1_16x8b, cmp_gt1_16x8b);
 1098|       |                // packing rows together for 16 SIMD operations
 1099|   275k|                left0_16x8b = _mm_unpacklo_epi64(left0_16x8b, cmp_lt0_16x8b);
 1100|   275k|                left1_16x8b = _mm_unpacklo_epi64(left1_16x8b, cmp_lt1_16x8b);
 1101|       |
 1102|       |                //separating +ve and and -ve values.
 1103|   275k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
 1104|   275k|                cmp_lt0_16x8b = _mm_subs_epu8(left0_16x8b, src_temp0_16x8b);
 1105|   275k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
 1106|   275k|                cmp_lt1_16x8b = _mm_subs_epu8(left1_16x8b, src_temp1_16x8b);
 1107|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1108|   275k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1109|   275k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1110|   275k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
 1111|   275k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
 1112|       |                //combining the appropriate sign change
 1113|   275k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1114|   275k|                left1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
 1115|       |
 1116|       |                //row = 0 right
 1117|   275k|                edge0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 1));
 1118|       |                // row = 1 right
 1119|   275k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd + 1));
 1120|       |                // row = 2 right
 1121|   275k|                edge1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd + 1));
 1122|       |                // row = 3 right
 1123|   275k|                cmp_gt1_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd + 1));
 1124|       |                // packing rows together for 16 SIMD operations
 1125|   275k|                edge0_16x8b = _mm_unpacklo_epi64(edge0_16x8b, cmp_gt0_16x8b);
 1126|   275k|                edge1_16x8b = _mm_unpacklo_epi64(edge1_16x8b, cmp_gt1_16x8b);
 1127|       |
 1128|       |                //separating +ve and and -ve values.
 1129|   275k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
 1130|   275k|                cmp_lt0_16x8b = _mm_subs_epu8(edge0_16x8b, src_temp0_16x8b);
 1131|   275k|                cmp_gt1_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
 1132|   275k|                cmp_lt1_16x8b = _mm_subs_epu8(edge1_16x8b, src_temp1_16x8b);
 1133|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1134|   275k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1135|   275k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1136|   275k|                cmp_gt1_16x8b = _mm_cmpeq_epi8(cmp_gt1_16x8b, const0_16x8b);
 1137|   275k|                cmp_lt1_16x8b = _mm_cmpeq_epi8(cmp_lt1_16x8b, const0_16x8b);
 1138|       |                //combining the appropriate sign change
 1139|   275k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1140|   275k|                edge1_16x8b = _mm_sub_epi8(cmp_gt1_16x8b, cmp_lt1_16x8b);
 1141|       |
 1142|       |                //combining sign-left and sign_right
 1143|   275k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
 1144|   275k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1145|       |                //adding constant 2
 1146|   275k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1147|   275k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1148|       |                //shuffle to get sao index
 1149|   275k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1150|   275k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1151|       |                //shuffle to get sao offset
 1152|       |                //using availability mask
 1153|   275k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1154|   275k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1155|       |
 1156|   275k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1157|   275k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1158|       |                //cnvert to 16 bit then add and then saturated pack
 1159|   275k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1160|   275k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1161|   275k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1162|   275k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1163|   275k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1164|   275k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1165|   275k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1166|   275k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1167|       |
 1168|   275k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1169|   275k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1170|   275k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1171|   275k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1172|   275k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1173|   275k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1174|   275k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1175|   275k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1176|       |                //separting row 1 and row 3
 1177|   275k|                cmp_lt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1178|   275k|                cmp_lt1_16x8b = _mm_srli_si128(src_temp1_16x8b, 8);
 1179|       |
 1180|   275k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 1181|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1182|   275k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1183|       |                // row = 1
 1184|   275k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_lt0_16x8b);
 1185|       |                // row = 2
 1186|   275k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp1_16x8b);
 1187|       |                // row = 3
 1188|   275k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt1_16x8b);
 1189|       |
 1190|   275k|                pu1_src_cpy += (src_strd << 2);
 1191|   275k|                pu1_src_left_cpy += 4;
 1192|   275k|                pu1_src_left_str += 4;
 1193|   275k|            }
 1194|  45.2k|            pu1_src += wd;
 1195|  45.2k|            pu1_src_left_cpy -= ht;
 1196|  45.2k|            pu1_src_left_str -= ht;
 1197|       |
 1198|  45.2k|            pu1_left_tmp = pu1_src_left_cpy;
 1199|  45.2k|            pu1_src_left_cpy = pu1_src_left_str;
 1200|  45.2k|            pu1_src_left_str = pu1_left_tmp;
 1201|  45.2k|        }
 1202|  1.18M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1202:22): [True: 1.14M, False: 47.1k]
  ------------------
 1203|  1.14M|        {
 1204|  1.14M|            pu1_src_left[row] = pu1_src_left_cpy[row];
 1205|  1.14M|        }
 1206|  47.1k|    }
 1207|  47.1k|}
ihevc_sao_edge_offset_class0_chroma_ssse3:
 1222|  24.6k|{
 1223|  24.6k|    WORD32 row, col;
 1224|  24.6k|    UWORD8 *pu1_src_cpy, *pu1_src_left_cpy, *pu1_src_left_str, *pu1_left_tmp;
 1225|  24.6k|    UWORD8 au1_mask[2 *MAX_CTB_SIZE], *au1_mask_cpy;
 1226|  24.6k|    UWORD8 au1_src_left_tmp[2 * (MAX_CTB_SIZE + 8)];
 1227|  24.6k|    UWORD8 au1_src_left_tmp1[2 * (MAX_CTB_SIZE + 8)];
 1228|  24.6k|    UWORD8 u1_avail0, u1_avail1;
 1229|  24.6k|    WORD32 wd_rem;
 1230|  24.6k|    WORD32 offset = 0;
 1231|       |
 1232|  24.6k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 1233|  24.6k|    __m128i left0_16x8b, left1_16x8b;
 1234|  24.6k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 1235|  24.6k|    __m128i edge0_16x8b, edge1_16x8b;
 1236|  24.6k|    __m128i au1_mask8x16b;
 1237|  24.6k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 1238|  24.6k|    __m128i const2_16x8b, const0_16x8b;
 1239|  24.6k|    __m128i left_store_16x8b;
 1240|  24.6k|    __m128i chroma_offset_8x16b;
 1241|  24.6k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
 1242|  24.6k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  24.6k|#define UNUSED(x) ((void)(x))
  ------------------
 1243|       |
 1244|  24.6k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 1245|       |
 1246|       |    /* Update  top and top-left arrays */
 1247|  24.6k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 1248|  24.6k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];;
 1249|       |
 1250|  58.2k|    for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (1250:19): [True: 33.6k, False: 24.6k]
  ------------------
 1251|  33.6k|    {
 1252|  33.6k|        const0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + offset + (ht - 1) * src_strd));
 1253|  33.6k|        _mm_storeu_si128((__m128i *)(pu1_src_top + offset), const0_16x8b);
 1254|  33.6k|        offset += 16;
 1255|  33.6k|    }
 1256|   597k|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1256:18): [True: 573k, False: 24.6k]
  ------------------
 1257|   573k|    {
 1258|   573k|        au1_src_left_tmp[row] = pu1_src_left[row];
 1259|   573k|    }
 1260|       |    //setting availability mask to ff size MAX_CTB_SIZE
 1261|   221k|    for(col = 0; col < 2 * MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   221k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (1261:18): [True: 196k, False: 24.6k]
  ------------------
 1262|   196k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 1263|       |
 1264|  24.6k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 1265|  24.6k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 1266|  24.6k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 1267|  24.6k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 1268|       |    //availability mask creation
 1269|  24.6k|    u1_avail0 = pu1_avail[0];
 1270|  24.6k|    u1_avail1 = pu1_avail[1];
 1271|  24.6k|    au1_mask[0] = u1_avail0;
 1272|  24.6k|    au1_mask[1] = u1_avail0;
 1273|  24.6k|    au1_mask[wd - 1] = u1_avail1;
 1274|  24.6k|    au1_mask[wd - 2] = u1_avail1;
 1275|  24.6k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 1276|  24.6k|    const2_16x8b = _mm_set1_epi8(2);
 1277|  24.6k|    const0_16x8b = _mm_setzero_si128();
 1278|       |
 1279|  24.6k|    {
 1280|  24.6k|        pu1_src_left_cpy = au1_src_left_tmp;
 1281|  24.6k|        pu1_src_left_str = au1_src_left_tmp1;
 1282|  24.6k|        au1_mask_cpy = au1_mask;
 1283|  58.3k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (1283:23): [True: 33.7k, False: 24.6k]
  ------------------
 1284|  33.7k|        {
 1285|  33.7k|            pu1_src_cpy = pu1_src;
 1286|  33.7k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 1287|       |
 1288|   264k|            for(row = ht; row > 0; row -= 2)
  ------------------
  |  Branch (1288:27): [True: 230k, False: 33.7k]
  ------------------
 1289|   230k|            {
 1290|       |
 1291|   230k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 1292|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1293|   230k|                src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 1294|       |                // row = 1
 1295|   230k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 1296|       |
 1297|   230k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 4);
 1298|       |                //row 1 left
 1299|   230k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 14);
 1300|   230k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 14);
 1301|       |                //row 0 left
 1302|   230k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 14);
 1303|   230k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 1304|       |
 1305|       |
 1306|       |                //separating +ve and and -ve values.row 0 left
 1307|   230k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
 1308|   230k|                cmp_lt0_16x8b = _mm_subs_epu8(left0_16x8b, src_temp0_16x8b);
 1309|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1310|   230k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1311|   230k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1312|       |                //combining the appropriate sign change
 1313|   230k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1314|       |
 1315|       |                //separating +ve and and -ve values.row 1 left
 1316|   230k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
 1317|   230k|                cmp_lt0_16x8b = _mm_subs_epu8(left1_16x8b, src_temp1_16x8b);
 1318|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1319|   230k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1320|   230k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1321|       |                //combining the appropriate sign change
 1322|   230k|                left1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1323|       |
 1324|       |
 1325|       |                //row = 0 right
 1326|   230k|                edge0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2));
 1327|       |                // row = 1 right
 1328|   230k|                edge1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 1329|       |                //separating +ve and and -ve values.row 0 right
 1330|   230k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
 1331|   230k|                cmp_lt0_16x8b = _mm_subs_epu8(edge0_16x8b, src_temp0_16x8b);
 1332|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1333|   230k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1334|   230k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1335|       |                //combining the appropriate sign change
 1336|   230k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1337|       |
 1338|       |                //separating +ve and and -ve values.row 1 right
 1339|   230k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
 1340|   230k|                cmp_lt0_16x8b = _mm_subs_epu8(edge1_16x8b, src_temp1_16x8b);
 1341|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1342|   230k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1343|   230k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1344|       |                //combining the appropriate sign change
 1345|   230k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1346|       |
 1347|       |                //combining sign-left and sign_right
 1348|   230k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
 1349|   230k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1350|       |                //adding constant 2
 1351|   230k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1352|   230k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1353|       |                //shuffle to get sao index
 1354|   230k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1355|   230k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1356|       |                //using availability mask
 1357|   230k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1358|   230k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1359|       |                //adding chroma offset to access U and V
 1360|   230k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 1361|   230k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 1362|       |
 1363|       |                //shuffle to get sao offset
 1364|   230k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1365|   230k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1366|       |                //cnvert to 16 bit then add and then saturated pack
 1367|   230k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1368|   230k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1369|   230k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1370|   230k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1371|   230k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1372|   230k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1373|   230k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 1374|   230k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1375|       |
 1376|   230k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1377|   230k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1378|   230k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1379|   230k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1380|   230k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1381|   230k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1382|   230k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 1383|   230k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1384|       |
 1385|   230k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 1386|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1387|   230k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1388|       |                // row = 1
 1389|   230k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 1390|       |
 1391|   230k|                pu1_src_cpy += (src_strd << 1);
 1392|   230k|                pu1_src_left_cpy += 4;
 1393|   230k|                pu1_src_left_str += 4;
 1394|   230k|            }
 1395|  33.7k|            au1_mask_cpy += 16;
 1396|  33.7k|            pu1_src += 16;
 1397|  33.7k|            pu1_src_left_cpy -= 2 * ht;
 1398|  33.7k|            pu1_src_left_str -= 2 * ht;
 1399|       |
 1400|  33.7k|            pu1_left_tmp = pu1_src_left_cpy;
 1401|  33.7k|            pu1_src_left_cpy = pu1_src_left_str;
 1402|  33.7k|            pu1_src_left_str = pu1_left_tmp;
 1403|  33.7k|        }
 1404|       |
 1405|  24.6k|        wd_rem = wd & 0xF;
 1406|  24.6k|        if(wd_rem)
  ------------------
  |  Branch (1406:12): [True: 2.18k, False: 22.4k]
  ------------------
 1407|  2.18k|        {
 1408|       |
 1409|  2.18k|            cmp_gt0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + (ht - 1) * src_strd));
 1410|  2.18k|            _mm_storel_epi64((__m128i *)(pu1_src_top + offset), cmp_gt0_16x8b);
 1411|       |
 1412|  2.18k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy);
 1413|  2.18k|            pu1_src_cpy = pu1_src;
 1414|  2.18k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 1415|       |
 1416|  6.59k|            for(row = ht; row > 0; row -= 4)
  ------------------
  |  Branch (1416:27): [True: 4.40k, False: 2.18k]
  ------------------
 1417|  4.40k|            {
 1418|  4.40k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 1419|       |                //row = 0 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1420|  4.40k|                src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 1421|       |                // row = 1
 1422|  4.40k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1423|       |                // row  = 2
 1424|  4.40k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1425|       |                // row = 3
 1426|  4.40k|                cmp_lt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 1427|       |
 1428|       |
 1429|  4.40k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, left_store_16x8b, 8);
 1430|       |                //row 3 left
 1431|  4.40k|                edge0_16x8b = _mm_slli_si128(cmp_lt0_16x8b, 8);
 1432|  4.40k|                left0_16x8b = _mm_alignr_epi8(cmp_lt0_16x8b, left_store_16x8b, 14);
 1433|  4.40k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1434|       |                //row 2 left
 1435|  4.40k|                edge0_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 1436|  4.40k|                left1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, left_store_16x8b, 14);
 1437|  4.40k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1438|       |
 1439|       |
 1440|       |                // packing rows together for 16 SIMD operations
 1441|  4.40k|                src_temp1_16x8b = _mm_unpacklo_epi64(src_temp1_16x8b, cmp_lt0_16x8b);
 1442|  4.40k|                left1_16x8b = _mm_unpacklo_epi64(left1_16x8b, left0_16x8b);
 1443|       |
 1444|       |                //row 1 left
 1445|  4.40k|                edge0_16x8b = _mm_slli_si128(cmp_gt0_16x8b, 8);
 1446|  4.40k|                edge1_16x8b = _mm_alignr_epi8(cmp_gt0_16x8b, left_store_16x8b, 14);
 1447|  4.40k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1448|       |                //row 0 left
 1449|  4.40k|                edge0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 1450|  4.40k|                left0_16x8b = _mm_alignr_epi8(src_temp0_16x8b, left_store_16x8b, 14);
 1451|  4.40k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, edge0_16x8b, 14);
 1452|       |                // packing rows together for 16 SIMD operations
 1453|  4.40k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, cmp_gt0_16x8b);
 1454|  4.40k|                left0_16x8b = _mm_unpacklo_epi64(left0_16x8b, edge1_16x8b);
 1455|       |
 1456|       |                //separating +ve and and -ve values.for row 2 and row 3
 1457|  4.40k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, left1_16x8b);
 1458|  4.40k|                cmp_lt0_16x8b = _mm_subs_epu8(left1_16x8b, src_temp1_16x8b);
 1459|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1460|  4.40k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1461|  4.40k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1462|       |                //combining the appropriate sign change
 1463|  4.40k|                left1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1464|       |
 1465|       |
 1466|       |
 1467|       |
 1468|       |
 1469|       |                //separating +ve and and -ve values.
 1470|  4.40k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, left0_16x8b);
 1471|  4.40k|                cmp_lt0_16x8b = _mm_subs_epu8(left0_16x8b, src_temp0_16x8b);
 1472|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1473|  4.40k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1474|  4.40k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1475|       |                //combining the appropriate sign change
 1476|  4.40k|                left0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1477|       |
 1478|       |
 1479|       |                //row = 0 right
 1480|  4.40k|                edge0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2));
 1481|       |                // row = 1 right
 1482|  4.40k|                cmp_gt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd + 2));
 1483|       |                // row = 2 right
 1484|  4.40k|                edge1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd + 2));
 1485|       |                // row = 3 right
 1486|  4.40k|                cmp_lt0_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd + 2));
 1487|       |                // packing rows together for 16 SIMD operations
 1488|  4.40k|                edge0_16x8b = _mm_unpacklo_epi64(edge0_16x8b, cmp_gt0_16x8b);
 1489|  4.40k|                edge1_16x8b = _mm_unpacklo_epi64(edge1_16x8b, cmp_lt0_16x8b);
 1490|       |
 1491|       |                //separating +ve and and -ve values.
 1492|  4.40k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, edge0_16x8b);
 1493|  4.40k|                cmp_lt0_16x8b = _mm_subs_epu8(edge0_16x8b, src_temp0_16x8b);
 1494|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1495|  4.40k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1496|  4.40k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1497|       |                //combining the appropriate sign change
 1498|  4.40k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1499|       |
 1500|  4.40k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, edge1_16x8b);
 1501|  4.40k|                cmp_lt0_16x8b = _mm_subs_epu8(edge1_16x8b, src_temp1_16x8b);
 1502|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1503|  4.40k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1504|  4.40k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1505|       |                //combining the appropriate sign change
 1506|  4.40k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1507|       |
 1508|       |                //combining sign-left and sign_right
 1509|  4.40k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, left0_16x8b);
 1510|  4.40k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, left1_16x8b);
 1511|       |                //adding constant 2
 1512|  4.40k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1513|  4.40k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1514|       |                //shuffle to get sao index
 1515|  4.40k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1516|  4.40k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1517|       |                //shuffle to get sao offset
 1518|       |                //using availability mask
 1519|  4.40k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 1520|  4.40k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 1521|       |                //adding chroma offset to access U and V
 1522|  4.40k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 1523|  4.40k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 1524|       |
 1525|  4.40k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1526|  4.40k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1527|       |                //cnvert to 16 bit then add and then saturated pack
 1528|  4.40k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1529|  4.40k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1530|  4.40k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, left0_16x8b);
 1531|  4.40k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1532|  4.40k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, left0_16x8b);
 1533|  4.40k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1534|  4.40k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 1535|  4.40k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1536|       |
 1537|  4.40k|                left0_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1538|  4.40k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1539|  4.40k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, left0_16x8b);
 1540|  4.40k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1541|  4.40k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, left0_16x8b);
 1542|  4.40k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1543|  4.40k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 1544|  4.40k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1545|       |
 1546|       |                //seaprting row 1 and row 3
 1547|  4.40k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1548|  4.40k|                cmp_lt0_16x8b = _mm_srli_si128(src_temp1_16x8b, 8);
 1549|       |
 1550|  4.40k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 1551|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1552|  4.40k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1553|       |                // row = 1
 1554|  4.40k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 1555|       |                // row = 2
 1556|  4.40k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_temp1_16x8b);
 1557|       |                // row = 3
 1558|  4.40k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 1559|       |
 1560|  4.40k|                pu1_src_cpy += (src_strd << 2);
 1561|  4.40k|                pu1_src_left_cpy += 8;
 1562|  4.40k|                pu1_src_left_str += 8;
 1563|  4.40k|            }
 1564|  2.18k|            pu1_src += wd;
 1565|  2.18k|            pu1_src_left_cpy -= 2 * ht;
 1566|  2.18k|            pu1_src_left_str -= 2 * ht;
 1567|       |
 1568|  2.18k|            pu1_left_tmp = pu1_src_left_cpy;
 1569|  2.18k|            pu1_src_left_cpy = pu1_src_left_str;
 1570|  2.18k|            pu1_src_left_str = pu1_left_tmp;
 1571|  2.18k|        }
 1572|   598k|        for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1572:22): [True: 574k, False: 24.6k]
  ------------------
 1573|   574k|        {
 1574|   574k|            pu1_src_left[row] = pu1_src_left_cpy[row];
 1575|   574k|        }
 1576|  24.6k|    }
 1577|       |
 1578|  24.6k|}
ihevc_sao_edge_offset_class1_ssse3:
 1592|  34.9k|{
 1593|  34.9k|    WORD32 row, col;
 1594|  34.9k|    UWORD8 *pu1_src_top_cpy;
 1595|  34.9k|    UWORD8 *pu1_src_cpy;
 1596|  34.9k|    WORD32 wd_rem;
 1597|       |
 1598|       |
 1599|  34.9k|    __m128i src_top_16x8b, src_bottom_16x8b;
 1600|  34.9k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 1601|  34.9k|    __m128i signup0_16x8b, signdwn1_16x8b;
 1602|  34.9k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 1603|  34.9k|    __m128i edge0_16x8b, edge1_16x8b;
 1604|  34.9k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 1605|  34.9k|    __m128i const2_16x8b, const0_16x8b;
 1606|       |
 1607|  34.9k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
 1608|  34.9k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
 1609|       |
 1610|       |
 1611|       |    /* Updating left and top-left  */
 1612|   832k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1612:18): [True: 797k, False: 34.9k]
  ------------------
 1613|   797k|    {
 1614|   797k|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
 1615|   797k|    }
 1616|  34.9k|    *pu1_src_top_left = pu1_src_top[wd - 1];
 1617|       |
 1618|       |
 1619|       |
 1620|  34.9k|    pu1_src_top_cpy = pu1_src_top;
 1621|  34.9k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 1622|  34.9k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
 1623|       |
 1624|       |    /* Update height and source pointers based on the availability flags */
 1625|  34.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1625:8): [True: 5.70k, False: 29.2k]
  ------------------
 1626|  5.70k|    {
 1627|  5.70k|        pu1_src_top_cpy = pu1_src;
 1628|  5.70k|        pu1_src += src_strd;
 1629|  5.70k|        ht--;
 1630|  5.70k|    }
 1631|  34.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1631:8): [True: 4.39k, False: 30.5k]
  ------------------
 1632|  4.39k|    {
 1633|  4.39k|        ht--;
 1634|  4.39k|    }
 1635|       |
 1636|  34.9k|    const2_16x8b = _mm_set1_epi8(2);
 1637|  34.9k|    const0_16x8b = _mm_setzero_si128();
 1638|       |
 1639|  34.9k|    {
 1640|  34.9k|        WORD32 ht_rem;
 1641|  69.6k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (1641:23): [True: 34.6k, False: 34.9k]
  ------------------
 1642|  34.6k|        {
 1643|  34.6k|            pu1_src_cpy = pu1_src;
 1644|  34.6k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 1645|       |            //row = 0
 1646|  34.6k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 1647|       |            //separating +ve and and -ve values.
 1648|  34.6k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 1649|  34.6k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 1650|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 1651|  34.6k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1652|  34.6k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1653|       |            //combining the appropriate sign change
 1654|  34.6k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1655|       |
 1656|   548k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (1656:27): [True: 514k, False: 34.6k]
  ------------------
 1657|   514k|            {
 1658|       |
 1659|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1660|   514k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 1661|       |                // row = 2
 1662|   514k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1663|       |
 1664|       |
 1665|       |                //row 0 -row1
 1666|       |                //separating +ve and and -ve values.
 1667|   514k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 1668|   514k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_temp0_16x8b);
 1669|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1670|   514k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1671|   514k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1672|       |                //combining the appropriate sign change
 1673|   514k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1674|       |                //row1-row0
 1675|   514k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1676|       |
 1677|       |                //row1 -bottom
 1678|   514k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 1679|   514k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 1680|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1681|   514k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1682|   514k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1683|       |                //combining the appropriate sign change
 1684|   514k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1685|       |
 1686|       |                //combining sign-left and sign_right
 1687|   514k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 1688|   514k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 1689|       |
 1690|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 1691|   514k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1692|       |                //adding constant 2
 1693|   514k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1694|   514k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1695|       |                //shuffle to get sao index
 1696|   514k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1697|   514k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1698|       |                //shuffle to get sao offset
 1699|   514k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1700|   514k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1701|       |                //copying the next top
 1702|   514k|                src_top_16x8b = src_temp1_16x8b;
 1703|       |                //cnvert to 16 bit then add and then saturated pack
 1704|   514k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1705|   514k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1706|   514k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1707|   514k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1708|   514k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1709|   514k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1710|   514k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1711|   514k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1712|       |
 1713|   514k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1714|   514k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1715|   514k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 1716|   514k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 1717|   514k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1718|   514k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 1719|   514k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1720|   514k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 1721|       |
 1722|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1723|   514k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1724|       |                // row = 1
 1725|   514k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 1726|       |
 1727|   514k|                src_temp0_16x8b = src_bottom_16x8b;
 1728|   514k|                pu1_src_cpy += (src_strd << 1);
 1729|   514k|            }
 1730|  34.6k|            ht_rem = ht & 0x1;
 1731|       |
 1732|  34.6k|            if(ht_rem)
  ------------------
  |  Branch (1732:16): [True: 7.92k, False: 26.7k]
  ------------------
 1733|  7.92k|            {
 1734|  7.92k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 1735|       |                //current row -next row
 1736|       |                //separating +ve and and -ve values.
 1737|  7.92k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 1738|  7.92k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 1739|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1740|  7.92k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1741|  7.92k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1742|       |                //combining the appropriate sign change
 1743|  7.92k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1744|       |                //adding top and botton and constant 2
 1745|  7.92k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 1746|  7.92k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1747|       |
 1748|  7.92k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1749|  7.92k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1750|       |                //copying the next top
 1751|  7.92k|                src_top_16x8b = src_temp0_16x8b;
 1752|       |                //cnvert to 16 bit then add and then saturated pack
 1753|  7.92k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1754|  7.92k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1755|  7.92k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1756|  7.92k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1757|  7.92k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1758|  7.92k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1759|  7.92k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1760|  7.92k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1761|       |
 1762|  7.92k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1763|  7.92k|            }
 1764|  34.6k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (1764:16): [True: 3.62k, False: 31.0k]
  ------------------
 1765|  3.62k|            {
 1766|  3.62k|                src_top_16x8b = src_bottom_16x8b;
 1767|  3.62k|            }
 1768|       |            //updating top flag
 1769|  34.6k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 1770|  34.6k|            pu1_src += 16;
 1771|  34.6k|        }
 1772|       |
 1773|  34.9k|        wd_rem = wd & 0xF;
 1774|  34.9k|        if(wd_rem)
  ------------------
  |  Branch (1774:12): [True: 33.2k, False: 1.74k]
  ------------------
 1775|  33.2k|        {
 1776|  33.2k|            pu1_src_cpy = pu1_src;
 1777|  33.2k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 1778|       |            //row = 0
 1779|  33.2k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 1780|       |            //separating +ve and and -ve values.
 1781|  33.2k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 1782|  33.2k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 1783|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 1784|  33.2k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1785|  33.2k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1786|       |            //combining the appropriate sign change
 1787|  33.2k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1788|  33.2k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 1789|   214k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (1789:27): [True: 180k, False: 33.2k]
  ------------------
 1790|   180k|            {
 1791|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1792|   180k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1793|       |                // row = 2
 1794|   180k|                src_bottom_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1795|       |
 1796|       |                //row 0 -row1
 1797|       |                //separating +ve and and -ve values.
 1798|   180k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 1799|   180k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_temp0_16x8b);
 1800|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1801|   180k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1802|   180k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1803|       |                //combining the appropriate sign change
 1804|   180k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1805|       |
 1806|       |                //row1-row0
 1807|   180k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1808|   180k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 1809|   180k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 1810|       |                //row1 -row2
 1811|   180k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 1812|   180k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 1813|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1814|   180k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1815|   180k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1816|       |                //combining the appropriate sign change
 1817|   180k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 1818|   180k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 1819|       |                //packing row 0 n row 1
 1820|   180k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 1821|       |                //row = 3
 1822|   180k|                src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 1823|       |                // row = 4
 1824|   180k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 4 * src_strd));
 1825|       |
 1826|   180k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 1827|   180k|                signdwn1_16x8b = _mm_slli_si128(signdwn1_16x8b, 8); //allign left (1-2)
 1828|       |                //separating +ve and and -ve values.(2,3)
 1829|   180k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_top_16x8b);
 1830|   180k|                cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_bottom_16x8b);
 1831|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1832|   180k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1833|   180k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1834|       |                //combining the appropriate sign change
 1835|   180k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 1836|       |
 1837|   180k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signdwn1_16x8b, 8); //(2-3) ,(1-2) (substract with down)
 1838|   180k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8);
 1839|       |                //separating +ve and and -ve values.(3,4)
 1840|   180k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp1_16x8b);
 1841|   180k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_top_16x8b);
 1842|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1843|   180k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1844|   180k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1845|   180k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-4)
 1846|       |                //combining sign-left and sign_right
 1847|   180k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-4),(2-3)
 1848|       |
 1849|   180k|                edge1_16x8b = _mm_sub_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 1850|       |
 1851|       |                //packing row 2 n row 3
 1852|   180k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 1853|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 1854|   180k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(4-3)
 1855|       |
 1856|       |                //adding constant 2
 1857|   180k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1858|   180k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 1859|       |                //shuffle to get sao index
 1860|   180k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1861|   180k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 1862|       |                //shuffle to get sao offset
 1863|   180k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1864|   180k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 1865|       |                //the next top already in  src_top_16x8b
 1866|       |                //src_top_16x8b = src_temp1_16x8b;
 1867|       |                //cnvert to 16 bit then add and then saturated pack
 1868|   180k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1869|   180k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1870|   180k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1871|   180k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 1872|   180k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1873|   180k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1874|   180k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1875|   180k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 1876|       |
 1877|   180k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 1878|   180k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 1879|   180k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 1880|   180k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 1881|   180k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1882|   180k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 1883|   180k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, cmp_lt0_16x8b);
 1884|   180k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 1885|       |
 1886|   180k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1887|   180k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 1888|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1889|   180k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1890|       |                // row = 1
 1891|   180k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 1892|       |                //row = 2
 1893|   180k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 1894|       |                // row = 3
 1895|   180k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 1896|       |
 1897|   180k|                src_temp0_16x8b = src_temp1_16x8b;
 1898|   180k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 1899|   180k|                pu1_src_cpy += (src_strd << 2);
 1900|       |
 1901|   180k|            }
 1902|  33.2k|            ht_rem = ht & 0x2;
 1903|  33.2k|            if(ht_rem)
  ------------------
  |  Branch (1903:16): [True: 9.46k, False: 23.7k]
  ------------------
 1904|  9.46k|            {
 1905|       |
 1906|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1907|  9.46k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1908|       |                // row = 2
 1909|  9.46k|                src_bottom_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 1910|       |
 1911|       |                //row 0 -row1
 1912|       |                //separating +ve and and -ve values.
 1913|  9.46k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 1914|  9.46k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_temp0_16x8b);
 1915|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1916|  9.46k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1917|  9.46k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1918|       |                //combining the appropriate sign change
 1919|  9.46k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1920|       |                //row1-row0
 1921|  9.46k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 1922|  9.46k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 1923|  9.46k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 1924|       |                //row1 -row2
 1925|  9.46k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 1926|  9.46k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 1927|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1928|  9.46k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1929|  9.46k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1930|       |                //combining the appropriate sign change
 1931|  9.46k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 1932|  9.46k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 1933|       |                //adding top and down substraction
 1934|  9.46k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 1935|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 1936|  9.46k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(2-1) for next
 1937|  9.46k|                src_top_16x8b = src_temp1_16x8b;
 1938|       |                //adding constant 2
 1939|  9.46k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1940|       |
 1941|       |                //shuffle to get sao index
 1942|  9.46k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1943|       |
 1944|       |                //shuffle to get sao offset
 1945|  9.46k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1946|       |
 1947|       |                //the next top already in  src_top_16x8b
 1948|       |                //cnvert to 16 bit then add and then saturated pack
 1949|  9.46k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1950|  9.46k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1951|  9.46k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1952|  9.46k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 1953|  9.46k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 1954|  9.46k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 1955|  9.46k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 1956|  9.46k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 1957|       |
 1958|  9.46k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 1959|       |
 1960|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 1961|  9.46k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 1962|       |                // row = 1
 1963|  9.46k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 1964|  9.46k|                src_temp0_16x8b = src_bottom_16x8b;
 1965|  9.46k|                pu1_src_cpy += (src_strd << 1);
 1966|       |
 1967|  9.46k|            }
 1968|  33.2k|            ht_rem = ht & 0x1;
 1969|  33.2k|            if(ht_rem)
  ------------------
  |  Branch (1969:16): [True: 9.13k, False: 24.1k]
  ------------------
 1970|  9.13k|            {
 1971|       |
 1972|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 1973|  9.13k|                src_bottom_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 1974|       |
 1975|       |                //row 0 -row1
 1976|       |                //separating +ve and and -ve values.
 1977|  9.13k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 1978|  9.13k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 1979|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 1980|  9.13k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 1981|  9.13k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 1982|       |                //combining the appropriate sign change
 1983|  9.13k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 1984|       |                //adding top and down substraction
 1985|  9.13k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 1986|       |                //adding constant 2
 1987|  9.13k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 1988|  9.13k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 1989|  9.13k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 1990|       |                //shuffle to get sao index
 1991|  9.13k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 1992|       |                //shuffle to get sao offset
 1993|  9.13k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 1994|  9.13k|                src_top_16x8b = src_temp0_16x8b;
 1995|       |                //cnvert to 16 bit then add and then saturated pack
 1996|  9.13k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 1997|  9.13k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 1998|  9.13k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 1999|  9.13k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2000|  9.13k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 2001|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 2002|  9.13k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2003|  9.13k|                pu1_src_cpy += (src_strd);
 2004|       |
 2005|  9.13k|            }
 2006|  33.2k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2006:16): [True: 4.32k, False: 28.9k]
  ------------------
 2007|  4.32k|            {
 2008|  4.32k|                src_top_16x8b = src_bottom_16x8b;
 2009|  4.32k|            }
 2010|  33.2k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2011|  33.2k|            pu1_src += 8;
 2012|  33.2k|        }
 2013|  34.9k|    }
 2014|  34.9k|}
ihevc_sao_edge_offset_class1_chroma_ssse3:
 2028|  38.5k|{
 2029|  38.5k|    WORD32 row, col;
 2030|  38.5k|    UWORD8 *pu1_src_top_cpy;
 2031|  38.5k|    UWORD8 *pu1_src_cpy;
 2032|  38.5k|    WORD32 wd_rem;
 2033|       |
 2034|       |
 2035|  38.5k|    __m128i src_top_16x8b, src_bottom_16x8b;
 2036|  38.5k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 2037|  38.5k|    __m128i signup0_16x8b, signdwn1_16x8b;
 2038|  38.5k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 2039|  38.5k|    __m128i edge0_16x8b, edge1_16x8b;
 2040|  38.5k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 2041|  38.5k|    __m128i const2_16x8b, const0_16x8b;
 2042|  38.5k|    __m128i chroma_offset_8x16b;
 2043|       |
 2044|  38.5k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  38.5k|#define UNUSED(x) ((void)(x))
  ------------------
 2045|  38.5k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  38.5k|#define UNUSED(x) ((void)(x))
  ------------------
 2046|       |
 2047|       |    /* Updating left and top and top-left */
 2048|   516k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (2048:18): [True: 478k, False: 38.5k]
  ------------------
 2049|   478k|    {
 2050|   478k|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
 2051|   478k|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
 2052|   478k|    }
 2053|  38.5k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 2054|  38.5k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
 2055|       |
 2056|       |
 2057|       |
 2058|  38.5k|    pu1_src_top_cpy = pu1_src_top;
 2059|  38.5k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 2060|  38.5k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 2061|  38.5k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 2062|  38.5k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 2063|       |    /* Update height and source pointers based on the availability flags */
 2064|  38.5k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (2064:8): [True: 5.88k, False: 32.6k]
  ------------------
 2065|  5.88k|    {
 2066|  5.88k|        pu1_src_top_cpy = pu1_src;
 2067|  5.88k|        pu1_src += src_strd;
 2068|  5.88k|        ht--;
 2069|  5.88k|    }
 2070|  38.5k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (2070:8): [True: 4.23k, False: 34.2k]
  ------------------
 2071|  4.23k|    {
 2072|  4.23k|        ht--;
 2073|  4.23k|    }
 2074|  38.5k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 2075|  38.5k|    const2_16x8b = _mm_set1_epi8(2);
 2076|  38.5k|    const0_16x8b = _mm_setzero_si128();
 2077|       |
 2078|       |
 2079|  38.5k|    {
 2080|  38.5k|        WORD32 ht_rem;
 2081|       |
 2082|       |
 2083|       |
 2084|  97.5k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (2084:23): [True: 59.0k, False: 38.5k]
  ------------------
 2085|  59.0k|        {
 2086|  59.0k|            pu1_src_cpy = pu1_src;
 2087|  59.0k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 2088|       |            //row = 0
 2089|  59.0k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 2090|       |            //separating +ve and and -ve values.
 2091|  59.0k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2092|  59.0k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 2093|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 2094|  59.0k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2095|  59.0k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2096|       |            //combining the appropriate sign change
 2097|  59.0k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2098|       |
 2099|   456k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (2099:27): [True: 397k, False: 59.0k]
  ------------------
 2100|   397k|            {
 2101|       |
 2102|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2103|   397k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 2104|       |                // row = 2
 2105|   397k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 2106|       |
 2107|       |
 2108|       |                //row 0 -row1
 2109|       |                //separating +ve and and -ve values.
 2110|   397k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 2111|   397k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_temp0_16x8b);
 2112|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2113|   397k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2114|   397k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2115|       |                //combining the appropriate sign change
 2116|   397k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2117|       |                //row1-row0
 2118|   397k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2119|       |
 2120|       |                //row1 -bottom
 2121|   397k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2122|   397k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 2123|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2124|   397k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2125|   397k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2126|       |                //combining the appropriate sign change
 2127|   397k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2128|       |
 2129|       |                //combining sign-left and sign_right
 2130|   397k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2131|   397k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 2132|       |
 2133|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 2134|   397k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2135|       |                //adding constant 2
 2136|   397k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2137|   397k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2138|       |                //copying the next top
 2139|   397k|                src_top_16x8b = src_temp1_16x8b;
 2140|       |
 2141|       |
 2142|       |                //shuffle to get sao index
 2143|   397k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2144|   397k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2145|       |                //adding chroma offset to access U and V
 2146|   397k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2147|   397k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 2148|       |
 2149|       |                //shuffle to get sao offset
 2150|   397k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2151|   397k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 2152|       |                //cnvert to 16 bit then add and then saturated pack
 2153|   397k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2154|   397k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2155|   397k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2156|   397k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2157|   397k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2158|   397k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2159|   397k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 2160|   397k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2161|       |
 2162|   397k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 2163|   397k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 2164|   397k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 2165|   397k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 2166|   397k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 2167|   397k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2168|   397k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 2169|   397k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 2170|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 2171|   397k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2172|       |                // row = 1
 2173|   397k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 2174|       |
 2175|   397k|                src_temp0_16x8b = src_bottom_16x8b;
 2176|   397k|                pu1_src_cpy += (src_strd << 1);
 2177|   397k|            }
 2178|  59.0k|            ht_rem = ht & 0x1;
 2179|       |
 2180|  59.0k|            if(ht_rem)
  ------------------
  |  Branch (2180:16): [True: 11.3k, False: 47.6k]
  ------------------
 2181|  11.3k|            {
 2182|  11.3k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 2183|       |                //current row -next row
 2184|       |                //separating +ve and and -ve values.
 2185|  11.3k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2186|  11.3k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 2187|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2188|  11.3k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2189|  11.3k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2190|       |                //combining the appropriate sign change
 2191|  11.3k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2192|       |                //adding top and botton and constant 2
 2193|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2194|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2195|       |                //copying the next top
 2196|  11.3k|                src_top_16x8b = src_temp0_16x8b;
 2197|       |
 2198|  11.3k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2199|       |                //adding chroma offset to access U and V
 2200|  11.3k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2201|  11.3k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2202|       |
 2203|       |                //cnvert to 16 bit then add and then saturated pack
 2204|  11.3k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2205|  11.3k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2206|  11.3k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2207|  11.3k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2208|  11.3k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2209|  11.3k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2210|  11.3k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 2211|  11.3k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2212|       |
 2213|  11.3k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2214|  11.3k|            }
 2215|  59.0k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2215:16): [True: 6.20k, False: 52.7k]
  ------------------
 2216|  6.20k|            {
 2217|  6.20k|                src_top_16x8b = src_bottom_16x8b;
 2218|  6.20k|            }
 2219|       |            //updating top flag
 2220|  59.0k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2221|  59.0k|            pu1_src += 16;
 2222|  59.0k|        }
 2223|       |
 2224|  38.5k|        wd_rem = wd & 0xF;
 2225|  38.5k|        if(wd_rem)
  ------------------
  |  Branch (2225:12): [True: 2.19k, False: 36.3k]
  ------------------
 2226|  2.19k|        {
 2227|  2.19k|            pu1_src_cpy = pu1_src;
 2228|  2.19k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 2229|       |            //row = 0
 2230|  2.19k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 2231|       |            //separating +ve and and -ve values.
 2232|  2.19k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2233|  2.19k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 2234|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 2235|  2.19k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2236|  2.19k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2237|       |            //combining the appropriate sign change
 2238|  2.19k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2239|  2.19k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 2240|  5.94k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (2240:27): [True: 3.75k, False: 2.19k]
  ------------------
 2241|  3.75k|            {
 2242|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2243|  3.75k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 2244|       |                // row = 2
 2245|  3.75k|                src_bottom_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 2246|       |
 2247|       |                //row 0 -row1
 2248|       |                //separating +ve and and -ve values.
 2249|  3.75k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 2250|  3.75k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_temp0_16x8b);
 2251|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2252|  3.75k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2253|  3.75k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2254|       |                //combining the appropriate sign change
 2255|  3.75k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2256|       |
 2257|       |                //row1-row0
 2258|  3.75k|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2259|  3.75k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 2260|  3.75k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 2261|       |                //row1 -row2
 2262|  3.75k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2263|  3.75k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 2264|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2265|  3.75k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2266|  3.75k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2267|       |                //combining the appropriate sign change
 2268|  3.75k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 2269|  3.75k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 2270|       |                //packing row 0 n row 1
 2271|  3.75k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 2272|       |                //row = 3
 2273|  3.75k|                src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd));
 2274|       |                // row = 4
 2275|  3.75k|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 4 * src_strd));
 2276|       |
 2277|  3.75k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 2278|  3.75k|                signdwn1_16x8b = _mm_slli_si128(signdwn1_16x8b, 8); //allign left (1-2)
 2279|       |                //separating +ve and and -ve values.(2,3)
 2280|  3.75k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_top_16x8b);
 2281|  3.75k|                cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_bottom_16x8b);
 2282|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2283|  3.75k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2284|  3.75k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2285|       |                //combining the appropriate sign change
 2286|  3.75k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 2287|       |
 2288|  3.75k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signdwn1_16x8b, 8); //(2-3) ,(1-2) (substract with down)
 2289|  3.75k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8);
 2290|       |                //separating +ve and and -ve values.(3,4)
 2291|  3.75k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp1_16x8b);
 2292|  3.75k|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_top_16x8b);
 2293|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2294|  3.75k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2295|  3.75k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2296|  3.75k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-4)
 2297|       |                //combining sign-left and sign_right
 2298|  3.75k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-4),(2-3)
 2299|       |
 2300|  3.75k|                edge1_16x8b = _mm_sub_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 2301|       |
 2302|       |                //packing row 2 n row 3
 2303|  3.75k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 2304|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 2305|  3.75k|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(4-3)
 2306|       |                //adding constant 2
 2307|  3.75k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2308|  3.75k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2309|       |                //shuffle to get sao index
 2310|  3.75k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2311|  3.75k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2312|       |                //adding chroma offset to access U and V
 2313|  3.75k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2314|  3.75k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 2315|       |
 2316|       |                //shuffle to get sao offset
 2317|  3.75k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2318|  3.75k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 2319|       |                //the next top already in  src_top_16x8b
 2320|       |                //cnvert to 16 bit then add and then saturated pack
 2321|  3.75k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2322|  3.75k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2323|  3.75k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2324|  3.75k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2325|  3.75k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2326|  3.75k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2327|  3.75k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 2328|  3.75k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2329|       |
 2330|  3.75k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 2331|  3.75k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 2332|  3.75k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 2333|  3.75k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 2334|  3.75k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 2335|  3.75k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2336|  3.75k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, edge1_16x8b);
 2337|  3.75k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 2338|       |
 2339|  3.75k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 2340|  3.75k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 2341|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 2342|  3.75k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2343|       |                // row = 1
 2344|  3.75k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 2345|       |                //row = 2
 2346|  3.75k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 2347|       |                // row = 3
 2348|  3.75k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 2349|       |
 2350|  3.75k|                src_temp0_16x8b = src_temp1_16x8b;
 2351|  3.75k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 2352|  3.75k|                pu1_src_cpy += (src_strd << 2);
 2353|       |
 2354|  3.75k|            }
 2355|  2.19k|            ht_rem = ht & 0x2;
 2356|  2.19k|            if(ht_rem)
  ------------------
  |  Branch (2356:16): [True: 871, False: 1.32k]
  ------------------
 2357|    871|            {
 2358|       |
 2359|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2360|    871|                src_temp1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 2361|       |                // row = 2
 2362|    871|                src_bottom_16x8b =  _mm_loadl_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd));
 2363|       |
 2364|       |                //row 0 -row1
 2365|       |                //separating +ve and and -ve values.
 2366|    871|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_temp1_16x8b);
 2367|    871|                cmp_lt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_temp0_16x8b);
 2368|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2369|    871|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2370|    871|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2371|       |                //combining the appropriate sign change
 2372|    871|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2373|       |                //row1-row0
 2374|    871|                edge1_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b);
 2375|    871|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 2376|    871|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 2377|       |                //row1 -row2
 2378|    871|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2379|    871|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 2380|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2381|    871|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2382|    871|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2383|       |                //combining the appropriate sign change
 2384|    871|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 2385|    871|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 2386|       |                //adding top and down substraction
 2387|    871|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 2388|       |                //for the next iteration signup0_16x8b = -signdwn1_16x8b
 2389|    871|                signup0_16x8b = _mm_sub_epi8(cmp_lt0_16x8b, cmp_gt0_16x8b); //(2-1) for next
 2390|    871|                src_top_16x8b = src_temp1_16x8b;
 2391|       |
 2392|       |                //adding constant 2
 2393|    871|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2394|       |
 2395|       |                //shuffle to get sao index
 2396|    871|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2397|       |
 2398|       |                //adding chroma offset to access U and V
 2399|    871|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2400|       |                //shuffle to get sao offset
 2401|    871|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2402|       |                //the next top already in  src_top_16x8b
 2403|       |                //cnvert to 16 bit then add and then saturated pack
 2404|    871|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2405|    871|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2406|    871|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2407|    871|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 2408|    871|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2409|    871|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2410|    871|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge0_16x8b);
 2411|    871|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 2412|       |
 2413|    871|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 2414|       |
 2415|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 2416|    871|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2417|       |                // row = 1
 2418|    871|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 2419|    871|                src_temp0_16x8b = src_bottom_16x8b;
 2420|    871|                pu1_src_cpy += (src_strd << 1);
 2421|       |
 2422|    871|            }
 2423|  2.19k|            ht_rem = ht & 0x1;
 2424|  2.19k|            if(ht_rem)
  ------------------
  |  Branch (2424:16): [True: 864, False: 1.32k]
  ------------------
 2425|    864|            {
 2426|       |
 2427|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2428|    864|                src_bottom_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy + src_strd));
 2429|       |
 2430|       |                //row 0 -row1
 2431|       |                //separating +ve and and -ve values.
 2432|    864|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2433|    864|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 2434|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2435|    864|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2436|    864|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2437|       |                //combining the appropriate sign change
 2438|    864|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2439|       |                //adding top and down substraction
 2440|    864|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2441|       |                //adding constant 2
 2442|    864|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2443|    864|                src_top_16x8b = src_temp0_16x8b;
 2444|       |
 2445|    864|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 2446|    864|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 2447|       |                //shuffle to get sao index
 2448|    864|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2449|       |                //adding chroma offset to access U and V
 2450|    864|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 2451|       |                //shuffle to get sao offset
 2452|    864|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2453|       |
 2454|       |                //cnvert to 16 bit then add and then saturated pack
 2455|    864|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2456|    864|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2457|    864|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2458|    864|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2459|    864|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 2460|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 2461|    864|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2462|    864|                pu1_src_cpy += (src_strd);
 2463|       |
 2464|    864|            }
 2465|  2.19k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2465:16): [True: 424, False: 1.76k]
  ------------------
 2466|    424|            {
 2467|    424|                src_top_16x8b = src_bottom_16x8b;
 2468|    424|            }
 2469|  2.19k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2470|  2.19k|            pu1_src += 8;
 2471|  2.19k|        }
 2472|  38.5k|    }
 2473|  38.5k|}
ihevc_sao_edge_offset_class2_ssse3:
 2487|  70.0k|{
 2488|  70.0k|    WORD32 row, col;
 2489|  70.0k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 2490|  70.0k|    UWORD8 *pu1_left_tmp, *pu1_src_left_str, *pu1_src_left_str2;
 2491|  70.0k|    UWORD8 *pu1_firstleft;
 2492|  70.0k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 2493|  70.0k|    UWORD8 au1_mask[MAX_CTB_SIZE], *au1_mask_cpy;
 2494|  70.0k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE + 8];
 2495|  70.0k|    UWORD8 au1_src_left_tmp1[MAX_CTB_SIZE + 8];
 2496|  70.0k|    WORD32 wd_rem;
 2497|  70.0k|    UWORD8 u1_pos_0_0_tmp, u1_pos_wd_ht_tmp;
 2498|  70.0k|    WORD32 ht_tmp, ht_0;
 2499|       |
 2500|  70.0k|    WORD32 bit_depth;
 2501|  70.0k|    UWORD8 u1_avail0, u1_avail1;
 2502|       |
 2503|  70.0k|    __m128i src_top_16x8b, src_bottom_16x8b;
 2504|  70.0k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 2505|  70.0k|    __m128i signup0_16x8b, signdwn1_16x8b;
 2506|  70.0k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 2507|  70.0k|    __m128i edge0_16x8b, edge1_16x8b;
 2508|  70.0k|    __m128i au1_mask8x16b;
 2509|  70.0k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 2510|  70.0k|    __m128i const2_16x8b, const0_16x8b;
 2511|  70.0k|    __m128i left_store_16x8b;
 2512|  70.0k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  70.0k|#define UNUSED(x) ((void)(x))
  ------------------
 2513|  70.0k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  70.0k|#define UNUSED(x) ((void)(x))
  ------------------
 2514|       |
 2515|  70.0k|    ht_0 = ht; ht_tmp = ht;
 2516|  70.0k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 2517|       |
 2518|       |    //setting availability mask to ff size MAX_CTB_SIZE
 2519|   350k|    for(col = 0; col < MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   350k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (2519:18): [True: 280k, False: 70.0k]
  ------------------
 2520|   280k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 2521|  1.50M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (2521:18): [True: 1.43M, False: 70.0k]
  ------------------
 2522|  1.43M|    {
 2523|  1.43M|        au1_src_left_tmp[row] = pu1_src_left[row];
 2524|  1.43M|    }
 2525|  70.0k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  70.0k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  70.0k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 2526|  70.0k|    pu1_src_org = pu1_src;
 2527|  70.0k|    pu1_src_top_cpy = pu1_src_top;
 2528|  70.0k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 2529|  70.0k|    pu1_src_left_cpy = au1_src_left_tmp;
 2530|  70.0k|    pu1_src_left_str2 = au1_src_left_tmp1;
 2531|  70.0k|    pu1_src_left_str = au1_src_left_tmp1;
 2532|  70.0k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 2533|  70.0k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
 2534|       |
 2535|       |
 2536|       |    /* If top-left is available, process separately */
 2537|  70.0k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (2537:8): [True: 53.2k, False: 16.8k]
  ------------------
 2538|  53.2k|    {
 2539|  53.2k|        WORD8 edge_idx;
 2540|       |
 2541|  53.2k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  53.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 48.6k, False: 4.57k]
  |  |  |  Branch (44:34): [True: 5.54k, False: 43.0k]
  |  |  ------------------
  ------------------
 2542|  53.2k|                        SIGN(pu1_src[0] - pu1_src[1 + src_strd]);
  ------------------
  |  |   44|  53.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 49.2k, False: 3.97k]
  |  |  |  Branch (44:34): [True: 5.34k, False: 43.8k]
  |  |  ------------------
  ------------------
 2543|       |
 2544|  53.2k|        edge_idx = gi1_table_edge_idx[edge_idx];
 2545|       |
 2546|  53.2k|        if(0 != edge_idx)
  ------------------
  |  Branch (2546:12): [True: 9.52k, False: 43.6k]
  ------------------
 2547|  9.52k|        {
 2548|  9.52k|            u1_pos_0_0_tmp = CLIP3(pu1_src[0] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.52k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 273, False: 9.24k]
  |  |  |  Branch (40:53): [True: 437, False: 8.81k]
  |  |  ------------------
  ------------------
 2549|  9.52k|        }
 2550|  43.6k|        else
 2551|  43.6k|        {
 2552|  43.6k|            u1_pos_0_0_tmp = pu1_src[0];
 2553|  43.6k|        }
 2554|  53.2k|    }
 2555|  16.8k|    else
 2556|  16.8k|    {
 2557|  16.8k|        u1_pos_0_0_tmp = pu1_src[0];
 2558|  16.8k|    }
 2559|       |
 2560|       |    /* If bottom-right is available, process separately */
 2561|  70.0k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (2561:8): [True: 57.6k, False: 12.3k]
  ------------------
 2562|  57.6k|    {
 2563|  57.6k|        WORD8 edge_idx;
 2564|       |
 2565|  57.6k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 1 - src_strd]) +
  ------------------
  |  |   44|  57.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 54.2k, False: 3.39k]
  |  |  |  Branch (44:34): [True: 3.80k, False: 50.4k]
  |  |  ------------------
  ------------------
 2566|  57.6k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  57.6k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 52.3k, False: 5.28k]
  |  |  |  Branch (44:34): [True: 5.75k, False: 46.6k]
  |  |  ------------------
  ------------------
 2567|       |
 2568|  57.6k|        edge_idx = gi1_table_edge_idx[edge_idx];
 2569|       |
 2570|  57.6k|        if(0 != edge_idx)
  ------------------
  |  Branch (2570:12): [True: 7.98k, False: 49.6k]
  ------------------
 2571|  7.98k|        {
 2572|  7.98k|            u1_pos_wd_ht_tmp = CLIP3(pu1_src[wd - 1 + (ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.98k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 558, False: 7.42k]
  |  |  |  Branch (40:53): [True: 273, False: 7.15k]
  |  |  ------------------
  ------------------
 2573|  7.98k|        }
 2574|  49.6k|        else
 2575|  49.6k|        {
 2576|  49.6k|            u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
 2577|  49.6k|        }
 2578|  57.6k|    }
 2579|  12.3k|    else
 2580|  12.3k|    {
 2581|  12.3k|        u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
 2582|  12.3k|    }
 2583|  70.0k|    pu1_firstleft = pu1_src_top_left;
 2584|       |
 2585|       |    /* Update height and source pointers based on the availability flags */
 2586|  70.0k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (2586:8): [True: 9.66k, False: 60.3k]
  ------------------
 2587|  9.66k|    {
 2588|  9.66k|        pu1_firstleft = pu1_src_left_cpy2;
 2589|  9.66k|        pu1_src_left_cpy2++;
 2590|  9.66k|        pu1_src_left_str2++;
 2591|  9.66k|        pu1_src_top_cpy = pu1_src;
 2592|  9.66k|        pu1_src += src_strd;
 2593|  9.66k|        ht--;
 2594|  9.66k|    }
 2595|  70.0k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (2595:8): [True: 7.24k, False: 62.7k]
  ------------------
 2596|  7.24k|    {
 2597|  7.24k|        ht--;
 2598|  7.24k|        ht_0--;
 2599|  7.24k|    }
 2600|       |    //storing top left in a mmx register
 2601|  70.0k|    left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_firstleft);
 2602|  70.0k|    const2_16x8b = _mm_set1_epi8(2);
 2603|  70.0k|    const0_16x8b = _mm_setzero_si128();
 2604|  70.0k|    left_store_16x8b = _mm_slli_si128(left_store_16x8b, 15);
 2605|       |    //update top -left
 2606|  70.0k|    *pu1_src_top_left = pu1_src_top[wd - 1];
 2607|       |    //availability mask creation
 2608|  70.0k|    u1_avail0 = pu1_avail[0];
 2609|  70.0k|    u1_avail1 = pu1_avail[1];
 2610|  70.0k|    au1_mask[0] = u1_avail0;
 2611|  70.0k|    au1_mask[wd - 1] = u1_avail1;
 2612|  70.0k|    {
 2613|  70.0k|        WORD32 ht_rem;
 2614|       |
 2615|       |
 2616|  70.0k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 2617|  70.0k|        pu1_src_left_str = pu1_src_left_str2;
 2618|  70.0k|        au1_mask_cpy = au1_mask;
 2619|   125k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (2619:23): [True: 55.1k, False: 70.0k]
  ------------------
 2620|  55.1k|        {
 2621|  55.1k|            pu1_src_cpy = pu1_src;
 2622|  55.1k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 2623|       |            //row = 0
 2624|  55.1k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 2625|  55.1k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 15);
 2626|       |            //loading the mask
 2627|  55.1k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 2628|       |            //separating +ve and and -ve values.
 2629|  55.1k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2630|  55.1k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 2631|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 2632|  55.1k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2633|  55.1k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2634|       |            //combining the appropriate sign change
 2635|  55.1k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2636|       |
 2637|       |
 2638|   764k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (2638:27): [True: 709k, False: 55.1k]
  ------------------
 2639|   709k|            {
 2640|   709k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 2641|       |                //row = 1
 2642|   709k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 2643|       |                // row = 1 right
 2644|   709k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
 2645|       |                //to insert left in row 0
 2646|   709k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 15);
 2647|       |                //row 0 -row1
 2648|       |                //separating +ve and and -ve values.
 2649|   709k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2650|   709k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 2651|       |
 2652|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2653|   709k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2654|   709k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2655|       |                //manipulation for row 1 - row 0
 2656|   709k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 15);
 2657|       |                //combining the appropriate sign change
 2658|   709k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 2659|       |                //row1-row0
 2660|       |                //separating +ve and and -ve values.
 2661|   709k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 2662|   709k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 2663|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2664|   709k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2665|   709k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2666|       |                // row = 2 right
 2667|   709k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd + 1));
 2668|   709k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 2669|       |
 2670|       |
 2671|       |                //row1 -bottom
 2672|   709k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 2673|   709k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 2674|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2675|   709k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2676|   709k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2677|       |                //combining the appropriate sign change
 2678|   709k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2679|       |                // row = 2
 2680|   709k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 2681|       |
 2682|       |                //combining sign-left and sign_right
 2683|   709k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2684|       |
 2685|       |                //storing the row 1 left for next row.
 2686|   709k|                signup0_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 2687|       |
 2688|       |                //combining sign-left and sign_right
 2689|   709k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 2690|       |                //manipulation for bottom - row 1
 2691|   709k|                signup0_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signup0_16x8b, 15);
 2692|       |                //eliminating old left for row 0 and row 1
 2693|   709k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 2694|       |                //bottom - row1
 2695|   709k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signup0_16x8b);
 2696|   709k|                cmp_lt0_16x8b = _mm_subs_epu8(signup0_16x8b, src_bottom_16x8b);
 2697|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2698|   709k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2699|   709k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2700|       |                //for the next iteration bottom -row1
 2701|   709k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2702|       |                //row1  getting it right for left of next block
 2703|   709k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 15);
 2704|       |                //adding constant 2
 2705|   709k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2706|   709k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2707|       |                //shuffle to get sao index
 2708|   709k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2709|   709k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2710|       |                //using availability mask
 2711|   709k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 2712|   709k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 2713|       |                //shuffle to get sao offset
 2714|   709k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2715|   709k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 2716|       |                //row0  getting it right for left of next block
 2717|   709k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 2718|       |                //copying the next top
 2719|   709k|                src_top_16x8b = src_temp1_16x8b;
 2720|       |                //cnvert to 16 bit then add and then saturated pack
 2721|   709k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2722|   709k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2723|   709k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2724|   709k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2725|   709k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2726|   709k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2727|   709k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2728|   709k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2729|       |
 2730|   709k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 2731|   709k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 2732|   709k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 2733|   709k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 2734|   709k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2735|   709k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 2736|   709k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 2737|   709k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 2738|       |
 2739|       |                //store left boundary
 2740|   709k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 2741|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 2742|   709k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2743|       |                // row = 1
 2744|   709k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 2745|       |
 2746|   709k|                src_temp0_16x8b = src_bottom_16x8b;
 2747|   709k|                pu1_src_cpy += (src_strd << 1);
 2748|   709k|                pu1_src_left_cpy += 2;
 2749|   709k|                pu1_src_left_str += 2;
 2750|   709k|            }
 2751|  55.1k|            ht_rem = ht & 0x1;
 2752|       |
 2753|  55.1k|            if(ht_rem)
  ------------------
  |  Branch (2753:16): [True: 11.4k, False: 43.7k]
  ------------------
 2754|  11.4k|            {
 2755|  11.4k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 2756|  11.4k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
 2757|       |                //current row -next row
 2758|       |                //separating +ve and and -ve values.
 2759|  11.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 2760|  11.4k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 2761|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2762|  11.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2763|  11.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2764|       |                //combining the appropriate sign change
 2765|  11.4k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2766|       |                //adding top and botton and constant 2
 2767|  11.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 2768|  11.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2769|       |                //eliminating old left for row 0 and row 1
 2770|  11.4k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 2771|       |
 2772|  11.4k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2773|       |                //using availability mask
 2774|  11.4k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 2775|       |
 2776|  11.4k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2777|       |
 2778|       |                //row0  getting it right for left of next block
 2779|  11.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 2780|       |                //copying the next top
 2781|  11.4k|                src_top_16x8b = src_temp0_16x8b;
 2782|       |                //cnvert to 16 bit then add and then saturated pack
 2783|  11.4k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 2784|  11.4k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 2785|  11.4k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 2786|  11.4k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 2787|  11.4k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2788|  11.4k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 2789|  11.4k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 2790|  11.4k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 2791|       |                //store left boundary
 2792|  11.4k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 2793|       |
 2794|  11.4k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 2795|  11.4k|                pu1_src_cpy += (src_strd);
 2796|  11.4k|                pu1_src_left_cpy += 1;
 2797|  11.4k|                pu1_src_left_str += 1;
 2798|  11.4k|            }
 2799|  55.1k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (2799:16): [True: 4.88k, False: 50.2k]
  ------------------
 2800|  4.88k|            {
 2801|  4.88k|                src_top_16x8b = src_bottom_16x8b;
 2802|  4.88k|                pu1_src_left_str[0] = pu1_src_cpy[15];
 2803|  4.88k|            }
 2804|  55.1k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (2804:16): [True: 7.31k, False: 47.8k]
  ------------------
 2805|  7.31k|            {
 2806|  7.31k|                pu1_src_left_str[-ht_0] = pu1_src[15 - src_strd];
 2807|  7.31k|            }
 2808|       |
 2809|       |            //for the top left of next part of the block
 2810|  55.1k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 2811|       |            //updating top flag
 2812|  55.1k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 2813|  55.1k|            pu1_src += 16;
 2814|  55.1k|            au1_mask_cpy += 16;
 2815|       |
 2816|       |
 2817|  55.1k|            pu1_left_tmp = pu1_src_left_cpy2;
 2818|  55.1k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 2819|  55.1k|            pu1_src_left_str2 = pu1_left_tmp;
 2820|       |
 2821|  55.1k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 2822|  55.1k|            pu1_src_left_str = pu1_src_left_str2;
 2823|  55.1k|        }
 2824|       |
 2825|  70.0k|        wd_rem = wd & 0xF;
 2826|  70.0k|        if(wd_rem)
  ------------------
  |  Branch (2826:12): [True: 68.6k, False: 1.36k]
  ------------------
 2827|  68.6k|        {
 2828|  68.6k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 2829|  68.6k|            pu1_src_left_str = pu1_src_left_str2;
 2830|  68.6k|            pu1_src_cpy = pu1_src;
 2831|  68.6k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 2832|       |            //row = 0
 2833|  68.6k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 2834|  68.6k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 15);
 2835|  68.6k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 2836|       |            //separating +ve and and -ve values.
 2837|  68.6k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 2838|  68.6k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 2839|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 2840|  68.6k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2841|  68.6k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2842|       |            //preparing au1_mask
 2843|  68.6k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 2844|       |            //combining the appropriate sign change
 2845|  68.6k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2846|  68.6k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 2847|       |
 2848|   404k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (2848:27): [True: 335k, False: 68.6k]
  ------------------
 2849|   335k|            {
 2850|   335k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 2851|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 2852|   335k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 2853|       |                // row = 2
 2854|   335k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 2855|       |                //right row1
 2856|   335k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 2857|       |                //row 0 -row1
 2858|       |                //separating +ve and and -ve values.
 2859|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 2860|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 2861|       |                //manipulation for row 1 -row 0
 2862|   335k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 15);
 2863|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2864|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2865|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2866|       |                //row 0 left
 2867|   335k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 15);
 2868|       |                //combining the appropriate sign change
 2869|   335k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2870|       |                //row 1 -row0
 2871|       |                //separating +ve and and -ve values.
 2872|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 2873|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 2874|       |
 2875|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2876|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2877|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2878|       |                //row1-row0
 2879|   335k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 2880|       |
 2881|   335k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 2882|       |
 2883|   335k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 2884|       |                //right row2
 2885|   335k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 2886|       |                //packing row 0 n row 1
 2887|   335k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 2888|       |                //row1 -row2
 2889|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 2890|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 2891|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2892|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2893|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2894|       |                //combining the appropriate sign change
 2895|   335k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 2896|   335k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 2897|       |                //manipulation for row 2 -row 1
 2898|   335k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 2899|       |                //row 1 left
 2900|   335k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 2901|       |                //row = 3
 2902|   335k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 2903|       |
 2904|       |                // row = 4
 2905|   335k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 2906|       |
 2907|   335k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 2908|       |
 2909|       |                //separating +ve and and -ve values.(2,1)
 2910|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 2911|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 2912|       |                //manipulation for row 3 -row 2
 2913|   335k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 13);
 2914|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2915|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2916|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2917|       |                //row 2 left
 2918|   335k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 2919|       |                //combining the appropriate sign change
 2920|   335k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 2921|       |
 2922|       |                //separating +ve and and -ve values.(3,2)
 2923|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 2924|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 2925|   335k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8); //aligned left (2-1)
 2926|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2927|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2928|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2929|       |                //right row3
 2930|   335k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 1);
 2931|       |                //combining the appropriate sign change
 2932|   335k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 2933|       |
 2934|   335k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(3-2) ,(2-1)
 2935|       |
 2936|       |                //separating +ve and and -ve values.(2,3)
 2937|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 2938|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 2939|       |                //right row 4
 2940|   335k|                signdwn1_16x8b =  _mm_srli_si128(src_temp1_16x8b, 1);
 2941|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2942|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2943|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2944|       |                //combining the appropriate sign change
 2945|   335k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 2946|       |
 2947|       |                //separating +ve and and -ve values.(3,bottom)
 2948|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 2949|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 2950|       |
 2951|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2952|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2953|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2954|   335k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 2955|       |                //combining the appropriate sign change
 2956|   335k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 2957|   335k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-bottom),(2-3)
 2958|       |
 2959|       |                //manipulation for bottom -row 3
 2960|   335k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 2961|       |                //eliminating old left for row 0,1,2,3
 2962|   335k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 2963|       |                //packing row 2 n row 3
 2964|   335k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 2965|       |                //row 3 left
 2966|   335k|                signdwn1_16x8b = _mm_alignr_epi8(src_top_16x8b, signdwn1_16x8b, 15);
 2967|       |                //loading row 3 right into left
 2968|   335k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_bottom_16x8b, 15);
 2969|       |                //adding bottom and top values of row 2 and row 3
 2970|   335k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 2971|       |                //separating +ve and and -ve values.(botttom,3)
 2972|   335k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 2973|   335k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 2974|       |                //to store right of row 2
 2975|   335k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 2976|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 2977|   335k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 2978|   335k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 2979|   335k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(bottom -3) for next iteration
 2980|       |
 2981|       |                //storing right of row 2into left
 2982|   335k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 2983|       |                //to store right of row 0
 2984|   335k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 2985|       |                //storing right of row 1 into left
 2986|   335k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 2987|       |
 2988|       |                //adding constant 2
 2989|   335k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 2990|   335k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 2991|       |                //shuffle to get sao index
 2992|   335k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 2993|   335k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 2994|       |                //using availability mask
 2995|   335k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 2996|   335k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 2997|       |                //shuffle to get sao offset
 2998|   335k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 2999|   335k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 3000|       |
 3001|       |                //storing right of row 0 into left
 3002|   335k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3003|       |                //cnvert to 16 bit then add and then saturated pack
 3004|   335k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3005|   335k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3006|   335k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3007|   335k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3008|   335k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3009|   335k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3010|   335k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3011|   335k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3012|       |
 3013|   335k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 3014|   335k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 3015|   335k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 3016|   335k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 3017|   335k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3018|   335k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 3019|   335k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, cmp_lt0_16x8b);
 3020|   335k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 3021|       |
 3022|   335k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3023|   335k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 3024|       |
 3025|   335k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3026|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 3027|   335k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3028|       |                // row = 1
 3029|   335k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3030|       |                //row = 2
 3031|   335k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 3032|       |                // row = 3
 3033|   335k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 3034|       |
 3035|   335k|                src_temp0_16x8b = src_temp1_16x8b;
 3036|   335k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 3037|   335k|                pu1_src_cpy += (src_strd << 2);
 3038|   335k|                pu1_src_left_cpy += 4;
 3039|   335k|                pu1_src_left_str += 4;
 3040|   335k|            }
 3041|  68.6k|            ht_rem = ht & 0x2;
 3042|  68.6k|            if(ht_rem)
  ------------------
  |  Branch (3042:16): [True: 16.4k, False: 52.1k]
  ------------------
 3043|  16.4k|            {
 3044|  16.4k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3045|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 3046|  16.4k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3047|       |                // row = 2
 3048|  16.4k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3049|       |
 3050|       |                //row 0 -row 1
 3051|  16.4k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 3052|       |                //separating +ve and and -ve values.
 3053|  16.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3054|  16.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3055|       |                //manipulation for row 1 -row 0
 3056|  16.4k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 15);
 3057|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3058|  16.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3059|  16.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3060|       |                //manipulation for row 1 - row 0
 3061|  16.4k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 15);
 3062|       |                //combining the appropriate sign change
 3063|  16.4k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3064|       |
 3065|       |                //row1-row0
 3066|       |                //separating +ve and and -ve values.
 3067|  16.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3068|  16.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3069|       |
 3070|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3071|  16.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3072|  16.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3073|       |                //combining the appropriate sign chang
 3074|  16.4k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3075|       |                //row 1 -bottom
 3076|  16.4k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 3077|       |
 3078|  16.4k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 3079|  16.4k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 3080|       |                //row1 -bottom
 3081|  16.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3082|  16.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3083|       |
 3084|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3085|  16.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3086|  16.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3087|       |                //combining the appropriate sign change
 3088|  16.4k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 3089|  16.4k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 3090|       |                //manipulation for bottom -row1
 3091|  16.4k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 3092|       |                //manipulation for bottom- row 1
 3093|  16.4k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 3094|       |                //adding top and down substraction
 3095|  16.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 3096|       |                //bottom - row 1
 3097|  16.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3098|  16.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3099|       |
 3100|       |                //eliminating old left for row 0,1
 3101|  16.4k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 3102|  16.4k|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 3103|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3104|  16.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3105|  16.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3106|       |                //for the next iteration signup0_16x8b
 3107|  16.4k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1) for next
 3108|       |
 3109|       |                //storing right of row 1 into left
 3110|  16.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3111|       |                //for storing right of row 1
 3112|  16.4k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3113|       |
 3114|  16.4k|                src_top_16x8b = src_temp1_16x8b;
 3115|       |                //storing right of row 0 into left
 3116|  16.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3117|       |
 3118|       |                //adding constant 2
 3119|  16.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3120|       |
 3121|       |                //shuffle to get sao index
 3122|  16.4k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3123|       |                //using availability mask
 3124|  16.4k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3125|       |                //shuffle to get sao offset
 3126|  16.4k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3127|       |
 3128|       |                //the next top already in  src_top_16x8b
 3129|       |                //cnvert to 16 bit then add and then saturated pack
 3130|  16.4k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3131|  16.4k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3132|  16.4k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3133|  16.4k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 3134|  16.4k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3135|  16.4k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3136|  16.4k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 3137|  16.4k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 3138|       |
 3139|  16.4k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3140|       |
 3141|  16.4k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3142|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 3143|  16.4k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3144|       |                // row = 1
 3145|  16.4k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3146|  16.4k|                src_temp0_16x8b = src_bottom_16x8b;
 3147|  16.4k|                pu1_src_cpy += (src_strd << 1);
 3148|  16.4k|                pu1_src_left_cpy += 2;
 3149|  16.4k|                pu1_src_left_str += 2;
 3150|  16.4k|            }
 3151|  68.6k|            ht_rem = ht & 0x1;
 3152|  68.6k|            if(ht_rem)
  ------------------
  |  Branch (3152:16): [True: 16.2k, False: 52.4k]
  ------------------
 3153|  16.2k|            {
 3154|  16.2k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3155|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 3156|  16.2k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3157|       |                //left store manipulation 1
 3158|  16.2k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 3159|       |                //row 0 -row1
 3160|  16.2k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 3161|       |                //separating +ve and and -ve values.
 3162|  16.2k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3163|  16.2k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3164|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3165|  16.2k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3166|  16.2k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3167|       |                //combining the appropriate sign change
 3168|  16.2k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3169|       |                //adding top and down substraction
 3170|  16.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3171|       |                //for row 0 right to put into left store
 3172|  16.2k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3173|       |                //adding constant 2
 3174|  16.2k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3175|  16.2k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 3176|  16.2k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 3177|       |                //filling the left boundary value
 3178|  16.2k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 3179|       |
 3180|       |                //shuffle to get sao index
 3181|  16.2k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3182|       |                //using availability mask
 3183|  16.2k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3184|       |                //shuffle to get sao offset
 3185|  16.2k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3186|  16.2k|                src_top_16x8b = src_temp0_16x8b;
 3187|       |                //cnvert to 16 bit then add and then saturated pack
 3188|  16.2k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3189|  16.2k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3190|  16.2k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3191|  16.2k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3192|  16.2k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 3193|       |
 3194|  16.2k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3195|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 3196|  16.2k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3197|  16.2k|                pu1_src_cpy += (src_strd);
 3198|  16.2k|                pu1_src_left_cpy += 1;
 3199|  16.2k|                pu1_src_left_str += 1;
 3200|  16.2k|            }
 3201|  68.6k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (3201:16): [True: 7.21k, False: 61.4k]
  ------------------
 3202|  7.21k|            {
 3203|  7.21k|                src_top_16x8b = src_bottom_16x8b;
 3204|  7.21k|                pu1_src_left_str[0] = pu1_src_cpy[7];
 3205|  7.21k|            }
 3206|       |
 3207|  68.6k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (3207:16): [True: 9.55k, False: 59.1k]
  ------------------
 3208|  9.55k|            {
 3209|  9.55k|                pu1_src_left_str[-ht_0] = pu1_src[7 - src_strd];
 3210|  9.55k|            }
 3211|       |
 3212|  68.6k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 3213|  68.6k|            pu1_src += 8;
 3214|  68.6k|            au1_mask_cpy += 16;
 3215|       |
 3216|  68.6k|            pu1_left_tmp = pu1_src_left_cpy2;
 3217|  68.6k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 3218|  68.6k|            pu1_src_left_str2 = pu1_left_tmp;
 3219|       |
 3220|  68.6k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 3221|  68.6k|            pu1_src_left_str = pu1_src_left_str2;
 3222|  68.6k|        }
 3223|  70.0k|        pu1_src_org[0] = u1_pos_0_0_tmp;
 3224|  70.0k|        pu1_src_org[wd - 1 + (ht_tmp - 1) * src_strd] = u1_pos_wd_ht_tmp;
 3225|  70.0k|        pu1_src_left_cpy = (0 == pu1_avail[2]) ? (pu1_src_left_cpy - 1) : pu1_src_left_cpy;
  ------------------
  |  Branch (3225:28): [True: 9.66k, False: 60.3k]
  ------------------
 3226|  1.50M|        for(row = 0; row < ht_tmp; row++)
  ------------------
  |  Branch (3226:22): [True: 1.43M, False: 70.0k]
  ------------------
 3227|  1.43M|        {
 3228|  1.43M|            pu1_src_left[row] = pu1_src_left_cpy[row];
 3229|  1.43M|        }
 3230|  70.0k|    }
 3231|       |
 3232|  70.0k|}
ihevc_sao_edge_offset_class2_chroma_ssse3:
 3247|  43.4k|{
 3248|  43.4k|    WORD32 row, col;
 3249|  43.4k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 3250|  43.4k|    UWORD8 *pu1_left_tmp, *pu1_src_left_str, *pu1_src_left_str2;
 3251|  43.4k|    UWORD8 *pu1_firstleft;
 3252|  43.4k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 3253|  43.4k|    UWORD8 au1_mask[2 * MAX_CTB_SIZE], *au1_mask_cpy;
 3254|  43.4k|    UWORD8 au1_src_left_tmp[2 * (MAX_CTB_SIZE + 8)];
 3255|  43.4k|    UWORD8 au1_src_left_tmp1[2 * (MAX_CTB_SIZE + 8)];
 3256|  43.4k|    WORD32 wd_rem;
 3257|  43.4k|    UWORD8 u1_pos_0_0_tmp_u, u1_pos_0_0_tmp_v, u1_pos_wd_ht_tmp_u, u1_pos_wd_ht_tmp_v;
 3258|  43.4k|    WORD32 ht_tmp;
 3259|  43.4k|    WORD32 ht_0;
 3260|       |
 3261|  43.4k|    WORD32 bit_depth;
 3262|  43.4k|    UWORD8 u1_avail0, u1_avail1;
 3263|       |
 3264|  43.4k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 3265|  43.4k|    __m128i signup0_16x8b, signdwn1_16x8b;
 3266|  43.4k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 3267|  43.4k|    __m128i edge0_16x8b, edge1_16x8b;
 3268|  43.4k|    __m128i src_top_16x8b, src_bottom_16x8b;
 3269|  43.4k|    __m128i au1_mask8x16b;
 3270|  43.4k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 3271|  43.4k|    __m128i const2_16x8b, const0_16x8b;
 3272|  43.4k|    __m128i left_store_16x8b;
 3273|  43.4k|    __m128i chroma_offset_8x16b;
 3274|       |
 3275|  43.4k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  43.4k|#define UNUSED(x) ((void)(x))
  ------------------
 3276|  43.4k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  43.4k|#define UNUSED(x) ((void)(x))
  ------------------
 3277|       |
 3278|  43.4k|    ht_0 = ht; ht_tmp = ht;
 3279|  43.4k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 3280|       |    /* Updating left and top-left  */
 3281|  1.02M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (3281:18): [True: 979k, False: 43.4k]
  ------------------
 3282|   979k|    {
 3283|   979k|        au1_src_left_tmp[row] = pu1_src_left[row];
 3284|   979k|    }
 3285|       |    //setting availability mask to ff size MAX_CTB_SIZE
 3286|   391k|    for(col = 0; col < 2 * MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   391k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (3286:18): [True: 348k, False: 43.4k]
  ------------------
 3287|   348k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 3288|  43.4k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  43.4k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  43.4k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 3289|  43.4k|    pu1_src_org = pu1_src;
 3290|  43.4k|    pu1_src_top_cpy = pu1_src_top;
 3291|  43.4k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 3292|  43.4k|    pu1_src_left_cpy = au1_src_left_tmp;
 3293|  43.4k|    pu1_src_left_str2 = au1_src_left_tmp1;
 3294|  43.4k|    pu1_src_left_str = au1_src_left_tmp1;
 3295|  43.4k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 3296|  43.4k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 3297|  43.4k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 3298|  43.4k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 3299|       |
 3300|       |    /* If top-left is available, process separately */
 3301|  43.4k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (3301:8): [True: 30.5k, False: 12.8k]
  ------------------
 3302|  30.5k|    {
 3303|  30.5k|        WORD32 edge_idx;
 3304|       |
 3305|       |        /* U */
 3306|  30.5k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  30.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.8k, False: 3.70k]
  |  |  |  Branch (44:34): [True: 4.13k, False: 22.7k]
  |  |  ------------------
  ------------------
 3307|  30.5k|                        SIGN(pu1_src[0] - pu1_src[2 + src_strd]);
  ------------------
  |  |   44|  30.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.7k, False: 2.79k]
  |  |  |  Branch (44:34): [True: 3.72k, False: 24.0k]
  |  |  ------------------
  ------------------
 3308|       |
 3309|  30.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3310|       |
 3311|  30.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (3311:12): [True: 7.29k, False: 23.2k]
  ------------------
 3312|  7.29k|        {
 3313|  7.29k|            u1_pos_0_0_tmp_u = CLIP3(pu1_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.29k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 361, False: 6.93k]
  |  |  |  Branch (40:53): [True: 300, False: 6.63k]
  |  |  ------------------
  ------------------
 3314|  7.29k|        }
 3315|  23.2k|        else
 3316|  23.2k|        {
 3317|  23.2k|            u1_pos_0_0_tmp_u = pu1_src[0];
 3318|  23.2k|        }
 3319|       |
 3320|       |        /* V */
 3321|  30.5k|        edge_idx = 2 + SIGN(pu1_src[1] - pu1_src_top_left[1]) +
  ------------------
  |  |   44|  30.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.8k, False: 3.72k]
  |  |  |  Branch (44:34): [True: 3.92k, False: 22.9k]
  |  |  ------------------
  ------------------
 3322|  30.5k|                        SIGN(pu1_src[1] - pu1_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  30.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 27.5k, False: 2.97k]
  |  |  |  Branch (44:34): [True: 3.64k, False: 23.9k]
  |  |  ------------------
  ------------------
 3323|       |
 3324|  30.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3325|       |
 3326|  30.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (3326:12): [True: 7.43k, False: 23.1k]
  ------------------
 3327|  7.43k|        {
 3328|  7.43k|            u1_pos_0_0_tmp_v = CLIP3(pu1_src[1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.43k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 331, False: 7.10k]
  |  |  |  Branch (40:53): [True: 306, False: 6.80k]
  |  |  ------------------
  ------------------
 3329|  7.43k|        }
 3330|  23.1k|        else
 3331|  23.1k|        {
 3332|  23.1k|            u1_pos_0_0_tmp_v = pu1_src[1];
 3333|  23.1k|        }
 3334|  30.5k|    }
 3335|  12.8k|    else
 3336|  12.8k|    {
 3337|  12.8k|        u1_pos_0_0_tmp_u = pu1_src[0];
 3338|  12.8k|        u1_pos_0_0_tmp_v = pu1_src[1];
 3339|  12.8k|    }
 3340|       |
 3341|       |    /* If bottom-right is available, process separately */
 3342|  43.4k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (3342:8): [True: 33.3k, False: 10.0k]
  ------------------
 3343|  33.3k|    {
 3344|  33.3k|        WORD32 edge_idx;
 3345|       |
 3346|       |        /* U */
 3347|  33.3k|        edge_idx = 2 + SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  33.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 31.7k, False: 1.55k]
  |  |  |  Branch (44:34): [True: 1.83k, False: 29.9k]
  |  |  ------------------
  ------------------
 3348|  33.3k|                        SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  33.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.1k, False: 4.18k]
  |  |  |  Branch (44:34): [True: 3.75k, False: 25.3k]
  |  |  ------------------
  ------------------
 3349|       |
 3350|  33.3k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3351|       |
 3352|  33.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (3352:12): [True: 7.74k, False: 25.5k]
  ------------------
 3353|  7.74k|        {
 3354|  7.74k|            u1_pos_wd_ht_tmp_u = CLIP3(pu1_src[wd - 2 + (ht - 1) * src_strd] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.74k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 296, False: 7.44k]
  |  |  |  Branch (40:53): [True: 275, False: 7.17k]
  |  |  ------------------
  ------------------
 3355|  7.74k|        }
 3356|  25.5k|        else
 3357|  25.5k|        {
 3358|  25.5k|            u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
 3359|  25.5k|        }
 3360|       |
 3361|       |        /* V */
 3362|  33.3k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  33.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 31.4k, False: 1.85k]
  |  |  |  Branch (44:34): [True: 2.04k, False: 29.4k]
  |  |  ------------------
  ------------------
 3363|  33.3k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  33.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.3k, False: 4.02k]
  |  |  |  Branch (44:34): [True: 4.01k, False: 25.2k]
  |  |  ------------------
  ------------------
 3364|       |
 3365|  33.3k|        edge_idx = gi1_table_edge_idx[edge_idx];
 3366|       |
 3367|  33.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (3367:12): [True: 7.90k, False: 25.4k]
  ------------------
 3368|  7.90k|        {
 3369|  7.90k|            u1_pos_wd_ht_tmp_v = CLIP3(pu1_src[wd - 1 + (ht - 1) * src_strd] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.90k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 409, False: 7.49k]
  |  |  |  Branch (40:53): [True: 273, False: 7.22k]
  |  |  ------------------
  ------------------
 3370|  7.90k|        }
 3371|  25.4k|        else
 3372|  25.4k|        {
 3373|  25.4k|            u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
 3374|  25.4k|        }
 3375|  33.3k|    }
 3376|  10.0k|    else
 3377|  10.0k|    {
 3378|  10.0k|        u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
 3379|  10.0k|        u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
 3380|  10.0k|    }
 3381|  43.4k|    pu1_firstleft = pu1_src_top_left;
 3382|       |
 3383|       |    /* Update height and source pointers based on the availability flags */
 3384|  43.4k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (3384:8): [True: 7.15k, False: 36.2k]
  ------------------
 3385|  7.15k|    {
 3386|  7.15k|        pu1_firstleft = pu1_src_left_cpy2;
 3387|  7.15k|        pu1_src_left_cpy2 += 2;
 3388|  7.15k|        pu1_src_left_str2 += 2;
 3389|  7.15k|        pu1_src_top_cpy = pu1_src;
 3390|  7.15k|        pu1_src += src_strd;
 3391|  7.15k|        ht--;
 3392|  7.15k|    }
 3393|  43.4k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (3393:8): [True: 4.98k, False: 38.4k]
  ------------------
 3394|  4.98k|    {
 3395|  4.98k|        ht--;
 3396|  4.98k|        ht_0--;
 3397|  4.98k|    }
 3398|       |    //storing top left in a mmx register
 3399|  43.4k|    left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_firstleft);
 3400|  43.4k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 3401|  43.4k|    const2_16x8b = _mm_set1_epi8(2);
 3402|  43.4k|    const0_16x8b = _mm_setzero_si128();
 3403|  43.4k|    left_store_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 3404|       |
 3405|       |    //availability mask creation
 3406|  43.4k|    u1_avail0 = pu1_avail[0];
 3407|  43.4k|    u1_avail1 = pu1_avail[1];
 3408|  43.4k|    au1_mask[0] = u1_avail0;
 3409|  43.4k|    au1_mask[1] = u1_avail0;
 3410|  43.4k|    au1_mask[wd - 1] = u1_avail1;
 3411|  43.4k|    au1_mask[wd - 2] = u1_avail1;
 3412|       |
 3413|       |    /* top-left arrays */
 3414|  43.4k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 3415|  43.4k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
 3416|  43.4k|    {
 3417|  43.4k|        WORD32 ht_rem;
 3418|  43.4k|        au1_mask_cpy = au1_mask;
 3419|       |
 3420|  43.4k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 3421|  43.4k|        pu1_src_left_str = pu1_src_left_str2;
 3422|   102k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (3422:23): [True: 59.0k, False: 43.4k]
  ------------------
 3423|  59.0k|        {
 3424|  59.0k|            pu1_src_cpy = pu1_src;
 3425|  59.0k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 3426|       |            //row = 0
 3427|  59.0k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 3428|  59.0k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 14);
 3429|       |            //loading the mask
 3430|  59.0k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 3431|       |            //separating +ve and and -ve values.
 3432|  59.0k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 3433|  59.0k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 3434|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 3435|  59.0k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3436|  59.0k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3437|       |            //combining the appropriate sign change
 3438|  59.0k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3439|       |
 3440|       |
 3441|   421k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (3441:27): [True: 362k, False: 59.0k]
  ------------------
 3442|   362k|            {
 3443|   362k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3444|       |                //row = 1
 3445|   362k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3446|       |                // row = 1 right
 3447|   362k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 3448|       |                //to insert left in row 0
 3449|   362k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 3450|       |                //row 0 -row1
 3451|       |                //separating +ve and and -ve values.
 3452|   362k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 3453|   362k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 3454|       |
 3455|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3456|   362k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3457|   362k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3458|       |                //manipulation for row 1 - row 0
 3459|   362k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 14);
 3460|       |                //combining the appropriate sign change
 3461|   362k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 3462|       |                //row1-row0
 3463|       |                //separating +ve and and -ve values.
 3464|   362k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3465|   362k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3466|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3467|   362k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3468|   362k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3469|       |                 // row = 2 right
 3470|   362k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd + 2));
 3471|   362k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 3472|       |
 3473|       |
 3474|       |                //row1 -bottom
 3475|   362k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 3476|   362k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 3477|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3478|   362k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3479|   362k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3480|       |                //combining the appropriate sign change
 3481|   362k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3482|       |                // row = 2
 3483|   362k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3484|       |
 3485|       |                //combining sign-left and sign_right
 3486|   362k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3487|       |
 3488|       |                //storing the row 1 left for next row.
 3489|   362k|                signup0_16x8b = _mm_slli_si128(left_store_16x8b, 12);
 3490|       |
 3491|       |                //combining sign-left and sign_right
 3492|   362k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 3493|       |                //manipulation for bottom - row 1
 3494|   362k|                signup0_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signup0_16x8b, 14);
 3495|       |                //eliminating old left for row 0 and row 1
 3496|   362k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 3497|       |                //bottom - row1
 3498|   362k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signup0_16x8b);
 3499|   362k|                cmp_lt0_16x8b = _mm_subs_epu8(signup0_16x8b, src_bottom_16x8b);
 3500|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3501|   362k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3502|   362k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3503|       |                //for the next iteration bottom -row1
 3504|   362k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3505|       |                //row1  getting it right for left of next iteration
 3506|   362k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 14);
 3507|       |                //copying the next top
 3508|   362k|                src_top_16x8b = src_temp1_16x8b;
 3509|       |                //row0  getting its right for left of next iteration.
 3510|   362k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 3511|       |
 3512|       |
 3513|       |                //adding constant 2
 3514|   362k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3515|   362k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 3516|       |                //shuffle to get sao index
 3517|   362k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3518|   362k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 3519|       |                //using availability mask
 3520|   362k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3521|   362k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 3522|       |                //adding chroma offset to access U and V
 3523|   362k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3524|   362k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 3525|       |
 3526|       |
 3527|       |                //shuffle to get sao offset
 3528|   362k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3529|   362k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 3530|       |                //cnvert to 16 bit then add and then saturated pack
 3531|   362k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3532|   362k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3533|   362k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3534|   362k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3535|   362k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3536|   362k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3537|   362k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 3538|   362k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3539|       |
 3540|   362k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 3541|   362k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 3542|   362k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 3543|   362k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 3544|   362k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 3545|   362k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3546|   362k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 3547|   362k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 3548|       |
 3549|       |                //store left boundary
 3550|   362k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3551|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 3552|   362k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3553|       |                // row = 1
 3554|   362k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 3555|       |
 3556|   362k|                src_temp0_16x8b = src_bottom_16x8b;
 3557|   362k|                pu1_src_cpy += (src_strd << 1);
 3558|   362k|                pu1_src_left_cpy += 4;
 3559|   362k|                pu1_src_left_str += 4;
 3560|   362k|            }
 3561|  59.0k|            ht_rem = ht & 0x1;
 3562|       |
 3563|  59.0k|            if(ht_rem)
  ------------------
  |  Branch (3563:16): [True: 16.6k, False: 42.3k]
  ------------------
 3564|  16.6k|            {
 3565|  16.6k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3566|  16.6k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 3567|       |                //current row -next row
 3568|       |                //separating +ve and and -ve values.
 3569|  16.6k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_bottom_16x8b);
 3570|  16.6k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp0_16x8b);
 3571|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3572|  16.6k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3573|  16.6k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3574|       |                //combining the appropriate sign change
 3575|  16.6k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3576|       |                //adding top and botton and constant 2
 3577|  16.6k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3578|  16.6k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3579|       |
 3580|       |                //eliminating old left for row 0 and row 1
 3581|  16.6k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 3582|       |                //copying the next top
 3583|  16.6k|                src_top_16x8b = src_temp0_16x8b;
 3584|       |                //row0  getting it right for left of next block
 3585|  16.6k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 3586|       |
 3587|  16.6k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3588|       |                //using availability mask
 3589|  16.6k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3590|       |                //adding chroma offset to access U and V
 3591|  16.6k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3592|       |
 3593|  16.6k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3594|       |
 3595|       |                //cnvert to 16 bit then add and then saturated pack
 3596|  16.6k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3597|  16.6k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3598|  16.6k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3599|  16.6k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3600|  16.6k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3601|  16.6k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3602|  16.6k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 3603|  16.6k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3604|       |
 3605|  16.6k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3606|       |
 3607|  16.6k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3608|  16.6k|                pu1_src_cpy += (src_strd);
 3609|  16.6k|                pu1_src_left_cpy += 2;
 3610|  16.6k|                pu1_src_left_str += 2;
 3611|  16.6k|            }
 3612|  59.0k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (3612:16): [True: 7.90k, False: 51.1k]
  ------------------
 3613|  7.90k|            {
 3614|  7.90k|                src_top_16x8b = src_bottom_16x8b;
 3615|  7.90k|                pu1_src_left_str[1] = pu1_src_cpy[15];
 3616|  7.90k|                pu1_src_left_str[0] = pu1_src_cpy[14];
 3617|  7.90k|            }
 3618|  59.0k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (3618:16): [True: 11.0k, False: 47.9k]
  ------------------
 3619|  11.0k|            {
 3620|  11.0k|                pu1_src_left_str[-2 * ht_0] = pu1_src[14 - src_strd];
 3621|  11.0k|                pu1_src_left_str[-2 * ht_0 + 1] = pu1_src[15 - src_strd];
 3622|  11.0k|            }
 3623|       |
 3624|       |            //for the top left of next part of the block
 3625|  59.0k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 3626|       |            //updating top flag
 3627|  59.0k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 3628|  59.0k|            pu1_src += 16;
 3629|  59.0k|            au1_mask_cpy += 16;
 3630|       |
 3631|  59.0k|            pu1_left_tmp = pu1_src_left_cpy2;
 3632|  59.0k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 3633|  59.0k|            pu1_src_left_str2 = pu1_left_tmp;
 3634|       |
 3635|  59.0k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 3636|  59.0k|            pu1_src_left_str = pu1_src_left_str2;
 3637|  59.0k|        }
 3638|  43.4k|        wd_rem = wd & 0xF;
 3639|  43.4k|        if(wd_rem)
  ------------------
  |  Branch (3639:12): [True: 3.32k, False: 40.0k]
  ------------------
 3640|  3.32k|        {
 3641|  3.32k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 3642|  3.32k|            pu1_src_left_str = pu1_src_left_str2;
 3643|  3.32k|            pu1_src_cpy = pu1_src;
 3644|  3.32k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col));
 3645|       |            //row = 0
 3646|  3.32k|            src_temp0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_cpy));
 3647|  3.32k|            src_top_16x8b = _mm_alignr_epi8(src_top_16x8b, left_store_16x8b, 14);
 3648|  3.32k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 3649|       |            //separating +ve and and -ve values.
 3650|  3.32k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 3651|  3.32k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 3652|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 3653|  3.32k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3654|  3.32k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3655|       |            //preparing au1_mask
 3656|  3.32k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 3657|       |            //combining the appropriate sign change
 3658|  3.32k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3659|  3.32k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 3660|       |
 3661|  9.85k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (3661:27): [True: 6.52k, False: 3.32k]
  ------------------
 3662|  6.52k|            {
 3663|  6.52k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3664|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 3665|  6.52k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3666|       |                // row = 2
 3667|  6.52k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3668|       |                //right row1
 3669|  6.52k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3670|       |                //row 0 -row1
 3671|       |                //separating +ve and and -ve values.
 3672|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3673|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3674|       |                //manipulation for row 1 -row 0
 3675|  6.52k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 3676|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3677|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3678|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3679|       |                //row 0 left
 3680|  6.52k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 14);
 3681|       |                //combining the appropriate sign change
 3682|  6.52k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3683|       |                //row 1 -row0
 3684|       |                //separating +ve and and -ve values.
 3685|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3686|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3687|       |
 3688|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3689|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3690|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3691|       |                //row1-row0
 3692|  6.52k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3693|       |
 3694|  6.52k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 3695|       |
 3696|  6.52k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 3697|       |                //right row2
 3698|  6.52k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 3699|       |                //packing row 0 n row 1
 3700|  6.52k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 3701|       |                //row1 -row2
 3702|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3703|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3704|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3705|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3706|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3707|       |                //combining the appropriate sign change
 3708|  6.52k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 3709|  6.52k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 3710|       |                //manipulation for row 2 -row 1
 3711|  6.52k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 3712|       |                //row 1 left
 3713|  6.52k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 3714|       |                //row = 3
 3715|  6.52k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 3716|       |
 3717|       |                // row = 4
 3718|  6.52k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 3719|       |
 3720|  6.52k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 3721|       |
 3722|       |                //separating +ve and and -ve values.(2,1)
 3723|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3724|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3725|       |                //manipulation for row 3 -row 2
 3726|  6.52k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 10);
 3727|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3728|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3729|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3730|       |                //row 2 left
 3731|  6.52k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 3732|       |                //combining the appropriate sign change
 3733|  6.52k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 3734|       |
 3735|       |                //separating +ve and and -ve values.(3,2)
 3736|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 3737|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 3738|  6.52k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8); //aligned left (2-1)
 3739|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3740|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3741|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3742|       |                //right row3
 3743|  6.52k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 2);
 3744|       |                //combining the appropriate sign change
 3745|  6.52k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 3746|       |
 3747|  6.52k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(3-2) ,(2-1)
 3748|       |
 3749|       |                //separating +ve and and -ve values.(2,3)
 3750|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3751|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3752|       |                //right row 4
 3753|  6.52k|                signdwn1_16x8b =  _mm_srli_si128(src_temp1_16x8b, 2);
 3754|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3755|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3756|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3757|       |                //combining the appropriate sign change
 3758|  6.52k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 3759|       |
 3760|       |                //separating +ve and and -ve values.(3,bottom)
 3761|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 3762|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 3763|       |
 3764|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3765|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3766|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3767|  6.52k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 3768|       |                //combining the appropriate sign change
 3769|  6.52k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 3770|  6.52k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-bottom),(2-3)
 3771|       |
 3772|       |                //manipulation for bottom -row 3
 3773|  6.52k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 8);
 3774|       |                //eliminating old left for row 0,1,2,3
 3775|  6.52k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 8);
 3776|       |                //packing row 2 n row 3
 3777|  6.52k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 3778|       |                //row 3 left
 3779|  6.52k|                signdwn1_16x8b = _mm_alignr_epi8(src_top_16x8b, signdwn1_16x8b, 14);
 3780|       |
 3781|       |                //adding bottom and top values of row 2 and row 3
 3782|  6.52k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 3783|       |                //separating +ve and and -ve values.(botttom,3)
 3784|  6.52k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3785|  6.52k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3786|       |
 3787|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3788|  6.52k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3789|  6.52k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3790|  6.52k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(bottom -3) for next iteration
 3791|       |
 3792|       |                //to store right of row 2
 3793|  6.52k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 3794|       |                //loading row 3 right into left
 3795|  6.52k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_bottom_16x8b, 14);
 3796|       |                //storing right of row 2into left
 3797|  6.52k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 3798|       |                //to store right of row 0
 3799|  6.52k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3800|       |                //storing right of row 1 into left
 3801|  6.52k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 3802|       |                //storing right of row 0 into left
 3803|  6.52k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 3804|       |
 3805|       |                //adding constant 2
 3806|  6.52k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3807|  6.52k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 3808|       |                //shuffle to get sao index
 3809|  6.52k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3810|  6.52k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 3811|       |                //using availability mask
 3812|  6.52k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3813|  6.52k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 3814|       |
 3815|       |                //adding chroma offset to access U and V
 3816|  6.52k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3817|  6.52k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 3818|       |
 3819|       |                //shuffle to get sao offset
 3820|  6.52k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3821|  6.52k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 3822|       |                //cnvert to 16 bit then add and then saturated pack
 3823|  6.52k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3824|  6.52k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3825|  6.52k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3826|  6.52k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 3827|  6.52k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3828|  6.52k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3829|  6.52k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 3830|  6.52k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 3831|       |
 3832|  6.52k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 3833|  6.52k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 3834|  6.52k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 3835|  6.52k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 3836|  6.52k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 3837|  6.52k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3838|  6.52k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, edge1_16x8b);
 3839|  6.52k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 3840|       |
 3841|  6.52k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3842|  6.52k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 3843|       |
 3844|       |
 3845|  6.52k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3846|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 3847|  6.52k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3848|       |                // row = 1
 3849|  6.52k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3850|       |                //row = 2
 3851|  6.52k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 3852|       |                // row = 3
 3853|  6.52k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 3854|       |
 3855|  6.52k|                src_temp0_16x8b = src_temp1_16x8b;
 3856|  6.52k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 3857|  6.52k|                pu1_src_cpy += (src_strd << 2);
 3858|  6.52k|                pu1_src_left_cpy += 8;
 3859|  6.52k|                pu1_src_left_str += 8;
 3860|  6.52k|            }
 3861|  3.32k|            ht_rem = ht & 0x2;
 3862|  3.32k|            if(ht_rem)
  ------------------
  |  Branch (3862:16): [True: 706, False: 2.62k]
  ------------------
 3863|    706|            {
 3864|    706|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3865|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 3866|    706|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3867|       |                // row = 2
 3868|    706|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 3869|       |
 3870|       |                //row 0 -row 1
 3871|    706|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 3872|       |                //separating +ve and and -ve values.
 3873|    706|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3874|    706|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3875|       |                //manipulation for row 1 -row 0
 3876|    706|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 3877|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3878|    706|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3879|    706|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3880|       |                //manipulation for row 1 - row 0
 3881|    706|                signdwn1_16x8b = _mm_alignr_epi8(src_temp0_16x8b, signdwn1_16x8b, 14);
 3882|       |                //combining the appropriate sign change
 3883|    706|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3884|       |
 3885|       |                //row1-row0
 3886|       |                //separating +ve and and -ve values.
 3887|    706|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3888|    706|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3889|       |
 3890|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3891|    706|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3892|    706|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3893|       |                //combining the appropriate sign chang
 3894|    706|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3895|       |                //row 1 -bottom
 3896|    706|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 3897|       |
 3898|    706|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 3899|    706|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 3900|       |                //row1 -bottom
 3901|    706|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 3902|    706|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 3903|       |
 3904|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3905|    706|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3906|    706|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3907|       |                //combining the appropriate sign change
 3908|    706|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 3909|    706|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 3910|       |                //manipulation for bottom -row1
 3911|    706|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 3912|       |                //eliminating old left for row 0,1
 3913|    706|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 3914|       |                //manipulation for bottom- row 1
 3915|    706|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 3916|       |                //adding top and down substraction
 3917|    706|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 3918|       |                //bottom - row 1
 3919|    706|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 3920|    706|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 3921|       |
 3922|       |                //shifting row 1
 3923|    706|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 3924|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3925|    706|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3926|    706|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3927|       |                //for the next iteration signup0_16x8b
 3928|    706|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1) for next
 3929|       |                //storing right of row 1 into left
 3930|    706|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14); //for storing right of row 0
 3931|    706|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3932|       |                //the next top  in  src_top_16x8b
 3933|    706|                src_top_16x8b = src_temp1_16x8b;
 3934|       |                //storing right of row 0 into left
 3935|    706|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 3936|       |
 3937|       |
 3938|       |                //adding constant 2
 3939|    706|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 3940|       |
 3941|       |                //shuffle to get sao index
 3942|    706|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 3943|       |                //using availability mask
 3944|    706|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 3945|       |
 3946|       |                //adding chroma offset to access U and V
 3947|    706|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 3948|       |
 3949|       |                //shuffle to get sao offset
 3950|    706|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 3951|       |                //the next top already in  src_top_16x8b
 3952|       |                //cnvert to 16 bit then add and then saturated pack
 3953|    706|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 3954|    706|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 3955|    706|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 3956|    706|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 3957|    706|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 3958|    706|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 3959|    706|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge0_16x8b);
 3960|    706|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 3961|       |
 3962|    706|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 3963|       |
 3964|    706|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 3965|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 3966|    706|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 3967|       |                // row = 1
 3968|    706|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 3969|    706|                src_temp0_16x8b = src_bottom_16x8b;
 3970|    706|                pu1_src_cpy += (src_strd << 1);
 3971|    706|                pu1_src_left_cpy += 4;
 3972|    706|                pu1_src_left_str += 4;
 3973|    706|            }
 3974|  3.32k|            ht_rem = ht & 0x1;
 3975|  3.32k|            if(ht_rem)
  ------------------
  |  Branch (3975:16): [True: 621, False: 2.70k]
  ------------------
 3976|    621|            {
 3977|    621|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 3978|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 3979|    621|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 3980|       |
 3981|       |                //row 0 -row1
 3982|    621|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 3983|       |                //separating +ve and and -ve values.
 3984|    621|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 3985|    621|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 3986|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 3987|    621|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 3988|    621|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 3989|       |                //combining the appropriate sign change
 3990|    621|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 3991|       |                //adding top and down substraction
 3992|    621|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 3993|       |
 3994|       |                //for row 0 right to put into left store
 3995|    621|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 3996|       |                //left store manipulation 1
 3997|    621|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 3998|    621|                src_top_16x8b = src_temp0_16x8b;
 3999|       |                //filling the left boundary value
 4000|    621|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 4001|       |
 4002|       |                //adding constant 2
 4003|    621|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4004|    621|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 4005|    621|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 4006|       |
 4007|       |
 4008|       |                //shuffle to get sao index
 4009|    621|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4010|       |                //using availability mask
 4011|    621|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4012|       |                //adding chroma offset to access U and V
 4013|    621|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 4014|       |
 4015|       |                //shuffle to get sao offset
 4016|    621|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4017|       |
 4018|       |                //cnvert to 16 bit then add and then saturated pack
 4019|    621|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4020|    621|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4021|    621|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4022|    621|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4023|    621|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 4024|       |
 4025|    621|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4026|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 4027|    621|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4028|    621|                pu1_src_cpy += (src_strd);
 4029|    621|                pu1_src_left_cpy += 2;
 4030|    621|                pu1_src_left_str += 2;
 4031|    621|            }
 4032|  3.32k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (4032:16): [True: 356, False: 2.97k]
  ------------------
 4033|    356|            {
 4034|    356|                src_top_16x8b = src_bottom_16x8b;
 4035|    356|                pu1_src_left_str[1] = pu1_src_cpy[7];
 4036|    356|                pu1_src_left_str[0] = pu1_src_cpy[6];
 4037|    356|            }
 4038|       |
 4039|  3.32k|            if(0 == pu1_avail[2])
  ------------------
  |  Branch (4039:16): [True: 435, False: 2.89k]
  ------------------
 4040|    435|            {
 4041|    435|                pu1_src_left_str[-2 * ht_0] = pu1_src[6 - src_strd];
 4042|    435|                pu1_src_left_str[-2 * ht_0 + 1] = pu1_src[7 - src_strd];
 4043|    435|            }
 4044|       |
 4045|  3.32k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 4046|  3.32k|            pu1_src += 8;
 4047|       |
 4048|  3.32k|            pu1_left_tmp = pu1_src_left_cpy2;
 4049|  3.32k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 4050|  3.32k|            pu1_src_left_str2 = pu1_left_tmp;
 4051|       |
 4052|  3.32k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4053|  3.32k|            pu1_src_left_str = pu1_src_left_str2;
 4054|  3.32k|        }
 4055|  43.4k|        pu1_src_org[0] = u1_pos_0_0_tmp_u;
 4056|  43.4k|        pu1_src_org[1] = u1_pos_0_0_tmp_v;
 4057|  43.4k|        pu1_src_org[wd - 2 + (ht_tmp - 1) * src_strd] = u1_pos_wd_ht_tmp_u;
 4058|  43.4k|        pu1_src_org[wd - 1 + (ht_tmp - 1) * src_strd] = u1_pos_wd_ht_tmp_v;
 4059|  43.4k|        pu1_src_left_cpy = (0 == pu1_avail[2]) ? (pu1_src_left_cpy - 2) : pu1_src_left_cpy;
  ------------------
  |  Branch (4059:28): [True: 7.15k, False: 36.2k]
  ------------------
 4060|  1.02M|        for(row = 0; row < 2 * ht_tmp; row++)
  ------------------
  |  Branch (4060:22): [True: 979k, False: 43.4k]
  ------------------
 4061|   979k|        {
 4062|   979k|            pu1_src_left[row] = pu1_src_left_cpy[row];
 4063|   979k|        }
 4064|  43.4k|    }
 4065|       |
 4066|  43.4k|}
ihevc_sao_edge_offset_class3_ssse3:
 4079|  46.3k|{
 4080|  46.3k|    WORD32 row, col;
 4081|  46.3k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 4082|  46.3k|    UWORD8 *pu1_left_tmp, *pu1_src_left_str, *pu1_src_left_str2;
 4083|  46.3k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 4084|  46.3k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE + 8];
 4085|  46.3k|    UWORD8 au1_src_left_tmp1[MAX_CTB_SIZE + 8];
 4086|  46.3k|    UWORD8 au1_mask[MAX_CTB_SIZE], *au1_mask_cpy;
 4087|  46.3k|    WORD32 wd_rem;
 4088|  46.3k|    UWORD8 u1_pos_wd_0_tmp, u1_pos_0_ht_tmp;
 4089|  46.3k|    WORD32 ht_tmp;
 4090|  46.3k|    WORD32 bit_depth;
 4091|  46.3k|    UWORD8 u1_avail0, u1_avail1;
 4092|       |
 4093|  46.3k|    __m128i src_top_16x8b, src_bottom_16x8b;
 4094|  46.3k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 4095|  46.3k|    __m128i signup0_16x8b, signdwn1_16x8b;
 4096|  46.3k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 4097|  46.3k|    __m128i edge0_16x8b, edge1_16x8b;
 4098|  46.3k|    __m128i au1_mask8x16b;
 4099|  46.3k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 4100|  46.3k|    __m128i const2_16x8b, const0_16x8b;
 4101|  46.3k|    __m128i left_store_16x8b;
 4102|       |
 4103|  46.3k|    ht_tmp = ht;
 4104|  46.3k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 4105|       |
 4106|  46.3k|    au1_src_left_tmp[0] = pu1_src[(wd - 1)];
 4107|       |    //manipulation for bottom left
 4108|   997k|    for(row = 1; row < ht; row++)
  ------------------
  |  Branch (4108:18): [True: 951k, False: 46.3k]
  ------------------
 4109|   951k|    {
 4110|   951k|        au1_src_left_tmp[row] = pu1_src_left[row];
 4111|   951k|    }
 4112|  46.3k|    au1_src_left_tmp[ht] = pu1_src_bot_left[0];
 4113|       |
 4114|  46.3k|    *pu1_src_top_left = pu1_src_top[wd - 1];
 4115|       |    //setting availability mask to ff size MAX_CTB_SIZE
 4116|   231k|    for(col = 0; col < MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   231k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (4116:18): [True: 185k, False: 46.3k]
  ------------------
 4117|   185k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 4118|  46.3k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  46.3k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  46.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4119|  46.3k|    pu1_src_org = pu1_src;
 4120|  46.3k|    pu1_src_top_cpy = pu1_src_top;
 4121|  46.3k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 4122|  46.3k|    pu1_src_left_cpy = au1_src_left_tmp;
 4123|  46.3k|    pu1_src_left_str2 = au1_src_left_tmp1;
 4124|  46.3k|    pu1_src_left_str = au1_src_left_tmp1;
 4125|  46.3k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 4126|  46.3k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset);
 4127|       |
 4128|       |    /* If top-right is available, process separately */
 4129|  46.3k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (4129:8): [True: 35.9k, False: 10.3k]
  ------------------
 4130|  35.9k|    {
 4131|  35.9k|        WORD32 edge_idx;
 4132|       |
 4133|  35.9k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  35.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 29.5k, False: 6.37k]
  |  |  |  Branch (44:34): [True: 3.28k, False: 26.3k]
  |  |  ------------------
  ------------------
 4134|  35.9k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  35.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.2k, False: 3.74k]
  |  |  |  Branch (44:34): [True: 4.52k, False: 27.6k]
  |  |  ------------------
  ------------------
 4135|       |
 4136|  35.9k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4137|       |
 4138|  35.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (4138:12): [True: 7.42k, False: 28.5k]
  ------------------
 4139|  7.42k|        {
 4140|  7.42k|            u1_pos_wd_0_tmp = CLIP3(pu1_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.42k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 386, False: 7.04k]
  |  |  |  Branch (40:53): [True: 135, False: 6.90k]
  |  |  ------------------
  ------------------
 4141|  7.42k|        }
 4142|  28.5k|        else
 4143|  28.5k|        {
 4144|  28.5k|            u1_pos_wd_0_tmp = pu1_src[wd - 1];
 4145|  28.5k|        }
 4146|  35.9k|    }
 4147|  10.3k|    else
 4148|  10.3k|    {
 4149|  10.3k|        u1_pos_wd_0_tmp = pu1_src[wd - 1];
 4150|  10.3k|    }
 4151|       |
 4152|       |    /* If bottom-left is available, process separately */
 4153|  46.3k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (4153:8): [True: 36.5k, False: 9.82k]
  ------------------
 4154|  36.5k|    {
 4155|  36.5k|        WORD32 edge_idx;
 4156|       |
 4157|  36.5k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  36.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 32.8k, False: 3.66k]
  |  |  |  Branch (44:34): [True: 4.13k, False: 28.7k]
  |  |  ------------------
  ------------------
 4158|  36.5k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  36.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 33.2k, False: 3.29k]
  |  |  |  Branch (44:34): [True: 6.58k, False: 26.6k]
  |  |  ------------------
  ------------------
 4159|       |
 4160|  36.5k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4161|       |
 4162|  36.5k|        if(0 != edge_idx)
  ------------------
  |  Branch (4162:12): [True: 7.36k, False: 29.1k]
  ------------------
 4163|  7.36k|        {
 4164|  7.36k|            u1_pos_0_ht_tmp = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  7.36k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 335, False: 7.03k]
  |  |  |  Branch (40:53): [True: 149, False: 6.88k]
  |  |  ------------------
  ------------------
 4165|  7.36k|        }
 4166|  29.1k|        else
 4167|  29.1k|        {
 4168|  29.1k|            u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 4169|  29.1k|        }
 4170|  36.5k|    }
 4171|  9.82k|    else
 4172|  9.82k|    {
 4173|  9.82k|        u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 4174|  9.82k|    }
 4175|       |
 4176|       |
 4177|       |
 4178|       |    /* Update height and source pointers based on the availability flags */
 4179|  46.3k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (4179:8): [True: 6.59k, False: 39.7k]
  ------------------
 4180|  6.59k|    {
 4181|  6.59k|        pu1_src_left_cpy2++;
 4182|  6.59k|        pu1_src_left_str2++;
 4183|  6.59k|        pu1_src_top_cpy = pu1_src;
 4184|  6.59k|        pu1_src += src_strd;
 4185|  6.59k|        ht--;
 4186|  6.59k|    }
 4187|  46.3k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (4187:8): [True: 4.72k, False: 41.6k]
  ------------------
 4188|  4.72k|    {
 4189|  4.72k|        ht--;
 4190|  4.72k|    }
 4191|       |
 4192|       |
 4193|  46.3k|    const2_16x8b = _mm_set1_epi8(2);
 4194|  46.3k|    const0_16x8b = _mm_setzero_si128();
 4195|       |
 4196|       |
 4197|       |    //availability mask creation
 4198|  46.3k|    u1_avail0 = pu1_avail[0];
 4199|  46.3k|    u1_avail1 = pu1_avail[1];
 4200|  46.3k|    au1_mask[0] = u1_avail0;
 4201|  46.3k|    au1_mask[wd - 1] = u1_avail1;
 4202|  46.3k|    {
 4203|  46.3k|        WORD32 ht_rem;
 4204|       |
 4205|  46.3k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 4206|  46.3k|        pu1_src_left_str = pu1_src_left_str2;
 4207|  46.3k|        au1_mask_cpy = au1_mask;
 4208|  86.2k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (4208:23): [True: 39.9k, False: 46.3k]
  ------------------
 4209|  39.9k|        {
 4210|  39.9k|            pu1_src_cpy = pu1_src;
 4211|  39.9k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col + 1));
 4212|       |            //row = 0
 4213|  39.9k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 4214|       |
 4215|       |            //loading the mask
 4216|  39.9k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 4217|       |            //separating +ve and and -ve values.
 4218|  39.9k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 4219|  39.9k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 4220|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 4221|  39.9k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4222|  39.9k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4223|       |            //combining the appropriate sign change
 4224|  39.9k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4225|       |
 4226|   578k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (4226:27): [True: 538k, False: 39.9k]
  ------------------
 4227|   538k|            {
 4228|   538k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 4229|       |                //row = 1
 4230|   538k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4231|       |                //to insert left in row 1
 4232|   538k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 4233|       |                // row = 0 right
 4234|   538k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 1));
 4235|       |
 4236|       |                //manipulation for row 1 - row 0
 4237|   538k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4238|       |                //row 0 -row1
 4239|       |                //separating +ve and and -ve values.
 4240|   538k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4241|   538k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 4242|       |
 4243|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4244|   538k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4245|   538k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4246|       |
 4247|       |                //combining the appropriate sign change
 4248|   538k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 4249|       |                //combining sign-left and sign_right
 4250|   538k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 4251|       |
 4252|       |                //row1-row0
 4253|       |                //separating +ve and and -ve values.
 4254|   538k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 4255|   538k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 4256|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4257|   538k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4258|   538k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4259|       |
 4260|       |                // row = 2
 4261|   538k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 4262|       |                // row = 1 right
 4263|   538k|                signdwn1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 1));
 4264|   538k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 4265|       |
 4266|       |                //bottom - row1
 4267|   538k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4268|   538k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 4269|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4270|   538k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4271|   538k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4272|       |                //for the next iteration bottom -row1
 4273|   538k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4274|       |
 4275|       |                //to insert left in row 1
 4276|   538k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 13);
 4277|       |                //manipulation for row 1 - bottom
 4278|   538k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4279|       |
 4280|       |                //row1 -bottom
 4281|   538k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4282|   538k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4283|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4284|   538k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4285|   538k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4286|       |                //combining the appropriate sign change
 4287|   538k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4288|       |
 4289|       |                //combining sign-left and sign_right
 4290|   538k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 4291|       |
 4292|       |                //eliminating old left for row 0 and row 1
 4293|   538k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 4294|       |
 4295|       |                //row1  getting it right for left of next block
 4296|   538k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 15);
 4297|       |                //adding constant 2
 4298|   538k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4299|   538k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 4300|       |                //shuffle to get sao index
 4301|   538k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4302|   538k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 4303|       |                //using availability mask
 4304|   538k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4305|   538k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 4306|       |                //shuffle to get sao offset
 4307|   538k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4308|   538k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 4309|       |                //row0  getting it right for left of next block
 4310|   538k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4311|       |                //copying the next top
 4312|   538k|                src_top_16x8b = src_temp1_16x8b;
 4313|       |                //cnvert to 16 bit then add and then saturated pack
 4314|   538k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4315|   538k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4316|   538k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4317|   538k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 4318|   538k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4319|   538k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4320|   538k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4321|   538k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 4322|       |
 4323|   538k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 4324|   538k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 4325|   538k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 4326|   538k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 4327|   538k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4328|   538k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 4329|   538k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 4330|   538k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 4331|       |                //store left boundary
 4332|   538k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4333|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 4334|   538k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4335|       |                // row = 1
 4336|   538k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 4337|       |
 4338|   538k|                src_temp0_16x8b = src_bottom_16x8b;
 4339|   538k|                pu1_src_cpy += (src_strd << 1);
 4340|   538k|                pu1_src_left_cpy += 2;
 4341|   538k|                pu1_src_left_str += 2;
 4342|   538k|            }
 4343|  39.9k|            ht_rem = ht & 0x1;
 4344|       |
 4345|  39.9k|            if(ht_rem)
  ------------------
  |  Branch (4345:16): [True: 10.0k, False: 29.8k]
  ------------------
 4346|  10.0k|            {
 4347|  10.0k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4348|  10.0k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4349|       |                //to insert left in row 1
 4350|  10.0k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 14);
 4351|       |                //manipulation for row 1 - row 0
 4352|  10.0k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4353|       |
 4354|       |                //current row -next row
 4355|       |                //separating +ve and and -ve values.
 4356|  10.0k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4357|  10.0k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 4358|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4359|  10.0k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4360|  10.0k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4361|       |                //combining the appropriate sign change
 4362|  10.0k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4363|       |                //adding top and bottom and constant 2
 4364|  10.0k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 4365|  10.0k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4366|       |                //eliminating old left for row 0 and row 1
 4367|  10.0k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4368|       |
 4369|  10.0k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4370|       |                //using availability mask
 4371|  10.0k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4372|       |
 4373|  10.0k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4374|       |
 4375|       |                //row0  getting it right for left of next block
 4376|  10.0k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4377|       |                //copying the next top
 4378|  10.0k|                src_top_16x8b = src_temp0_16x8b;
 4379|       |                //cnvert to 16 bit then add and then saturated pack
 4380|  10.0k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4381|  10.0k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4382|  10.0k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4383|  10.0k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 4384|  10.0k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4385|  10.0k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4386|  10.0k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4387|  10.0k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 4388|       |                //store left boundary
 4389|  10.0k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4390|       |
 4391|  10.0k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4392|  10.0k|                pu1_src_cpy += (src_strd);
 4393|  10.0k|                src_temp0_16x8b = src_bottom_16x8b;
 4394|  10.0k|                pu1_src_left_cpy++;
 4395|  10.0k|                pu1_src_left_str++;
 4396|  10.0k|            }
 4397|  39.9k|            {   //for bottom right
 4398|  39.9k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4399|  39.9k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4400|  39.9k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4401|  39.9k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4402|  39.9k|            }
 4403|  39.9k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (4403:16): [True: 5.34k, False: 34.5k]
  ------------------
 4404|  5.34k|            {
 4405|  5.34k|                src_top_16x8b = src_bottom_16x8b;
 4406|  5.34k|            }
 4407|       |            //for the top left of next part of the block
 4408|  39.9k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 4409|       |            //updating top flag
 4410|  39.9k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 4411|  39.9k|            pu1_src += 16;
 4412|  39.9k|            au1_mask_cpy += 16;
 4413|       |
 4414|  39.9k|            pu1_left_tmp = pu1_src_left_cpy2;
 4415|  39.9k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 4416|  39.9k|            pu1_src_left_str2 = pu1_left_tmp;
 4417|       |
 4418|  39.9k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4419|  39.9k|            pu1_src_left_str = pu1_src_left_str2;
 4420|  39.9k|        }
 4421|       |
 4422|  46.3k|        wd_rem = wd & 0xF;
 4423|  46.3k|        if(wd_rem)
  ------------------
  |  Branch (4423:12): [True: 45.3k, False: 1.02k]
  ------------------
 4424|  45.3k|        {
 4425|  45.3k|            pu1_src_cpy = pu1_src;
 4426|  45.3k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4427|  45.3k|            pu1_src_left_str = pu1_src_left_str2;
 4428|  45.3k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col + 1));
 4429|       |            //row = 0
 4430|  45.3k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 4431|  45.3k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 4432|       |            //separating +ve and and -ve values.
 4433|  45.3k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 4434|  45.3k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 4435|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 4436|  45.3k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4437|  45.3k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4438|       |            //preparing au1_mask
 4439|  45.3k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 4440|       |            //combining the appropriate sign change
 4441|  45.3k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4442|  45.3k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 4443|       |
 4444|   280k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (4444:27): [True: 234k, False: 45.3k]
  ------------------
 4445|   234k|            {
 4446|   234k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4447|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 4448|   234k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4449|       |                // row = 2
 4450|   234k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 4451|       |                //manipulation for row 0 -row 1
 4452|   234k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 4453|       |                //row 1 left
 4454|   234k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4455|       |                //row 0 -row1
 4456|       |                //separating +ve and and -ve values.
 4457|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4458|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 4459|       |
 4460|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4461|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4462|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4463|       |                //manipulatiing for row 1 -row 0
 4464|   234k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 1);
 4465|       |                //combining the appropriate sign change
 4466|   234k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4467|       |                //row 1 -row0
 4468|       |                //separating +ve and and -ve values.
 4469|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4470|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4471|       |
 4472|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4473|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4474|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4475|       |                //row1-row0
 4476|   234k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4477|       |
 4478|   234k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 4479|       |
 4480|   234k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 4481|       |                //manipulation for row 1 -row 2
 4482|   234k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 13);
 4483|       |                //row 2 left
 4484|   234k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4485|       |                //packing row 0 n row 1
 4486|   234k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 4487|       |                //row1 -row2
 4488|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4489|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4490|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4491|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4492|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4493|       |                //combining the appropriate sign change
 4494|   234k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 4495|   234k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 4496|       |
 4497|       |                //row 1 right
 4498|   234k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 4499|       |                //row = 3
 4500|   234k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 4501|       |
 4502|       |                // row = 4
 4503|   234k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 4504|       |
 4505|   234k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 4506|       |
 4507|       |                //separating +ve and and -ve values.(2,1)
 4508|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4509|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 4510|       |
 4511|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4512|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4513|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4514|       |                //row 2 right
 4515|   234k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 1);
 4516|       |                //combining the appropriate sign change
 4517|   234k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 4518|       |
 4519|       |                //separating +ve and and -ve values.(3,2)
 4520|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 4521|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 4522|   234k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8); //aligned left (2-1)
 4523|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4524|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4525|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4526|       |                //manipulation for row 2 -row 3
 4527|   234k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 4528|       |                //row 3 left
 4529|   234k|                signdwn1_16x8b = _mm_alignr_epi8(src_top_16x8b, signdwn1_16x8b, 15);
 4530|       |                //combining the appropriate sign change
 4531|   234k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 4532|       |
 4533|   234k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(3-2) ,(2-1)
 4534|       |
 4535|       |                //separating +ve and and -ve values.(2,3)
 4536|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4537|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 4538|       |
 4539|       |                //manipulation for row 3 -bottom
 4540|   234k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 11);
 4541|       |                //bottom left
 4542|   234k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4543|       |
 4544|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4545|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4546|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4547|       |                //combining the appropriate sign change
 4548|   234k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 4549|       |
 4550|       |                //separating +ve and and -ve values.(3,bottom)
 4551|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 4552|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 4553|       |
 4554|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4555|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4556|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4557|   234k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 4558|       |                //combining the appropriate sign change
 4559|   234k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 4560|   234k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-bottom),(2-3)
 4561|       |
 4562|       |
 4563|       |                //eliminating old left for row 0,1,2,3
 4564|   234k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 4565|       |                //packing row 2 n row 3
 4566|   234k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 4567|       |                //row 3 right
 4568|   234k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 1);
 4569|       |                //loading row 3 right into left
 4570|   234k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_bottom_16x8b, 15);
 4571|       |                //adding bottom and top values of row 2 and row 3
 4572|   234k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 4573|       |                //separating +ve and and -ve values.(botttom,3)
 4574|   234k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4575|   234k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4576|       |                //to store right of row 2
 4577|   234k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 4578|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4579|   234k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4580|   234k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4581|   234k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(bottom -3) for next iteration
 4582|       |
 4583|       |                //storing right of row 2into left
 4584|   234k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4585|       |                //to store right of row 0
 4586|   234k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4587|       |                //storing right of row 1 into left
 4588|   234k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4589|       |
 4590|       |                //adding constant 2
 4591|   234k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4592|   234k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 4593|       |                //shuffle to get sao index
 4594|   234k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4595|   234k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 4596|       |                //using availability mask
 4597|   234k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4598|   234k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 4599|       |                //shuffle to get sao offset
 4600|   234k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4601|   234k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 4602|       |
 4603|       |                //storing right of row 0 into left
 4604|   234k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4605|       |                //cnvert to 16 bit then add and then saturated pack
 4606|   234k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4607|   234k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4608|   234k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4609|   234k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 4610|   234k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4611|   234k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4612|   234k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4613|   234k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 4614|       |
 4615|   234k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 4616|   234k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 4617|   234k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 4618|   234k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 4619|   234k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4620|   234k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 4621|   234k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, cmp_lt0_16x8b);
 4622|   234k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 4623|       |
 4624|   234k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 4625|   234k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 4626|       |
 4627|   234k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4628|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 4629|   234k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4630|       |                // row = 1
 4631|   234k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 4632|       |                //row = 2
 4633|   234k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 4634|       |                // row = 3
 4635|   234k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 4636|       |
 4637|   234k|                src_temp0_16x8b = src_temp1_16x8b;
 4638|   234k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 4639|   234k|                pu1_src_cpy += (src_strd << 2);
 4640|   234k|                pu1_src_left_cpy += 4;
 4641|   234k|                pu1_src_left_str += 4;
 4642|   234k|            }
 4643|  45.3k|            ht_rem = ht & 0x2;
 4644|  45.3k|            if(ht_rem)
  ------------------
  |  Branch (4644:16): [True: 10.5k, False: 34.8k]
  ------------------
 4645|  10.5k|            {
 4646|  10.5k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4647|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 4648|  10.5k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4649|       |                // row = 2
 4650|  10.5k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 4651|       |
 4652|       |                //manipulation for row 0 -row 1
 4653|  10.5k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 4654|       |                //bottom left
 4655|  10.5k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 15);
 4656|       |                //separating +ve and and -ve values.
 4657|  10.5k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4658|  10.5k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 4659|       |
 4660|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4661|  10.5k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4662|  10.5k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4663|       |                //manipulation for row 1 - row 0
 4664|  10.5k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 1);
 4665|       |                //combining the appropriate sign change
 4666|  10.5k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4667|       |
 4668|       |                //row1-row0
 4669|       |                //separating +ve and and -ve values.
 4670|  10.5k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4671|  10.5k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4672|       |
 4673|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4674|  10.5k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4675|  10.5k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4676|       |                //combining the appropriate sign chang
 4677|  10.5k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4678|       |
 4679|       |                //manipulation for row 1 -bottom
 4680|  10.5k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 13);
 4681|       |                //bottom left
 4682|  10.5k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4683|       |
 4684|  10.5k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 4685|  10.5k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 4686|       |                //row1 -bottom
 4687|  10.5k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 4688|  10.5k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 4689|       |
 4690|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4691|  10.5k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4692|  10.5k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4693|       |                //combining the appropriate sign change
 4694|  10.5k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 4695|  10.5k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 4696|       |                //manipulation for bottom- row 1 (row 1 right)
 4697|  10.5k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 1);
 4698|       |                //adding top and down substraction
 4699|  10.5k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 4700|       |                //bottom - row 1
 4701|  10.5k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 4702|  10.5k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 4703|       |
 4704|       |                //eliminating old left for row 0,1
 4705|  10.5k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 4706|  10.5k|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 4707|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4708|  10.5k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4709|  10.5k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4710|       |                //for the next iteration signup0_16x8b
 4711|  10.5k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1) for next
 4712|       |
 4713|       |                //storing right of row 1 into left
 4714|  10.5k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4715|       |                //for storing right of row 1
 4716|  10.5k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4717|       |
 4718|  10.5k|                src_top_16x8b = src_temp1_16x8b;
 4719|       |                //storing right of row 0 into left
 4720|  10.5k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4721|       |
 4722|       |                //adding constant 2
 4723|  10.5k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4724|       |
 4725|       |                //shuffle to get sao index
 4726|  10.5k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4727|       |                //using availability mask
 4728|  10.5k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4729|       |                //shuffle to get sao offset
 4730|  10.5k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4731|       |
 4732|       |                //the next top already in  src_top_16x8b
 4733|       |                //cnvert to 16 bit then add and then saturated pack
 4734|  10.5k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4735|  10.5k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4736|  10.5k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4737|  10.5k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 4738|  10.5k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4739|  10.5k|                cmp_lt0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 4740|  10.5k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, cmp_lt0_16x8b);
 4741|  10.5k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 4742|       |
 4743|  10.5k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 4744|       |
 4745|  10.5k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4746|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 4747|  10.5k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4748|       |                // row = 1
 4749|  10.5k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 4750|  10.5k|                src_temp0_16x8b = src_bottom_16x8b;
 4751|  10.5k|                pu1_src_cpy += (src_strd << 1);
 4752|  10.5k|                pu1_src_left_cpy += 2;
 4753|  10.5k|                pu1_src_left_str += 2;
 4754|  10.5k|            }
 4755|  45.3k|            ht_rem = ht & 0x1;
 4756|  45.3k|            if(ht_rem)
  ------------------
  |  Branch (4756:16): [True: 9.86k, False: 35.4k]
  ------------------
 4757|  9.86k|            {
 4758|  9.86k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4759|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 4760|  9.86k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 4761|       |
 4762|       |
 4763|       |                //manipulation for row 0 -bottom
 4764|  9.86k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 14);
 4765|       |                //bottom left
 4766|  9.86k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 15);
 4767|       |                //separating +ve and and -ve values.
 4768|  9.86k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 4769|  9.86k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 4770|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 4771|  9.86k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 4772|  9.86k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 4773|       |                //combining the appropriate sign change
 4774|  9.86k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 4775|       |                //adding top and down substraction
 4776|  9.86k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 4777|       |                //for row 0 right to put into left store
 4778|  9.86k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4779|       |                //adding constant 2
 4780|  9.86k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 4781|  9.86k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 4782|  9.86k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 4783|       |                //left store manipulation 1
 4784|  9.86k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4785|       |                //filling the left boundary value
 4786|  9.86k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 15);
 4787|       |
 4788|       |                //shuffle to get sao index
 4789|  9.86k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 4790|       |                //using availability mask
 4791|  9.86k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 4792|       |                //shuffle to get sao offset
 4793|  9.86k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 4794|  9.86k|                src_top_16x8b = src_temp0_16x8b;
 4795|       |                //cnvert to 16 bit then add and then saturated pack
 4796|  9.86k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 4797|  9.86k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 4798|  9.86k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 4799|  9.86k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 4800|  9.86k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 4801|       |
 4802|  9.86k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4803|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 4804|  9.86k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 4805|  9.86k|                pu1_src_cpy += (src_strd);
 4806|  9.86k|                src_temp0_16x8b = src_bottom_16x8b;
 4807|  9.86k|                pu1_src_left_cpy++;
 4808|  9.86k|                pu1_src_left_str++;
 4809|  9.86k|            }
 4810|  45.3k|            {   //for bottom right
 4811|  45.3k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 4812|  45.3k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 1);
 4813|  45.3k|                src_temp0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 4814|  45.3k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 15);
 4815|  45.3k|                _mm_storel_epi64((__m128i *)(pu1_src_left_str), left_store_16x8b);
 4816|  45.3k|            }
 4817|  45.3k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (4817:16): [True: 4.68k, False: 40.6k]
  ------------------
 4818|  4.68k|            {
 4819|  4.68k|                src_top_16x8b = src_bottom_16x8b;
 4820|  4.68k|            }
 4821|  45.3k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 4822|  45.3k|            pu1_src += 8;
 4823|       |
 4824|  45.3k|            pu1_left_tmp = pu1_src_left_cpy2;
 4825|  45.3k|            pu1_src_left_cpy2 = pu1_src_left_str2;
 4826|  45.3k|            pu1_src_left_str2 = pu1_left_tmp;
 4827|       |
 4828|  45.3k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 4829|  45.3k|            pu1_src_left_str = pu1_src_left_str2;
 4830|       |
 4831|  45.3k|        }
 4832|  46.3k|        pu1_src_org[wd - 1] = u1_pos_wd_0_tmp;
 4833|  46.3k|        pu1_src_org[(ht_tmp - 1) * src_strd] = u1_pos_0_ht_tmp;
 4834|  46.3k|        pu1_src_left_cpy = (0 == pu1_avail[2]) ? (pu1_src_left_cpy - 1) : pu1_src_left_cpy;
  ------------------
  |  Branch (4834:28): [True: 6.59k, False: 39.7k]
  ------------------
 4835|  46.3k|        pu1_src_left[0] = au1_src_left_tmp[0];
 4836|   994k|        for(row = 1; row < ht_tmp; row++)
  ------------------
  |  Branch (4836:22): [True: 948k, False: 46.3k]
  ------------------
 4837|   948k|        {
 4838|   948k|            pu1_src_left[row] = pu1_src_left_cpy[row];
 4839|   948k|        }
 4840|  46.3k|    }
 4841|       |
 4842|  46.3k|}
ihevc_sao_edge_offset_class3_chroma_ssse3:
 4856|  79.1k|{
 4857|  79.1k|    WORD32 row, col;
 4858|  79.1k|    UWORD8 *pu1_src_top_cpy, *pu1_src_left_cpy, *pu1_src_left_cpy2;
 4859|  79.1k|    UWORD8 *pu1_src_cpy, *pu1_src_org;
 4860|  79.1k|    UWORD8 au1_src_left_tmp[2 * (MAX_CTB_SIZE + 8)];
 4861|  79.1k|    UWORD8 au1_mask[2 * MAX_CTB_SIZE], *au1_mask_cpy;
 4862|  79.1k|    WORD32 wd_rem;
 4863|  79.1k|    UWORD8 u1_pos_wd_0_tmp_u, u1_pos_wd_0_tmp_v, u1_pos_0_ht_tmp_u, u1_pos_0_ht_tmp_v;
 4864|  79.1k|    WORD32 ht_tmp;
 4865|  79.1k|    WORD32 bit_depth;
 4866|  79.1k|    UWORD8 u1_avail0, u1_avail1;
 4867|       |
 4868|  79.1k|    __m128i src_top_16x8b, src_bottom_16x8b;
 4869|  79.1k|    __m128i src_temp0_16x8b, src_temp1_16x8b;
 4870|  79.1k|    __m128i signup0_16x8b, signdwn1_16x8b;
 4871|  79.1k|    __m128i cmp_gt0_16x8b, cmp_lt0_16x8b;
 4872|  79.1k|    __m128i edge0_16x8b, edge1_16x8b;
 4873|  79.1k|    __m128i au1_mask8x16b;
 4874|  79.1k|    __m128i edge_idx_8x16b, sao_offset_8x16b;
 4875|  79.1k|    __m128i left_store_16x8b;
 4876|  79.1k|    __m128i const0_16x8b, const2_16x8b;
 4877|  79.1k|    __m128i chroma_offset_8x16b;
 4878|       |
 4879|  79.1k|    ht_tmp = ht;
 4880|  79.1k|    au1_mask8x16b = _mm_set1_epi8(0xff);
 4881|       |
 4882|       |
 4883|  79.1k|    au1_src_left_tmp[0] = pu1_src[(wd - 2)];
 4884|  79.1k|    au1_src_left_tmp[1] = pu1_src[(wd - 1)];
 4885|       |    //manipulation for bottom left
 4886|  1.47M|    for(row = 2; row < 2 * ht; row++)
  ------------------
  |  Branch (4886:18): [True: 1.39M, False: 79.1k]
  ------------------
 4887|  1.39M|    {
 4888|  1.39M|        au1_src_left_tmp[row] = pu1_src_left[row];
 4889|  1.39M|    }
 4890|  79.1k|    au1_src_left_tmp[2 * ht] = pu1_src_bot_left[0];
 4891|  79.1k|    au1_src_left_tmp[2 * ht + 1] = pu1_src_bot_left[1];
 4892|       |
 4893|  79.1k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
 4894|  79.1k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
 4895|       |    //setting availability mask to ff size MAX_CTB_SIZE
 4896|   713k|    for(col = 0; col < 2 * MAX_CTB_SIZE; col += 16)
  ------------------
  |  |  351|   713k|#define MAX_CTB_SIZE        64
  ------------------
  |  Branch (4896:18): [True: 634k, False: 79.1k]
  ------------------
 4897|   634k|        _mm_storeu_si128((__m128i *)(au1_mask + col), au1_mask8x16b);
 4898|  79.1k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  273|  79.1k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  272|  79.1k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 4899|  79.1k|    pu1_src_org = pu1_src;
 4900|  79.1k|    pu1_src_top_cpy = pu1_src_top;
 4901|  79.1k|    pu1_src_left_cpy2 = au1_src_left_tmp;
 4902|  79.1k|    pu1_src_left_cpy = au1_src_left_tmp;
 4903|  79.1k|    edge_idx_8x16b   = _mm_loadl_epi64((__m128i *)gi1_table_edge_idx);
 4904|  79.1k|    sao_offset_8x16b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_u);
 4905|  79.1k|    const0_16x8b = _mm_loadl_epi64((__m128i *)pi1_sao_offset_v);
 4906|  79.1k|    chroma_offset_8x16b = _mm_set1_epi16(0x0800);
 4907|       |    /* If top-right is available, process separately */
 4908|  79.1k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (4908:8): [True: 53.3k, False: 25.8k]
  ------------------
 4909|  53.3k|    {
 4910|  53.3k|        WORD32 edge_idx;
 4911|       |
 4912|       |        /* U */
 4913|  53.3k|        edge_idx = 2 + SIGN(pu1_src[wd - 2] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  53.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 48.3k, False: 4.95k]
  |  |  |  Branch (44:34): [True: 5.53k, False: 42.8k]
  |  |  ------------------
  ------------------
 4914|  53.3k|                        SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|  53.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 49.4k, False: 3.87k]
  |  |  |  Branch (44:34): [True: 4.19k, False: 45.2k]
  |  |  ------------------
  ------------------
 4915|       |
 4916|  53.3k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4917|       |
 4918|  53.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (4918:12): [True: 9.58k, False: 43.7k]
  ------------------
 4919|  9.58k|        {
 4920|  9.58k|            u1_pos_wd_0_tmp_u = CLIP3(pu1_src[wd - 2] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.58k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 465, False: 9.11k]
  |  |  |  Branch (40:53): [True: 558, False: 8.56k]
  |  |  ------------------
  ------------------
 4921|  9.58k|        }
 4922|  43.7k|        else
 4923|  43.7k|        {
 4924|  43.7k|            u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 4925|  43.7k|        }
 4926|       |
 4927|       |        /* V */
 4928|  53.3k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[1]) +
  ------------------
  |  |   44|  53.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 48.5k, False: 4.71k]
  |  |  |  Branch (44:34): [True: 5.80k, False: 42.7k]
  |  |  ------------------
  ------------------
 4929|  53.3k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|  53.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 49.5k, False: 3.76k]
  |  |  |  Branch (44:34): [True: 3.74k, False: 45.7k]
  |  |  ------------------
  ------------------
 4930|       |
 4931|  53.3k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4932|       |
 4933|  53.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (4933:12): [True: 9.12k, False: 44.1k]
  ------------------
 4934|  9.12k|        {
 4935|  9.12k|            u1_pos_wd_0_tmp_v = CLIP3(pu1_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.12k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 362, False: 8.76k]
  |  |  |  Branch (40:53): [True: 601, False: 8.16k]
  |  |  ------------------
  ------------------
 4936|  9.12k|        }
 4937|  44.1k|        else
 4938|  44.1k|        {
 4939|  44.1k|            u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 4940|  44.1k|        }
 4941|  53.3k|    }
 4942|  25.8k|    else
 4943|  25.8k|    {
 4944|  25.8k|        u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 4945|  25.8k|        u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 4946|  25.8k|    }
 4947|       |
 4948|       |    /* If bottom-left is available, process separately */
 4949|  79.1k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (4949:8): [True: 57.9k, False: 21.2k]
  ------------------
 4950|  57.9k|    {
 4951|  57.9k|        WORD32 edge_idx;
 4952|       |
 4953|       |        /* U */
 4954|  57.9k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|  57.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 54.6k, False: 3.33k]
  |  |  |  Branch (44:34): [True: 4.00k, False: 50.6k]
  |  |  ------------------
  ------------------
 4955|  57.9k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  57.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 52.7k, False: 5.19k]
  |  |  |  Branch (44:34): [True: 5.15k, False: 47.5k]
  |  |  ------------------
  ------------------
 4956|       |
 4957|  57.9k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4958|       |
 4959|  57.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (4959:12): [True: 9.30k, False: 48.6k]
  ------------------
 4960|  9.30k|        {
 4961|  9.30k|            u1_pos_0_ht_tmp_u = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.30k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 404, False: 8.90k]
  |  |  |  Branch (40:53): [True: 717, False: 8.18k]
  |  |  ------------------
  ------------------
 4962|  9.30k|        }
 4963|  48.6k|        else
 4964|  48.6k|        {
 4965|  48.6k|            u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 4966|  48.6k|        }
 4967|       |
 4968|       |        /* V */
 4969|  57.9k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|  57.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 55.2k, False: 2.66k]
  |  |  |  Branch (44:34): [True: 4.11k, False: 51.1k]
  |  |  ------------------
  ------------------
 4970|  57.9k|                        SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src_bot_left[1]);
  ------------------
  |  |   44|  57.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 52.5k, False: 5.42k]
  |  |  |  Branch (44:34): [True: 4.76k, False: 47.7k]
  |  |  ------------------
  ------------------
 4971|       |
 4972|  57.9k|        edge_idx = gi1_table_edge_idx[edge_idx];
 4973|       |
 4974|  57.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (4974:12): [True: 8.99k, False: 48.9k]
  ------------------
 4975|  8.99k|        {
 4976|  8.99k|            u1_pos_0_ht_tmp_v = CLIP3(pu1_src[(ht - 1) * src_strd + 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.99k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 499, False: 8.49k]
  |  |  |  Branch (40:53): [True: 587, False: 7.90k]
  |  |  ------------------
  ------------------
 4977|  8.99k|        }
 4978|  48.9k|        else
 4979|  48.9k|        {
 4980|  48.9k|            u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 4981|  48.9k|        }
 4982|  57.9k|    }
 4983|  21.2k|    else
 4984|  21.2k|    {
 4985|  21.2k|        u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 4986|  21.2k|        u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 4987|  21.2k|    }
 4988|       |
 4989|       |
 4990|       |
 4991|       |    /* Update height and source pointers based on the availability flags */
 4992|  79.1k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (4992:8): [True: 18.3k, False: 60.8k]
  ------------------
 4993|  18.3k|    {
 4994|  18.3k|        pu1_src_left_cpy2 += 2;
 4995|  18.3k|        pu1_src_top_cpy = pu1_src;
 4996|  18.3k|        pu1_src += src_strd;
 4997|  18.3k|        ht--;
 4998|  18.3k|    }
 4999|  79.1k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (4999:8): [True: 10.7k, False: 68.3k]
  ------------------
 5000|  10.7k|    {
 5001|  10.7k|        ht--;
 5002|  10.7k|    }
 5003|       |
 5004|  79.1k|    sao_offset_8x16b = _mm_unpacklo_epi64(sao_offset_8x16b, const0_16x8b);
 5005|  79.1k|    const2_16x8b = _mm_set1_epi8(2);
 5006|  79.1k|    const0_16x8b = _mm_setzero_si128();
 5007|       |
 5008|       |
 5009|       |    //availability mask creation
 5010|  79.1k|    u1_avail0 = pu1_avail[0];
 5011|  79.1k|    u1_avail1 = pu1_avail[1];
 5012|  79.1k|    au1_mask[0] = u1_avail0;
 5013|  79.1k|    au1_mask[1] = u1_avail0;
 5014|  79.1k|    au1_mask[wd - 1] = u1_avail1;
 5015|  79.1k|    au1_mask[wd - 2] = u1_avail1;
 5016|  79.1k|    {
 5017|  79.1k|        WORD32 ht_rem;
 5018|  79.1k|        au1_mask_cpy = au1_mask;
 5019|   167k|        for(col = wd; col >= 16; col -= 16)
  ------------------
  |  Branch (5019:23): [True: 88.6k, False: 79.1k]
  ------------------
 5020|  88.6k|        {
 5021|  88.6k|            pu1_src_cpy = pu1_src;
 5022|  88.6k|            src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col + 2));
 5023|       |            //row = 0
 5024|  88.6k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 5025|       |
 5026|       |            //loading the mask
 5027|  88.6k|            au1_mask8x16b = _mm_loadu_si128((__m128i *)au1_mask_cpy);
 5028|       |            //separating +ve and and -ve values.
 5029|  88.6k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 5030|  88.6k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 5031|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 5032|  88.6k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5033|  88.6k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5034|       |            //combining the appropriate sign change
 5035|  88.6k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5036|  88.6k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 5037|       |
 5038|   556k|            for(row = ht; row >= 2; row -= 2)
  ------------------
  |  Branch (5038:27): [True: 468k, False: 88.6k]
  ------------------
 5039|   468k|            {
 5040|   468k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_left_cpy));
 5041|       |                //row = 1
 5042|   468k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5043|       |                //to insert left in row 1
 5044|   468k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 12);
 5045|       |                // row = 0 right
 5046|   468k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2));
 5047|       |
 5048|       |                //manipulation for row 1 - row 0
 5049|   468k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5050|       |                //row 0 -row1
 5051|       |                //separating +ve and and -ve values.
 5052|   468k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5053|   468k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 5054|       |
 5055|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5056|   468k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5057|   468k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5058|       |
 5059|       |                //combining the appropriate sign change
 5060|   468k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(0-1)
 5061|       |                //combining sign-left and sign_right
 5062|   468k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 5063|       |
 5064|       |                //row1-row0
 5065|       |                //separating +ve and and -ve values.
 5066|   468k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, src_bottom_16x8b);
 5067|   468k|                cmp_lt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, src_temp1_16x8b);
 5068|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5069|   468k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5070|   468k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5071|       |
 5072|       |                // row = 2
 5073|   468k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 5074|       |                // row = 1 right
 5075|   468k|                signdwn1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd + 2));
 5076|   468k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-0)
 5077|       |
 5078|       |                //bottom - row1
 5079|   468k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5080|   468k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 5081|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5082|   468k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5083|   468k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5084|       |                //for the next iteration bottom -row1
 5085|   468k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5086|       |
 5087|       |                //to insert left in row 1
 5088|   468k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 10);
 5089|       |                //manipulation for row 1 - bottom
 5090|   468k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5091|       |
 5092|       |                //row1 -bottom
 5093|   468k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5094|   468k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5095|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5096|   468k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5097|   468k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5098|       |                //combining the appropriate sign change
 5099|   468k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5100|       |
 5101|       |                //combining sign-left and sign_right
 5102|   468k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signdwn1_16x8b);
 5103|       |
 5104|       |                //eliminating old left for row 0 and row 1
 5105|   468k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 5106|       |                //row1  getting it right for left of next block
 5107|   468k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp1_16x8b, 14);
 5108|       |                //row0  getting it right for left of next block
 5109|   468k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5110|       |                //copying the next top
 5111|   468k|                src_top_16x8b = src_temp1_16x8b;
 5112|       |
 5113|       |
 5114|       |                //adding constant 2
 5115|   468k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5116|   468k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 5117|       |                //shuffle to get sao index
 5118|   468k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5119|   468k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 5120|       |                //using availability mask
 5121|   468k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5122|   468k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 5123|       |
 5124|       |                //adding chroma offset to access U and V
 5125|   468k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5126|   468k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 5127|       |
 5128|       |                //shuffle to get sao offset
 5129|   468k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5130|   468k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 5131|       |                //cnvert to 16 bit then add and then saturated pack
 5132|   468k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5133|   468k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5134|   468k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5135|   468k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 5136|   468k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5137|   468k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5138|   468k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 5139|   468k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 5140|       |
 5141|   468k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 5142|   468k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 5143|   468k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 5144|   468k|                src_temp1_16x8b = _mm_unpackhi_epi8(src_temp1_16x8b, const0_16x8b);
 5145|   468k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 5146|   468k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5147|   468k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge1_16x8b);
 5148|   468k|                src_temp1_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp1_16x8b);
 5149|       |                //store left boundary
 5150|   468k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5151|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 5152|   468k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5153|       |                // row = 1
 5154|   468k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy + src_strd), src_temp1_16x8b);
 5155|       |
 5156|   468k|                src_temp0_16x8b = src_bottom_16x8b;
 5157|   468k|                pu1_src_cpy += (src_strd << 1);
 5158|   468k|                pu1_src_left_cpy += 4;
 5159|   468k|            }
 5160|  88.6k|            ht_rem = ht & 0x1;
 5161|       |
 5162|  88.6k|            if(ht_rem)
  ------------------
  |  Branch (5162:16): [True: 30.8k, False: 57.7k]
  ------------------
 5163|  30.8k|            {
 5164|  30.8k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5165|  30.8k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5166|       |                //to insert left in row 1
 5167|  30.8k|                signdwn1_16x8b = _mm_slli_si128(left_store_16x8b, 12);
 5168|       |                //manipulation for row 1 - row 0
 5169|  30.8k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5170|       |
 5171|       |                //current row -next row
 5172|       |                //separating +ve and and -ve values.
 5173|  30.8k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5174|  30.8k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 5175|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5176|  30.8k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5177|  30.8k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5178|       |                //combining the appropriate sign change
 5179|  30.8k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5180|       |                //adding top and bottom and constant 2
 5181|  30.8k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 5182|  30.8k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5183|       |                //eliminating old left for row 0 and row 1
 5184|  30.8k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5185|       |                //row0  getting it right for left of next block
 5186|  30.8k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5187|       |                //copying the next top
 5188|  30.8k|                src_top_16x8b = src_temp0_16x8b;
 5189|       |
 5190|  30.8k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5191|       |                //using availability mask
 5192|  30.8k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5193|       |
 5194|       |                //adding chroma offset to access U and V
 5195|  30.8k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5196|       |
 5197|       |
 5198|  30.8k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5199|       |
 5200|       |                //cnvert to 16 bit then add and then saturated pack
 5201|  30.8k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5202|  30.8k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5203|  30.8k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5204|  30.8k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 5205|  30.8k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5206|  30.8k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5207|  30.8k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 5208|  30.8k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 5209|       |
 5210|       |                //store left boundary
 5211|  30.8k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5212|       |
 5213|  30.8k|                _mm_storeu_si128((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5214|  30.8k|                pu1_src_cpy += (src_strd);
 5215|  30.8k|                src_temp0_16x8b = src_bottom_16x8b;
 5216|  30.8k|                pu1_src_left_cpy += 2;
 5217|  30.8k|            }
 5218|  88.6k|            {   //for bottom right
 5219|  88.6k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5220|  88.6k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5221|  88.6k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5222|  88.6k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5223|  88.6k|            }
 5224|  88.6k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (5224:16): [True: 11.6k, False: 76.9k]
  ------------------
 5225|  11.6k|            {
 5226|  11.6k|                src_top_16x8b = src_bottom_16x8b;
 5227|  11.6k|            }
 5228|       |            //for the top left of next part of the block
 5229|  88.6k|            left_store_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_top_cpy + wd - col));
 5230|       |            //updating top flag
 5231|  88.6k|            _mm_storeu_si128((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 5232|  88.6k|            pu1_src += 16;
 5233|  88.6k|            au1_mask_cpy += 16;
 5234|  88.6k|        }
 5235|  79.1k|        pu1_src_left_cpy = pu1_src_left_cpy2;
 5236|  79.1k|        wd_rem = wd & 0xF;
 5237|  79.1k|        if(wd_rem)
  ------------------
  |  Branch (5237:12): [True: 7.51k, False: 71.6k]
  ------------------
 5238|  7.51k|        {
 5239|  7.51k|            pu1_src_cpy = pu1_src;
 5240|  7.51k|            src_top_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src_top_cpy + wd - col + 2));
 5241|       |            //row = 0
 5242|  7.51k|            src_temp0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy));
 5243|  7.51k|            au1_mask8x16b = _mm_loadl_epi64((__m128i *)au1_mask_cpy); //????
 5244|       |            //separating +ve and and -ve values.
 5245|  7.51k|            cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, src_top_16x8b);
 5246|  7.51k|            cmp_lt0_16x8b = _mm_subs_epu8(src_top_16x8b, src_temp0_16x8b);
 5247|       |            //creating mask 00 for +ve and -ve values and FF for zero.
 5248|  7.51k|            cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5249|  7.51k|            cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5250|       |            //preparing au1_mask
 5251|  7.51k|            au1_mask8x16b = _mm_unpacklo_epi64(au1_mask8x16b, au1_mask8x16b);
 5252|       |            //combining the appropriate sign change
 5253|  7.51k|            signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5254|  7.51k|            signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 5255|  7.51k|            pu1_src_left_cpy = pu1_src_left_cpy2;
 5256|  20.9k|            for(row = ht; row >= 4; row -= 4)
  ------------------
  |  Branch (5256:27): [True: 13.4k, False: 7.51k]
  ------------------
 5257|  13.4k|            {
 5258|  13.4k|                left_store_16x8b = _mm_loadu_si128((__m128i *)pu1_src_left_cpy);
 5259|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 5260|  13.4k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5261|       |                // row = 2
 5262|  13.4k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 5263|       |                //manipulation for row 0 -row 1
 5264|  13.4k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 5265|       |                //row 1 left
 5266|  13.4k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5267|       |                //row 0 -row1
 5268|       |                //separating +ve and and -ve values.
 5269|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5270|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 5271|       |
 5272|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5273|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5274|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5275|       |                //manipulatiing for row 1 -row 0
 5276|  13.4k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 2);
 5277|       |                //combining the appropriate sign change
 5278|  13.4k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5279|       |                //row 1 -row0
 5280|       |                //separating +ve and and -ve values.
 5281|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5282|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5283|       |
 5284|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5285|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5286|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5287|       |                //row1-row0
 5288|  13.4k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5289|       |
 5290|  13.4k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 5291|       |
 5292|  13.4k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 5293|       |                //manipulation for row 1 -row 2
 5294|  13.4k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 10);
 5295|       |                //row 2 left
 5296|  13.4k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5297|       |                //packing row 0 n row 1
 5298|  13.4k|                src_temp0_16x8b = _mm_unpacklo_epi64(src_temp0_16x8b, src_temp1_16x8b);
 5299|       |                //row1 -row2
 5300|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5301|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5302|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5303|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5304|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5305|       |                //combining the appropriate sign change
 5306|  13.4k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 5307|  13.4k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 5308|       |
 5309|       |                //row 1 right
 5310|  13.4k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 5311|       |                //row = 3
 5312|  13.4k|                src_top_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 3 * src_strd));
 5313|       |
 5314|       |                // row = 4
 5315|  13.4k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + 4 * src_strd));
 5316|       |
 5317|  13.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 5318|       |
 5319|       |                //separating +ve and and -ve values.(2,1)
 5320|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5321|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 5322|       |
 5323|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5324|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5325|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5326|       |                //row 2 right
 5327|  13.4k|                signdwn1_16x8b = _mm_srli_si128(src_bottom_16x8b, 2);
 5328|       |                //combining the appropriate sign change
 5329|  13.4k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1)
 5330|       |
 5331|       |                //separating +ve and and -ve values.(3,2)
 5332|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 5333|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 5334|  13.4k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8); //aligned left (2-1)
 5335|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5336|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5337|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5338|       |                //manipulation for row 2 -row 3
 5339|  13.4k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 8);
 5340|       |                //row 3 left
 5341|  13.4k|                signdwn1_16x8b = _mm_alignr_epi8(src_top_16x8b, signdwn1_16x8b, 14);
 5342|       |                //combining the appropriate sign change
 5343|  13.4k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-2)
 5344|       |
 5345|  13.4k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(3-2) ,(2-1)
 5346|       |
 5347|       |                //separating +ve and and -ve values.(2,3)
 5348|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5349|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 5350|       |
 5351|       |                //manipulation for row 3 -bottom
 5352|  13.4k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 6);
 5353|       |                //bottom left
 5354|  13.4k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5355|       |
 5356|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5357|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5358|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5359|       |                //combining the appropriate sign change
 5360|  13.4k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-3)
 5361|       |
 5362|       |                //separating +ve and and -ve values.(3,bottom)
 5363|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_top_16x8b, signdwn1_16x8b);
 5364|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_top_16x8b);
 5365|       |
 5366|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5367|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5368|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5369|  13.4k|                edge1_16x8b = _mm_slli_si128(edge1_16x8b, 8); //aligned left (2-3)
 5370|       |                //combining the appropriate sign change
 5371|  13.4k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(3-bottom)
 5372|  13.4k|                edge1_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge1_16x8b, 8); //(3-bottom),(2-3)
 5373|       |
 5374|       |
 5375|       |                //eliminating old left for row 0,1,2,3
 5376|  13.4k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 8);
 5377|       |                //packing row 2 n row 3
 5378|  13.4k|                src_bottom_16x8b = _mm_unpacklo_epi64(src_bottom_16x8b, src_top_16x8b);
 5379|       |                //row 3 right
 5380|  13.4k|                signdwn1_16x8b = _mm_srli_si128(src_top_16x8b, 2);
 5381|       |                //loading row 3 right into left
 5382|  13.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_bottom_16x8b, 14);
 5383|       |                //adding bottom and top values of row 2 and row 3
 5384|  13.4k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, signup0_16x8b); //(3,2)
 5385|       |                //separating +ve and and -ve values.(botttom,3)
 5386|  13.4k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5387|  13.4k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5388|       |                //to store right of row 2
 5389|  13.4k|                signdwn1_16x8b = _mm_slli_si128(src_bottom_16x8b, 8);
 5390|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5391|  13.4k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5392|  13.4k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5393|  13.4k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(bottom -3) for next iteration
 5394|       |
 5395|       |                //storing right of row 2into left
 5396|  13.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5397|       |                //to store right of row 0
 5398|  13.4k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5399|       |                //storing right of row 1 into left
 5400|  13.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5401|       |                //storing right of row 0 into left
 5402|  13.4k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5403|       |
 5404|       |
 5405|       |                //adding constant 2
 5406|  13.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5407|  13.4k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, const2_16x8b);
 5408|       |                //shuffle to get sao index
 5409|  13.4k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5410|  13.4k|                edge1_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge1_16x8b);
 5411|       |                //using availability mask
 5412|  13.4k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5413|  13.4k|                edge1_16x8b = _mm_and_si128(edge1_16x8b, au1_mask8x16b);
 5414|       |                //adding chroma offset to access U and V
 5415|  13.4k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5416|  13.4k|                edge1_16x8b = _mm_add_epi8(edge1_16x8b, chroma_offset_8x16b);
 5417|       |                //shuffle to get sao offset
 5418|  13.4k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5419|  13.4k|                edge1_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge1_16x8b);
 5420|       |
 5421|       |                //cnvert to 16 bit then add and then saturated pack
 5422|  13.4k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5423|  13.4k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5424|  13.4k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5425|  13.4k|                src_temp0_16x8b = _mm_unpackhi_epi8(src_temp0_16x8b, const0_16x8b);
 5426|  13.4k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5427|  13.4k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5428|  13.4k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, edge0_16x8b);
 5429|  13.4k|                src_temp0_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_temp0_16x8b);
 5430|       |
 5431|  13.4k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge1_16x8b);
 5432|  13.4k|                cmp_gt0_16x8b = _mm_unpacklo_epi8(src_bottom_16x8b, const0_16x8b);
 5433|  13.4k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge1_16x8b, signdwn1_16x8b);
 5434|  13.4k|                src_bottom_16x8b = _mm_unpackhi_epi8(src_bottom_16x8b, const0_16x8b);
 5435|  13.4k|                edge1_16x8b = _mm_unpackhi_epi8(edge1_16x8b, signdwn1_16x8b);
 5436|  13.4k|                cmp_gt0_16x8b = _mm_add_epi16(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5437|  13.4k|                src_bottom_16x8b = _mm_add_epi16(src_bottom_16x8b, edge1_16x8b);
 5438|  13.4k|                src_bottom_16x8b = _mm_packus_epi16(cmp_gt0_16x8b, src_bottom_16x8b);
 5439|       |
 5440|  13.4k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 5441|  13.4k|                cmp_lt0_16x8b = _mm_srli_si128(src_bottom_16x8b, 8);
 5442|  13.4k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5443|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 5444|  13.4k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5445|       |                // row = 1
 5446|  13.4k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 5447|       |                //row = 2
 5448|  13.4k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 2 * src_strd), src_bottom_16x8b);
 5449|       |                // row = 3
 5450|  13.4k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + 3 * src_strd), cmp_lt0_16x8b);
 5451|       |
 5452|  13.4k|                src_temp0_16x8b = src_temp1_16x8b;
 5453|  13.4k|                signup0_16x8b = _mm_slli_si128(signup0_16x8b, 8);
 5454|  13.4k|                pu1_src_cpy += (src_strd << 2);
 5455|  13.4k|                pu1_src_left_cpy += 8;
 5456|  13.4k|            }
 5457|  7.51k|            ht_rem = ht & 0x2;
 5458|  7.51k|            if(ht_rem)
  ------------------
  |  Branch (5458:16): [True: 2.44k, False: 5.07k]
  ------------------
 5459|  2.44k|            {
 5460|  2.44k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5461|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 5462|  2.44k|                src_temp1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5463|       |                // row = 2
 5464|  2.44k|                src_bottom_16x8b =  _mm_loadu_si128((__m128i *)(pu1_src_cpy + 2 * src_strd));
 5465|       |
 5466|       |                //manipulation for row 0 -row 1
 5467|  2.44k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 5468|       |                //bottom left
 5469|  2.44k|                signdwn1_16x8b = _mm_alignr_epi8(src_temp1_16x8b, signdwn1_16x8b, 14);
 5470|       |                //separating +ve and and -ve values.
 5471|  2.44k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5472|  2.44k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 5473|       |
 5474|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5475|  2.44k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5476|  2.44k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5477|       |                //manipulation for row 1 - row 0
 5478|  2.44k|                signdwn1_16x8b = _mm_srli_si128(src_temp0_16x8b, 2);
 5479|       |                //combining the appropriate sign change
 5480|  2.44k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5481|       |
 5482|       |                //row1-row0
 5483|       |                //separating +ve and and -ve values.
 5484|  2.44k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5485|  2.44k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5486|       |
 5487|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5488|  2.44k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5489|  2.44k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5490|       |                //combining the appropriate sign chang
 5491|  2.44k|                edge1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5492|       |
 5493|       |                //manipulation for row 1 -bottom
 5494|  2.44k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 10);
 5495|       |                //bottom left
 5496|  2.44k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5497|       |
 5498|  2.44k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8); //aligned left (0-1)
 5499|  2.44k|                signup0_16x8b = _mm_alignr_epi8(edge1_16x8b, signup0_16x8b, 8); //(1-0),(0-top)
 5500|       |                //row1 -bottom
 5501|  2.44k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp1_16x8b, signdwn1_16x8b);
 5502|  2.44k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp1_16x8b);
 5503|       |
 5504|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5505|  2.44k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5506|  2.44k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5507|       |                //combining the appropriate sign change
 5508|  2.44k|                signdwn1_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(1-2)
 5509|  2.44k|                edge0_16x8b = _mm_alignr_epi8(signdwn1_16x8b, edge0_16x8b, 8); //(1-2),(0-1)
 5510|       |
 5511|       |                //manipulation for bottom- row 1 (row 1 right)
 5512|  2.44k|                signdwn1_16x8b = _mm_srli_si128(src_temp1_16x8b, 2);
 5513|       |                //adding top and down substraction
 5514|  2.44k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b); //(1,0) sign_up empty
 5515|       |                //bottom - row 1
 5516|  2.44k|                cmp_gt0_16x8b = _mm_subs_epu8(src_bottom_16x8b, signdwn1_16x8b);
 5517|  2.44k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_bottom_16x8b);
 5518|       |
 5519|       |                //eliminating old left for row 0,1
 5520|  2.44k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 4);
 5521|  2.44k|                signdwn1_16x8b = _mm_slli_si128(src_temp1_16x8b, 8);
 5522|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5523|  2.44k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5524|  2.44k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5525|       |                //for the next iteration signup0_16x8b
 5526|  2.44k|                signup0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b); //(2-1) for next
 5527|       |
 5528|       |                //storing right of row 1 into left
 5529|  2.44k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5530|       |                //for storing right of row 1
 5531|  2.44k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5532|       |
 5533|  2.44k|                src_top_16x8b = src_temp1_16x8b;
 5534|       |                //storing right of row 0 into left
 5535|  2.44k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5536|       |
 5537|       |                //adding constant 2
 5538|  2.44k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5539|       |
 5540|       |                //shuffle to get sao index
 5541|  2.44k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5542|       |                //using availability mask
 5543|  2.44k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5544|       |                //adding chroma offset to access U and V
 5545|  2.44k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5546|       |                //shuffle to get sao offset
 5547|  2.44k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5548|       |                //the next top already in  src_top_16x8b
 5549|       |                //cnvert to 16 bit then add and then saturated pack
 5550|  2.44k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5551|  2.44k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5552|  2.44k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5553|  2.44k|                src_temp1_16x8b = _mm_unpacklo_epi8(src_temp1_16x8b, const0_16x8b);
 5554|  2.44k|                edge0_16x8b = _mm_unpackhi_epi8(edge0_16x8b, signdwn1_16x8b);
 5555|  2.44k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 5556|  2.44k|                src_temp1_16x8b = _mm_add_epi16(src_temp1_16x8b, edge0_16x8b);
 5557|  2.44k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, src_temp1_16x8b);
 5558|       |
 5559|  2.44k|                cmp_gt0_16x8b = _mm_srli_si128(src_temp0_16x8b, 8);
 5560|       |
 5561|  2.44k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5562|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 5563|  2.44k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5564|       |                // row = 1
 5565|  2.44k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy + src_strd), cmp_gt0_16x8b);
 5566|  2.44k|                src_temp0_16x8b = src_bottom_16x8b;
 5567|  2.44k|                pu1_src_cpy += (src_strd << 1);
 5568|  2.44k|                pu1_src_left_cpy += 4;
 5569|  2.44k|            }
 5570|  7.51k|            ht_rem = ht & 0x1;
 5571|  7.51k|            if(ht_rem)
  ------------------
  |  Branch (5571:16): [True: 2.34k, False: 5.16k]
  ------------------
 5572|  2.34k|            {
 5573|  2.34k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5574|       |                //row = 1 load 8 pixel values from 7:0 pos. relative to cur. pos.
 5575|  2.34k|                src_bottom_16x8b = _mm_loadu_si128((__m128i *)(pu1_src_cpy + src_strd));
 5576|       |
 5577|       |
 5578|       |                //manipulation for row 0 -bottom
 5579|  2.34k|                signdwn1_16x8b =  _mm_slli_si128(left_store_16x8b, 12);
 5580|       |                //bottom left
 5581|  2.34k|                signdwn1_16x8b = _mm_alignr_epi8(src_bottom_16x8b, signdwn1_16x8b, 14);
 5582|       |                //separating +ve and and -ve values.
 5583|  2.34k|                cmp_gt0_16x8b = _mm_subs_epu8(src_temp0_16x8b, signdwn1_16x8b);
 5584|  2.34k|                cmp_lt0_16x8b = _mm_subs_epu8(signdwn1_16x8b, src_temp0_16x8b);
 5585|       |                //creating mask 00 for +ve and -ve values and FF for zero.
 5586|  2.34k|                cmp_gt0_16x8b = _mm_cmpeq_epi8(cmp_gt0_16x8b, const0_16x8b);
 5587|  2.34k|                cmp_lt0_16x8b = _mm_cmpeq_epi8(cmp_lt0_16x8b, const0_16x8b);
 5588|       |                //combining the appropriate sign change
 5589|  2.34k|                edge0_16x8b = _mm_sub_epi8(cmp_gt0_16x8b, cmp_lt0_16x8b);
 5590|       |                //adding top and down substraction
 5591|  2.34k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, signup0_16x8b);
 5592|       |                //for row 0 right to put into left store
 5593|  2.34k|                signdwn1_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5594|       |                //adding constant 2
 5595|  2.34k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, const2_16x8b);
 5596|  2.34k|                edge0_16x8b = _mm_slli_si128(edge0_16x8b, 8);
 5597|  2.34k|                edge0_16x8b = _mm_srli_si128(edge0_16x8b, 8);
 5598|       |                //left store manipulation 1
 5599|  2.34k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5600|       |                //filling the left boundary value
 5601|  2.34k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, signdwn1_16x8b, 14);
 5602|  2.34k|                src_top_16x8b = src_temp0_16x8b;
 5603|       |
 5604|       |                //shuffle to get sao index
 5605|  2.34k|                edge0_16x8b = _mm_shuffle_epi8(edge_idx_8x16b, edge0_16x8b);
 5606|       |                //using availability mask
 5607|  2.34k|                edge0_16x8b = _mm_and_si128(edge0_16x8b, au1_mask8x16b);
 5608|       |                //adding chroma offset to access U and V
 5609|  2.34k|                edge0_16x8b = _mm_add_epi8(edge0_16x8b, chroma_offset_8x16b);
 5610|       |                //shuffle to get sao offset
 5611|  2.34k|                edge0_16x8b = _mm_shuffle_epi8(sao_offset_8x16b, edge0_16x8b);
 5612|       |
 5613|       |                //cnvert to 16 bit then add and then saturated pack
 5614|  2.34k|                signdwn1_16x8b =  _mm_cmpgt_epi8(const0_16x8b, edge0_16x8b);
 5615|  2.34k|                src_temp0_16x8b = _mm_unpacklo_epi8(src_temp0_16x8b, const0_16x8b);
 5616|  2.34k|                cmp_lt0_16x8b = _mm_unpacklo_epi8(edge0_16x8b, signdwn1_16x8b);
 5617|  2.34k|                src_temp0_16x8b = _mm_add_epi16(src_temp0_16x8b, cmp_lt0_16x8b);
 5618|  2.34k|                src_temp0_16x8b = _mm_packus_epi16(src_temp0_16x8b, const0_16x8b);
 5619|       |
 5620|  2.34k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5621|       |                //row = 0 store 8 pixel values from 7:0 pos. relative to cur. pos.
 5622|  2.34k|                _mm_storel_epi64((__m128i *)(pu1_src_cpy), src_temp0_16x8b);
 5623|  2.34k|                pu1_src_cpy += (src_strd);
 5624|  2.34k|                src_temp0_16x8b = src_bottom_16x8b;
 5625|  2.34k|                pu1_src_left_cpy += 2;
 5626|  2.34k|            }
 5627|  7.51k|            {   //for bottom right
 5628|  7.51k|                left_store_16x8b = _mm_loadl_epi64((__m128i *)pu1_src_left_cpy);
 5629|  7.51k|                left_store_16x8b = _mm_srli_si128(left_store_16x8b, 2);
 5630|  7.51k|                src_temp0_16x8b = _mm_slli_si128(src_temp0_16x8b, 8);
 5631|  7.51k|                left_store_16x8b = _mm_alignr_epi8(left_store_16x8b, src_temp0_16x8b, 14);
 5632|  7.51k|                _mm_storel_epi64((__m128i *)(pu1_src_left_cpy), left_store_16x8b);
 5633|  7.51k|            }
 5634|  7.51k|            if(0 == pu1_avail[3])
  ------------------
  |  Branch (5634:16): [True: 1.16k, False: 6.35k]
  ------------------
 5635|  1.16k|            {
 5636|  1.16k|                src_top_16x8b = src_bottom_16x8b;
 5637|  1.16k|            }
 5638|       |
 5639|  7.51k|            _mm_storel_epi64((__m128i *)(pu1_src_top + wd - col), src_top_16x8b);
 5640|  7.51k|            pu1_src += 8;
 5641|  7.51k|        }
 5642|  79.1k|        pu1_src_org[wd - 2] = u1_pos_wd_0_tmp_u;
 5643|  79.1k|        pu1_src_org[wd - 1] = u1_pos_wd_0_tmp_v;
 5644|  79.1k|        pu1_src_org[(ht_tmp - 1) * src_strd] = u1_pos_0_ht_tmp_u;
 5645|  79.1k|        pu1_src_org[(ht_tmp - 1) * src_strd + 1] = u1_pos_0_ht_tmp_v;
 5646|  1.63M|        for(row = 0; row < 2 * ht_tmp; row++)
  ------------------
  |  Branch (5646:22): [True: 1.55M, False: 79.1k]
  ------------------
 5647|  1.55M|        {
 5648|  1.55M|            pu1_src_left[row] = au1_src_left_tmp[row];
 5649|  1.55M|        }
 5650|  79.1k|    }
 5651|       |
 5652|  79.1k|}

ihevc_weighted_pred_uni_sse42:
  120|  47.4k|{
  121|  47.4k|    WORD32 row, col, temp;
  122|  47.4k|    WORD32 dst0, dst1, dst2, dst3;
  123|       |
  124|       |    /* all 128 bit registers are named with a suffix mxnb, where m is the */
  125|       |    /* number of n bits packed in the register                            */
  126|  47.4k|    __m128i src_temp0_4x32b, src_temp1_4x32b, src_temp2_4x32b, src_temp3_4x32b;
  127|  47.4k|    __m128i const_temp_4x32b, lvl_shift_4x32b, wgt0_4x32b, off0_4x32b;
  128|       |
  129|  47.4k|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  47.4k|#define ASSERT(x) {}
  ------------------
  130|  47.4k|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  47.4k|#define ASSERT(x) {}
  ------------------
  131|       |
  132|  47.4k|    temp = 1 << (shift - 1);
  133|       |
  134|       |    // seting values in register
  135|  47.4k|    const_temp_4x32b = _mm_set1_epi32(temp);
  136|  47.4k|    lvl_shift_4x32b = _mm_set1_epi32(lvl_shift);
  137|  47.4k|    wgt0_4x32b = _mm_set1_epi32(wgt0);
  138|  47.4k|    off0_4x32b = _mm_set1_epi32(off0);
  139|       |
  140|  47.4k|    if(0 == (wd & 7)) /* wd multiple of 8 case */
  ------------------
  |  Branch (140:8): [True: 42.9k, False: 4.44k]
  ------------------
  141|  42.9k|    {
  142|  42.9k|        __m128i src_temp4_4x32b, src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b;
  143|       |
  144|       |        /*  outer for loop starts from here */
  145|   134k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (145:22): [True: 91.8k, False: 42.9k]
  ------------------
  146|  91.8k|        {
  147|   219k|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (147:26): [True: 127k, False: 91.8k]
  ------------------
  148|   127k|            {   /* for row =0 ,1,2,3*/
  149|       |
  150|       |                /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  151|   127k|                src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
  152|       |                /* row = 1 */
  153|   127k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  154|       |                /* row = 2 */
  155|   127k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd));
  156|       |                /* row = 3 */
  157|   127k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 3 * src_strd));
  158|       |
  159|       |                /* row = 0 */ /* Last 4 pixels */
  160|   127k|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 4));
  161|       |                /* row = 1 */
  162|   127k|                src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 4));
  163|       |                /* row = 2 */
  164|   127k|                src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd + 4));
  165|       |                /* row = 3 */
  166|   127k|                src_temp7_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 3 * src_strd + 4));
  167|       |
  168|       |                /* considering pix. 4:0 by converting 16-into 32 bit */ /* First 4 pixels */
  169|   127k|                src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  170|   127k|                src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  171|   127k|                src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  172|   127k|                src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  173|       |
  174|       |                /* (pi2_src[col] + lvl_shift)*/ /* First 4 pixels */
  175|   127k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
  176|   127k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
  177|   127k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
  178|   127k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
  179|       |
  180|       |                /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/ /* First 4 pixels */
  181|   127k|                src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
  182|   127k|                src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
  183|   127k|                src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
  184|   127k|                src_temp3_4x32b  = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
  185|       |
  186|       |                /* considering pix. 4:0 by converting 16-into 32 bit */ /* Last 4 pixels */
  187|   127k|                src_temp4_4x32b  = _mm_cvtepi16_epi32(src_temp4_4x32b);
  188|   127k|                src_temp5_4x32b  = _mm_cvtepi16_epi32(src_temp5_4x32b);
  189|   127k|                src_temp6_4x32b  = _mm_cvtepi16_epi32(src_temp6_4x32b);
  190|   127k|                src_temp7_4x32b  = _mm_cvtepi16_epi32(src_temp7_4x32b);
  191|       |
  192|       |                /* (pi2_src[col] + lvl_shift)*/ /* Last 4 pixels */
  193|   127k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift_4x32b);
  194|   127k|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift_4x32b);
  195|   127k|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift_4x32b);
  196|   127k|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift_4x32b);
  197|       |
  198|       |                /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/ /* Last 4 pixels */
  199|   127k|                src_temp4_4x32b  = _mm_mullo_epi32(src_temp4_4x32b, wgt0_4x32b);
  200|   127k|                src_temp5_4x32b  = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
  201|   127k|                src_temp6_4x32b  = _mm_mullo_epi32(src_temp6_4x32b, wgt0_4x32b);
  202|   127k|                src_temp7_4x32b  = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
  203|       |
  204|       |                /* i4_tmp += 1 << (shift - 1) */ /* First 4 pixels */
  205|   127k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
  206|   127k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
  207|   127k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
  208|   127k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
  209|       |
  210|       |                /* (i4_tmp >> shift) */ /* First 4 pixels */
  211|   127k|                src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b, shift);
  212|   127k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b, shift);
  213|   127k|                src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b, shift);
  214|   127k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b, shift);
  215|       |
  216|       |                /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
  217|   127k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, const_temp_4x32b);
  218|   127k|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
  219|   127k|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, const_temp_4x32b);
  220|   127k|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
  221|       |
  222|       |                /* (i4_tmp >> shift) */ /* Last 4 pixels */
  223|   127k|                src_temp4_4x32b = _mm_srai_epi32(src_temp4_4x32b, shift);
  224|   127k|                src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b, shift);
  225|   127k|                src_temp6_4x32b = _mm_srai_epi32(src_temp6_4x32b, shift);
  226|   127k|                src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b, shift);
  227|       |
  228|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */ /* First 4 pixels */
  229|   127k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
  230|   127k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
  231|   127k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
  232|   127k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
  233|       |
  234|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  235|   127k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, off0_4x32b);
  236|   127k|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, off0_4x32b);
  237|   127k|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, off0_4x32b);
  238|   127k|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, off0_4x32b);
  239|       |
  240|   127k|                src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp4_4x32b);
  241|   127k|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp5_4x32b);
  242|   127k|                src_temp2_4x32b = _mm_packs_epi32(src_temp2_4x32b, src_temp6_4x32b);
  243|   127k|                src_temp3_4x32b = _mm_packs_epi32(src_temp3_4x32b, src_temp7_4x32b);
  244|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  245|   127k|                src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp0_4x32b);
  246|   127k|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
  247|   127k|                src_temp2_4x32b = _mm_packus_epi16(src_temp2_4x32b, src_temp2_4x32b);
  248|   127k|                src_temp3_4x32b = _mm_packus_epi16(src_temp3_4x32b, src_temp3_4x32b);
  249|       |
  250|       |                /* store four 8-bit output values  */
  251|   127k|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp0_4x32b); /* row = 0*/
  252|   127k|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp1_4x32b); /* row = 2*/
  253|   127k|                _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_temp2_4x32b); /* row = 1*/
  254|   127k|                _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_temp3_4x32b); /* row = 3*/
  255|       |
  256|       |                /* To update pointer */
  257|   127k|                pi2_src += 8;
  258|   127k|                pu1_dst += 8;
  259|       |
  260|   127k|            } /* inner loop ends here(4-output values in single iteration) */
  261|       |
  262|  91.8k|            pi2_src = pi2_src - wd + 4 * src_strd;    /* Pointer update */
  263|  91.8k|            pu1_dst = pu1_dst - wd + 4 * dst_strd; /* Pointer update */
  264|       |
  265|  91.8k|        }
  266|  42.9k|    }
  267|  4.44k|    else  /* wd multiple of 4 case */
  268|  4.44k|    {
  269|       |        /*  outer for loop starts from here */
  270|  14.3k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (270:22): [True: 9.88k, False: 4.44k]
  ------------------
  271|  9.88k|        {
  272|  21.4k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (272:26): [True: 11.5k, False: 9.88k]
  ------------------
  273|  11.5k|            {   /* for row =0 ,1,2,3*/
  274|       |
  275|       |                /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  276|  11.5k|                src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
  277|       |                /* row = 1 */
  278|  11.5k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  279|       |                /* row = 2 */
  280|  11.5k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd));
  281|       |                /* row = 3 */
  282|  11.5k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 3 * src_strd));
  283|       |
  284|       |                /* considering pix. 4:0 by converting 16-into 32 bit */
  285|  11.5k|                src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  286|  11.5k|                src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  287|  11.5k|                src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  288|  11.5k|                src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  289|       |
  290|       |                /* (pi2_src[col] + lvl_shift)*/
  291|  11.5k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
  292|  11.5k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
  293|  11.5k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
  294|  11.5k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
  295|       |
  296|       |                /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  297|  11.5k|                src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
  298|  11.5k|                src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
  299|  11.5k|                src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
  300|  11.5k|                src_temp3_4x32b  = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
  301|       |
  302|       |                /* i4_tmp += 1 << (shift - 1) */
  303|  11.5k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
  304|  11.5k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
  305|  11.5k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
  306|  11.5k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
  307|       |
  308|       |                /* (i4_tmp >> shift) */
  309|  11.5k|                src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b, shift);
  310|  11.5k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b, shift);
  311|  11.5k|                src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b, shift);
  312|  11.5k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b, shift);
  313|       |
  314|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */
  315|  11.5k|                src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
  316|  11.5k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
  317|  11.5k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
  318|  11.5k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
  319|       |
  320|  11.5k|                src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp1_4x32b);
  321|  11.5k|                src_temp2_4x32b = _mm_packs_epi32(src_temp2_4x32b, src_temp3_4x32b);
  322|       |
  323|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  324|  11.5k|                src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp2_4x32b);
  325|       |
  326|  11.5k|                dst0 = _mm_cvtsi128_si32(src_temp0_4x32b);
  327|       |                /* dst row = 1 to 3 */
  328|  11.5k|                src_temp1_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 1);
  329|  11.5k|                src_temp2_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 2);
  330|  11.5k|                src_temp3_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 3);
  331|       |
  332|       |                /* store four 8-bit output values  */
  333|  11.5k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
  334|       |
  335|  11.5k|                dst1 = _mm_cvtsi128_si32(src_temp1_4x32b);
  336|  11.5k|                dst2 = _mm_cvtsi128_si32(src_temp2_4x32b);
  337|  11.5k|                dst3 = _mm_cvtsi128_si32(src_temp3_4x32b);
  338|       |
  339|       |                /* row = 1 to row = 3 */
  340|  11.5k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
  341|  11.5k|                *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2;
  342|  11.5k|                *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3;
  343|       |
  344|       |                /* To update pointer */
  345|  11.5k|                pi2_src += 4;
  346|  11.5k|                pu1_dst += 4;
  347|       |
  348|  11.5k|            } /* inner loop ends here(4-output values in single iteration) */
  349|       |
  350|  9.88k|            pi2_src = pi2_src - wd + 4 * src_strd;    /* Pointer update */
  351|  9.88k|            pu1_dst = pu1_dst - wd + 4 * dst_strd; /* Pointer update */
  352|       |
  353|  9.88k|        }
  354|  4.44k|    }
  355|  47.4k|}
ihevc_weighted_pred_chroma_uni_sse42:
  421|  47.0k|{
  422|  47.0k|    WORD32 row, col, temp, wdx2;
  423|       |    /* all 128 bit registers are named with a suffix mxnb, where m is the */
  424|       |    /* number of n bits packed in the register                            */
  425|       |
  426|  47.0k|    __m128i src_temp0_4x32b, src_temp1_4x32b;
  427|  47.0k|    __m128i const_temp_4x32b, lvl_shift_4x32b, wgt0_4x32b, off0_4x32b;
  428|       |
  429|  47.0k|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  47.0k|#define ASSERT(x) {}
  ------------------
  430|  47.0k|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  47.0k|#define ASSERT(x) {}
  ------------------
  431|       |
  432|  47.0k|    temp = 1 << (shift - 1);
  433|  47.0k|    wdx2 = 2 * wd;
  434|       |
  435|       |    // seting values in register
  436|  47.0k|    const_temp_4x32b = _mm_set1_epi32(temp);
  437|  47.0k|    lvl_shift_4x32b = _mm_set1_epi32(lvl_shift);
  438|  47.0k|    wgt0_4x32b = _mm_set_epi32(wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb);
  439|  47.0k|    off0_4x32b = _mm_set_epi32(off0_cr, off0_cb, off0_cr, off0_cb);
  440|       |
  441|       |#if 0 /* Enable this for ht%4=0 case. But was degrading performance for lower sizes and improving for higher sizes!!! */
  442|       |    if( 0 == (ht & 3)) /* ht multiple of 4 case */
  443|       |    {
  444|       |        if( 0 == (wdx2 & 15)) /* 2*wd multiple of 168 case */
  445|       |        {
  446|       |            __m128i src_temp2_4x32b, src_temp3_4x32b;
  447|       |            __m128i src_temp4_4x32b, src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b;
  448|       |            __m128i src_temp8_4x32b, src_temp9_4x32b, src_temp10_4x32b, src_temp11_4x32b;
  449|       |            __m128i src_temp12_4x32b, src_temp13_4x32b, src_temp14_4x32b, src_temp15_4x32b;
  450|       |            /*  outer for loop starts from here */
  451|       |            for(row = 0; row < ht; row +=4)
  452|       |            {
  453|       |                for(col = 0; col < wdx2; col +=16)
  454|       |                {
  455|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  456|       |                    src_temp0_4x32b = _mm_loadu_si128((__m128i*)(pi2_src));
  457|       |                    /* row = 1 */
  458|       |                    src_temp1_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+src_strd));
  459|       |                    /* row = 0 */ /* Second 4 pixels */
  460|       |                    src_temp2_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+4));
  461|       |                    /* row = 1 */
  462|       |                    src_temp3_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+src_strd+4));
  463|       |                    /* row = 0 */ /* Third 4 pixels */
  464|       |                    src_temp4_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+8));
  465|       |                    /* row = 1 */
  466|       |                    src_temp5_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+src_strd+8));
  467|       |                    /* row = 0 */ /* Last 4 pixels */
  468|       |                    src_temp6_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+12));
  469|       |                    /* row = 1 */
  470|       |                    src_temp7_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+src_strd+12));
  471|       |
  472|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  473|       |                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  474|       |                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  475|       |                    /* (pi2_src[col] + lvl_shift)*/
  476|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, lvl_shift_4x32b);
  477|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, lvl_shift_4x32b);
  478|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  479|       |                    src_temp0_4x32b  = _mm_mullo_epi32 (src_temp0_4x32b, wgt0_4x32b);
  480|       |                    src_temp1_4x32b  = _mm_mullo_epi32 (src_temp1_4x32b, wgt0_4x32b);
  481|       |
  482|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Second 4 pixels */
  483|       |                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  484|       |                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  485|       |                    /* (pi2_src[col] + lvl_shift)*/
  486|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, lvl_shift_4x32b);
  487|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, lvl_shift_4x32b);
  488|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  489|       |                    src_temp2_4x32b  = _mm_mullo_epi32 (src_temp2_4x32b, wgt0_4x32b);
  490|       |                    src_temp3_4x32b  = _mm_mullo_epi32 (src_temp3_4x32b, wgt0_4x32b);
  491|       |
  492|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Third 4 pixels */
  493|       |                    src_temp4_4x32b  = _mm_cvtepi16_epi32(src_temp4_4x32b);
  494|       |                    src_temp5_4x32b  = _mm_cvtepi16_epi32(src_temp5_4x32b);
  495|       |                    /* (pi2_src[col] + lvl_shift)*/
  496|       |                    src_temp4_4x32b = _mm_add_epi32 (src_temp4_4x32b, lvl_shift_4x32b);
  497|       |                    src_temp5_4x32b = _mm_add_epi32 (src_temp5_4x32b, lvl_shift_4x32b);
  498|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  499|       |                    src_temp4_4x32b  = _mm_mullo_epi32 (src_temp4_4x32b, wgt0_4x32b);
  500|       |                    src_temp5_4x32b  = _mm_mullo_epi32 (src_temp5_4x32b, wgt0_4x32b);
  501|       |
  502|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Last 4 pixels */
  503|       |                    src_temp6_4x32b  = _mm_cvtepi16_epi32(src_temp6_4x32b);
  504|       |                    src_temp7_4x32b  = _mm_cvtepi16_epi32(src_temp7_4x32b);
  505|       |                    /* (pi2_src[col] + lvl_shift)*/
  506|       |                    src_temp6_4x32b = _mm_add_epi32 (src_temp6_4x32b, lvl_shift_4x32b);
  507|       |                    src_temp7_4x32b = _mm_add_epi32 (src_temp7_4x32b, lvl_shift_4x32b);
  508|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  509|       |                    src_temp6_4x32b  = _mm_mullo_epi32 (src_temp6_4x32b, wgt0_4x32b);
  510|       |                    src_temp7_4x32b  = _mm_mullo_epi32 (src_temp7_4x32b, wgt0_4x32b);
  511|       |
  512|       |                    /* i4_tmp += 1 << (shift - 1) */
  513|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, const_temp_4x32b);
  514|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, const_temp_4x32b);
  515|       |                    /* (i4_tmp >> shift) */
  516|       |                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
  517|       |                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
  518|       |
  519|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Second 4 pixels */
  520|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, const_temp_4x32b);
  521|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, const_temp_4x32b);
  522|       |                    /* (i4_tmp >> shift) */
  523|       |                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
  524|       |                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
  525|       |
  526|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Third 4 pixels */
  527|       |                    src_temp4_4x32b = _mm_add_epi32 (src_temp4_4x32b, const_temp_4x32b);
  528|       |                    src_temp5_4x32b = _mm_add_epi32 (src_temp5_4x32b, const_temp_4x32b);
  529|       |                    /* (i4_tmp >> shift) */
  530|       |                    src_temp4_4x32b = _mm_srai_epi32(src_temp4_4x32b,  shift);
  531|       |                    src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
  532|       |
  533|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
  534|       |                    src_temp6_4x32b = _mm_add_epi32 (src_temp6_4x32b, const_temp_4x32b);
  535|       |                    src_temp7_4x32b = _mm_add_epi32 (src_temp7_4x32b, const_temp_4x32b);
  536|       |                    /* (i4_tmp >> shift) */
  537|       |                    src_temp6_4x32b = _mm_srai_epi32(src_temp6_4x32b,  shift);
  538|       |                    src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
  539|       |
  540|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  541|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, off0_4x32b);
  542|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, off0_4x32b);
  543|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Second 4 pixels */
  544|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, off0_4x32b);
  545|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, off0_4x32b);
  546|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Third 4 pixels */
  547|       |                    src_temp4_4x32b = _mm_add_epi32 (src_temp4_4x32b, off0_4x32b);
  548|       |                    src_temp5_4x32b = _mm_add_epi32 (src_temp5_4x32b, off0_4x32b);
  549|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  550|       |                    src_temp6_4x32b = _mm_add_epi32 (src_temp6_4x32b, off0_4x32b);
  551|       |                    src_temp7_4x32b = _mm_add_epi32 (src_temp7_4x32b, off0_4x32b);
  552|       |
  553|       |                    src_temp0_4x32b = _mm_packs_epi32 (src_temp0_4x32b, src_temp2_4x32b);
  554|       |                    src_temp1_4x32b = _mm_packs_epi32 (src_temp1_4x32b, src_temp3_4x32b);
  555|       |                    src_temp4_4x32b = _mm_packs_epi32 (src_temp4_4x32b, src_temp6_4x32b);
  556|       |                    src_temp5_4x32b = _mm_packs_epi32 (src_temp5_4x32b, src_temp7_4x32b);
  557|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  558|       |                    src_temp0_4x32b = _mm_packus_epi16 (src_temp0_4x32b, src_temp4_4x32b);
  559|       |                    src_temp1_4x32b = _mm_packus_epi16 (src_temp1_4x32b, src_temp5_4x32b);
  560|       |
  561|       |                    /* store 16 8-bit output values  */
  562|       |                    _mm_storeu_si128((__m128i*)(pu1_dst+0*dst_strd), src_temp0_4x32b); /* row = 0*/
  563|       |                    _mm_storeu_si128((__m128i*)(pu1_dst+1*dst_strd), src_temp1_4x32b); /* row = 1*/
  564|       |
  565|       |                    /* row = 2 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  566|       |                    src_temp8_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd));
  567|       |                    /* row = 3 */
  568|       |                    src_temp9_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd));
  569|       |                    /* row = 2 */ /* Second 4 pixels */
  570|       |                    src_temp10_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd+4));
  571|       |                    /* row = 3 */
  572|       |                    src_temp11_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd+4));
  573|       |                    /* row = 2 */ /* Third 4 pixels */
  574|       |                    src_temp12_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd+8));
  575|       |                    /* row = 3 */
  576|       |                    src_temp13_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd+8));
  577|       |                    /* row = 2 */ /* Last 4 pixels */
  578|       |                    src_temp14_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd+12));
  579|       |                    /* row = 3 */
  580|       |                    src_temp15_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd+12));
  581|       |
  582|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  583|       |                    src_temp8_4x32b  = _mm_cvtepi16_epi32(src_temp8_4x32b);
  584|       |                    src_temp9_4x32b  = _mm_cvtepi16_epi32(src_temp9_4x32b);
  585|       |                    /* (pi2_src[col] + lvl_shift)*/
  586|       |                    src_temp8_4x32b = _mm_add_epi32 (src_temp8_4x32b, lvl_shift_4x32b);
  587|       |                    src_temp9_4x32b = _mm_add_epi32 (src_temp9_4x32b, lvl_shift_4x32b);
  588|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  589|       |                    src_temp8_4x32b  = _mm_mullo_epi32 (src_temp8_4x32b, wgt0_4x32b);
  590|       |                    src_temp9_4x32b  = _mm_mullo_epi32 (src_temp9_4x32b, wgt0_4x32b);
  591|       |
  592|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Second 4 pixels */
  593|       |                    src_temp10_4x32b  = _mm_cvtepi16_epi32(src_temp10_4x32b);
  594|       |                    src_temp11_4x32b  = _mm_cvtepi16_epi32(src_temp11_4x32b);
  595|       |                    /* (pi2_src[col] + lvl_shift)*/
  596|       |                    src_temp10_4x32b = _mm_add_epi32 (src_temp10_4x32b, lvl_shift_4x32b);
  597|       |                    src_temp11_4x32b = _mm_add_epi32 (src_temp11_4x32b, lvl_shift_4x32b);
  598|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  599|       |                    src_temp10_4x32b  = _mm_mullo_epi32 (src_temp10_4x32b, wgt0_4x32b);
  600|       |                    src_temp11_4x32b  = _mm_mullo_epi32 (src_temp11_4x32b, wgt0_4x32b);
  601|       |
  602|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Third 4 pixels */
  603|       |                    src_temp12_4x32b  = _mm_cvtepi16_epi32(src_temp12_4x32b);
  604|       |                    src_temp13_4x32b  = _mm_cvtepi16_epi32(src_temp13_4x32b);
  605|       |                    /* (pi2_src[col] + lvl_shift)*/
  606|       |                    src_temp12_4x32b = _mm_add_epi32 (src_temp12_4x32b, lvl_shift_4x32b);
  607|       |                    src_temp13_4x32b = _mm_add_epi32 (src_temp13_4x32b, lvl_shift_4x32b);
  608|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  609|       |                    src_temp12_4x32b  = _mm_mullo_epi32 (src_temp12_4x32b, wgt0_4x32b);
  610|       |                    src_temp13_4x32b  = _mm_mullo_epi32 (src_temp13_4x32b, wgt0_4x32b);
  611|       |
  612|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Last 4 pixels */
  613|       |                    src_temp14_4x32b  = _mm_cvtepi16_epi32(src_temp14_4x32b);
  614|       |                    src_temp15_4x32b  = _mm_cvtepi16_epi32(src_temp15_4x32b);
  615|       |                    /* (pi2_src[col] + lvl_shift)*/
  616|       |                    src_temp14_4x32b = _mm_add_epi32 (src_temp14_4x32b, lvl_shift_4x32b);
  617|       |                    src_temp15_4x32b = _mm_add_epi32 (src_temp15_4x32b, lvl_shift_4x32b);
  618|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  619|       |                    src_temp14_4x32b  = _mm_mullo_epi32 (src_temp14_4x32b, wgt0_4x32b);
  620|       |                    src_temp15_4x32b  = _mm_mullo_epi32 (src_temp15_4x32b, wgt0_4x32b);
  621|       |
  622|       |                    /* i4_tmp += 1 << (shift - 1) */
  623|       |                    src_temp8_4x32b = _mm_add_epi32 (src_temp8_4x32b, const_temp_4x32b);
  624|       |                    src_temp9_4x32b = _mm_add_epi32 (src_temp9_4x32b, const_temp_4x32b);
  625|       |                    /* (i4_tmp >> shift) */
  626|       |                    src_temp8_4x32b = _mm_srai_epi32(src_temp8_4x32b,  shift);
  627|       |                    src_temp9_4x32b = _mm_srai_epi32(src_temp9_4x32b,  shift);
  628|       |
  629|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Second 4 pixels */
  630|       |                    src_temp10_4x32b = _mm_add_epi32 (src_temp10_4x32b, const_temp_4x32b);
  631|       |                    src_temp11_4x32b = _mm_add_epi32 (src_temp11_4x32b, const_temp_4x32b);
  632|       |                    /* (i4_tmp >> shift) */
  633|       |                    src_temp10_4x32b = _mm_srai_epi32(src_temp10_4x32b,  shift);
  634|       |                    src_temp11_4x32b = _mm_srai_epi32(src_temp11_4x32b,  shift);
  635|       |
  636|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Third 4 pixels */
  637|       |                    src_temp12_4x32b = _mm_add_epi32 (src_temp12_4x32b, const_temp_4x32b);
  638|       |                    src_temp13_4x32b = _mm_add_epi32 (src_temp13_4x32b, const_temp_4x32b);
  639|       |                    /* (i4_tmp >> shift) */
  640|       |                    src_temp12_4x32b = _mm_srai_epi32(src_temp12_4x32b,  shift);
  641|       |                    src_temp13_4x32b = _mm_srai_epi32(src_temp13_4x32b,  shift);
  642|       |
  643|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
  644|       |                    src_temp14_4x32b = _mm_add_epi32 (src_temp14_4x32b, const_temp_4x32b);
  645|       |                    src_temp15_4x32b = _mm_add_epi32 (src_temp15_4x32b, const_temp_4x32b);
  646|       |                    /* (i4_tmp >> shift) */
  647|       |                    src_temp14_4x32b = _mm_srai_epi32(src_temp14_4x32b,  shift);
  648|       |                    src_temp15_4x32b = _mm_srai_epi32(src_temp15_4x32b,  shift);
  649|       |
  650|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  651|       |                    src_temp8_4x32b = _mm_add_epi32 (src_temp8_4x32b, off0_4x32b);
  652|       |                    src_temp9_4x32b = _mm_add_epi32 (src_temp9_4x32b, off0_4x32b);
  653|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Second 4 pixels */
  654|       |                    src_temp10_4x32b = _mm_add_epi32 (src_temp10_4x32b, off0_4x32b);
  655|       |                    src_temp11_4x32b = _mm_add_epi32 (src_temp11_4x32b, off0_4x32b);
  656|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Third 4 pixels */
  657|       |                    src_temp12_4x32b = _mm_add_epi32 (src_temp12_4x32b, off0_4x32b);
  658|       |                    src_temp13_4x32b = _mm_add_epi32 (src_temp13_4x32b, off0_4x32b);
  659|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  660|       |                    src_temp14_4x32b = _mm_add_epi32 (src_temp14_4x32b, off0_4x32b);
  661|       |                    src_temp15_4x32b = _mm_add_epi32 (src_temp15_4x32b, off0_4x32b);
  662|       |
  663|       |                    src_temp8_4x32b = _mm_packs_epi32 (src_temp8_4x32b, src_temp10_4x32b);
  664|       |                    src_temp9_4x32b = _mm_packs_epi32 (src_temp9_4x32b, src_temp11_4x32b);
  665|       |                    src_temp12_4x32b = _mm_packs_epi32 (src_temp12_4x32b, src_temp14_4x32b);
  666|       |                    src_temp13_4x32b = _mm_packs_epi32 (src_temp13_4x32b, src_temp15_4x32b);
  667|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  668|       |                    src_temp8_4x32b = _mm_packus_epi16 (src_temp8_4x32b, src_temp12_4x32b);
  669|       |                    src_temp9_4x32b = _mm_packus_epi16 (src_temp9_4x32b, src_temp13_4x32b);
  670|       |
  671|       |                    /* store 16 8-bit output values  */
  672|       |                    _mm_storeu_si128((__m128i*)(pu1_dst+2*dst_strd), src_temp8_4x32b); /* row = 2*/
  673|       |                    _mm_storeu_si128((__m128i*)(pu1_dst+3*dst_strd), src_temp9_4x32b); /* row = 3*/
  674|       |
  675|       |                    pi2_src += 16;  /* Pointer update */
  676|       |                    pu1_dst += 16; /* Pointer update */
  677|       |
  678|       |                } /* inner loop ends here(4-output values in single iteration) */
  679|       |                pi2_src = pi2_src - wdx2 + 4*src_strd;  /* Pointer update */
  680|       |                pu1_dst = pu1_dst - wdx2 + 4*dst_strd; /* Pointer update */
  681|       |            }
  682|       |        }
  683|       |        else if( 0 == (wdx2 & 7)) /* 2*wd multiple of 8 case */
  684|       |        {
  685|       |            __m128i src_temp2_4x32b,src_temp3_4x32b;
  686|       |            __m128i src_temp4_4x32b, src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b;
  687|       |            /*  outer for loop starts from here */
  688|       |            for(row = 0; row < ht; row +=4)
  689|       |            {
  690|       |                for(col = 0; col < wdx2; col +=8)
  691|       |                {
  692|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  693|       |                    src_temp0_4x32b = _mm_loadu_si128((__m128i*)(pi2_src));
  694|       |                    /* row = 1 */
  695|       |                    src_temp1_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+src_strd));
  696|       |                    /* row = 2 */
  697|       |                    src_temp2_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd));
  698|       |                    /* row = 3 */
  699|       |                    src_temp3_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd));
  700|       |
  701|       |                    /* row = 0 */ /* Last 4 pixels */
  702|       |                    src_temp4_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+4));
  703|       |                    /* row = 1 */
  704|       |                    src_temp5_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+src_strd+4));
  705|       |                    /* row = 2 */
  706|       |                    src_temp6_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd+4));
  707|       |                    /* row = 3 */
  708|       |                    src_temp7_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd+4));
  709|       |
  710|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  711|       |                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  712|       |                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  713|       |                    /* (pi2_src[col] + lvl_shift)*/
  714|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, lvl_shift_4x32b);
  715|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, lvl_shift_4x32b);
  716|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  717|       |                    src_temp0_4x32b  = _mm_mullo_epi32 (src_temp0_4x32b, wgt0_4x32b);
  718|       |                    src_temp1_4x32b  = _mm_mullo_epi32 (src_temp1_4x32b, wgt0_4x32b);
  719|       |
  720|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Last 4 pixels */
  721|       |                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  722|       |                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  723|       |                    /* (pi2_src[col] + lvl_shift)*/
  724|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, lvl_shift_4x32b);
  725|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, lvl_shift_4x32b);
  726|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  727|       |                    src_temp2_4x32b  = _mm_mullo_epi32 (src_temp2_4x32b, wgt0_4x32b);
  728|       |                    src_temp3_4x32b  = _mm_mullo_epi32 (src_temp3_4x32b, wgt0_4x32b);
  729|       |
  730|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  731|       |                    src_temp4_4x32b  = _mm_cvtepi16_epi32(src_temp4_4x32b);
  732|       |                    src_temp5_4x32b  = _mm_cvtepi16_epi32(src_temp5_4x32b);
  733|       |                    /* (pi2_src[col] + lvl_shift)*/
  734|       |                    src_temp4_4x32b = _mm_add_epi32 (src_temp4_4x32b, lvl_shift_4x32b);
  735|       |                    src_temp5_4x32b = _mm_add_epi32 (src_temp5_4x32b, lvl_shift_4x32b);
  736|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  737|       |                    src_temp4_4x32b  = _mm_mullo_epi32 (src_temp4_4x32b, wgt0_4x32b);
  738|       |                    src_temp5_4x32b  = _mm_mullo_epi32 (src_temp5_4x32b, wgt0_4x32b);
  739|       |
  740|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  741|       |                    src_temp6_4x32b  = _mm_cvtepi16_epi32(src_temp6_4x32b);
  742|       |                    src_temp7_4x32b  = _mm_cvtepi16_epi32(src_temp7_4x32b);
  743|       |                    /* (pi2_src[col] + lvl_shift)*/
  744|       |                    src_temp6_4x32b = _mm_add_epi32 (src_temp6_4x32b, lvl_shift_4x32b);
  745|       |                    src_temp7_4x32b = _mm_add_epi32 (src_temp7_4x32b, lvl_shift_4x32b);
  746|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  747|       |                    src_temp6_4x32b  = _mm_mullo_epi32 (src_temp6_4x32b, wgt0_4x32b);
  748|       |                    src_temp7_4x32b  = _mm_mullo_epi32 (src_temp7_4x32b, wgt0_4x32b);
  749|       |
  750|       |                    /* i4_tmp += 1 << (shift - 1) */
  751|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, const_temp_4x32b);
  752|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, const_temp_4x32b);
  753|       |                    /* (i4_tmp >> shift) */
  754|       |                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
  755|       |                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
  756|       |
  757|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
  758|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, const_temp_4x32b);
  759|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, const_temp_4x32b);
  760|       |                    /* (i4_tmp >> shift) */
  761|       |                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
  762|       |                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
  763|       |
  764|       |                    /* i4_tmp += 1 << (shift - 1) */
  765|       |                    src_temp4_4x32b = _mm_add_epi32 (src_temp4_4x32b, const_temp_4x32b);
  766|       |                    src_temp5_4x32b = _mm_add_epi32 (src_temp5_4x32b, const_temp_4x32b);
  767|       |                    /* (i4_tmp >> shift) */
  768|       |                    src_temp4_4x32b = _mm_srai_epi32(src_temp4_4x32b,  shift);
  769|       |                    src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
  770|       |
  771|       |                    /* i4_tmp += 1 << (shift - 1) */
  772|       |                    src_temp6_4x32b = _mm_add_epi32 (src_temp6_4x32b, const_temp_4x32b);
  773|       |                    src_temp7_4x32b = _mm_add_epi32 (src_temp7_4x32b, const_temp_4x32b);
  774|       |                    /* (i4_tmp >> shift) */
  775|       |                    src_temp6_4x32b = _mm_srai_epi32(src_temp6_4x32b,  shift);
  776|       |                    src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
  777|       |
  778|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  779|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, off0_4x32b);
  780|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, off0_4x32b);
  781|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  782|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, off0_4x32b);
  783|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, off0_4x32b);
  784|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  785|       |                    src_temp4_4x32b = _mm_add_epi32 (src_temp4_4x32b, off0_4x32b);
  786|       |                    src_temp5_4x32b = _mm_add_epi32 (src_temp5_4x32b, off0_4x32b);
  787|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  788|       |                    src_temp6_4x32b = _mm_add_epi32 (src_temp6_4x32b, off0_4x32b);
  789|       |                    src_temp7_4x32b = _mm_add_epi32 (src_temp7_4x32b, off0_4x32b);
  790|       |
  791|       |                    src_temp0_4x32b = _mm_packs_epi32 (src_temp0_4x32b, src_temp4_4x32b);
  792|       |                    src_temp1_4x32b = _mm_packs_epi32 (src_temp1_4x32b, src_temp5_4x32b);
  793|       |                    src_temp2_4x32b = _mm_packs_epi32 (src_temp2_4x32b, src_temp6_4x32b);
  794|       |                    src_temp3_4x32b = _mm_packs_epi32 (src_temp3_4x32b, src_temp7_4x32b);
  795|       |
  796|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  797|       |                    src_temp0_4x32b = _mm_packus_epi16 (src_temp0_4x32b, src_temp0_4x32b);
  798|       |                    src_temp1_4x32b = _mm_packus_epi16 (src_temp1_4x32b, src_temp1_4x32b);
  799|       |                    src_temp2_4x32b = _mm_packus_epi16 (src_temp2_4x32b, src_temp2_4x32b);
  800|       |                    src_temp3_4x32b = _mm_packus_epi16 (src_temp3_4x32b, src_temp3_4x32b);
  801|       |
  802|       |                    /* store four 8-bit output values  */
  803|       |                    _mm_storel_epi64((__m128i*)(pu1_dst+0*dst_strd), src_temp0_4x32b); /* row = 0*/
  804|       |                    _mm_storel_epi64((__m128i*)(pu1_dst+1*dst_strd), src_temp1_4x32b); /* row = 1*/
  805|       |                    _mm_storel_epi64((__m128i*)(pu1_dst+2*dst_strd), src_temp2_4x32b); /* row = 0*/
  806|       |                    _mm_storel_epi64((__m128i*)(pu1_dst+3*dst_strd), src_temp3_4x32b); /* row = 1*/
  807|       |
  808|       |                    pi2_src += 8;   /* Pointer update */
  809|       |                    pu1_dst += 8; /* Pointer update */
  810|       |
  811|       |                } /* inner loop ends here(4-output values in single iteration) */
  812|       |                pi2_src = pi2_src - wdx2 + 4*src_strd;  /* Pointer update */
  813|       |                pu1_dst = pu1_dst - wdx2 + 4*dst_strd; /* Pointer update */
  814|       |            }
  815|       |        }
  816|       |        else /* 2*wd multiple of 4 case */
  817|       |        {
  818|       |            WORD32 dst0, dst1, dst2, dst3;
  819|       |            __m128i src_temp2_4x32b,src_temp3_4x32b;
  820|       |            /*  outer for loop starts from here */
  821|       |            for(row = 0; row < ht; row +=4)
  822|       |            {
  823|       |                for(col = 0; col < wdx2; col +=4)
  824|       |                {
  825|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  826|       |                    src_temp0_4x32b = _mm_loadu_si128((__m128i*)(pi2_src));
  827|       |                    /* row = 1 */
  828|       |                    src_temp1_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+1*src_strd));
  829|       |                    /* row = 2 */
  830|       |                    src_temp2_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+2*src_strd));
  831|       |                    /* row = 3 */
  832|       |                    src_temp3_4x32b = _mm_loadu_si128((__m128i*)(pi2_src+3*src_strd));
  833|       |
  834|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  835|       |                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  836|       |                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  837|       |                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  838|       |                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  839|       |
  840|       |                    /* (pi2_src[col] + lvl_shift)*/
  841|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, lvl_shift_4x32b);
  842|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, lvl_shift_4x32b);
  843|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  844|       |                    src_temp0_4x32b  = _mm_mullo_epi32 (src_temp0_4x32b, wgt0_4x32b);
  845|       |                    src_temp1_4x32b  = _mm_mullo_epi32 (src_temp1_4x32b, wgt0_4x32b);
  846|       |
  847|       |                    /* (pi2_src[col] + lvl_shift)*/
  848|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, lvl_shift_4x32b);
  849|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, lvl_shift_4x32b);
  850|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  851|       |                    src_temp2_4x32b  = _mm_mullo_epi32 (src_temp2_4x32b, wgt0_4x32b);
  852|       |                    src_temp3_4x32b  = _mm_mullo_epi32 (src_temp3_4x32b, wgt0_4x32b);
  853|       |
  854|       |                    /* i4_tmp += 1 << (shift - 1) */
  855|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, const_temp_4x32b);
  856|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, const_temp_4x32b);
  857|       |                    /* (i4_tmp >> shift) */
  858|       |                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
  859|       |                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
  860|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  861|       |                    src_temp0_4x32b = _mm_add_epi32 (src_temp0_4x32b, off0_4x32b);
  862|       |                    src_temp1_4x32b = _mm_add_epi32 (src_temp1_4x32b, off0_4x32b);
  863|       |
  864|       |                    /* i4_tmp += 1 << (shift - 1) */
  865|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, const_temp_4x32b);
  866|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, const_temp_4x32b);
  867|       |                    /* (i4_tmp >> shift) */
  868|       |                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
  869|       |                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
  870|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  871|       |                    src_temp2_4x32b = _mm_add_epi32 (src_temp2_4x32b, off0_4x32b);
  872|       |                    src_temp3_4x32b = _mm_add_epi32 (src_temp3_4x32b, off0_4x32b);
  873|       |
  874|       |                    src_temp0_4x32b = _mm_packs_epi32 (src_temp0_4x32b, src_temp1_4x32b);
  875|       |                    src_temp2_4x32b = _mm_packs_epi32 (src_temp2_4x32b, src_temp3_4x32b);
  876|       |
  877|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  878|       |                    src_temp0_4x32b = _mm_packus_epi16 (src_temp0_4x32b, src_temp2_4x32b);
  879|       |
  880|       |                    dst0 = _mm_cvtsi128_si32(src_temp0_4x32b);
  881|       |                    /* dst row = 1 to 3 */
  882|       |                    src_temp1_4x32b = _mm_shuffle_epi32 (src_temp0_4x32b, 1);
  883|       |                    src_temp2_4x32b = _mm_shuffle_epi32 (src_temp0_4x32b, 2);
  884|       |                    src_temp3_4x32b = _mm_shuffle_epi32 (src_temp0_4x32b, 3);
  885|       |
  886|       |                    /* store four 8-bit output values  */
  887|       |                    *(WORD32 *) (&pu1_dst[0*dst_strd]) = dst0;
  888|       |
  889|       |                    dst1 = _mm_cvtsi128_si32(src_temp1_4x32b);
  890|       |                    dst2 = _mm_cvtsi128_si32(src_temp2_4x32b);
  891|       |                    dst3 = _mm_cvtsi128_si32(src_temp3_4x32b);
  892|       |                    /* row = 1 */
  893|       |                    *(WORD32 *) (&pu1_dst[1*dst_strd]) = dst1;
  894|       |                    /* row = 2 */
  895|       |                    *(WORD32 *) (&pu1_dst[2*dst_strd]) = dst2;
  896|       |                    /* row = 3 */
  897|       |                    *(WORD32 *) (&pu1_dst[3*dst_strd]) = dst3;
  898|       |
  899|       |                    pi2_src += 4;   /* Pointer update */
  900|       |                    pu1_dst += 4; /* Pointer update */
  901|       |
  902|       |                } /* inner loop ends here(4-output values in single iteration) */
  903|       |                pi2_src = pi2_src - wdx2 + 4*src_strd;  /* Pointer update */
  904|       |                pu1_dst = pu1_dst - wdx2 + 4*dst_strd; /* Pointer update */
  905|       |            }
  906|       |        }
  907|       |    }
  908|       |    else /* ht multiple of 2 case */
  909|       |#endif
  910|       |
  911|  47.0k|    {
  912|  47.0k|        if(0 == (wdx2 & 15)) /* 2*wd multiple of 168 case */
  ------------------
  |  Branch (912:12): [True: 1.38k, False: 45.6k]
  ------------------
  913|  1.38k|        {
  914|  1.38k|            __m128i src_temp2_4x32b, src_temp3_4x32b;
  915|  1.38k|            __m128i src_temp4_4x32b, src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b;
  916|       |            /*  outer for loop starts from here */
  917|  11.4k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (917:26): [True: 10.0k, False: 1.38k]
  ------------------
  918|  10.0k|            {
  919|  32.8k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (919:30): [True: 22.7k, False: 10.0k]
  ------------------
  920|  22.7k|                {
  921|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  922|  22.7k|                    src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
  923|       |                    /* row = 1 */
  924|  22.7k|                    src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  925|       |
  926|       |                    /* row = 0 */ /* Second 4 pixels */
  927|  22.7k|                    src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 4));
  928|       |                    /* row = 1 */
  929|  22.7k|                    src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 4));
  930|       |                    /* row = 0 */ /* Third 4 pixels */
  931|  22.7k|                    src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 8));
  932|       |                    /* row = 1 */
  933|  22.7k|                    src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 8));
  934|       |                    /* row = 0 */ /* Last 4 pixels */
  935|  22.7k|                    src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 12));
  936|       |                    /* row = 1 */
  937|  22.7k|                    src_temp7_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 12));
  938|       |
  939|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
  940|  22.7k|                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
  941|  22.7k|                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
  942|       |                    /* (pi2_src[col] + lvl_shift)*/
  943|  22.7k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
  944|  22.7k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
  945|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  946|  22.7k|                    src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
  947|  22.7k|                    src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
  948|       |
  949|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Second 4 pixels */
  950|  22.7k|                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
  951|  22.7k|                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
  952|       |                    /* (pi2_src[col] + lvl_shift)*/
  953|  22.7k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
  954|  22.7k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
  955|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  956|  22.7k|                    src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
  957|  22.7k|                    src_temp3_4x32b  = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
  958|       |
  959|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Third 4 pixels */
  960|  22.7k|                    src_temp4_4x32b  = _mm_cvtepi16_epi32(src_temp4_4x32b);
  961|  22.7k|                    src_temp5_4x32b  = _mm_cvtepi16_epi32(src_temp5_4x32b);
  962|       |                    /* (pi2_src[col] + lvl_shift)*/
  963|  22.7k|                    src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift_4x32b);
  964|  22.7k|                    src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift_4x32b);
  965|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  966|  22.7k|                    src_temp4_4x32b  = _mm_mullo_epi32(src_temp4_4x32b, wgt0_4x32b);
  967|  22.7k|                    src_temp5_4x32b  = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
  968|       |
  969|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Last 4 pixels */
  970|  22.7k|                    src_temp6_4x32b  = _mm_cvtepi16_epi32(src_temp6_4x32b);
  971|  22.7k|                    src_temp7_4x32b  = _mm_cvtepi16_epi32(src_temp7_4x32b);
  972|       |                    /* (pi2_src[col] + lvl_shift)*/
  973|  22.7k|                    src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift_4x32b);
  974|  22.7k|                    src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift_4x32b);
  975|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
  976|  22.7k|                    src_temp6_4x32b  = _mm_mullo_epi32(src_temp6_4x32b, wgt0_4x32b);
  977|  22.7k|                    src_temp7_4x32b  = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
  978|       |
  979|       |                    /* i4_tmp += 1 << (shift - 1) */
  980|  22.7k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
  981|  22.7k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
  982|       |                    /* (i4_tmp >> shift) */
  983|  22.7k|                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
  984|  22.7k|                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
  985|       |
  986|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Second 4 pixels */
  987|  22.7k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
  988|  22.7k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
  989|       |                    /* (i4_tmp >> shift) */
  990|  22.7k|                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
  991|  22.7k|                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
  992|       |
  993|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Third 4 pixels */
  994|  22.7k|                    src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, const_temp_4x32b);
  995|  22.7k|                    src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
  996|       |                    /* (i4_tmp >> shift) */
  997|  22.7k|                    src_temp4_4x32b = _mm_srai_epi32(src_temp4_4x32b,  shift);
  998|  22.7k|                    src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
  999|       |
 1000|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
 1001|  22.7k|                    src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, const_temp_4x32b);
 1002|  22.7k|                    src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
 1003|       |                    /* (i4_tmp >> shift) */
 1004|  22.7k|                    src_temp6_4x32b = _mm_srai_epi32(src_temp6_4x32b,  shift);
 1005|  22.7k|                    src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
 1006|       |
 1007|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
 1008|  22.7k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
 1009|  22.7k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
 1010|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Second 4 pixels */
 1011|  22.7k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
 1012|  22.7k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
 1013|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Third 4 pixels */
 1014|  22.7k|                    src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, off0_4x32b);
 1015|  22.7k|                    src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, off0_4x32b);
 1016|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
 1017|  22.7k|                    src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, off0_4x32b);
 1018|  22.7k|                    src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, off0_4x32b);
 1019|       |
 1020|  22.7k|                    src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp2_4x32b);
 1021|  22.7k|                    src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1022|  22.7k|                    src_temp4_4x32b = _mm_packs_epi32(src_temp4_4x32b, src_temp6_4x32b);
 1023|  22.7k|                    src_temp5_4x32b = _mm_packs_epi32(src_temp5_4x32b, src_temp7_4x32b);
 1024|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
 1025|  22.7k|                    src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp4_4x32b);
 1026|  22.7k|                    src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp5_4x32b);
 1027|       |
 1028|       |                    /* store 16 8-bit output values  */
 1029|  22.7k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 0 * dst_strd), src_temp0_4x32b); /* row = 0*/
 1030|  22.7k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src_temp1_4x32b); /* row = 1*/
 1031|       |
 1032|  22.7k|                    pi2_src += 16;  /* Pointer update */
 1033|  22.7k|                    pu1_dst += 16; /* Pointer update */
 1034|       |
 1035|  22.7k|                } /* inner loop ends here(4-output values in single iteration) */
 1036|  10.0k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
 1037|  10.0k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
 1038|  10.0k|            }
 1039|  1.38k|        }
 1040|  45.6k|        else if(0 == (wdx2 & 7)) /* 2*wd multiple of 8 case */
  ------------------
  |  Branch (1040:17): [True: 41.2k, False: 4.42k]
  ------------------
 1041|  41.2k|        {
 1042|  41.2k|            __m128i src_temp2_4x32b, src_temp3_4x32b;
 1043|       |            /*  outer for loop starts from here */
 1044|   123k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1044:26): [True: 82.3k, False: 41.2k]
  ------------------
 1045|  82.3k|            {
 1046|   165k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (1046:30): [True: 83.0k, False: 82.3k]
  ------------------
 1047|  83.0k|                {
 1048|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1049|  83.0k|                    src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
 1050|       |                    /* row = 1 */
 1051|  83.0k|                    src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
 1052|       |
 1053|       |                    /* row = 0 */ /* Last 4 pixels */
 1054|  83.0k|                    src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + 4));
 1055|       |                    /* row = 1 */
 1056|  83.0k|                    src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 4));
 1057|       |
 1058|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
 1059|  83.0k|                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
 1060|  83.0k|                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1061|       |                    /* (pi2_src[col] + lvl_shift)*/
 1062|  83.0k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
 1063|  83.0k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
 1064|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
 1065|  83.0k|                    src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
 1066|  83.0k|                    src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1067|       |
 1068|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */ /* Last 4 pixels */
 1069|  83.0k|                    src_temp2_4x32b  = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1070|  83.0k|                    src_temp3_4x32b  = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1071|       |                    /* (pi2_src[col] + lvl_shift)*/
 1072|  83.0k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift_4x32b);
 1073|  83.0k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift_4x32b);
 1074|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
 1075|  83.0k|                    src_temp2_4x32b  = _mm_mullo_epi32(src_temp2_4x32b, wgt0_4x32b);
 1076|  83.0k|                    src_temp3_4x32b  = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1077|       |
 1078|       |                    /* i4_tmp += 1 << (shift - 1) */
 1079|  83.0k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
 1080|  83.0k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1081|       |                    /* (i4_tmp >> shift) */
 1082|  83.0k|                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
 1083|  83.0k|                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1084|       |
 1085|       |                    /* i4_tmp += 1 << (shift - 1) */ /* Last 4 pixels */
 1086|  83.0k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, const_temp_4x32b);
 1087|  83.0k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1088|       |                    /* (i4_tmp >> shift) */
 1089|  83.0k|                    src_temp2_4x32b = _mm_srai_epi32(src_temp2_4x32b,  shift);
 1090|  83.0k|                    src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1091|       |
 1092|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
 1093|  83.0k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
 1094|  83.0k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
 1095|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
 1096|  83.0k|                    src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, off0_4x32b);
 1097|  83.0k|                    src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, off0_4x32b);
 1098|       |
 1099|  83.0k|                    src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp2_4x32b);
 1100|  83.0k|                    src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1101|       |
 1102|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
 1103|  83.0k|                    src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp0_4x32b);
 1104|  83.0k|                    src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1105|       |
 1106|       |                    /* store four 8-bit output values  */
 1107|  83.0k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp0_4x32b); /* row = 0*/
 1108|  83.0k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp1_4x32b); /* row = 1*/
 1109|       |
 1110|  83.0k|                    pi2_src += 8;   /* Pointer update */
 1111|  83.0k|                    pu1_dst += 8; /* Pointer update */
 1112|       |
 1113|  83.0k|                } /* inner loop ends here(4-output values in single iteration) */
 1114|  82.3k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
 1115|  82.3k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
 1116|  82.3k|            }
 1117|  41.2k|        }
 1118|  4.42k|        else /* 2*wd multiple of 4 case */
 1119|  4.42k|        {
 1120|  4.42k|            WORD32 dst0, dst1;
 1121|       |            /*  outer for loop starts from here */
 1122|  14.3k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1122:26): [True: 9.89k, False: 4.42k]
  ------------------
 1123|  9.89k|            {
 1124|  21.4k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (1124:30): [True: 11.5k, False: 9.89k]
  ------------------
 1125|  11.5k|                {
 1126|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1127|  11.5k|                    src_temp0_4x32b = _mm_loadu_si128((__m128i *)(pi2_src));
 1128|       |                    /* row = 1 */
 1129|  11.5k|                    src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
 1130|       |
 1131|       |                    /* considering pix. 4:0 by converting 16-into 32 bit */
 1132|  11.5k|                    src_temp0_4x32b  = _mm_cvtepi16_epi32(src_temp0_4x32b);
 1133|  11.5k|                    src_temp1_4x32b  = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1134|       |
 1135|       |                    /* (pi2_src[col] + lvl_shift)*/
 1136|  11.5k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, lvl_shift_4x32b);
 1137|  11.5k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift_4x32b);
 1138|       |
 1139|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0*/
 1140|  11.5k|                    src_temp0_4x32b  = _mm_mullo_epi32(src_temp0_4x32b, wgt0_4x32b);
 1141|  11.5k|                    src_temp1_4x32b  = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1142|       |
 1143|       |                    /* i4_tmp += 1 << (shift - 1) */
 1144|  11.5k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, const_temp_4x32b);
 1145|  11.5k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1146|       |
 1147|       |                    /* (i4_tmp >> shift) */
 1148|  11.5k|                    src_temp0_4x32b = _mm_srai_epi32(src_temp0_4x32b,  shift);
 1149|  11.5k|                    src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1150|       |
 1151|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
 1152|  11.5k|                    src_temp0_4x32b = _mm_add_epi32(src_temp0_4x32b, off0_4x32b);
 1153|  11.5k|                    src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, off0_4x32b);
 1154|       |
 1155|  11.5k|                    src_temp0_4x32b = _mm_packs_epi32(src_temp0_4x32b, src_temp1_4x32b);
 1156|       |
 1157|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
 1158|  11.5k|                    src_temp0_4x32b = _mm_packus_epi16(src_temp0_4x32b, src_temp0_4x32b);
 1159|       |
 1160|  11.5k|                    dst0 = _mm_cvtsi128_si32(src_temp0_4x32b);
 1161|       |                    /* dst row = 1 to 3 */
 1162|  11.5k|                    src_temp1_4x32b = _mm_shuffle_epi32(src_temp0_4x32b, 1);
 1163|       |
 1164|       |                    /* store four 8-bit output values  */
 1165|  11.5k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1166|       |
 1167|  11.5k|                    dst1 = _mm_cvtsi128_si32(src_temp1_4x32b);
 1168|       |                    /* row = 1 */
 1169|  11.5k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1170|       |
 1171|  11.5k|                    pi2_src += 4;   /* Pointer update */
 1172|  11.5k|                    pu1_dst += 4; /* Pointer update */
 1173|       |
 1174|  11.5k|                } /* inner loop ends here(4-output values in single iteration) */
 1175|  9.89k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
 1176|  9.89k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
 1177|  9.89k|            }
 1178|  4.42k|        }
 1179|  47.0k|    }
 1180|  47.0k|}
ihevc_weighted_pred_bi_sse42:
 1261|  1.24M|{
 1262|  1.24M|    WORD32 row, col, temp;
 1263|       |
 1264|  1.24M|    __m128i src_temp1_4x32b, src_temp2_4x32b, src_temp3_4x32b, src_temp4_4x32b;
 1265|  1.24M|    __m128i const_temp_4x32b, lvl_shift1_4x32b, lvl_shift2_4x32b, wgt0_4x32b, wgt1_4x32b;
 1266|       |
 1267|       |
 1268|  1.24M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.24M|#define ASSERT(x) {}
  ------------------
 1269|  1.24M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.24M|#define ASSERT(x) {}
  ------------------
 1270|       |
 1271|  1.24M|    temp = (off0 + off1 + 1) << (shift - 1);
 1272|       |
 1273|       |    // seting values in register
 1274|  1.24M|    const_temp_4x32b = _mm_set1_epi32(temp);
 1275|  1.24M|    lvl_shift1_4x32b = _mm_set1_epi32(lvl_shift1);
 1276|  1.24M|    lvl_shift2_4x32b = _mm_set1_epi32(lvl_shift2);
 1277|  1.24M|    wgt0_4x32b = _mm_set1_epi32(wgt0);
 1278|  1.24M|    wgt1_4x32b = _mm_set1_epi32(wgt1);
 1279|       |
 1280|  1.24M|    if(0 == (wd & 7)) /* wd multiple of 8 case */
  ------------------
  |  Branch (1280:8): [True: 1.34M, False: 18.4E]
  ------------------
 1281|  1.34M|    {
 1282|  1.34M|        __m128i src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b, src_temp8_4x32b;
 1283|       |        /*  outer for loop starts from here */
 1284|  6.66M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1284:22): [True: 5.32M, False: 1.34M]
  ------------------
 1285|  5.32M|        {
 1286|  10.8M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1286:26): [True: 5.52M, False: 5.32M]
  ------------------
 1287|  5.52M|            {
 1288|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1289|  5.52M|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1290|  5.52M|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1291|  5.52M|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1292|  5.52M|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1293|       |                /* Next 4 pixels */
 1294|  5.52M|                src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 4)); /* row = 0 */
 1295|  5.52M|                src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 4)); /* row = 0 */
 1296|  5.52M|                src_temp7_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1 + 4)); /* row = 1 */
 1297|  5.52M|                src_temp8_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2 + 4)); /* row = 1 */
 1298|       |
 1299|       |                /* considering pix. 4:0 by converting 16-into 32 bit */
 1300|  5.52M|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1301|  5.52M|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1302|       |                /* (pi2_src1[col] + lvl_shift1) */
 1303|  5.52M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1304|       |                /* (pi2_src2[col] + lvl_shift2) */
 1305|  5.52M|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1306|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1307|  5.52M|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1308|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1309|  5.52M|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1310|       |
 1311|  5.52M|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1312|  5.52M|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1313|  5.52M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1314|  5.52M|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1315|  5.52M|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1316|  5.52M|                src_temp4_4x32b = _mm_mullo_epi32(src_temp4_4x32b, wgt1_4x32b);
 1317|       |
 1318|       |                /* Next 4 Pixels */
 1319|  5.52M|                src_temp5_4x32b = _mm_cvtepi16_epi32(src_temp5_4x32b);
 1320|  5.52M|                src_temp6_4x32b = _mm_cvtepi16_epi32(src_temp6_4x32b);
 1321|  5.52M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift1_4x32b);
 1322|  5.52M|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift2_4x32b);
 1323|  5.52M|                src_temp5_4x32b = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
 1324|  5.52M|                src_temp6_4x32b = _mm_mullo_epi32(src_temp6_4x32b, wgt1_4x32b);
 1325|  5.52M|                src_temp7_4x32b = _mm_cvtepi16_epi32(src_temp7_4x32b);
 1326|  5.52M|                src_temp8_4x32b = _mm_cvtepi16_epi32(src_temp8_4x32b);
 1327|  5.52M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift1_4x32b);
 1328|  5.52M|                src_temp8_4x32b = _mm_add_epi32(src_temp8_4x32b, lvl_shift2_4x32b);
 1329|  5.52M|                src_temp7_4x32b = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
 1330|  5.52M|                src_temp8_4x32b = _mm_mullo_epi32(src_temp8_4x32b, wgt1_4x32b);
 1331|       |
 1332|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
 1333|  5.52M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1334|  5.52M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1335|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1336|  5.52M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1337|  5.52M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1338|       |                /* (i4_tmp >> shift) */
 1339|  5.52M|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1340|  5.52M|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1341|       |
 1342|       |                /* Next 4 Pixels */
 1343|  5.52M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, src_temp6_4x32b);
 1344|  5.52M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, src_temp8_4x32b);
 1345|  5.52M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
 1346|  5.52M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
 1347|  5.52M|                src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
 1348|  5.52M|                src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
 1349|       |
 1350|  5.52M|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp5_4x32b);
 1351|  5.52M|                src_temp3_4x32b = _mm_packs_epi32(src_temp3_4x32b, src_temp7_4x32b);
 1352|       |
 1353|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1354|  5.52M|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1355|  5.52M|                src_temp3_4x32b = _mm_packus_epi16(src_temp3_4x32b, src_temp3_4x32b);
 1356|       |
 1357|       |                /* store four 8-bit output values  */
 1358|  5.52M|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_4x32b); /* row = 0*/
 1359|  5.52M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_4x32b); /* row = 1*/
 1360|       |
 1361|  5.52M|                pi2_src1 += 8;  /* Pointer update */
 1362|  5.52M|                pi2_src2 += 8;  /* Pointer update */
 1363|  5.52M|                pu1_dst  += 8;  /* Pointer update */
 1364|       |
 1365|  5.52M|            } /* inner loop ends here(4-output values in single iteration) */
 1366|       |
 1367|  5.32M|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1;  /* Pointer update */
 1368|  5.32M|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2;  /* Pointer update */
 1369|  5.32M|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;   /* Pointer update */
 1370|       |
 1371|  5.32M|        } /* outer loop ends */
 1372|  1.34M|    }
 1373|  18.4E|    else /* wd multiple of 4 case */
 1374|  18.4E|    {
 1375|  18.4E|        WORD32 dst0, dst1;
 1376|       |        /*  outer for loop starts from here */
 1377|  18.4E|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1377:22): [True: 69.1k, False: 18.4E]
  ------------------
 1378|  69.1k|        {
 1379|   207k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1379:26): [True: 138k, False: 69.1k]
  ------------------
 1380|   138k|            {
 1381|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1382|   138k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1383|   138k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1384|   138k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1385|   138k|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1386|       |
 1387|       |                /* considering pix. 4:0 by converting 16-into 32 bit */
 1388|   138k|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1389|   138k|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1390|       |                /* (pi2_src1[col] + lvl_shift1) */
 1391|   138k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1392|       |                /* (pi2_src2[col] + lvl_shift2) */
 1393|   138k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1394|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1395|   138k|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1396|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1397|   138k|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1398|       |
 1399|   138k|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1400|   138k|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1401|   138k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1402|   138k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1403|   138k|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1404|   138k|                src_temp4_4x32b = _mm_mullo_epi32(src_temp4_4x32b, wgt1_4x32b);
 1405|       |
 1406|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
 1407|   138k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1408|   138k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1409|       |
 1410|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1411|   138k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1412|   138k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1413|       |
 1414|       |                /* (i4_tmp >> shift) */
 1415|   138k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1416|   138k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1417|       |
 1418|   138k|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1419|       |
 1420|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1421|   138k|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1422|       |
 1423|   138k|                dst0 = _mm_cvtsi128_si32(src_temp1_4x32b);
 1424|       |
 1425|       |                /* dst row = 1 to 3 */
 1426|   138k|                src_temp2_4x32b = _mm_shuffle_epi32(src_temp1_4x32b, 1);
 1427|       |
 1428|       |                /* store four 8-bit output values  */
 1429|   138k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1430|       |
 1431|   138k|                dst1 = _mm_cvtsi128_si32(src_temp2_4x32b);
 1432|       |
 1433|       |                /* row = 1 to 3 */
 1434|   138k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1435|       |
 1436|   138k|                pi2_src1 += 4;  /* Pointer update */
 1437|   138k|                pi2_src2 += 4;  /* Pointer update */
 1438|   138k|                pu1_dst  += 4;  /* Pointer update */
 1439|       |
 1440|   138k|            } /* inner loop ends here(4-output values in single iteration) */
 1441|       |
 1442|  69.1k|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1;  /* Pointer update */
 1443|  69.1k|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2;  /* Pointer update */
 1444|  69.1k|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;   /* Pointer update */
 1445|       |
 1446|  69.1k|        } /* outer loop ends */
 1447|  18.4E|    }
 1448|       |
 1449|  1.24M|}
ihevc_weighted_pred_chroma_bi_sse42:
 1534|  1.23M|{
 1535|  1.23M|    WORD32 row, col, temp1, temp2;
 1536|  1.23M|    WORD32 wdx2;
 1537|       |
 1538|  1.23M|    __m128i src_temp1_4x32b, src_temp2_4x32b, src_temp3_4x32b, src_temp4_4x32b;
 1539|  1.23M|    __m128i const_temp_4x32b, lvl_shift1_4x32b, lvl_shift2_4x32b, wgt0_4x32b, wgt1_4x32b;
 1540|       |
 1541|       |
 1542|  1.23M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.23M|#define ASSERT(x) {}
  ------------------
 1543|  1.23M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  1.23M|#define ASSERT(x) {}
  ------------------
 1544|       |
 1545|  1.23M|    temp1 = (off0_cb + off1_cb + 1) << (shift - 1);
 1546|  1.23M|    temp2 = (off0_cr + off1_cr + 1) << (shift - 1);
 1547|       |
 1548|       |    // seting values in register
 1549|  1.23M|    const_temp_4x32b = _mm_set_epi32(temp2, temp1, temp2, temp1);
 1550|  1.23M|    lvl_shift1_4x32b = _mm_set1_epi32(lvl_shift1);
 1551|  1.23M|    lvl_shift2_4x32b = _mm_set1_epi32(lvl_shift2);
 1552|  1.23M|    wgt0_4x32b = _mm_set_epi32(wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb);
 1553|  1.23M|    wgt1_4x32b = _mm_set_epi32(wgt1_cr, wgt1_cb, wgt1_cr, wgt1_cb);
 1554|       |
 1555|  1.23M|    wdx2 = wd * 2;
 1556|       |
 1557|  1.23M|    if(0 == (wdx2 & 7)) /* wdx2 multiple of 8 case */
  ------------------
  |  Branch (1557:8): [True: 1.33M, False: 18.4E]
  ------------------
 1558|  1.33M|    {
 1559|  1.33M|        __m128i src_temp5_4x32b, src_temp6_4x32b, src_temp7_4x32b, src_temp8_4x32b;
 1560|       |        /*  outer for loop starts from here */
 1561|  4.03M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1561:22): [True: 2.69M, False: 1.33M]
  ------------------
 1562|  2.69M|        {
 1563|  5.49M|            for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (1563:26): [True: 2.79M, False: 2.69M]
  ------------------
 1564|  2.79M|            {
 1565|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1566|  2.79M|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1567|  2.79M|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1568|  2.79M|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1569|  2.79M|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1570|       |                /* Next 4 pixels */
 1571|  2.79M|                src_temp5_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 4)); /* row = 0 */
 1572|  2.79M|                src_temp6_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 4)); /* row = 0 */
 1573|  2.79M|                src_temp7_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1 + 4)); /* row = 1 */
 1574|  2.79M|                src_temp8_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2 + 4)); /* row = 1 */
 1575|       |
 1576|       |                /* considering pix. 4:0 by converting 16-into 32 bit */
 1577|  2.79M|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1578|  2.79M|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1579|       |                /* (pi2_src1[col] + lvl_shift1) */
 1580|  2.79M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1581|       |                /* (pi2_src2[col] + lvl_shift2) */
 1582|  2.79M|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1583|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1584|  2.79M|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1585|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1586|  2.79M|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1587|       |
 1588|  2.79M|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1589|  2.79M|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1590|  2.79M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1591|  2.79M|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1592|  2.79M|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1593|  2.79M|                src_temp4_4x32b = _mm_mullo_epi32(src_temp4_4x32b, wgt1_4x32b);
 1594|       |
 1595|       |                /* Next 4 Pixels */
 1596|  2.79M|                src_temp5_4x32b = _mm_cvtepi16_epi32(src_temp5_4x32b);
 1597|  2.79M|                src_temp6_4x32b = _mm_cvtepi16_epi32(src_temp6_4x32b);
 1598|  2.79M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, lvl_shift1_4x32b);
 1599|  2.79M|                src_temp6_4x32b = _mm_add_epi32(src_temp6_4x32b, lvl_shift2_4x32b);
 1600|  2.79M|                src_temp5_4x32b = _mm_mullo_epi32(src_temp5_4x32b, wgt0_4x32b);
 1601|  2.79M|                src_temp6_4x32b = _mm_mullo_epi32(src_temp6_4x32b, wgt1_4x32b);
 1602|  2.79M|                src_temp7_4x32b = _mm_cvtepi16_epi32(src_temp7_4x32b);
 1603|  2.79M|                src_temp8_4x32b = _mm_cvtepi16_epi32(src_temp8_4x32b);
 1604|  2.79M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, lvl_shift1_4x32b);
 1605|  2.79M|                src_temp8_4x32b = _mm_add_epi32(src_temp8_4x32b, lvl_shift2_4x32b);
 1606|  2.79M|                src_temp7_4x32b = _mm_mullo_epi32(src_temp7_4x32b, wgt0_4x32b);
 1607|  2.79M|                src_temp8_4x32b = _mm_mullo_epi32(src_temp8_4x32b, wgt1_4x32b);
 1608|       |
 1609|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
 1610|  2.79M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1611|  2.79M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1612|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1613|  2.79M|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1614|  2.79M|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1615|       |                /* (i4_tmp >> shift) */
 1616|  2.79M|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1617|  2.79M|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1618|       |
 1619|       |                /* Next 4 Pixels */
 1620|  2.79M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, src_temp6_4x32b);
 1621|  2.79M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, src_temp8_4x32b);
 1622|  2.79M|                src_temp5_4x32b = _mm_add_epi32(src_temp5_4x32b, const_temp_4x32b);
 1623|  2.79M|                src_temp7_4x32b = _mm_add_epi32(src_temp7_4x32b, const_temp_4x32b);
 1624|  2.79M|                src_temp5_4x32b = _mm_srai_epi32(src_temp5_4x32b,  shift);
 1625|  2.79M|                src_temp7_4x32b = _mm_srai_epi32(src_temp7_4x32b,  shift);
 1626|       |
 1627|  2.79M|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp5_4x32b);
 1628|  2.79M|                src_temp3_4x32b = _mm_packs_epi32(src_temp3_4x32b, src_temp7_4x32b);
 1629|       |
 1630|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1631|  2.79M|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1632|  2.79M|                src_temp3_4x32b = _mm_packus_epi16(src_temp3_4x32b, src_temp3_4x32b);
 1633|       |
 1634|       |                /* store four 8-bit output values  */
 1635|  2.79M|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_4x32b); /* row = 0*/
 1636|  2.79M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_4x32b); /* row = 1*/
 1637|       |
 1638|  2.79M|                pi2_src1 += 8;  /* Pointer update */
 1639|  2.79M|                pi2_src2 += 8;  /* Pointer update */
 1640|  2.79M|                pu1_dst  += 8;  /* Pointer update */
 1641|       |
 1642|  2.79M|            } /* inner loop ends here(4-output values in single iteration) */
 1643|       |
 1644|  2.69M|            pi2_src1 = pi2_src1 - wdx2 + 2 * src_strd1;    /* Pointer update */
 1645|  2.69M|            pi2_src2 = pi2_src2 - wdx2 + 2 * src_strd2;    /* Pointer update */
 1646|  2.69M|            pu1_dst  = pu1_dst  - wdx2 + 2 * dst_strd;   /* Pointer update */
 1647|       |
 1648|  2.69M|        } /* outer loop ends */
 1649|  1.33M|    }
 1650|  18.4E|    else /* wdx2 multiple of 4 case */
 1651|  18.4E|    {
 1652|  18.4E|        WORD32 dst0, dst1;
 1653|       |        /*  outer for loop starts from here */
 1654|  18.4E|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1654:22): [True: 34.7k, False: 18.4E]
  ------------------
 1655|  34.7k|        {
 1656|   104k|            for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (1656:26): [True: 69.5k, False: 34.7k]
  ------------------
 1657|  69.5k|            {
 1658|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1659|  69.5k|                src_temp1_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1660|  69.5k|                src_temp2_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1661|  69.5k|                src_temp3_4x32b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1662|  69.5k|                src_temp4_4x32b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1663|       |
 1664|       |                /* considering pix. 4:0 by converting 16-into 32 bit */
 1665|  69.5k|                src_temp1_4x32b = _mm_cvtepi16_epi32(src_temp1_4x32b);
 1666|  69.5k|                src_temp2_4x32b = _mm_cvtepi16_epi32(src_temp2_4x32b);
 1667|       |                /* (pi2_src1[col] + lvl_shift1) */
 1668|  69.5k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, lvl_shift1_4x32b);
 1669|       |                /* (pi2_src2[col] + lvl_shift2) */
 1670|  69.5k|                src_temp2_4x32b = _mm_add_epi32(src_temp2_4x32b, lvl_shift2_4x32b);
 1671|       |                /*i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0 */
 1672|  69.5k|                src_temp1_4x32b = _mm_mullo_epi32(src_temp1_4x32b, wgt0_4x32b);
 1673|       |                /*(pi2_src2[col] + lvl_shift2) * wgt1 */
 1674|  69.5k|                src_temp2_4x32b = _mm_mullo_epi32(src_temp2_4x32b, wgt1_4x32b);
 1675|       |
 1676|  69.5k|                src_temp3_4x32b = _mm_cvtepi16_epi32(src_temp3_4x32b);
 1677|  69.5k|                src_temp4_4x32b = _mm_cvtepi16_epi32(src_temp4_4x32b);
 1678|  69.5k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, lvl_shift1_4x32b);
 1679|  69.5k|                src_temp4_4x32b = _mm_add_epi32(src_temp4_4x32b, lvl_shift2_4x32b);
 1680|  69.5k|                src_temp3_4x32b = _mm_mullo_epi32(src_temp3_4x32b, wgt0_4x32b);
 1681|  69.5k|                src_temp4_4x32b = _mm_mullo_epi32(src_temp4_4x32b, wgt1_4x32b);
 1682|       |
 1683|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
 1684|  69.5k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, src_temp2_4x32b);
 1685|  69.5k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, src_temp4_4x32b);
 1686|       |
 1687|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1688|  69.5k|                src_temp1_4x32b = _mm_add_epi32(src_temp1_4x32b, const_temp_4x32b);
 1689|  69.5k|                src_temp3_4x32b = _mm_add_epi32(src_temp3_4x32b, const_temp_4x32b);
 1690|       |
 1691|       |                /* (i4_tmp >> shift) */
 1692|  69.5k|                src_temp1_4x32b = _mm_srai_epi32(src_temp1_4x32b,  shift);
 1693|  69.5k|                src_temp3_4x32b = _mm_srai_epi32(src_temp3_4x32b,  shift);
 1694|       |
 1695|  69.5k|                src_temp1_4x32b = _mm_packs_epi32(src_temp1_4x32b, src_temp3_4x32b);
 1696|       |
 1697|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1698|  69.5k|                src_temp1_4x32b = _mm_packus_epi16(src_temp1_4x32b, src_temp1_4x32b);
 1699|       |
 1700|  69.5k|                dst0 = _mm_cvtsi128_si32(src_temp1_4x32b);
 1701|       |
 1702|       |                /* dst row = 1 to 3 */
 1703|  69.5k|                src_temp2_4x32b = _mm_shuffle_epi32(src_temp1_4x32b, 1);
 1704|       |
 1705|       |                /* store four 8-bit output values  */
 1706|  69.5k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1707|       |
 1708|  69.5k|                dst1 = _mm_cvtsi128_si32(src_temp2_4x32b);
 1709|       |
 1710|       |                /* row = 1 to 3 */
 1711|  69.5k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1712|       |
 1713|  69.5k|                pi2_src1 += 4;  /* Pointer update */
 1714|  69.5k|                pi2_src2 += 4;  /* Pointer update */
 1715|  69.5k|                pu1_dst  += 4;  /* Pointer update */
 1716|       |
 1717|  69.5k|            } /* inner loop ends here(4-output values in single iteration) */
 1718|       |
 1719|  34.7k|            pi2_src1 = pi2_src1 - wdx2 + 2 * src_strd1;    /* Pointer update */
 1720|  34.7k|            pi2_src2 = pi2_src2 - wdx2 + 2 * src_strd2;    /* Pointer update */
 1721|  34.7k|            pu1_dst  = pu1_dst  - wdx2 + 2 * dst_strd;   /* Pointer update */
 1722|  34.7k|        }
 1723|  18.4E|    }
 1724|       |
 1725|  1.23M|}
ihevc_weighted_pred_bi_default_sse42:
 1790|  17.7M|{
 1791|  17.7M|    WORD32 row, col, temp;
 1792|  17.7M|    WORD32 shift;
 1793|       |
 1794|  17.7M|    __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1795|  17.7M|    __m128i const_temp_8x16b, lvl_shift1_8x16b, lvl_shift2_8x16b;
 1796|  17.7M|    __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1797|       |
 1798|  17.7M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  17.7M|#define ASSERT(x) {}
  ------------------
 1799|  17.7M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  17.7M|#define ASSERT(x) {}
  ------------------
 1800|       |
 1801|  17.7M|    shift = SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|  17.7M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  17.7M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1802|  17.7M|    temp = 1 << (shift - 1);
 1803|       |
 1804|       |    // seting values in register
 1805|  17.7M|    lvl_shift1_8x16b = _mm_set1_epi16(lvl_shift1);
 1806|  17.7M|    lvl_shift2_8x16b = _mm_set1_epi16(lvl_shift2);
 1807|  17.7M|    const_temp_8x16b = _mm_set1_epi16(temp);
 1808|       |
 1809|  17.7M|    lvl_shift1_8x16b = _mm_adds_epi16(lvl_shift1_8x16b, lvl_shift2_8x16b);
 1810|  17.7M|    lvl_shift1_8x16b = _mm_adds_epi16(lvl_shift1_8x16b, const_temp_8x16b);
 1811|       |
 1812|  17.7M|    if(0 == (ht & 3)) /* ht multiple of 4*/
  ------------------
  |  Branch (1812:8): [True: 17.7M, False: 1.02k]
  ------------------
 1813|  17.7M|    {
 1814|  17.7M|        if(0 == (wd & 15)) /* wd multiple of 16 case */
  ------------------
  |  Branch (1814:12): [True: 366k, False: 17.4M]
  ------------------
 1815|   366k|        {
 1816|   366k|            __m128i src_temp9_8x16b,  src_temp10_8x16b, src_temp11_8x16b, src_temp12_8x16b;
 1817|   366k|            __m128i src_temp13_8x16b, src_temp14_8x16b, src_temp15_8x16b, src_temp16_8x16b;
 1818|       |            /*  outer for loop starts from here */
 1819|  2.32M|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1819:26): [True: 1.95M, False: 366k]
  ------------------
 1820|  1.95M|            {
 1821|  5.96M|                for(col = 0; col < wd; col += 16)
  ------------------
  |  Branch (1821:30): [True: 4.00M, False: 1.95M]
  ------------------
 1822|  4.00M|                {
 1823|       |                    /*load 8 pixel values */ /* First 8 Values */
 1824|  4.00M|                    src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1));
 1825|  4.00M|                    src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2));
 1826|       |                    /* row = 1 */
 1827|  4.00M|                    src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1));
 1828|  4.00M|                    src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2));
 1829|       |                    /* row = 2 */
 1830|  4.00M|                    src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1));
 1831|  4.00M|                    src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2));
 1832|       |                    /* row = 3 */
 1833|  4.00M|                    src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1));
 1834|  4.00M|                    src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2));
 1835|       |
 1836|       |                    /*load 8 pixel values */ /* Second 8 Values */
 1837|  4.00M|                    src_temp9_8x16b  = _mm_loadu_si128((__m128i *)(pi2_src1 + 8));
 1838|  4.00M|                    src_temp10_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 8));
 1839|       |                    /* row = 1 */
 1840|  4.00M|                    src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1 + 8));
 1841|  4.00M|                    src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2 + 8));
 1842|       |                    /* row = 2 */
 1843|  4.00M|                    src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1 + 8));
 1844|  4.00M|                    src_temp14_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2 + 8));
 1845|       |
 1846|       |                    /* (pi2_src1[col] + pi2_src2[col]) */ /* First 8 Values */
 1847|  4.00M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1848|  4.00M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1849|  4.00M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1850|  4.00M|                    src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, src_temp8_8x16b);
 1851|       |
 1852|       |                    /*load 8 pixel values */ /* Second 8 Values */
 1853|       |                    /* row = 3 */
 1854|  4.00M|                    src_temp15_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1 + 8));
 1855|  4.00M|                    src_temp16_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2 + 8));
 1856|       |
 1857|       |                    /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */ /* First 8 Values */
 1858|  4.00M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1859|  4.00M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, lvl_shift1_8x16b);
 1860|  4.00M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1861|  4.00M|                    src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, lvl_shift1_8x16b);
 1862|       |
 1863|       |                    /* (pi2_src1[col] + pi2_src2[col]) */ /* Second 8 Values */
 1864|  4.00M|                    src_temp9_8x16b  = _mm_adds_epi16(src_temp9_8x16b,  src_temp10_8x16b);
 1865|  4.00M|                    src_temp11_8x16b = _mm_adds_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1866|  4.00M|                    src_temp13_8x16b = _mm_adds_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1867|  4.00M|                    src_temp15_8x16b = _mm_adds_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1868|       |
 1869|       |                    /* (i4_tmp >> shift) */ /* First 8 Values */
 1870|  4.00M|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1871|  4.00M|                    src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  shift);
 1872|  4.00M|                    src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1873|  4.00M|                    src_temp7_8x16b = _mm_srai_epi16(src_temp7_8x16b,  shift);
 1874|       |
 1875|       |                    /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */ /* Second 8 Values */
 1876|  4.00M|                    src_temp9_8x16b  = _mm_adds_epi16(src_temp9_8x16b, lvl_shift1_8x16b);
 1877|  4.00M|                    src_temp11_8x16b = _mm_adds_epi16(src_temp11_8x16b, lvl_shift1_8x16b);
 1878|  4.00M|                    src_temp13_8x16b = _mm_adds_epi16(src_temp13_8x16b, lvl_shift1_8x16b);
 1879|  4.00M|                    src_temp15_8x16b = _mm_adds_epi16(src_temp15_8x16b, lvl_shift1_8x16b);
 1880|       |
 1881|       |                    /* (i4_tmp >> shift) */ /* Second 8 Values */
 1882|  4.00M|                    src_temp9_8x16b  = _mm_srai_epi16(src_temp9_8x16b,  shift);
 1883|  4.00M|                    src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  shift);
 1884|  4.00M|                    src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  shift);
 1885|  4.00M|                    src_temp15_8x16b = _mm_srai_epi16(src_temp15_8x16b,  shift);
 1886|       |
 1887|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */ /* 16 8 Values */
 1888|  4.00M|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp9_8x16b);
 1889|  4.00M|                    src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, src_temp11_8x16b);
 1890|  4.00M|                    src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp13_8x16b);
 1891|  4.00M|                    src_temp7_8x16b = _mm_packus_epi16(src_temp7_8x16b, src_temp15_8x16b);
 1892|       |
 1893|       |                    /* store four 8-bit output values  */ /* 16 8 Values */
 1894|  4.00M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_8x16b); /* row = 0*/
 1895|  4.00M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_8x16b); /* row = 2*/
 1896|  4.00M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src_temp5_8x16b); /* row = 1*/
 1897|  4.00M|                    _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src_temp7_8x16b); /* row = 3*/
 1898|       |
 1899|       |                    /* To update pointer */
 1900|  4.00M|                    pi2_src1 += 16;
 1901|  4.00M|                    pi2_src2 += 16;
 1902|  4.00M|                    pu1_dst  += 16;
 1903|       |
 1904|  4.00M|                } /* inner loop ends here(8-output values in single iteration) */
 1905|       |
 1906|  1.95M|                pi2_src1 = pi2_src1 - wd + 4 * src_strd1;  /* Pointer update */
 1907|  1.95M|                pi2_src2 = pi2_src2 - wd + 4 * src_strd2;  /* Pointer update */
 1908|  1.95M|                pu1_dst  = pu1_dst - wd + 4 * dst_strd;   /* Pointer update */
 1909|       |
 1910|  1.95M|            }
 1911|   366k|        }
 1912|  17.4M|        else if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (1912:17): [True: 17.3M, False: 8.87k]
  ------------------
 1913|  17.3M|        {
 1914|       |            /*  outer for loop starts from here */
 1915|  43.9M|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1915:26): [True: 26.5M, False: 17.3M]
  ------------------
 1916|  26.5M|            {
 1917|  53.2M|                for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1917:30): [True: 26.6M, False: 26.5M]
  ------------------
 1918|  26.6M|                {
 1919|       |                    /*load 8 pixel values */
 1920|  26.6M|                    src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1));
 1921|  26.6M|                    src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2));
 1922|       |                    /* row = 1 */
 1923|  26.6M|                    src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1));
 1924|  26.6M|                    src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2));
 1925|       |                    /* row = 2 */
 1926|  26.6M|                    src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1));
 1927|  26.6M|                    src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2));
 1928|       |                    /* row = 3 */
 1929|  26.6M|                    src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1));
 1930|  26.6M|                    src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2));
 1931|       |
 1932|       |                    /* (pi2_src1[col] + pi2_src2[col]) */
 1933|  26.6M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1934|  26.6M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1935|  26.6M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1936|  26.6M|                    src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, src_temp8_8x16b);
 1937|       |
 1938|       |                    /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */
 1939|  26.6M|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1940|  26.6M|                    src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, lvl_shift1_8x16b);
 1941|  26.6M|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1942|  26.6M|                    src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, lvl_shift1_8x16b);
 1943|       |
 1944|       |                    /* (i4_tmp >> shift) */
 1945|  26.6M|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1946|  26.6M|                    src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  shift);
 1947|  26.6M|                    src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1948|  26.6M|                    src_temp7_8x16b = _mm_srai_epi16(src_temp7_8x16b,  shift);
 1949|       |
 1950|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1951|  26.6M|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 1952|  26.6M|                    src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, src_temp3_8x16b);
 1953|  26.6M|                    src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp5_8x16b);
 1954|  26.6M|                    src_temp7_8x16b = _mm_packus_epi16(src_temp7_8x16b, src_temp7_8x16b);
 1955|       |
 1956|       |                    /* store four 8-bit output values  */
 1957|  26.6M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_8x16b); /* row = 0*/
 1958|  26.6M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_8x16b); /* row = 2*/
 1959|  26.6M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_temp5_8x16b); /* row = 1*/
 1960|  26.6M|                    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_temp7_8x16b); /* row = 3*/
 1961|       |
 1962|       |                    /* To update pointer */
 1963|  26.6M|                    pi2_src1 += 8;
 1964|  26.6M|                    pi2_src2 += 8;
 1965|  26.6M|                    pu1_dst  += 8;
 1966|       |
 1967|  26.6M|                } /* inner loop ends here(8-output values in single iteration) */
 1968|       |
 1969|  26.5M|                pi2_src1 = pi2_src1 - wd + 4 * src_strd1;  /* Pointer update */
 1970|  26.5M|                pi2_src2 = pi2_src2 - wd + 4 * src_strd2;  /* Pointer update */
 1971|  26.5M|                pu1_dst  = pu1_dst - wd + 4 * dst_strd;   /* Pointer update */
 1972|       |
 1973|  26.5M|            }
 1974|  17.3M|        }
 1975|  8.87k|        else /* wd multiple of 4 case*/
 1976|  8.87k|        {
 1977|  8.87k|            WORD32 dst0, dst1, dst2, dst3;
 1978|       |
 1979|       |            /*  outer for loop starts from here */
 1980|  44.3k|            for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1980:26): [True: 35.5k, False: 8.87k]
  ------------------
 1981|  35.5k|            {
 1982|   108k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1982:30): [True: 72.7k, False: 35.5k]
  ------------------
 1983|  72.7k|                {
 1984|       |                    /*load 4 pixel values from 7:0 pos. relative to cur. pos.*/
 1985|  72.7k|                    src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1));
 1986|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1987|  72.7k|                    src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2));
 1988|       |
 1989|       |                    /* row = 1 */
 1990|  72.7k|                    src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + src_strd1));
 1991|  72.7k|                    src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + src_strd2));
 1992|       |                    /* row = 2 */
 1993|  72.7k|                    src_temp5_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 2 * src_strd1));
 1994|  72.7k|                    src_temp6_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 2 * src_strd2));
 1995|       |                    /* row = 3 */
 1996|  72.7k|                    src_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 3 * src_strd1));
 1997|  72.7k|                    src_temp8_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 3 * src_strd2));
 1998|       |
 1999|       |                    /* Pack two rows together */
 2000|  72.7k|                    src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 2001|  72.7k|                    src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 2002|  72.7k|                    src_temp5_8x16b = _mm_unpacklo_epi64(src_temp5_8x16b, src_temp7_8x16b);
 2003|  72.7k|                    src_temp6_8x16b = _mm_unpacklo_epi64(src_temp6_8x16b, src_temp8_8x16b);
 2004|       |
 2005|       |                    /* (pi2_src1[col] + pi2_src2[col]) */
 2006|  72.7k|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2007|  72.7k|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 2008|       |
 2009|       |                    /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */
 2010|  72.7k|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 2011|  72.7k|                    src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 2012|       |
 2013|       |                    /* (i4_tmp >> shift) */
 2014|  72.7k|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 2015|  72.7k|                    src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 2016|       |
 2017|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 2018|  72.7k|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 2019|  72.7k|                    src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp5_8x16b);
 2020|       |
 2021|  72.7k|                    dst0 = _mm_cvtsi128_si32(src_temp1_8x16b);
 2022|       |                    /* dst row = 1 to 3 */
 2023|  72.7k|                    src_temp2_8x16b = _mm_shuffle_epi32(src_temp1_8x16b, 1);
 2024|  72.7k|                    src_temp4_8x16b = _mm_shuffle_epi32(src_temp5_8x16b, 1);
 2025|       |
 2026|       |                    /* store four 8-bit output values  */
 2027|  72.7k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 2028|       |
 2029|  72.7k|                    dst1 = _mm_cvtsi128_si32(src_temp2_8x16b);
 2030|  72.7k|                    dst2 = _mm_cvtsi128_si32(src_temp5_8x16b);
 2031|  72.7k|                    dst3 = _mm_cvtsi128_si32(src_temp4_8x16b);
 2032|       |
 2033|       |                    /* row = 1 to row = 3 */
 2034|  72.7k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 2035|  72.7k|                    *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2;
 2036|  72.7k|                    *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3;
 2037|       |
 2038|       |                    /* To update pointer */
 2039|  72.7k|                    pi2_src1 += 4;
 2040|  72.7k|                    pi2_src2 += 4;
 2041|  72.7k|                    pu1_dst  += 4;
 2042|       |
 2043|  72.7k|                } /* inner loop ends here(4-output values in single iteration) */
 2044|       |
 2045|  35.5k|                pi2_src1 = pi2_src1 - wd + 4 * src_strd1; /* Pointer update */
 2046|  35.5k|                pi2_src2 = pi2_src2 - wd + 4 * src_strd2; /* Pointer update */
 2047|  35.5k|                pu1_dst  = pu1_dst  - wd + 4 * dst_strd;  /* Pointer update */
 2048|       |
 2049|  35.5k|            }
 2050|  8.87k|        }
 2051|  17.7M|    }
 2052|  1.02k|    else /* ht multiple of 2 case and wd multiple of 4 case*/
 2053|  1.02k|    {
 2054|       |
 2055|  1.02k|        WORD32 dst0, dst1;
 2056|       |
 2057|       |        /*  outer for loop starts from here */
 2058|  10.8k|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (2058:22): [True: 9.82k, False: 1.02k]
  ------------------
 2059|  9.82k|        {
 2060|  49.1k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (2060:26): [True: 39.2k, False: 9.82k]
  ------------------
 2061|  39.2k|            {
 2062|       |                /*load 4 pixel values from 7:0 pos. relative to cur. pos.*/
 2063|  39.2k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1));
 2064|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 2065|  39.2k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2));
 2066|       |
 2067|       |                /* row = 1 */
 2068|  39.2k|                src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + src_strd1));
 2069|  39.2k|                src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + src_strd2));
 2070|       |
 2071|       |                /* Pack two rows together */
 2072|  39.2k|                src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 2073|  39.2k|                src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 2074|       |
 2075|       |                /* (pi2_src1[col] + pi2_src2[col]) */
 2076|  39.2k|                src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 2077|       |
 2078|       |                /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */
 2079|  39.2k|                src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 2080|       |
 2081|       |                /* (i4_tmp >> shift) */
 2082|  39.2k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 2083|       |
 2084|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 2085|  39.2k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 2086|       |
 2087|  39.2k|                dst0 = _mm_cvtsi128_si32(src_temp1_8x16b);
 2088|       |                /* dst row = 1 to 3 */
 2089|  39.2k|                src_temp2_8x16b = _mm_shuffle_epi32(src_temp1_8x16b, 1);
 2090|       |
 2091|       |                /* store four 8-bit output values  */
 2092|  39.2k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 2093|       |
 2094|  39.2k|                dst1 = _mm_cvtsi128_si32(src_temp2_8x16b);
 2095|       |
 2096|       |                /* row = 1 to row = 3 */
 2097|  39.2k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 2098|       |
 2099|       |                /* To update pointer */
 2100|  39.2k|                pi2_src1 += 4;
 2101|  39.2k|                pi2_src2 += 4;
 2102|  39.2k|                pu1_dst  += 4;
 2103|       |
 2104|  39.2k|            } /* inner loop ends here(4-output values in single iteration) */
 2105|       |
 2106|  9.82k|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1; /* Pointer update */
 2107|  9.82k|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2; /* Pointer update */
 2108|  9.82k|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;  /* Pointer update */
 2109|       |
 2110|  9.82k|        }
 2111|       |
 2112|  1.02k|    }
 2113|       |
 2114|  17.7M|}

ihevc_weighted_pred_uni_ssse3:
  122|   267k|{
  123|   267k|    WORD32 row, col, temp;
  124|       |
  125|       |    /* all 128 bit registers are named with a suffix mxnb, where m is the */
  126|       |    /* number of n bits packed in the register                            */
  127|   267k|    __m128i src_temp0_8x16b, src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b;
  128|   267k|    __m128i const_temp_4x32b, lvl_shift_4x32b, wgt0_8x16b, off0_4x32b;
  129|   267k|    __m128i res_temp0_4x32b, res_temp1_4x32b, res_temp2_4x32b, res_temp3_4x32b;
  130|       |
  131|   267k|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|   267k|#define ASSERT(x) {}
  ------------------
  132|   267k|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|   267k|#define ASSERT(x) {}
  ------------------
  133|       |
  134|   267k|    temp = 1 << (shift - 1);
  135|       |
  136|       |    // seting values in register
  137|   267k|    lvl_shift_4x32b = _mm_set1_epi16(lvl_shift);
  138|   267k|    wgt0_8x16b = _mm_set1_epi16(wgt0);
  139|       |
  140|       |    /* lvl_shift * wgt0 */
  141|   267k|    res_temp0_4x32b = _mm_mullo_epi16(lvl_shift_4x32b, wgt0_8x16b);
  142|   267k|    res_temp1_4x32b = _mm_mulhi_epi16(lvl_shift_4x32b, wgt0_8x16b);
  143|       |
  144|   267k|    const_temp_4x32b = _mm_set1_epi32(temp);
  145|   267k|    off0_4x32b = _mm_set1_epi32(off0);
  146|       |
  147|       |
  148|       |    /* lvl_shift * wgt0 */
  149|   267k|    lvl_shift_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, res_temp1_4x32b);
  150|       |    /* lvl_shift * wgt0 + 1 << (shift - 1) */
  151|   267k|    lvl_shift_4x32b = _mm_add_epi32(lvl_shift_4x32b, const_temp_4x32b);
  152|       |
  153|   267k|    if(0 == (wd & 7)) /* wd multiple of 8 case */
  ------------------
  |  Branch (153:8): [True: 256k, False: 10.8k]
  ------------------
  154|   256k|    {
  155|   256k|        __m128i res_temp4_4x32b, res_temp5_4x32b, res_temp6_4x32b, res_temp7_4x32b;
  156|       |
  157|       |        /*  outer for loop starts from here */
  158|   800k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (158:22): [True: 544k, False: 256k]
  ------------------
  159|   544k|        {
  160|  1.33M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (160:26): [True: 792k, False: 544k]
  ------------------
  161|   792k|            {   /* for row =0 ,1,2,3*/
  162|       |
  163|       |                /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  164|   792k|                src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pi2_src));
  165|       |                /* row = 1 */
  166|   792k|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  167|       |                /* row = 2 */
  168|   792k|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + 2 * src_strd));
  169|       |                /* row = 3 */
  170|   792k|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + 3 * src_strd));
  171|       |
  172|       |                /*i4_tmp = (pi2_src[col]) * wgt0*/ /* Lower 16 bit */
  173|   792k|                res_temp0_4x32b  = _mm_mullo_epi16(src_temp0_8x16b, wgt0_8x16b);
  174|   792k|                res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
  175|   792k|                res_temp2_4x32b  = _mm_mullo_epi16(src_temp2_8x16b, wgt0_8x16b);
  176|   792k|                res_temp3_4x32b  = _mm_mullo_epi16(src_temp3_8x16b, wgt0_8x16b);
  177|       |
  178|       |                /*i4_tmp = (pi2_src[col] ) * wgt0*/ /* Higher 16 bit */
  179|   792k|                src_temp0_8x16b  = _mm_mulhi_epi16(src_temp0_8x16b, wgt0_8x16b);
  180|   792k|                src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
  181|   792k|                src_temp2_8x16b  = _mm_mulhi_epi16(src_temp2_8x16b, wgt0_8x16b);
  182|   792k|                src_temp3_8x16b  = _mm_mulhi_epi16(src_temp3_8x16b, wgt0_8x16b);
  183|       |
  184|       |                /* Get 32 bit Result */
  185|   792k|                res_temp4_4x32b = _mm_unpackhi_epi16(res_temp0_4x32b, src_temp0_8x16b);
  186|   792k|                res_temp5_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
  187|   792k|                res_temp6_4x32b = _mm_unpackhi_epi16(res_temp2_4x32b, src_temp2_8x16b);
  188|   792k|                res_temp7_4x32b = _mm_unpackhi_epi16(res_temp3_4x32b, src_temp3_8x16b);
  189|       |
  190|   792k|                res_temp0_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, src_temp0_8x16b);
  191|   792k|                res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
  192|   792k|                res_temp2_4x32b = _mm_unpacklo_epi16(res_temp2_4x32b, src_temp2_8x16b);
  193|   792k|                res_temp3_4x32b = _mm_unpacklo_epi16(res_temp3_4x32b, src_temp3_8x16b);
  194|       |
  195|       |                /* i4_tmp = (pi2_src[col] + lvl_shift) * wgt0 + 1 << (shift - 1) */
  196|   792k|                res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, lvl_shift_4x32b);
  197|   792k|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, lvl_shift_4x32b);
  198|   792k|                res_temp6_4x32b = _mm_add_epi32(res_temp6_4x32b, lvl_shift_4x32b);
  199|   792k|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, lvl_shift_4x32b);
  200|   792k|                res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, lvl_shift_4x32b);
  201|   792k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift_4x32b);
  202|   792k|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift_4x32b);
  203|   792k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift_4x32b);
  204|       |
  205|       |                /* (i4_tmp >> shift) */ /* First 4 pixels */
  206|   792k|                res_temp0_4x32b = _mm_srai_epi32(res_temp0_4x32b, shift);
  207|   792k|                res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b, shift);
  208|   792k|                res_temp2_4x32b = _mm_srai_epi32(res_temp2_4x32b, shift);
  209|   792k|                res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b, shift);
  210|       |
  211|       |                /* (i4_tmp >> shift) */ /* Last 4 pixels */
  212|   792k|                res_temp4_4x32b = _mm_srai_epi32(res_temp4_4x32b, shift);
  213|   792k|                res_temp5_4x32b = _mm_srai_epi32(res_temp5_4x32b, shift);
  214|   792k|                res_temp6_4x32b = _mm_srai_epi32(res_temp6_4x32b, shift);
  215|   792k|                res_temp7_4x32b = _mm_srai_epi32(res_temp7_4x32b, shift);
  216|       |
  217|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */ /* First 4 pixels */
  218|   792k|                res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, off0_4x32b);
  219|   792k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, off0_4x32b);
  220|   792k|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, off0_4x32b);
  221|   792k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, off0_4x32b);
  222|       |
  223|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  224|   792k|                res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, off0_4x32b);
  225|   792k|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, off0_4x32b);
  226|   792k|                res_temp6_4x32b = _mm_add_epi32(res_temp6_4x32b, off0_4x32b);
  227|   792k|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, off0_4x32b);
  228|       |
  229|   792k|                res_temp0_4x32b = _mm_packs_epi32(res_temp0_4x32b, res_temp4_4x32b);
  230|   792k|                res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp5_4x32b);
  231|   792k|                res_temp2_4x32b = _mm_packs_epi32(res_temp2_4x32b, res_temp6_4x32b);
  232|   792k|                res_temp3_4x32b = _mm_packs_epi32(res_temp3_4x32b, res_temp7_4x32b);
  233|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  234|   792k|                res_temp0_4x32b = _mm_packus_epi16(res_temp0_4x32b, res_temp0_4x32b);
  235|   792k|                res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp1_4x32b);
  236|   792k|                res_temp2_4x32b = _mm_packus_epi16(res_temp2_4x32b, res_temp2_4x32b);
  237|   792k|                res_temp3_4x32b = _mm_packus_epi16(res_temp3_4x32b, res_temp3_4x32b);
  238|       |
  239|       |                /* store four 8-bit output values  */
  240|   792k|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), res_temp0_4x32b); /* row = 0*/
  241|   792k|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), res_temp1_4x32b); /* row = 2*/
  242|   792k|                _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), res_temp2_4x32b); /* row = 1*/
  243|   792k|                _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), res_temp3_4x32b); /* row = 3*/
  244|       |
  245|       |                /* To update pointer */
  246|   792k|                pi2_src += 8;
  247|   792k|                pu1_dst += 8;
  248|       |
  249|   792k|            } /* inner loop ends here(4-output values in single iteration) */
  250|       |
  251|   544k|            pi2_src = pi2_src - wd + 4 * src_strd;    /* Pointer update */
  252|   544k|            pu1_dst = pu1_dst - wd + 4 * dst_strd; /* Pointer update */
  253|       |
  254|   544k|        }
  255|   256k|    }
  256|  10.8k|    else  /* wd multiple of 4 case */
  257|  10.8k|    {
  258|  10.8k|        WORD32 dst0, dst1, dst2, dst3;
  259|       |        /*  outer for loop starts from here */
  260|  36.2k|        for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (260:22): [True: 25.3k, False: 10.8k]
  ------------------
  261|  25.3k|        {
  262|  56.9k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (262:26): [True: 31.6k, False: 25.3k]
  ------------------
  263|  31.6k|            {   /* for row =0 ,1,2,3*/
  264|       |
  265|       |                /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  266|  31.6k|                src_temp0_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src));
  267|       |                /* row = 1 */
  268|  31.6k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + src_strd));
  269|       |                /* row = 2 */
  270|  31.6k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + 2 * src_strd));
  271|       |                /* row = 3 */
  272|  31.6k|                src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + 3 * src_strd));
  273|       |
  274|       |                /* 2 rows together */
  275|  31.6k|                src_temp0_8x16b = _mm_unpacklo_epi64(src_temp0_8x16b, src_temp2_8x16b);
  276|  31.6k|                src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
  277|       |
  278|       |                /*i4_tmp = (pi2_src[col]) * wgt0*/ /* Lower 16 bit */
  279|  31.6k|                res_temp0_4x32b  = _mm_mullo_epi16(src_temp0_8x16b, wgt0_8x16b);
  280|  31.6k|                res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
  281|       |                /*i4_tmp = (pi2_src[col]) * wgt0*/ /* Higher 16 bit */
  282|  31.6k|                src_temp0_8x16b  = _mm_mulhi_epi16(src_temp0_8x16b, wgt0_8x16b);
  283|  31.6k|                src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
  284|       |
  285|       |                /* Get 32 bit Result */
  286|  31.6k|                res_temp2_4x32b = _mm_unpackhi_epi16(res_temp0_4x32b, src_temp0_8x16b);
  287|  31.6k|                res_temp3_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
  288|       |
  289|  31.6k|                res_temp0_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, src_temp0_8x16b);
  290|  31.6k|                res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
  291|       |
  292|       |                /* i4_tmp = (pi2_src[col] + lvl_shift) * wgt0 + 1 << (shift - 1) */
  293|  31.6k|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift_4x32b);
  294|  31.6k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift_4x32b);
  295|  31.6k|                res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, lvl_shift_4x32b);
  296|  31.6k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift_4x32b);
  297|       |
  298|       |                /* (i4_tmp >> shift) */
  299|  31.6k|                res_temp0_4x32b = _mm_srai_epi32(res_temp0_4x32b, shift);
  300|  31.6k|                res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b, shift);
  301|  31.6k|                res_temp2_4x32b = _mm_srai_epi32(res_temp2_4x32b, shift);
  302|  31.6k|                res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b, shift);
  303|       |
  304|       |                /*i4_tmp = (i4_tmp >> shift) + off0; */
  305|  31.6k|                res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, off0_4x32b);
  306|  31.6k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, off0_4x32b);
  307|  31.6k|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, off0_4x32b);
  308|  31.6k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, off0_4x32b);
  309|       |
  310|  31.6k|                res_temp0_4x32b = _mm_packs_epi32(res_temp0_4x32b, res_temp1_4x32b);
  311|  31.6k|                res_temp2_4x32b = _mm_packs_epi32(res_temp2_4x32b, res_temp3_4x32b);
  312|       |
  313|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  314|  31.6k|                res_temp0_4x32b = _mm_packus_epi16(res_temp0_4x32b, res_temp2_4x32b);
  315|       |
  316|  31.6k|                dst0 = _mm_cvtsi128_si32(res_temp0_4x32b);
  317|       |                /* dst row = 1 to 3 */
  318|  31.6k|                res_temp1_4x32b = _mm_shuffle_epi32(res_temp0_4x32b, 1);
  319|  31.6k|                res_temp2_4x32b = _mm_shuffle_epi32(res_temp0_4x32b, 2);
  320|  31.6k|                res_temp3_4x32b = _mm_shuffle_epi32(res_temp0_4x32b, 3);
  321|       |
  322|       |                /* store four 8-bit output values  */
  323|  31.6k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
  324|       |
  325|  31.6k|                dst1 = _mm_cvtsi128_si32(res_temp1_4x32b);
  326|  31.6k|                dst2 = _mm_cvtsi128_si32(res_temp2_4x32b);
  327|  31.6k|                dst3 = _mm_cvtsi128_si32(res_temp3_4x32b);
  328|       |
  329|       |                /* row = 1 to row = 3 */
  330|  31.6k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
  331|  31.6k|                *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2;
  332|  31.6k|                *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3;
  333|       |
  334|       |                /* To update pointer */
  335|  31.6k|                pi2_src += 4;
  336|  31.6k|                pu1_dst += 4;
  337|       |
  338|  31.6k|            } /* inner loop ends here(4-output values in single iteration) */
  339|       |
  340|  25.3k|            pi2_src = pi2_src - wd + 4 * src_strd;    /* Pointer update */
  341|  25.3k|            pu1_dst = pu1_dst - wd + 4 * dst_strd; /* Pointer update */
  342|       |
  343|  25.3k|        }
  344|  10.8k|    }
  345|   267k|}
ihevc_weighted_pred_chroma_uni_ssse3:
  412|   240k|{
  413|   240k|    WORD32 row, col, temp, wdx2;
  414|       |    /* all 128 bit registers are named with a suffix mxnb, where m is the */
  415|       |    /* number of n bits packed in the register                            */
  416|       |
  417|   240k|    __m128i src_temp0_8x16b, src_temp1_8x16b;
  418|   240k|    __m128i const_temp_4x32b, lvl_shift_4x32b, wgt0_8x16b, off0_4x32b;
  419|   240k|    __m128i res_temp0_4x32b, res_temp1_4x32b;
  420|       |
  421|   240k|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   240k|#define ASSERT(x) {}
  ------------------
  422|   240k|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|   240k|#define ASSERT(x) {}
  ------------------
  423|       |
  424|   240k|    temp = 1 << (shift - 1);
  425|   240k|    wdx2 = 2 * wd;
  426|       |
  427|       |    // seting values in register
  428|   240k|    lvl_shift_4x32b = _mm_set1_epi16(lvl_shift);
  429|   240k|    wgt0_8x16b = _mm_set_epi16(wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb);
  430|       |
  431|       |    /* lvl_shift * wgt0 */
  432|   240k|    res_temp0_4x32b = _mm_mullo_epi16(lvl_shift_4x32b, wgt0_8x16b);
  433|   240k|    res_temp1_4x32b = _mm_mulhi_epi16(lvl_shift_4x32b, wgt0_8x16b);
  434|       |
  435|   240k|    const_temp_4x32b = _mm_set1_epi32(temp);
  436|   240k|    off0_4x32b = _mm_set_epi32(off0_cr, off0_cb, off0_cr, off0_cb);
  437|       |
  438|       |    /* lvl_shift * wgt0 */
  439|   240k|    lvl_shift_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, res_temp1_4x32b);
  440|       |    /* lvl_shift * wgt0 + 1 << (shift - 1) */
  441|   240k|    lvl_shift_4x32b = _mm_add_epi32(lvl_shift_4x32b, const_temp_4x32b);
  442|       |
  443|   240k|    {
  444|   240k|        if(0 == (wdx2 & 15)) /* 2*wd multiple of 16 case */
  ------------------
  |  Branch (444:12): [True: 7.85k, False: 232k]
  ------------------
  445|  7.85k|        {
  446|  7.85k|            __m128i src_temp2_8x16b, src_temp3_8x16b;
  447|  7.85k|            __m128i res_temp2_4x32b, res_temp3_4x32b;
  448|  7.85k|            __m128i res_temp4_4x32b, res_temp5_4x32b, res_temp6_4x32b, res_temp7_4x32b;
  449|       |
  450|       |            /*  outer for loop starts from here */
  451|  69.2k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (451:26): [True: 61.3k, False: 7.85k]
  ------------------
  452|  61.3k|            {
  453|   215k|                for(col = 0; col < wdx2; col += 16)
  ------------------
  |  Branch (453:30): [True: 153k, False: 61.3k]
  ------------------
  454|   153k|                {
  455|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  456|   153k|                    src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pi2_src));
  457|       |                    /* row = 1 */
  458|   153k|                    src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  459|       |                    /* row = 0 */ /* Next 8 pixels */
  460|   153k|                    src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + 8));
  461|       |                    /* row = 1 */
  462|   153k|                    src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd + 8));
  463|       |
  464|       |                    /*i4_tmp = (pi2_src[col]) * wgt0*/ /* Lower 16 bit */
  465|   153k|                    res_temp0_4x32b  = _mm_mullo_epi16(src_temp0_8x16b, wgt0_8x16b);
  466|   153k|                    res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
  467|   153k|                    res_temp4_4x32b  = _mm_mullo_epi16(src_temp2_8x16b, wgt0_8x16b);
  468|   153k|                    res_temp5_4x32b  = _mm_mullo_epi16(src_temp3_8x16b, wgt0_8x16b);
  469|       |
  470|       |                    /*i4_tmp = (pi2_src[col] ) * wgt0*/ /* Higher 16 bit */
  471|   153k|                    src_temp0_8x16b  = _mm_mulhi_epi16(src_temp0_8x16b, wgt0_8x16b);
  472|   153k|                    src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
  473|   153k|                    src_temp2_8x16b  = _mm_mulhi_epi16(src_temp2_8x16b, wgt0_8x16b);
  474|   153k|                    src_temp3_8x16b  = _mm_mulhi_epi16(src_temp3_8x16b, wgt0_8x16b);
  475|       |
  476|       |                    /* Get 32 bit Result */
  477|   153k|                    res_temp2_4x32b = _mm_unpackhi_epi16(res_temp0_4x32b, src_temp0_8x16b);
  478|   153k|                    res_temp3_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
  479|   153k|                    res_temp6_4x32b = _mm_unpackhi_epi16(res_temp4_4x32b, src_temp2_8x16b);
  480|   153k|                    res_temp7_4x32b = _mm_unpackhi_epi16(res_temp5_4x32b, src_temp3_8x16b);
  481|       |
  482|   153k|                    res_temp0_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, src_temp0_8x16b);
  483|   153k|                    res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
  484|   153k|                    res_temp4_4x32b = _mm_unpacklo_epi16(res_temp4_4x32b, src_temp2_8x16b);
  485|   153k|                    res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, src_temp3_8x16b);
  486|       |
  487|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0 + 1 << (shift - 1) */
  488|   153k|                    res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, lvl_shift_4x32b);
  489|   153k|                    res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift_4x32b);
  490|   153k|                    res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift_4x32b);
  491|   153k|                    res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift_4x32b);
  492|   153k|                    res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, lvl_shift_4x32b);
  493|   153k|                    res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, lvl_shift_4x32b);
  494|   153k|                    res_temp6_4x32b = _mm_add_epi32(res_temp6_4x32b, lvl_shift_4x32b);
  495|   153k|                    res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, lvl_shift_4x32b);
  496|       |
  497|       |                    /* (i4_tmp >> shift) */
  498|   153k|                    res_temp0_4x32b = _mm_srai_epi32(res_temp0_4x32b,  shift);
  499|   153k|                    res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
  500|   153k|                    res_temp2_4x32b = _mm_srai_epi32(res_temp2_4x32b,  shift);
  501|   153k|                    res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b,  shift);
  502|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  503|   153k|                    res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, off0_4x32b);
  504|   153k|                    res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, off0_4x32b);
  505|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Second 4 pixels */
  506|   153k|                    res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, off0_4x32b);
  507|   153k|                    res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, off0_4x32b);
  508|       |
  509|       |                    /* (i4_tmp >> shift) */
  510|   153k|                    res_temp4_4x32b = _mm_srai_epi32(res_temp4_4x32b,  shift);
  511|   153k|                    res_temp5_4x32b = _mm_srai_epi32(res_temp5_4x32b,  shift);
  512|   153k|                    res_temp6_4x32b = _mm_srai_epi32(res_temp6_4x32b,  shift);
  513|   153k|                    res_temp7_4x32b = _mm_srai_epi32(res_temp7_4x32b,  shift);
  514|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Third 4 pixels */
  515|   153k|                    res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, off0_4x32b);
  516|   153k|                    res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, off0_4x32b);
  517|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  518|   153k|                    res_temp6_4x32b = _mm_add_epi32(res_temp6_4x32b, off0_4x32b);
  519|   153k|                    res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, off0_4x32b);
  520|       |
  521|   153k|                    res_temp0_4x32b = _mm_packs_epi32(res_temp0_4x32b, res_temp2_4x32b);
  522|   153k|                    res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp3_4x32b);
  523|   153k|                    res_temp4_4x32b = _mm_packs_epi32(res_temp4_4x32b, res_temp6_4x32b);
  524|   153k|                    res_temp5_4x32b = _mm_packs_epi32(res_temp5_4x32b, res_temp7_4x32b);
  525|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  526|   153k|                    res_temp0_4x32b = _mm_packus_epi16(res_temp0_4x32b, res_temp4_4x32b);
  527|   153k|                    res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp5_4x32b);
  528|       |
  529|       |                    /* store 16 8-bit output values  */
  530|   153k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 0 * dst_strd), res_temp0_4x32b); /* row = 0*/
  531|   153k|                    _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), res_temp1_4x32b); /* row = 1*/
  532|       |
  533|   153k|                    pi2_src += 16;  /* Pointer update */
  534|   153k|                    pu1_dst += 16; /* Pointer update */
  535|       |
  536|   153k|                } /* inner loop ends here(4-output values in single iteration) */
  537|  61.3k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
  538|  61.3k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
  539|  61.3k|            }
  540|  7.85k|        }
  541|   232k|        else if(0 == (wdx2 & 7)) /* 2*wd multiple of 8 case */
  ------------------
  |  Branch (541:17): [True: 222k, False: 10.6k]
  ------------------
  542|   222k|        {
  543|   222k|            __m128i res_temp2_4x32b, res_temp3_4x32b;
  544|       |            /*  outer for loop starts from here */
  545|   671k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (545:26): [True: 449k, False: 222k]
  ------------------
  546|   449k|            {
  547|   903k|                for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (547:30): [True: 454k, False: 449k]
  ------------------
  548|   454k|                {
  549|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  550|   454k|                    src_temp0_8x16b = _mm_loadu_si128((__m128i *)(pi2_src));
  551|       |                    /* row = 1 */
  552|   454k|                    src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src + src_strd));
  553|       |
  554|       |                    /*i4_tmp = (pi2_src[col]) * wgt0*/ /* Lower 16 bit */
  555|   454k|                    res_temp0_4x32b  = _mm_mullo_epi16(src_temp0_8x16b, wgt0_8x16b);
  556|   454k|                    res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
  557|       |                    /*i4_tmp = (pi2_src[col] ) * wgt0*/ /* Higher 16 bit */
  558|   454k|                    src_temp0_8x16b  = _mm_mulhi_epi16(src_temp0_8x16b, wgt0_8x16b);
  559|   454k|                    src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
  560|       |
  561|       |                    /* Get 32 bit Result */
  562|   454k|                    res_temp2_4x32b = _mm_unpackhi_epi16(res_temp0_4x32b, src_temp0_8x16b);
  563|   454k|                    res_temp3_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
  564|       |
  565|   454k|                    res_temp0_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, src_temp0_8x16b);
  566|   454k|                    res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
  567|       |
  568|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0 + 1 << (shift - 1) */
  569|   454k|                    res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, lvl_shift_4x32b);
  570|   454k|                    res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift_4x32b);
  571|   454k|                    res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift_4x32b);
  572|   454k|                    res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift_4x32b);
  573|       |
  574|       |                    /* (i4_tmp >> shift) */
  575|   454k|                    res_temp0_4x32b = _mm_srai_epi32(res_temp0_4x32b,  shift);
  576|   454k|                    res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
  577|   454k|                    res_temp2_4x32b = _mm_srai_epi32(res_temp2_4x32b,  shift);
  578|   454k|                    res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b,  shift);
  579|       |
  580|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  581|   454k|                    res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, off0_4x32b);
  582|   454k|                    res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, off0_4x32b);
  583|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */ /* Last 4 pixels */
  584|   454k|                    res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, off0_4x32b);
  585|   454k|                    res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, off0_4x32b);
  586|       |
  587|   454k|                    res_temp0_4x32b = _mm_packs_epi32(res_temp0_4x32b, res_temp2_4x32b);
  588|   454k|                    res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp3_4x32b);
  589|       |
  590|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  591|   454k|                    res_temp0_4x32b = _mm_packus_epi16(res_temp0_4x32b, res_temp0_4x32b);
  592|   454k|                    res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp1_4x32b);
  593|       |
  594|       |                    /* store four 8-bit output values  */
  595|   454k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), res_temp0_4x32b); /* row = 0*/
  596|   454k|                    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), res_temp1_4x32b); /* row = 1*/
  597|       |
  598|   454k|                    pi2_src += 8;   /* Pointer update */
  599|   454k|                    pu1_dst += 8; /* Pointer update */
  600|       |
  601|   454k|                } /* inner loop ends here(4-output values in single iteration) */
  602|   449k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
  603|   449k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
  604|   449k|            }
  605|   222k|        }
  606|  10.6k|        else /* 2*wd multiple of 4 case */
  607|  10.6k|        {
  608|  10.6k|            WORD32 dst0, dst1;
  609|       |            /*  outer for loop starts from here */
  610|  35.4k|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (610:26): [True: 24.7k, False: 10.6k]
  ------------------
  611|  24.7k|            {
  612|  55.5k|                for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (612:30): [True: 30.8k, False: 24.7k]
  ------------------
  613|  30.8k|                {
  614|       |                    /* row = 0 */ /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  615|  30.8k|                    src_temp0_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src));
  616|       |                    /* row = 1 */
  617|  30.8k|                    src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src + src_strd));
  618|       |
  619|       |                    /* 2 rows together */
  620|  30.8k|                    src_temp0_8x16b = _mm_unpacklo_epi64(src_temp0_8x16b, src_temp1_8x16b);
  621|       |
  622|       |                    /*i4_tmp = (pi2_src[col]) * wgt0*/ /* Lower 16 bit */
  623|  30.8k|                    res_temp0_4x32b  = _mm_mullo_epi16(src_temp0_8x16b, wgt0_8x16b);
  624|       |                    /*i4_tmp = (pi2_src[col] ) * wgt0*/ /* Higher 16 bit */
  625|  30.8k|                    src_temp0_8x16b  = _mm_mulhi_epi16(src_temp0_8x16b, wgt0_8x16b);
  626|       |
  627|       |                    /* Get 32 bit Result */
  628|  30.8k|                    res_temp1_4x32b = _mm_unpackhi_epi16(res_temp0_4x32b, src_temp0_8x16b);
  629|  30.8k|                    res_temp0_4x32b = _mm_unpacklo_epi16(res_temp0_4x32b, src_temp0_8x16b);
  630|       |
  631|       |                    /*i4_tmp = (pi2_src[col] + lvl_shift) * wgt0 + 1 << (shift - 1) */
  632|  30.8k|                    res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, lvl_shift_4x32b);
  633|  30.8k|                    res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift_4x32b);
  634|       |
  635|       |                    /* (i4_tmp >> shift) */
  636|  30.8k|                    res_temp0_4x32b = _mm_srai_epi32(res_temp0_4x32b,  shift);
  637|  30.8k|                    res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
  638|       |
  639|       |                    /*i4_tmp = (i4_tmp >> shift) + off0; */
  640|  30.8k|                    res_temp0_4x32b = _mm_add_epi32(res_temp0_4x32b, off0_4x32b);
  641|  30.8k|                    res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, off0_4x32b);
  642|       |
  643|  30.8k|                    res_temp0_4x32b = _mm_packs_epi32(res_temp0_4x32b, res_temp1_4x32b);
  644|       |
  645|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp); */
  646|  30.8k|                    res_temp0_4x32b = _mm_packus_epi16(res_temp0_4x32b, res_temp0_4x32b);
  647|       |
  648|  30.8k|                    dst0 = _mm_cvtsi128_si32(res_temp0_4x32b);
  649|       |                    /* dst row = 1 to 3 */
  650|  30.8k|                    res_temp1_4x32b = _mm_shuffle_epi32(res_temp0_4x32b, 1);
  651|       |
  652|       |                    /* store four 8-bit output values  */
  653|  30.8k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
  654|       |
  655|  30.8k|                    dst1 = _mm_cvtsi128_si32(res_temp1_4x32b);
  656|       |                    /* row = 1 */
  657|  30.8k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
  658|       |
  659|  30.8k|                    pi2_src += 4;   /* Pointer update */
  660|  30.8k|                    pu1_dst += 4; /* Pointer update */
  661|       |
  662|  30.8k|                } /* inner loop ends here(4-output values in single iteration) */
  663|  24.7k|                pi2_src = pi2_src - wdx2 + 2 * src_strd;  /* Pointer update */
  664|  24.7k|                pu1_dst = pu1_dst - wdx2 + 2 * dst_strd; /* Pointer update */
  665|  24.7k|            }
  666|  10.6k|        }
  667|   240k|    }
  668|   240k|}
ihevc_weighted_pred_bi_ssse3:
  750|  5.84M|{
  751|  5.84M|    WORD32 row, col, temp;
  752|       |
  753|  5.84M|    __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
  754|  5.84M|    __m128i const_temp_4x32b, lvl_shift1_4x32b, lvl_shift2_4x32b, wgt0_8x16b, wgt1_8x16b;
  755|  5.84M|    __m128i res_temp1_4x32b, res_temp2_4x32b, res_temp3_4x32b, res_temp4_4x32b;
  756|       |
  757|  5.84M|    ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  5.84M|#define ASSERT(x) {}
  ------------------
  758|  5.84M|    ASSERT(ht % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  5.84M|#define ASSERT(x) {}
  ------------------
  759|       |
  760|  5.84M|    temp = (off0 + off1 + 1) << (shift - 1);
  761|       |
  762|       |    // seting values in register
  763|  5.84M|    lvl_shift1_4x32b = _mm_set1_epi16(lvl_shift1);
  764|  5.84M|    wgt0_8x16b = _mm_set1_epi16(wgt0);
  765|  5.84M|    lvl_shift2_4x32b = _mm_set1_epi16(lvl_shift2);
  766|  5.84M|    wgt1_8x16b = _mm_set1_epi16(wgt1);
  767|       |
  768|       |    /* lvl_shift1 * wgt0 */
  769|  5.84M|    res_temp1_4x32b = _mm_mullo_epi16(lvl_shift1_4x32b, wgt0_8x16b);
  770|  5.84M|    res_temp2_4x32b = _mm_mulhi_epi16(lvl_shift1_4x32b, wgt0_8x16b);
  771|       |    /* lvl_shift2 * wgt1 */
  772|  5.84M|    res_temp3_4x32b = _mm_mullo_epi16(lvl_shift2_4x32b, wgt1_8x16b);
  773|  5.84M|    res_temp4_4x32b = _mm_mulhi_epi16(lvl_shift2_4x32b, wgt1_8x16b);
  774|       |
  775|  5.84M|    const_temp_4x32b = _mm_set1_epi32(temp);
  776|       |
  777|       |    /* lvl_shift1 * wgt0 */
  778|  5.84M|    lvl_shift1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, res_temp2_4x32b);
  779|       |    /* lvl_shift2 * wgt1 */
  780|  5.84M|    lvl_shift2_4x32b = _mm_unpacklo_epi16(res_temp3_4x32b, res_temp4_4x32b);
  781|       |
  782|  5.84M|    if(0 == (wd & 7)) /* wd multiple of 8 case */
  ------------------
  |  Branch (782:8): [True: 5.85M, False: 18.4E]
  ------------------
  783|  5.85M|    {
  784|  5.85M|        __m128i res_temp5_4x32b, res_temp6_4x32b, res_temp7_4x32b, res_temp8_4x32b;
  785|       |        /*  outer for loop starts from here */
  786|  29.6M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (786:22): [True: 23.8M, False: 5.85M]
  ------------------
  787|  23.8M|        {
  788|  49.8M|            for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (788:26): [True: 25.9M, False: 23.8M]
  ------------------
  789|  25.9M|            {
  790|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  791|  25.9M|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
  792|  25.9M|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
  793|  25.9M|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
  794|  25.9M|                src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
  795|       |
  796|       |                /*i4_tmp = (pi2_src[col]) * wgt*/ /* Lower 16 bit */
  797|  25.9M|                res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
  798|  25.9M|                res_temp2_4x32b  = _mm_mullo_epi16(src_temp2_8x16b, wgt1_8x16b);
  799|  25.9M|                res_temp3_4x32b  = _mm_mullo_epi16(src_temp3_8x16b, wgt0_8x16b);
  800|  25.9M|                res_temp4_4x32b  = _mm_mullo_epi16(src_temp4_8x16b, wgt1_8x16b);
  801|       |                /*i4_tmp = (pi2_src[col] ) * wgt*/ /* Higher 16 bit */
  802|  25.9M|                src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
  803|  25.9M|                src_temp2_8x16b  = _mm_mulhi_epi16(src_temp2_8x16b, wgt1_8x16b);
  804|  25.9M|                src_temp3_8x16b  = _mm_mulhi_epi16(src_temp3_8x16b, wgt0_8x16b);
  805|  25.9M|                src_temp4_8x16b  = _mm_mulhi_epi16(src_temp4_8x16b, wgt1_8x16b);
  806|       |
  807|       |                /* Get 32 bit Result */
  808|  25.9M|                res_temp5_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
  809|  25.9M|                res_temp6_4x32b = _mm_unpackhi_epi16(res_temp2_4x32b, src_temp2_8x16b);
  810|  25.9M|                res_temp7_4x32b = _mm_unpackhi_epi16(res_temp3_4x32b, src_temp3_8x16b);
  811|  25.9M|                res_temp8_4x32b = _mm_unpackhi_epi16(res_temp4_4x32b, src_temp4_8x16b);
  812|       |
  813|  25.9M|                res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
  814|  25.9M|                res_temp2_4x32b = _mm_unpacklo_epi16(res_temp2_4x32b, src_temp2_8x16b);
  815|  25.9M|                res_temp3_4x32b = _mm_unpacklo_epi16(res_temp3_4x32b, src_temp3_8x16b);
  816|  25.9M|                res_temp4_4x32b = _mm_unpacklo_epi16(res_temp4_4x32b, src_temp4_8x16b);
  817|       |
  818|       |                /* (pi2_src[col] + lvl_shift) * wgt */
  819|  25.9M|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, lvl_shift1_4x32b);
  820|  25.9M|                res_temp6_4x32b = _mm_add_epi32(res_temp6_4x32b, lvl_shift2_4x32b);
  821|  25.9M|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, lvl_shift1_4x32b);
  822|  25.9M|                res_temp8_4x32b = _mm_add_epi32(res_temp8_4x32b, lvl_shift2_4x32b);
  823|  25.9M|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift1_4x32b);
  824|  25.9M|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift2_4x32b);
  825|  25.9M|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift1_4x32b);
  826|  25.9M|                res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, lvl_shift2_4x32b);
  827|       |
  828|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
  829|  25.9M|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp2_4x32b);
  830|  25.9M|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, res_temp4_4x32b);
  831|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
  832|  25.9M|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, const_temp_4x32b);
  833|  25.9M|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, const_temp_4x32b);
  834|       |                /* (i4_tmp >> shift) */
  835|  25.9M|                res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
  836|  25.9M|                res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b,  shift);
  837|       |
  838|       |                /* Next 4 Pixels */
  839|  25.9M|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, res_temp6_4x32b);
  840|  25.9M|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, res_temp8_4x32b);
  841|  25.9M|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, const_temp_4x32b);
  842|  25.9M|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, const_temp_4x32b);
  843|  25.9M|                res_temp5_4x32b = _mm_srai_epi32(res_temp5_4x32b,  shift);
  844|  25.9M|                res_temp7_4x32b = _mm_srai_epi32(res_temp7_4x32b,  shift);
  845|       |
  846|  25.9M|                res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp5_4x32b);
  847|  25.9M|                res_temp3_4x32b = _mm_packs_epi32(res_temp3_4x32b, res_temp7_4x32b);
  848|       |
  849|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
  850|  25.9M|                res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp1_4x32b);
  851|  25.9M|                res_temp3_4x32b = _mm_packus_epi16(res_temp3_4x32b, res_temp3_4x32b);
  852|       |
  853|       |                /* store four 8-bit output values  */
  854|  25.9M|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), res_temp1_4x32b); /* row = 0*/
  855|  25.9M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), res_temp3_4x32b); /* row = 1*/
  856|       |
  857|  25.9M|                pi2_src1 += 8;  /* Pointer update */
  858|  25.9M|                pi2_src2 += 8;  /* Pointer update */
  859|  25.9M|                pu1_dst  += 8;  /* Pointer update */
  860|       |
  861|  25.9M|            } /* inner loop ends here(4-output values in single iteration) */
  862|       |
  863|  23.8M|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1;  /* Pointer update */
  864|  23.8M|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2;  /* Pointer update */
  865|  23.8M|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;   /* Pointer update */
  866|       |
  867|  23.8M|        } /* outer loop ends */
  868|  5.85M|    }
  869|  18.4E|    else /* wd multiple of 4 case */
  870|  18.4E|    {
  871|  18.4E|        WORD32 dst0, dst1;
  872|       |        /*  outer for loop starts from here */
  873|  18.4E|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (873:22): [True: 71.1k, False: 18.4E]
  ------------------
  874|  71.1k|        {
  875|   213k|            for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (875:26): [True: 142k, False: 71.1k]
  ------------------
  876|   142k|            {
  877|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
  878|   142k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1)); /* row = 0 */
  879|   142k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2)); /* row = 0 */
  880|   142k|                src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
  881|   142k|                src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
  882|       |
  883|       |                /* 2 rows together */
  884|   142k|                src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
  885|   142k|                src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
  886|       |
  887|       |                /*i4_tmp = (pi2_src[col]) * wgt*/ /* Lower 16 bit */
  888|   142k|                res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
  889|   142k|                res_temp2_4x32b  = _mm_mullo_epi16(src_temp2_8x16b, wgt1_8x16b);
  890|       |                /*i4_tmp = (pi2_src[col] ) * wgt*/ /* Higher 16 bit */
  891|   142k|                src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
  892|   142k|                src_temp2_8x16b  = _mm_mulhi_epi16(src_temp2_8x16b, wgt1_8x16b);
  893|       |
  894|       |                /* Get 32 bit Result */
  895|   142k|                res_temp3_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
  896|   142k|                res_temp4_4x32b = _mm_unpackhi_epi16(res_temp2_4x32b, src_temp2_8x16b);
  897|       |
  898|   142k|                res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
  899|   142k|                res_temp2_4x32b = _mm_unpacklo_epi16(res_temp2_4x32b, src_temp2_8x16b);
  900|       |
  901|       |                /* (pi2_src[col] + lvl_shift) * wgt */
  902|   142k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift1_4x32b);
  903|   142k|                res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, lvl_shift2_4x32b);
  904|   142k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift1_4x32b);
  905|   142k|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift2_4x32b);
  906|       |
  907|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
  908|   142k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp2_4x32b);
  909|   142k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, res_temp4_4x32b);
  910|       |
  911|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
  912|   142k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, const_temp_4x32b);
  913|   142k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, const_temp_4x32b);
  914|       |
  915|       |                /* (i4_tmp >> shift) */
  916|   142k|                res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
  917|   142k|                res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b,  shift);
  918|       |
  919|   142k|                res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp3_4x32b);
  920|       |
  921|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
  922|   142k|                res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp1_4x32b);
  923|       |
  924|   142k|                dst0 = _mm_cvtsi128_si32(res_temp1_4x32b);
  925|       |
  926|       |                /* dst row = 1 to 3 */
  927|   142k|                res_temp2_4x32b = _mm_shuffle_epi32(res_temp1_4x32b, 1);
  928|       |
  929|       |                /* store four 8-bit output values  */
  930|   142k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
  931|       |
  932|   142k|                dst1 = _mm_cvtsi128_si32(res_temp2_4x32b);
  933|       |
  934|       |                /* row = 1 */
  935|   142k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
  936|       |
  937|   142k|                pi2_src1 += 4;  /* Pointer update */
  938|   142k|                pi2_src2 += 4;  /* Pointer update */
  939|   142k|                pu1_dst  += 4;  /* Pointer update */
  940|       |
  941|   142k|            } /* inner loop ends here(4-output values in single iteration) */
  942|       |
  943|  71.1k|            pi2_src1 = pi2_src1 - wd + 2 * src_strd1;  /* Pointer update */
  944|  71.1k|            pi2_src2 = pi2_src2 - wd + 2 * src_strd2;  /* Pointer update */
  945|  71.1k|            pu1_dst  = pu1_dst  - wd + 2 * dst_strd;   /* Pointer update */
  946|       |
  947|  71.1k|        } /* outer loop ends */
  948|  18.4E|    }
  949|       |
  950|  5.84M|}
ihevc_weighted_pred_chroma_bi_ssse3:
 1036|  5.79M|{
 1037|  5.79M|    WORD32 row, col, temp1, temp2;
 1038|  5.79M|    WORD32 wdx2;
 1039|       |
 1040|  5.79M|    __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1041|  5.79M|    __m128i const_temp_4x32b, lvl_shift1_4x32b, lvl_shift2_4x32b, wgt0_8x16b, wgt1_8x16b;
 1042|  5.79M|    __m128i res_temp1_4x32b, res_temp2_4x32b, res_temp3_4x32b, res_temp4_4x32b;
 1043|       |
 1044|  5.79M|    ASSERT(wd % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  5.79M|#define ASSERT(x) {}
  ------------------
 1045|  5.79M|    ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  5.79M|#define ASSERT(x) {}
  ------------------
 1046|       |
 1047|  5.79M|    temp1 = (off0_cb + off1_cb + 1) << (shift - 1);
 1048|  5.79M|    temp2 = (off0_cr + off1_cr + 1) << (shift - 1);
 1049|       |
 1050|       |    // seting values in register
 1051|  5.79M|    lvl_shift1_4x32b = _mm_set1_epi16(lvl_shift1);
 1052|  5.79M|    wgt0_8x16b = _mm_set_epi16(wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb, wgt0_cr, wgt0_cb);
 1053|  5.79M|    lvl_shift2_4x32b = _mm_set1_epi16(lvl_shift2);
 1054|  5.79M|    wgt1_8x16b = _mm_set_epi16(wgt1_cr, wgt1_cb, wgt1_cr, wgt1_cb, wgt1_cr, wgt1_cb, wgt1_cr, wgt1_cb);
 1055|       |
 1056|       |    /* lvl_shift1 * wgt0 */
 1057|  5.79M|    res_temp1_4x32b = _mm_mullo_epi16(lvl_shift1_4x32b, wgt0_8x16b);
 1058|  5.79M|    res_temp2_4x32b = _mm_mulhi_epi16(lvl_shift1_4x32b, wgt0_8x16b);
 1059|       |    /* lvl_shift2 * wgt1 */
 1060|  5.79M|    res_temp3_4x32b = _mm_mullo_epi16(lvl_shift2_4x32b, wgt1_8x16b);
 1061|  5.79M|    res_temp4_4x32b = _mm_mulhi_epi16(lvl_shift2_4x32b, wgt1_8x16b);
 1062|       |
 1063|  5.79M|    const_temp_4x32b = _mm_set_epi32(temp2, temp1, temp2, temp1);
 1064|  5.79M|    wdx2 = wd * 2;
 1065|       |
 1066|       |    /* lvl_shift1 * wgt0 */
 1067|  5.79M|    lvl_shift1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, res_temp2_4x32b);
 1068|       |    /* lvl_shift2 * wgt1 */
 1069|  5.79M|    lvl_shift2_4x32b = _mm_unpacklo_epi16(res_temp3_4x32b, res_temp4_4x32b);
 1070|       |
 1071|  5.79M|    if(0 == (wdx2 & 7)) /* wdx2 multiple of 8 case */
  ------------------
  |  Branch (1071:8): [True: 5.80M, False: 18.4E]
  ------------------
 1072|  5.80M|    {
 1073|  5.80M|        __m128i res_temp5_4x32b, res_temp6_4x32b, res_temp7_4x32b, res_temp8_4x32b;
 1074|       |        /*  outer for loop starts from here */
 1075|  17.6M|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1075:22): [True: 11.8M, False: 5.80M]
  ------------------
 1076|  11.8M|        {
 1077|  24.7M|            for(col = 0; col < wdx2; col += 8)
  ------------------
  |  Branch (1077:26): [True: 12.9M, False: 11.8M]
  ------------------
 1078|  12.9M|            {
 1079|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1080|  12.9M|                src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1)); /* row = 0 */
 1081|  12.9M|                src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2)); /* row = 0 */
 1082|  12.9M|                src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1083|  12.9M|                src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1084|       |
 1085|       |                /*i4_tmp = (pi2_src[col]) * wgt*/ /* Lower 16 bit */
 1086|  12.9M|                res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
 1087|  12.9M|                res_temp2_4x32b  = _mm_mullo_epi16(src_temp2_8x16b, wgt1_8x16b);
 1088|  12.9M|                res_temp3_4x32b  = _mm_mullo_epi16(src_temp3_8x16b, wgt0_8x16b);
 1089|  12.9M|                res_temp4_4x32b  = _mm_mullo_epi16(src_temp4_8x16b, wgt1_8x16b);
 1090|       |                /*i4_tmp = (pi2_src[col] ) * wgt*/ /* Higher 16 bit */
 1091|  12.9M|                src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
 1092|  12.9M|                src_temp2_8x16b  = _mm_mulhi_epi16(src_temp2_8x16b, wgt1_8x16b);
 1093|  12.9M|                src_temp3_8x16b  = _mm_mulhi_epi16(src_temp3_8x16b, wgt0_8x16b);
 1094|  12.9M|                src_temp4_8x16b  = _mm_mulhi_epi16(src_temp4_8x16b, wgt1_8x16b);
 1095|       |
 1096|       |                /* Get 32 bit Result */
 1097|  12.9M|                res_temp5_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
 1098|  12.9M|                res_temp6_4x32b = _mm_unpackhi_epi16(res_temp2_4x32b, src_temp2_8x16b);
 1099|  12.9M|                res_temp7_4x32b = _mm_unpackhi_epi16(res_temp3_4x32b, src_temp3_8x16b);
 1100|  12.9M|                res_temp8_4x32b = _mm_unpackhi_epi16(res_temp4_4x32b, src_temp4_8x16b);
 1101|       |
 1102|  12.9M|                res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
 1103|  12.9M|                res_temp2_4x32b = _mm_unpacklo_epi16(res_temp2_4x32b, src_temp2_8x16b);
 1104|  12.9M|                res_temp3_4x32b = _mm_unpacklo_epi16(res_temp3_4x32b, src_temp3_8x16b);
 1105|  12.9M|                res_temp4_4x32b = _mm_unpacklo_epi16(res_temp4_4x32b, src_temp4_8x16b);
 1106|       |
 1107|       |                /* (pi2_src[col] + lvl_shift) * wgt */
 1108|  12.9M|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, lvl_shift1_4x32b);
 1109|  12.9M|                res_temp6_4x32b = _mm_add_epi32(res_temp6_4x32b, lvl_shift2_4x32b);
 1110|  12.9M|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, lvl_shift1_4x32b);
 1111|  12.9M|                res_temp8_4x32b = _mm_add_epi32(res_temp8_4x32b, lvl_shift2_4x32b);
 1112|  12.9M|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift1_4x32b);
 1113|  12.9M|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift2_4x32b);
 1114|  12.9M|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift1_4x32b);
 1115|  12.9M|                res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, lvl_shift2_4x32b);
 1116|       |
 1117|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
 1118|  12.9M|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp2_4x32b);
 1119|  12.9M|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, res_temp4_4x32b);
 1120|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1121|  12.9M|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, const_temp_4x32b);
 1122|  12.9M|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, const_temp_4x32b);
 1123|       |                /* (i4_tmp >> shift) */
 1124|  12.9M|                res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
 1125|  12.9M|                res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b,  shift);
 1126|       |
 1127|       |                /* Next 4 Pixels */
 1128|  12.9M|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, res_temp6_4x32b);
 1129|  12.9M|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, res_temp8_4x32b);
 1130|  12.9M|                res_temp5_4x32b = _mm_add_epi32(res_temp5_4x32b, const_temp_4x32b);
 1131|  12.9M|                res_temp7_4x32b = _mm_add_epi32(res_temp7_4x32b, const_temp_4x32b);
 1132|  12.9M|                res_temp5_4x32b = _mm_srai_epi32(res_temp5_4x32b,  shift);
 1133|  12.9M|                res_temp7_4x32b = _mm_srai_epi32(res_temp7_4x32b,  shift);
 1134|       |
 1135|  12.9M|                res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp5_4x32b);
 1136|  12.9M|                res_temp3_4x32b = _mm_packs_epi32(res_temp3_4x32b, res_temp7_4x32b);
 1137|       |
 1138|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1139|  12.9M|                res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp1_4x32b);
 1140|  12.9M|                res_temp3_4x32b = _mm_packus_epi16(res_temp3_4x32b, res_temp3_4x32b);
 1141|       |
 1142|       |                /* store four 8-bit output values  */
 1143|  12.9M|                _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), res_temp1_4x32b); /* row = 0*/
 1144|  12.9M|                _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), res_temp3_4x32b); /* row = 1*/
 1145|       |
 1146|  12.9M|                pi2_src1 += 8;  /* Pointer update */
 1147|  12.9M|                pi2_src2 += 8;  /* Pointer update */
 1148|  12.9M|                pu1_dst  += 8;  /* Pointer update */
 1149|       |
 1150|  12.9M|            } /* inner loop ends here(4-output values in single iteration) */
 1151|       |
 1152|  11.8M|            pi2_src1 = pi2_src1 - wdx2 + 2 * src_strd1;    /* Pointer update */
 1153|  11.8M|            pi2_src2 = pi2_src2 - wdx2 + 2 * src_strd2;    /* Pointer update */
 1154|  11.8M|            pu1_dst  = pu1_dst  - wdx2 + 2 * dst_strd;   /* Pointer update */
 1155|       |
 1156|  11.8M|        } /* outer loop ends */
 1157|  5.80M|    }
 1158|  18.4E|    else /* wdx2 multiple of 4 case */
 1159|  18.4E|    {
 1160|  18.4E|        WORD32 dst0, dst1;
 1161|       |        /*  outer for loop starts from here */
 1162|  18.4E|        for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1162:22): [True: 35.4k, False: 18.4E]
  ------------------
 1163|  35.4k|        {
 1164|   106k|            for(col = 0; col < wdx2; col += 4)
  ------------------
  |  Branch (1164:26): [True: 71.0k, False: 35.4k]
  ------------------
 1165|  71.0k|            {
 1166|       |                /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1167|  71.0k|                src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1)); /* row = 0 */
 1168|  71.0k|                src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2)); /* row = 0 */
 1169|  71.0k|                src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 1 * src_strd1)); /* row = 1 */
 1170|  71.0k|                src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 1 * src_strd2)); /* row = 1 */
 1171|       |
 1172|       |                /* 2 rows together */
 1173|  71.0k|                src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 1174|  71.0k|                src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 1175|       |
 1176|       |                /*i4_tmp = (pi2_src[col]) * wgt*/ /* Lower 16 bit */
 1177|  71.0k|                res_temp1_4x32b  = _mm_mullo_epi16(src_temp1_8x16b, wgt0_8x16b);
 1178|  71.0k|                res_temp2_4x32b  = _mm_mullo_epi16(src_temp2_8x16b, wgt1_8x16b);
 1179|       |                /*i4_tmp = (pi2_src[col] ) * wgt*/ /* Higher 16 bit */
 1180|  71.0k|                src_temp1_8x16b  = _mm_mulhi_epi16(src_temp1_8x16b, wgt0_8x16b);
 1181|  71.0k|                src_temp2_8x16b  = _mm_mulhi_epi16(src_temp2_8x16b, wgt1_8x16b);
 1182|       |
 1183|       |                /* Get 32 bit Result */
 1184|  71.0k|                res_temp3_4x32b = _mm_unpackhi_epi16(res_temp1_4x32b, src_temp1_8x16b);
 1185|  71.0k|                res_temp4_4x32b = _mm_unpackhi_epi16(res_temp2_4x32b, src_temp2_8x16b);
 1186|       |
 1187|  71.0k|                res_temp1_4x32b = _mm_unpacklo_epi16(res_temp1_4x32b, src_temp1_8x16b);
 1188|  71.0k|                res_temp2_4x32b = _mm_unpacklo_epi16(res_temp2_4x32b, src_temp2_8x16b);
 1189|       |
 1190|       |                /* (pi2_src[col] + lvl_shift) * wgt */
 1191|  71.0k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, lvl_shift1_4x32b);
 1192|  71.0k|                res_temp4_4x32b = _mm_add_epi32(res_temp4_4x32b, lvl_shift2_4x32b);
 1193|  71.0k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, lvl_shift1_4x32b);
 1194|  71.0k|                res_temp2_4x32b = _mm_add_epi32(res_temp2_4x32b, lvl_shift2_4x32b);
 1195|       |
 1196|       |                /* (pi2_src1[col] + lvl_shift1) * wgt0 + (pi2_src2[col] + lvl_shift2) * wgt1 */
 1197|  71.0k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, res_temp2_4x32b);
 1198|  71.0k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, res_temp4_4x32b);
 1199|       |
 1200|       |                /* i4_tmp += (off0 + off1 + 1) << (shift - 1); */
 1201|  71.0k|                res_temp1_4x32b = _mm_add_epi32(res_temp1_4x32b, const_temp_4x32b);
 1202|  71.0k|                res_temp3_4x32b = _mm_add_epi32(res_temp3_4x32b, const_temp_4x32b);
 1203|       |
 1204|       |                /* (i4_tmp >> shift) */
 1205|  71.0k|                res_temp1_4x32b = _mm_srai_epi32(res_temp1_4x32b,  shift);
 1206|  71.0k|                res_temp3_4x32b = _mm_srai_epi32(res_temp3_4x32b,  shift);
 1207|       |
 1208|  71.0k|                res_temp1_4x32b = _mm_packs_epi32(res_temp1_4x32b, res_temp3_4x32b);
 1209|       |
 1210|       |                /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1211|  71.0k|                res_temp1_4x32b = _mm_packus_epi16(res_temp1_4x32b, res_temp1_4x32b);
 1212|       |
 1213|  71.0k|                dst0 = _mm_cvtsi128_si32(res_temp1_4x32b);
 1214|       |
 1215|       |                /* dst row = 1 to 3 */
 1216|  71.0k|                res_temp2_4x32b = _mm_shuffle_epi32(res_temp1_4x32b, 1);
 1217|       |
 1218|       |                /* store four 8-bit output values  */
 1219|  71.0k|                *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1220|       |
 1221|  71.0k|                dst1 = _mm_cvtsi128_si32(res_temp2_4x32b);
 1222|       |
 1223|       |                /* row = 1 */
 1224|  71.0k|                *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1225|       |
 1226|  71.0k|                pi2_src1 += 4;  /* Pointer update */
 1227|  71.0k|                pi2_src2 += 4;  /* Pointer update */
 1228|  71.0k|                pu1_dst  += 4;  /* Pointer update */
 1229|       |
 1230|  71.0k|            } /* inner loop ends here(4-output values in single iteration) */
 1231|       |
 1232|  35.4k|            pi2_src1 = pi2_src1 - wdx2 + 2 * src_strd1;    /* Pointer update */
 1233|  35.4k|            pi2_src2 = pi2_src2 - wdx2 + 2 * src_strd2;    /* Pointer update */
 1234|  35.4k|            pu1_dst  = pu1_dst  - wdx2 + 2 * dst_strd;   /* Pointer update */
 1235|  35.4k|        }
 1236|  18.4E|    }
 1237|       |
 1238|  5.79M|}
ihevc_weighted_pred_bi_default_ssse3:
 1302|  41.8M|{
 1303|  41.8M|    {
 1304|  41.8M|        WORD32 row, col, temp;
 1305|  41.8M|        WORD32 shift;
 1306|       |
 1307|  41.8M|        __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1308|  41.8M|        __m128i const_temp_8x16b, lvl_shift1_8x16b, lvl_shift2_8x16b;
 1309|  41.8M|        __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1310|       |
 1311|  41.8M|        ASSERT(wd % 4 == 0); /* checking assumption*/
  ------------------
  |  |   55|  41.8M|#define ASSERT(x) {}
  ------------------
 1312|  41.8M|        ASSERT(ht % 2 == 0); /* checking assumption*/
  ------------------
  |  |   55|  41.8M|#define ASSERT(x) {}
  ------------------
 1313|       |
 1314|  41.8M|        shift = SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|  41.8M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  272|  41.8M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1315|  41.8M|        temp = 1 << (shift - 1);
 1316|       |
 1317|       |        // seting values in register
 1318|  41.8M|        lvl_shift1_8x16b = _mm_set1_epi16(lvl_shift1);
 1319|  41.8M|        lvl_shift2_8x16b = _mm_set1_epi16(lvl_shift2);
 1320|  41.8M|        const_temp_8x16b = _mm_set1_epi16(temp);
 1321|       |
 1322|  41.8M|        lvl_shift1_8x16b = _mm_adds_epi16(lvl_shift1_8x16b, lvl_shift2_8x16b);
 1323|  41.8M|        lvl_shift1_8x16b = _mm_adds_epi16(lvl_shift1_8x16b, const_temp_8x16b);
 1324|       |
 1325|  41.8M|        if(0 == (ht & 3)) /* ht multiple of 4*/
  ------------------
  |  Branch (1325:12): [True: 41.8M, False: 18.4E]
  ------------------
 1326|  41.8M|        {
 1327|  41.8M|            if(0 == (wd & 15)) /* wd multiple of 16 case */
  ------------------
  |  Branch (1327:16): [True: 306k, False: 41.5M]
  ------------------
 1328|   306k|            {
 1329|   306k|                __m128i src_temp9_8x16b,  src_temp10_8x16b, src_temp11_8x16b, src_temp12_8x16b;
 1330|   306k|                __m128i src_temp13_8x16b, src_temp14_8x16b, src_temp15_8x16b, src_temp16_8x16b;
 1331|       |                /*  outer for loop starts from here */
 1332|  1.93M|                for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1332:30): [True: 1.63M, False: 306k]
  ------------------
 1333|  1.63M|                {
 1334|  5.20M|                    for(col = 0; col < wd; col += 16)
  ------------------
  |  Branch (1334:34): [True: 3.57M, False: 1.63M]
  ------------------
 1335|  3.57M|                    {
 1336|       |                        /*load 8 pixel values */ /* First 8 Values */
 1337|  3.57M|                        src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1));
 1338|  3.57M|                        src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2));
 1339|       |                        /* row = 1 */
 1340|  3.57M|                        src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1));
 1341|  3.57M|                        src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2));
 1342|       |                        /* row = 2 */
 1343|  3.57M|                        src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1));
 1344|  3.57M|                        src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2));
 1345|       |                        /* row = 3 */
 1346|  3.57M|                        src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1));
 1347|  3.57M|                        src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2));
 1348|       |
 1349|       |                        /*load 8 pixel values */ /* Second 8 Values */
 1350|  3.57M|                        src_temp9_8x16b  = _mm_loadu_si128((__m128i *)(pi2_src1 + 8));
 1351|  3.57M|                        src_temp10_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 8));
 1352|       |                        /* row = 1 */
 1353|  3.57M|                        src_temp11_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1 + 8));
 1354|  3.57M|                        src_temp12_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2 + 8));
 1355|       |                        /* row = 2 */
 1356|  3.57M|                        src_temp13_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1 + 8));
 1357|  3.57M|                        src_temp14_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2 + 8));
 1358|       |
 1359|       |                        /* (pi2_src1[col] + pi2_src2[col]) */ /* First 8 Values */
 1360|  3.57M|                        src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1361|  3.57M|                        src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1362|  3.57M|                        src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1363|  3.57M|                        src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, src_temp8_8x16b);
 1364|       |
 1365|       |                        /*load 8 pixel values */ /* Second 8 Values */
 1366|       |                        /* row = 3 */
 1367|  3.57M|                        src_temp15_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1 + 8));
 1368|  3.57M|                        src_temp16_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2 + 8));
 1369|       |
 1370|       |                        /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */ /* First 8 Values */
 1371|  3.57M|                        src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1372|  3.57M|                        src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, lvl_shift1_8x16b);
 1373|  3.57M|                        src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1374|  3.57M|                        src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, lvl_shift1_8x16b);
 1375|       |
 1376|       |                        /* (pi2_src1[col] + pi2_src2[col]) */ /* Second 8 Values */
 1377|  3.57M|                        src_temp9_8x16b  = _mm_adds_epi16(src_temp9_8x16b,  src_temp10_8x16b);
 1378|  3.57M|                        src_temp11_8x16b = _mm_adds_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1379|  3.57M|                        src_temp13_8x16b = _mm_adds_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1380|  3.57M|                        src_temp15_8x16b = _mm_adds_epi16(src_temp15_8x16b, src_temp16_8x16b);
 1381|       |
 1382|       |                        /* (i4_tmp >> shift) */ /* First 8 Values */
 1383|  3.57M|                        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1384|  3.57M|                        src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  shift);
 1385|  3.57M|                        src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1386|  3.57M|                        src_temp7_8x16b = _mm_srai_epi16(src_temp7_8x16b,  shift);
 1387|       |
 1388|       |                        /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */ /* Second 8 Values */
 1389|  3.57M|                        src_temp9_8x16b  = _mm_adds_epi16(src_temp9_8x16b, lvl_shift1_8x16b);
 1390|  3.57M|                        src_temp11_8x16b = _mm_adds_epi16(src_temp11_8x16b, lvl_shift1_8x16b);
 1391|  3.57M|                        src_temp13_8x16b = _mm_adds_epi16(src_temp13_8x16b, lvl_shift1_8x16b);
 1392|  3.57M|                        src_temp15_8x16b = _mm_adds_epi16(src_temp15_8x16b, lvl_shift1_8x16b);
 1393|       |
 1394|       |                        /* (i4_tmp >> shift) */ /* Second 8 Values */
 1395|  3.57M|                        src_temp9_8x16b  = _mm_srai_epi16(src_temp9_8x16b,  shift);
 1396|  3.57M|                        src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  shift);
 1397|  3.57M|                        src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  shift);
 1398|  3.57M|                        src_temp15_8x16b = _mm_srai_epi16(src_temp15_8x16b,  shift);
 1399|       |
 1400|       |                        /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */ /* 16 8 Values */
 1401|  3.57M|                        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp9_8x16b);
 1402|  3.57M|                        src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, src_temp11_8x16b);
 1403|  3.57M|                        src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp13_8x16b);
 1404|  3.57M|                        src_temp7_8x16b = _mm_packus_epi16(src_temp7_8x16b, src_temp15_8x16b);
 1405|       |
 1406|       |                        /* store four 8-bit output values  */ /* 16 8 Values */
 1407|  3.57M|                        _mm_storeu_si128((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_8x16b); /* row = 0*/
 1408|  3.57M|                        _mm_storeu_si128((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_8x16b); /* row = 2*/
 1409|  3.57M|                        _mm_storeu_si128((__m128i *)(pu1_dst + 2 * dst_strd), src_temp5_8x16b); /* row = 1*/
 1410|  3.57M|                        _mm_storeu_si128((__m128i *)(pu1_dst + 3 * dst_strd), src_temp7_8x16b); /* row = 3*/
 1411|       |
 1412|       |                        /* To update pointer */
 1413|  3.57M|                        pi2_src1 += 16;
 1414|  3.57M|                        pi2_src2 += 16;
 1415|  3.57M|                        pu1_dst  += 16;
 1416|       |
 1417|  3.57M|                    } /* inner loop ends here(8-output values in single iteration) */
 1418|       |
 1419|  1.63M|                    pi2_src1 = pi2_src1 - wd + 4 * src_strd1;  /* Pointer update */
 1420|  1.63M|                    pi2_src2 = pi2_src2 - wd + 4 * src_strd2;  /* Pointer update */
 1421|  1.63M|                    pu1_dst  = pu1_dst - wd + 4 * dst_strd;   /* Pointer update */
 1422|       |
 1423|  1.63M|                }
 1424|   306k|            }
 1425|  41.5M|            else if(0 == (wd & 7)) /* multiple of 8 case */
  ------------------
  |  Branch (1425:21): [True: 41.4M, False: 49.9k]
  ------------------
 1426|  41.4M|            {
 1427|       |                /*  outer for loop starts from here */
 1428|   105M|                for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1428:30): [True: 64.0M, False: 41.4M]
  ------------------
 1429|  64.0M|                {
 1430|   128M|                    for(col = 0; col < wd; col += 8)
  ------------------
  |  Branch (1430:34): [True: 64.2M, False: 64.0M]
  ------------------
 1431|  64.2M|                    {
 1432|       |                        /*load 8 pixel values */
 1433|  64.2M|                        src_temp1_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1));
 1434|  64.2M|                        src_temp2_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2));
 1435|       |                        /* row = 1 */
 1436|  64.2M|                        src_temp3_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + src_strd1));
 1437|  64.2M|                        src_temp4_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + src_strd2));
 1438|       |                        /* row = 2 */
 1439|  64.2M|                        src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 2 * src_strd1));
 1440|  64.2M|                        src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 2 * src_strd2));
 1441|       |                        /* row = 3 */
 1442|  64.2M|                        src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pi2_src1 + 3 * src_strd1));
 1443|  64.2M|                        src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pi2_src2 + 3 * src_strd2));
 1444|       |
 1445|       |                        /* (pi2_src1[col] + pi2_src2[col]) */
 1446|  64.2M|                        src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1447|  64.2M|                        src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1448|  64.2M|                        src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1449|  64.2M|                        src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, src_temp8_8x16b);
 1450|       |
 1451|       |                        /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */
 1452|  64.2M|                        src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1453|  64.2M|                        src_temp3_8x16b = _mm_adds_epi16(src_temp3_8x16b, lvl_shift1_8x16b);
 1454|  64.2M|                        src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1455|  64.2M|                        src_temp7_8x16b = _mm_adds_epi16(src_temp7_8x16b, lvl_shift1_8x16b);
 1456|       |
 1457|       |                        /* (i4_tmp >> shift) */
 1458|  64.2M|                        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1459|  64.2M|                        src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  shift);
 1460|  64.2M|                        src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1461|  64.2M|                        src_temp7_8x16b = _mm_srai_epi16(src_temp7_8x16b,  shift);
 1462|       |
 1463|       |                        /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1464|  64.2M|                        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 1465|  64.2M|                        src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, src_temp3_8x16b);
 1466|  64.2M|                        src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp5_8x16b);
 1467|  64.2M|                        src_temp7_8x16b = _mm_packus_epi16(src_temp7_8x16b, src_temp7_8x16b);
 1468|       |
 1469|       |                        /* store four 8-bit output values  */
 1470|  64.2M|                        _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), src_temp1_8x16b); /* row = 0*/
 1471|  64.2M|                        _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), src_temp3_8x16b); /* row = 2*/
 1472|  64.2M|                        _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), src_temp5_8x16b); /* row = 1*/
 1473|  64.2M|                        _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), src_temp7_8x16b); /* row = 3*/
 1474|       |
 1475|       |                        /* To update pointer */
 1476|  64.2M|                        pi2_src1 += 8;
 1477|  64.2M|                        pi2_src2 += 8;
 1478|  64.2M|                        pu1_dst  += 8;
 1479|       |
 1480|  64.2M|                    } /* inner loop ends here(8-output values in single iteration) */
 1481|       |
 1482|  64.0M|                    pi2_src1 = pi2_src1 - wd + 4 * src_strd1;  /* Pointer update */
 1483|  64.0M|                    pi2_src2 = pi2_src2 - wd + 4 * src_strd2;  /* Pointer update */
 1484|  64.0M|                    pu1_dst  = pu1_dst - wd + 4 * dst_strd;   /* Pointer update */
 1485|       |
 1486|  64.0M|                }
 1487|  41.4M|            }
 1488|  49.9k|            else /* wd multiple of 4 case*/
 1489|  49.9k|            {
 1490|  49.9k|                WORD32 dst0, dst1, dst2, dst3;
 1491|       |
 1492|       |                /*  outer for loop starts from here */
 1493|   118k|                for(row = 0; row < ht; row += 4)
  ------------------
  |  Branch (1493:30): [True: 68.1k, False: 49.9k]
  ------------------
 1494|  68.1k|                {
 1495|   206k|                    for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1495:34): [True: 138k, False: 68.1k]
  ------------------
 1496|   138k|                    {
 1497|       |                        /*load 4 pixel values from 7:0 pos. relative to cur. pos.*/
 1498|   138k|                        src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1));
 1499|       |                        /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1500|   138k|                        src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2));
 1501|       |
 1502|       |                        /* row = 1 */
 1503|   138k|                        src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + src_strd1));
 1504|   138k|                        src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + src_strd2));
 1505|       |                        /* row = 2 */
 1506|   138k|                        src_temp5_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 2 * src_strd1));
 1507|   138k|                        src_temp6_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 2 * src_strd2));
 1508|       |                        /* row = 3 */
 1509|   138k|                        src_temp7_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + 3 * src_strd1));
 1510|   138k|                        src_temp8_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + 3 * src_strd2));
 1511|       |
 1512|       |                        /* Pack two rows together */
 1513|   138k|                        src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 1514|   138k|                        src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 1515|   138k|                        src_temp5_8x16b = _mm_unpacklo_epi64(src_temp5_8x16b, src_temp7_8x16b);
 1516|   138k|                        src_temp6_8x16b = _mm_unpacklo_epi64(src_temp6_8x16b, src_temp8_8x16b);
 1517|       |
 1518|       |                        /* (pi2_src1[col] + pi2_src2[col]) */
 1519|   138k|                        src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1520|   138k|                        src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, src_temp6_8x16b);
 1521|       |
 1522|       |                        /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */
 1523|   138k|                        src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1524|   138k|                        src_temp5_8x16b = _mm_adds_epi16(src_temp5_8x16b, lvl_shift1_8x16b);
 1525|       |
 1526|       |                        /* (i4_tmp >> shift) */
 1527|   138k|                        src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1528|   138k|                        src_temp5_8x16b = _mm_srai_epi16(src_temp5_8x16b,  shift);
 1529|       |
 1530|       |                        /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1531|   138k|                        src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 1532|   138k|                        src_temp5_8x16b = _mm_packus_epi16(src_temp5_8x16b, src_temp5_8x16b);
 1533|       |
 1534|   138k|                        dst0 = _mm_cvtsi128_si32(src_temp1_8x16b);
 1535|       |                        /* dst row = 1 to 3 */
 1536|   138k|                        src_temp2_8x16b = _mm_shuffle_epi32(src_temp1_8x16b, 1);
 1537|   138k|                        src_temp4_8x16b = _mm_shuffle_epi32(src_temp5_8x16b, 1);
 1538|       |
 1539|       |                        /* store four 8-bit output values  */
 1540|   138k|                        *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1541|       |
 1542|   138k|                        dst1 = _mm_cvtsi128_si32(src_temp2_8x16b);
 1543|   138k|                        dst2 = _mm_cvtsi128_si32(src_temp5_8x16b);
 1544|   138k|                        dst3 = _mm_cvtsi128_si32(src_temp4_8x16b);
 1545|       |
 1546|       |                        /* row = 1 to row = 3 */
 1547|   138k|                        *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1548|   138k|                        *(WORD32 *)(&pu1_dst[2 * dst_strd]) = dst2;
 1549|   138k|                        *(WORD32 *)(&pu1_dst[3 * dst_strd]) = dst3;
 1550|       |
 1551|       |                        /* To update pointer */
 1552|   138k|                        pi2_src1 += 4;
 1553|   138k|                        pi2_src2 += 4;
 1554|   138k|                        pu1_dst  += 4;
 1555|       |
 1556|   138k|                    } /* inner loop ends here(4-output values in single iteration) */
 1557|       |
 1558|  68.1k|                    pi2_src1 = pi2_src1 - wd + 4 * src_strd1; /* Pointer update */
 1559|  68.1k|                    pi2_src2 = pi2_src2 - wd + 4 * src_strd2; /* Pointer update */
 1560|  68.1k|                    pu1_dst  = pu1_dst  - wd + 4 * dst_strd;  /* Pointer update */
 1561|       |
 1562|  68.1k|                }
 1563|  49.9k|            }
 1564|  41.8M|        }
 1565|  18.4E|        else /* ht multiple of 2 case and wd multiple of 4 case*/
 1566|  18.4E|        {
 1567|       |
 1568|  18.4E|            WORD32 dst0, dst1;
 1569|       |
 1570|       |            /*  outer for loop starts from here */
 1571|  18.4E|            for(row = 0; row < ht; row += 2)
  ------------------
  |  Branch (1571:26): [True: 14.0k, False: 18.4E]
  ------------------
 1572|  14.0k|            {
 1573|  70.2k|                for(col = 0; col < wd; col += 4)
  ------------------
  |  Branch (1573:30): [True: 56.2k, False: 14.0k]
  ------------------
 1574|  56.2k|                {
 1575|       |                    /*load 4 pixel values from 7:0 pos. relative to cur. pos.*/
 1576|  56.2k|                    src_temp1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1));
 1577|       |                    /*load 8 pixel values from 7:0 pos. relative to cur. pos.*/
 1578|  56.2k|                    src_temp2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2));
 1579|       |
 1580|       |                    /* row = 1 */
 1581|  56.2k|                    src_temp3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src1 + src_strd1));
 1582|  56.2k|                    src_temp4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_src2 + src_strd2));
 1583|       |
 1584|       |                    /* Pack two rows together */
 1585|  56.2k|                    src_temp1_8x16b = _mm_unpacklo_epi64(src_temp1_8x16b, src_temp3_8x16b);
 1586|  56.2k|                    src_temp2_8x16b = _mm_unpacklo_epi64(src_temp2_8x16b, src_temp4_8x16b);
 1587|       |
 1588|       |                    /* (pi2_src1[col] + pi2_src2[col]) */
 1589|  56.2k|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1590|       |
 1591|       |                    /* i4_tmp = (pi2_src1[col] + pi2_src2[col] + lvl_shift1 + lvl_shift2 + shift_value) */
 1592|  56.2k|                    src_temp1_8x16b = _mm_adds_epi16(src_temp1_8x16b, lvl_shift1_8x16b);
 1593|       |
 1594|       |                    /* (i4_tmp >> shift) */
 1595|  56.2k|                    src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  shift);
 1596|       |
 1597|       |                    /* pu1_dst[col] = CLIP_U8(i4_tmp >> shift); */
 1598|  56.2k|                    src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, src_temp1_8x16b);
 1599|       |
 1600|  56.2k|                    dst0 = _mm_cvtsi128_si32(src_temp1_8x16b);
 1601|       |                    /* dst row = 1 to 3 */
 1602|  56.2k|                    src_temp2_8x16b = _mm_shuffle_epi32(src_temp1_8x16b, 1);
 1603|       |
 1604|       |                    /* store four 8-bit output values  */
 1605|  56.2k|                    *(WORD32 *)(&pu1_dst[0 * dst_strd]) = dst0;
 1606|       |
 1607|  56.2k|                    dst1 = _mm_cvtsi128_si32(src_temp2_8x16b);
 1608|       |
 1609|       |                    /* row = 1 to row = 3 */
 1610|  56.2k|                    *(WORD32 *)(&pu1_dst[1 * dst_strd]) = dst1;
 1611|       |
 1612|       |                    /* To update pointer */
 1613|  56.2k|                    pi2_src1 += 4;
 1614|  56.2k|                    pi2_src2 += 4;
 1615|  56.2k|                    pu1_dst  += 4;
 1616|       |
 1617|  56.2k|                } /* inner loop ends here(4-output values in single iteration) */
 1618|       |
 1619|  14.0k|                pi2_src1 = pi2_src1 - wd + 2 * src_strd1; /* Pointer update */
 1620|  14.0k|                pi2_src2 = pi2_src2 - wd + 2 * src_strd2; /* Pointer update */
 1621|  14.0k|                pu1_dst  = pu1_dst  - wd + 2 * dst_strd;  /* Pointer update */
 1622|       |
 1623|  14.0k|            }
 1624|       |
 1625|  18.4E|        }
 1626|       |
 1627|  41.8M|    }
 1628|  41.8M|}

ihevcd_set_default_params:
  921|  27.6k|{
  922|       |
  923|  27.6k|    WORD32 ret = IV_SUCCESS;
  924|       |
  925|  27.6k|    ps_codec->e_pic_skip_mode = IVD_SKIP_NONE;
  926|  27.6k|    ps_codec->i4_strd = 0;
  927|  27.6k|    ps_codec->i4_disp_strd = 0;
  928|  27.6k|    ps_codec->i4_header_mode = 0;
  929|  27.6k|    ps_codec->e_pic_out_order = IVD_DISPLAY_FRAME_OUT;
  930|  27.6k|    return ret;
  931|  27.6k|}
ihevcd_update_function_ptr:
  934|  52.1k|{
  935|       |
  936|       |    /* Init inter pred function array */
  937|  52.1k|    ps_codec->apf_inter_pred[0] = NULL;
  938|  52.1k|    ps_codec->apf_inter_pred[1] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr;
  939|  52.1k|    ps_codec->apf_inter_pred[2] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr;
  940|  52.1k|    ps_codec->apf_inter_pred[3] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr;
  941|  52.1k|    ps_codec->apf_inter_pred[4] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  942|  52.1k|    ps_codec->apf_inter_pred[5] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr;
  943|  52.1k|    ps_codec->apf_inter_pred[6] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr;
  944|  52.1k|    ps_codec->apf_inter_pred[7] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  945|  52.1k|    ps_codec->apf_inter_pred[8] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  946|  52.1k|    ps_codec->apf_inter_pred[9] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr;
  947|  52.1k|    ps_codec->apf_inter_pred[10] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr;
  948|  52.1k|    ps_codec->apf_inter_pred[11] = NULL;
  949|  52.1k|    ps_codec->apf_inter_pred[12] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr;
  950|  52.1k|    ps_codec->apf_inter_pred[13] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr;
  951|  52.1k|    ps_codec->apf_inter_pred[14] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr;
  952|  52.1k|    ps_codec->apf_inter_pred[15] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  953|  52.1k|    ps_codec->apf_inter_pred[16] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr;
  954|  52.1k|    ps_codec->apf_inter_pred[17] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr;
  955|  52.1k|    ps_codec->apf_inter_pred[18] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  956|  52.1k|    ps_codec->apf_inter_pred[19] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  957|  52.1k|    ps_codec->apf_inter_pred[20] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr;
  958|  52.1k|    ps_codec->apf_inter_pred[21] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr;
  959|       |
  960|       |    /* Init intra pred function array */
  961|  52.1k|    ps_codec->apf_intra_pred_luma[0] = (pf_intra_pred)NULL;
  962|  52.1k|    ps_codec->apf_intra_pred_luma[1] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr;
  963|  52.1k|    ps_codec->apf_intra_pred_luma[2] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr;
  964|  52.1k|    ps_codec->apf_intra_pred_luma[3] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr;
  965|  52.1k|    ps_codec->apf_intra_pred_luma[4] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr;
  966|  52.1k|    ps_codec->apf_intra_pred_luma[5] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr;
  967|  52.1k|    ps_codec->apf_intra_pred_luma[6] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr;
  968|  52.1k|    ps_codec->apf_intra_pred_luma[7] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr;
  969|  52.1k|    ps_codec->apf_intra_pred_luma[8] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr;
  970|  52.1k|    ps_codec->apf_intra_pred_luma[9] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr;
  971|  52.1k|    ps_codec->apf_intra_pred_luma[10] =  (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr;
  972|       |
  973|  52.1k|    ps_codec->apf_intra_pred_chroma[0] = (pf_intra_pred)NULL;
  974|  52.1k|    ps_codec->apf_intra_pred_chroma[1] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr;
  975|  52.1k|    ps_codec->apf_intra_pred_chroma[2] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr;
  976|  52.1k|    ps_codec->apf_intra_pred_chroma[3] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr;
  977|  52.1k|    ps_codec->apf_intra_pred_chroma[4] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr;
  978|  52.1k|    ps_codec->apf_intra_pred_chroma[5] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr;
  979|  52.1k|    ps_codec->apf_intra_pred_chroma[6] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr;
  980|  52.1k|    ps_codec->apf_intra_pred_chroma[7] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr;
  981|  52.1k|    ps_codec->apf_intra_pred_chroma[8] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr;
  982|  52.1k|    ps_codec->apf_intra_pred_chroma[9] =  (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr;
  983|  52.1k|    ps_codec->apf_intra_pred_chroma[10] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr;
  984|       |
  985|       |    /* Init itrans res function array */
  986|  52.1k|    ps_codec->apf_itrans_res[0] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_4x4_ttype1_fptr;
  987|  52.1k|    ps_codec->apf_itrans_res[1] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_4x4_fptr;
  988|  52.1k|    ps_codec->apf_itrans_res[2] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_8x8_fptr;
  989|  52.1k|    ps_codec->apf_itrans_res[3] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_16x16_fptr;
  990|  52.1k|    ps_codec->apf_itrans_res[4] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_32x32_fptr;
  991|       |
  992|       |    /* Init itrans_recon function array */
  993|  52.1k|    ps_codec->apf_itrans_recon[0] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr;
  994|  52.1k|    ps_codec->apf_itrans_recon[1] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr;
  995|  52.1k|    ps_codec->apf_itrans_recon[2] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr;
  996|  52.1k|    ps_codec->apf_itrans_recon[3] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr;
  997|  52.1k|    ps_codec->apf_itrans_recon[4] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr;
  998|  52.1k|    ps_codec->apf_itrans_recon[5] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr;
  999|  52.1k|    ps_codec->apf_itrans_recon[6] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr;
 1000|  52.1k|    ps_codec->apf_itrans_recon[7] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr;
 1001|  52.1k|    ps_codec->apf_itrans_recon[8] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_32x32_fptr;
 1002|       |
 1003|       |    /* Init recon function array */
 1004|  52.1k|    ps_codec->apf_recon[0] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr;
 1005|  52.1k|    ps_codec->apf_recon[1] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_fptr;
 1006|  52.1k|    ps_codec->apf_recon[2] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_8x8_fptr;
 1007|  52.1k|    ps_codec->apf_recon[3] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_16x16_fptr;
 1008|  52.1k|    ps_codec->apf_recon[4] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_32x32_fptr;
 1009|  52.1k|    ps_codec->apf_recon[5] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr;
 1010|  52.1k|    ps_codec->apf_recon[6] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr;
 1011|  52.1k|    ps_codec->apf_recon[7] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr;
 1012|  52.1k|    ps_codec->apf_recon[8] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_32x32_fptr;
 1013|       |
 1014|       |    /* Init itrans_recon_dc function array */
 1015|  52.1k|    ps_codec->apf_itrans_recon_dc[0] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr;
 1016|  52.1k|    ps_codec->apf_itrans_recon_dc[1] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr;
 1017|       |
 1018|  52.1k|    ps_codec->apf_itrans_res_dc = (pf_itrans_res_dc)ps_codec->s_func_selector.ihevc_itrans_res_dc_fptr;
 1019|       |
 1020|       |    /* Init sao function array */
 1021|  52.1k|    ps_codec->apf_sao_luma[0] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr;
 1022|  52.1k|    ps_codec->apf_sao_luma[1] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr;
 1023|  52.1k|    ps_codec->apf_sao_luma[2] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr;
 1024|  52.1k|    ps_codec->apf_sao_luma[3] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr;
 1025|       |
 1026|  52.1k|    ps_codec->apf_sao_chroma[0] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr;
 1027|  52.1k|    ps_codec->apf_sao_chroma[1] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr;
 1028|  52.1k|    ps_codec->apf_sao_chroma[2] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr;
 1029|  52.1k|    ps_codec->apf_sao_chroma[3] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr;
 1030|       |
 1031|       |    /* HBD functions */
 1032|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[0] = NULL; // Unused
 1033|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[1] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_planar_fptr;
 1034|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[2] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_dc_fptr;
 1035|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[3] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_mode2_fptr;
 1036|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[4] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_mode_3_to_9_fptr;
 1037|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[5] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_horz_fptr;
 1038|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[6] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_mode_11_to_17_fptr;
 1039|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[7] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_mode_18_34_fptr;
 1040|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[8] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_mode_19_to_25_fptr;
 1041|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[9] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_ver_fptr;
 1042|  52.1k|    ps_codec->apf_hbd_intra_pred_luma[10] = (pf_hbd_intra_pred_luma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_mode_27_to_33_fptr;
 1043|       |
 1044|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[0] = NULL; // Unused
 1045|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[1] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_planar_fptr;
 1046|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[2] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_dc_fptr;
 1047|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[3] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode2_fptr;
 1048|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[4] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode_3_to_9_fptr;
 1049|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[5] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_horz_fptr;
 1050|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[6] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode_11_to_17_fptr;
 1051|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[7] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode_18_34_fptr;
 1052|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[8] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode_19_to_25_fptr;
 1053|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[9] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_ver_fptr;
 1054|  52.1k|    ps_codec->apf_hbd_intra_pred_chroma[10] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode_27_to_33_fptr;
 1055|       |
 1056|  52.1k|    ps_codec->apf_hbd_itrans_recon[0] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_4x4_ttype1_fptr;
 1057|  52.1k|    ps_codec->apf_hbd_itrans_recon[1] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_4x4_fptr;
 1058|  52.1k|    ps_codec->apf_hbd_itrans_recon[2] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_8x8_fptr;
 1059|  52.1k|    ps_codec->apf_hbd_itrans_recon[3] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_16x16_fptr;
 1060|  52.1k|    ps_codec->apf_hbd_itrans_recon[4] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_32x32_fptr;
 1061|  52.1k|    ps_codec->apf_hbd_itrans_recon[5] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_4x4_fptr;
 1062|  52.1k|    ps_codec->apf_hbd_itrans_recon[6] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_8x8_fptr;
 1063|  52.1k|    ps_codec->apf_hbd_itrans_recon[7] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_16x16_fptr;
 1064|  52.1k|    ps_codec->apf_hbd_itrans_recon[8] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_itrans_recon_32x32_fptr;
 1065|       |
 1066|  52.1k|    ps_codec->apf_hbd_itrans_recon_dc[0] = (pf_hbd_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_hbd_itrans_recon_dc_luma_fptr;
 1067|  52.1k|    ps_codec->apf_hbd_itrans_recon_dc[1] = (pf_hbd_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_hbd_itrans_recon_dc_chroma_fptr;
 1068|       |
 1069|  52.1k|    ps_codec->apf_hbd_recon[0] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_4x4_ttype1_fptr;
 1070|  52.1k|    ps_codec->apf_hbd_recon[1] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_4x4_fptr;
 1071|  52.1k|    ps_codec->apf_hbd_recon[2] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_8x8_fptr;
 1072|  52.1k|    ps_codec->apf_hbd_recon[3] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_16x16_fptr;
 1073|  52.1k|    ps_codec->apf_hbd_recon[4] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_recon_32x32_fptr;
 1074|  52.1k|    ps_codec->apf_hbd_recon[5] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_4x4_fptr;
 1075|  52.1k|    ps_codec->apf_hbd_recon[6] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_8x8_fptr;
 1076|  52.1k|    ps_codec->apf_hbd_recon[7] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_16x16_fptr;
 1077|  52.1k|    ps_codec->apf_hbd_recon[8] = (pf_hbd_recon)ps_codec->s_func_selector.ihevc_hbd_chroma_recon_32x32_fptr;
 1078|       |
 1079|  52.1k|    ps_codec->apf_hbd_sao_luma[0] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class0_fptr;
 1080|  52.1k|    ps_codec->apf_hbd_sao_luma[1] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class1_fptr;
 1081|  52.1k|    ps_codec->apf_hbd_sao_luma[2] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class2_fptr;
 1082|  52.1k|    ps_codec->apf_hbd_sao_luma[3] = (pf_hbd_sao_luma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class3_fptr;
 1083|       |
 1084|  52.1k|    ps_codec->apf_hbd_sao_chroma[0] = (pf_hbd_sao_chroma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class0_chroma_fptr;
 1085|  52.1k|    ps_codec->apf_hbd_sao_chroma[1] = (pf_hbd_sao_chroma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class1_chroma_fptr;
 1086|  52.1k|    ps_codec->apf_hbd_sao_chroma[2] = (pf_hbd_sao_chroma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class2_chroma_fptr;
 1087|  52.1k|    ps_codec->apf_hbd_sao_chroma[3] = (pf_hbd_sao_chroma)ps_codec->s_func_selector.ihevc_hbd_sao_edge_offset_class3_chroma_fptr;
 1088|       |
 1089|  52.1k|    ps_codec->apf_hbd_inter_pred[0] = NULL;
 1090|  52.1k|    ps_codec->apf_hbd_inter_pred[1] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_copy_fptr;
 1091|  52.1k|    ps_codec->apf_hbd_inter_pred[2] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_vert_fptr;
 1092|  52.1k|    ps_codec->apf_hbd_inter_pred[3] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_horz_fptr;
 1093|  52.1k|    ps_codec->apf_hbd_inter_pred[4] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_horz_w16out_fptr;
 1094|  52.1k|    ps_codec->apf_hbd_inter_pred[5] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_copy_w16out_fptr;
 1095|  52.1k|    ps_codec->apf_hbd_inter_pred[6] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_vert_w16out_fptr;
 1096|  52.1k|    ps_codec->apf_hbd_inter_pred[7] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_horz_w16out_fptr;
 1097|  52.1k|    ps_codec->apf_hbd_inter_pred[8] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_horz_w16out_fptr;
 1098|  52.1k|    ps_codec->apf_hbd_inter_pred[9] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_vert_w16inp_fptr;
 1099|  52.1k|    ps_codec->apf_hbd_inter_pred[10] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_luma_vert_w16inp_w16out_fptr;
 1100|       |    ps_codec->apf_hbd_inter_pred[11] = NULL;
 1101|  52.1k|    ps_codec->apf_hbd_inter_pred[12] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_copy_fptr;
 1102|  52.1k|    ps_codec->apf_hbd_inter_pred[13] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_vert_fptr;
 1103|  52.1k|    ps_codec->apf_hbd_inter_pred[14] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_horz_fptr;
 1104|  52.1k|    ps_codec->apf_hbd_inter_pred[15] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_horz_w16out_fptr;
 1105|  52.1k|    ps_codec->apf_hbd_inter_pred[16] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_copy_w16out_fptr;
 1106|  52.1k|    ps_codec->apf_hbd_inter_pred[17] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_vert_w16out_fptr;
 1107|  52.1k|    ps_codec->apf_hbd_inter_pred[18] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_horz_w16out_fptr;
 1108|  52.1k|    ps_codec->apf_hbd_inter_pred[19] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_horz_w16out_fptr;
 1109|  52.1k|    ps_codec->apf_hbd_inter_pred[20] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_vert_w16inp_fptr;
 1110|  52.1k|    ps_codec->apf_hbd_inter_pred[21] = (pf_hbd_inter_pred)ps_codec->s_func_selector.ihevc_hbd_inter_pred_chroma_vert_w16inp_w16out_fptr;
 1111|  52.1k|}
ihevcd_init:
 1133|  27.6k|{
 1134|  27.6k|    WORD32 status = IV_SUCCESS;
 1135|  27.6k|    WORD32 i;
 1136|       |
 1137|       |    /* Free any dynamic buffers that are allocated */
 1138|  27.6k|    ihevcd_free_dynamic_bufs(ps_codec);
 1139|       |
 1140|  27.6k|    ps_codec->u4_allocate_dynamic_done = 0;
 1141|  27.6k|    ps_codec->i4_num_disp_bufs = 1;
 1142|  27.6k|    ps_codec->i4_flush_mode = 0;
 1143|       |
 1144|  27.6k|    ps_codec->i4_ht = ps_codec->i4_disp_ht = 0;
 1145|  27.6k|    ps_codec->i4_wd = ps_codec->i4_disp_wd = 0;
 1146|  27.6k|    ps_codec->i4_strd = 0;
 1147|  27.6k|    ps_codec->i4_disp_strd = 0;
 1148|  27.6k|    ps_codec->i4_num_cores = 1;
 1149|       |
 1150|  27.6k|    ps_codec->u4_pic_cnt = 0;
 1151|  27.6k|    ps_codec->u4_disp_cnt = 0;
 1152|       |
 1153|  27.6k|    ps_codec->i4_header_mode = 0;
 1154|  27.6k|    ps_codec->i4_header_in_slice_mode = 0;
 1155|  27.6k|    ps_codec->i4_sps_done = 0;
 1156|  27.6k|    ps_codec->i4_pps_done = 0;
 1157|  27.6k|    ps_codec->i4_init_done   = 1;
 1158|  27.6k|    ps_codec->i4_first_pic_done = 0;
 1159|  27.6k|    ps_codec->s_parse.i4_first_pic_init = 0;
 1160|  27.6k|    ps_codec->i4_error_code = 0;
 1161|  27.6k|    ps_codec->i4_reset_flag = 0;
 1162|  27.6k|    ps_codec->i4_cra_as_first_pic = 1;
 1163|  27.6k|    ps_codec->i4_rasl_output_flag = 0;
 1164|       |
 1165|  27.6k|    ps_codec->i4_prev_poc_msb = 0;
 1166|  27.6k|    ps_codec->i4_prev_poc_lsb = -1;
 1167|  27.6k|    ps_codec->i4_max_prev_poc_lsb = -1;
 1168|  27.6k|    ps_codec->s_parse.i4_abs_pic_order_cnt = -1;
 1169|       |
 1170|  27.6k|    ps_codec->i4_chroma_format_idc = CHROMA_FMT_IDC_YUV420;
 1171|  27.6k|    ps_codec->i4_pixel_size_y = PIXEL_SIZE_1BYTE;
  ------------------
  |  |  279|  27.6k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
 1172|  27.6k|    ps_codec->i4_pixel_size_uv = PIXEL_SIZE_1BYTE;
  ------------------
  |  |  279|  27.6k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
 1173|  27.6k|    ps_codec->i4_bit_depth_luma = BIT_DEPTH_8BITS;
  ------------------
  |  |  276|  27.6k|#define BIT_DEPTH_8BITS     8
  ------------------
 1174|  27.6k|    ps_codec->i4_bit_depth_chroma = BIT_DEPTH_8BITS;
  ------------------
  |  |  276|  27.6k|#define BIT_DEPTH_8BITS     8
  ------------------
 1175|       |
 1176|       |    /* Set ref chroma format by default to 420SP UV interleaved */
 1177|  27.6k|    ps_codec->e_ref_chroma_fmt = IV_YUV_420SP_UV;
 1178|       |
 1179|       |    /* If the codec is in shared mode and required format is 420 SP VU interleaved then change
 1180|       |     * reference buffers chroma format
 1181|       |     */
 1182|  27.6k|    if(IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1182:8): [True: 4.41k, False: 23.2k]
  ------------------
 1183|  4.41k|    {
 1184|  4.41k|        ps_codec->e_ref_chroma_fmt = IV_YUV_420SP_VU;
 1185|  4.41k|    }
 1186|       |
 1187|       |
 1188|       |
 1189|  27.6k|    ps_codec->i4_disable_deblk_pic = 0;
 1190|       |
 1191|  27.6k|    ps_codec->i4_degrade_pic_cnt    = 0;
 1192|  27.6k|    ps_codec->i4_degrade_pics       = 0;
 1193|  27.6k|    ps_codec->i4_degrade_type       = 0;
 1194|  27.6k|    ps_codec->i4_disable_sao_pic    = 0;
 1195|  27.6k|    ps_codec->i4_fullpel_inter_pred = 0;
 1196|  27.6k|    ps_codec->u4_enable_fmt_conv_ahead = 0;
 1197|  27.6k|    ps_codec->i4_share_disp_buf_cnt = 0;
 1198|       |
 1199|  27.6k|    {
 1200|  27.6k|        sps_t *ps_sps = ps_codec->ps_sps_base;
 1201|  27.6k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1202|       |
 1203|   498k|        for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  327|   498k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1203:20): [True: 470k, False: 27.6k]
  ------------------
 1204|   470k|        {
 1205|   470k|            ps_sps->i1_sps_valid = 0;
 1206|   470k|            ps_sps++;
 1207|   470k|        }
 1208|       |
 1209|  1.82M|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  344|  1.82M|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1209:20): [True: 1.79M, False: 27.6k]
  ------------------
 1210|  1.79M|        {
 1211|  1.79M|            ps_pps->i1_pps_valid = 0;
 1212|  1.79M|            ps_pps++;
 1213|  1.79M|        }
 1214|  27.6k|    }
 1215|       |
 1216|  27.6k|    ihevcd_set_default_params(ps_codec);
 1217|       |    /* Initialize MV Bank buffer manager */
 1218|  27.6k|    ihevc_buf_mgr_init((buf_mgr_t *)ps_codec->pv_mv_buf_mgr);
 1219|       |
 1220|       |    /* Initialize Picture buffer manager */
 1221|  27.6k|    ihevc_buf_mgr_init((buf_mgr_t *)ps_codec->pv_pic_buf_mgr);
 1222|       |
 1223|  27.6k|    ps_codec->ps_pic_buf = (pic_buf_t *)ps_codec->pv_pic_buf_base;
 1224|       |
 1225|  27.6k|    memset(ps_codec->ps_pic_buf, 0, BUF_MGR_MAX_CNT  * sizeof(pic_buf_t));
  ------------------
  |  |   37|  27.6k|#define BUF_MGR_MAX_CNT 64
  ------------------
 1226|       |
 1227|       |
 1228|       |
 1229|       |    /* Initialize display buffer manager */
 1230|  27.6k|    ihevc_disp_mgr_init((disp_mgr_t *)ps_codec->pv_disp_buf_mgr);
 1231|       |
 1232|       |    /* Initialize dpb manager */
 1233|  27.6k|    ihevc_dpb_mgr_init((dpb_mgr_t *)ps_codec->pv_dpb_mgr);
 1234|       |
 1235|  27.6k|    ps_codec->e_processor_soc = SOC_GENERIC;
 1236|       |    /* The following can be over-ridden using soc parameter as a hack */
 1237|  27.6k|    ps_codec->u4_nctb = 0x7FFFFFFF;
 1238|  27.6k|    ihevcd_init_arch(ps_codec);
 1239|       |
 1240|  27.6k|    ihevcd_init_function_ptr(ps_codec);
 1241|       |
 1242|  27.6k|    ihevcd_update_function_ptr(ps_codec);
 1243|       |
 1244|  27.6k|    return status;
 1245|  27.6k|}
ihevcd_allocate_static_bufs:
 1272|  24.4k|{
 1273|  24.4k|    WORD32 size;
 1274|  24.4k|    void *pv_buf;
 1275|  24.4k|    UWORD8 *pu1_buf;
 1276|  24.4k|    WORD32 i;
 1277|  24.4k|    codec_t *ps_codec;
 1278|  24.4k|    IV_API_CALL_STATUS_T status = IV_SUCCESS;
 1279|  24.4k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1280|  24.4k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1281|  24.4k|    void *pv_mem_ctxt;
 1282|       |
 1283|       |    /* Request memory for HEVCD object */
 1284|  24.4k|    ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 1285|       |
 1286|  24.4k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1287|  24.4k|    pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 1288|  24.4k|    pv_mem_ctxt  = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1289|       |
 1290|       |
 1291|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(iv_obj_t));
 1292|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1293|  24.4k|    memset(pv_buf, 0, sizeof(iv_obj_t));
 1294|  24.4k|    *pps_codec_obj = (iv_obj_t *)pv_buf;
 1295|  24.4k|    ps_create_op->s_ivd_create_op_t.pv_handle = *pps_codec_obj;
 1296|       |
 1297|       |
 1298|  24.4k|    (*pps_codec_obj)->pv_codec_handle = NULL;
 1299|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(codec_t));
 1300|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1301|  24.4k|    (*pps_codec_obj)->pv_codec_handle = (codec_t *)pv_buf;
 1302|  24.4k|    ps_codec = (codec_t *)pv_buf;
 1303|       |
 1304|  24.4k|    memset(ps_codec, 0, sizeof(codec_t));
 1305|       |
 1306|  24.4k|#ifndef LOGO_EN
 1307|  24.4k|    ps_codec->i4_share_disp_buf = ps_create_ip->s_ivd_create_ip_t.u4_share_disp_buf;
 1308|       |#else
 1309|       |    ps_codec->i4_share_disp_buf = 0;
 1310|       |#endif
 1311|       |
 1312|       |    /* Shared display mode is supported only for 420SP and 420P formats */
 1313|  24.4k|    if((ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) &&
  ------------------
  |  Branch (1313:8): [True: 14.7k, False: 9.69k]
  ------------------
 1314|  14.7k|       (ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (1314:8): [True: 10.1k, False: 4.56k]
  ------------------
 1315|  10.1k|       (ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (1315:8): [True: 6.17k, False: 4.00k]
  ------------------
 1316|  6.17k|    {
 1317|  6.17k|        ps_codec->i4_share_disp_buf = 0;
 1318|  6.17k|    }
 1319|       |
 1320|  24.4k|    if (ps_create_ip->s_ivd_create_ip_t.u4_size == sizeof(ihevcd_cxa_create_ip_t))
  ------------------
  |  Branch (1320:9): [True: 24.4k, False: 0]
  ------------------
 1321|  24.4k|    {
 1322|  24.4k|        ps_codec->u1_enable_cu_info = ps_create_ip->u4_enable_frame_info;
 1323|  24.4k|    }
 1324|       |
 1325|  24.4k|    ps_codec->e_chroma_fmt = ps_create_ip->s_ivd_create_ip_t.e_output_format;
 1326|       |
 1327|  24.4k|    ps_codec->pf_aligned_alloc = pf_aligned_alloc;
 1328|  24.4k|    ps_codec->pf_aligned_free = pf_aligned_free;
 1329|  24.4k|    ps_codec->pv_mem_ctxt = pv_mem_ctxt;
 1330|  24.4k|    ps_codec->i4_threads_active = ps_create_ip->u4_keep_threads_active;
 1331|       |
 1332|       |    /* Request memory to hold thread handles for each processing thread */
 1333|  24.4k|    size = MAX_PROCESS_THREADS * ithread_get_handle_size();
  ------------------
  |  |  121|  24.4k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.4k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1334|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1335|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1336|  24.4k|    memset(pv_buf, 0, size);
 1337|       |
 1338|   220k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   220k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   220k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1338:16): [True: 195k, False: 24.4k]
  ------------------
 1339|   195k|    {
 1340|   195k|        WORD32 handle_size = ithread_get_handle_size();
 1341|   195k|        ps_codec->apv_process_thread_handle[i] =
 1342|   195k|                        (UWORD8 *)pv_buf + (i * handle_size);
 1343|   195k|    }
 1344|       |
 1345|  24.4k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1345:8): [True: 24.4k, False: 0]
  ------------------
 1346|  24.4k|    {
 1347|       |        /* Request memory to hold mutex (start/done) for each processing thread */
 1348|  24.4k|        size = 2 * MAX_PROCESS_THREADS * ithread_get_mutex_lock_size();
  ------------------
  |  |  121|  24.4k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.4k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1349|  24.4k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1350|  24.4k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1351|  24.4k|        memset(pv_buf, 0, size);
 1352|       |
 1353|   220k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   220k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   220k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1353:20): [True: 195k, False: 24.4k]
  ------------------
 1354|   195k|        {
 1355|   195k|            WORD32 ret;
 1356|   195k|            WORD32 mutex_size = ithread_get_mutex_lock_size();
 1357|   195k|            ps_codec->apv_proc_start_mutex[i] =
 1358|   195k|                            (UWORD8 *)pv_buf + (2 * i * mutex_size);
 1359|   195k|            ps_codec->apv_proc_done_mutex[i] =
 1360|   195k|                            (UWORD8 *)pv_buf + ((2 * i + 1) * mutex_size);
 1361|       |
 1362|   195k|            ret = ithread_mutex_init(ps_codec->apv_proc_start_mutex[i]);
 1363|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1364|       |
 1365|   195k|            ret = ithread_mutex_init(ps_codec->apv_proc_done_mutex[i]);
 1366|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1367|   195k|        }
 1368|       |
 1369|  24.4k|        size = 2 * MAX_PROCESS_THREADS * ithread_get_cond_struct_size();
  ------------------
  |  |  121|  24.4k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.4k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1370|  24.4k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1371|  24.4k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1372|  24.4k|        memset(pv_buf, 0, size);
 1373|       |
 1374|   220k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   220k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   220k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1374:20): [True: 195k, False: 24.4k]
  ------------------
 1375|   195k|        {
 1376|   195k|            WORD32 ret;
 1377|   195k|            WORD32 cond_size = ithread_get_cond_struct_size();
 1378|   195k|            ps_codec->apv_proc_start_condition[i] =
 1379|   195k|                            (UWORD8 *)pv_buf + (2 * i * cond_size);
 1380|   195k|            ps_codec->apv_proc_done_condition[i] =
 1381|   195k|                            (UWORD8 *)pv_buf + ((2 * i + 1) * cond_size);
 1382|       |
 1383|   195k|            ret = ithread_cond_init(ps_codec->apv_proc_start_condition[i]);
 1384|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1385|       |
 1386|   195k|            ret = ithread_cond_init(ps_codec->apv_proc_done_condition[i]);
 1387|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1388|   195k|        }
 1389|  24.4k|    }
 1390|       |
 1391|       |    /* Request memory for static bitstream buffer which holds bitstream after emulation prevention */
 1392|  24.4k|    size = MIN_BITSBUF_SIZE;
  ------------------
  |  |  180|  24.4k|#define MIN_BITSBUF_SIZE (1024 * 1024)
  ------------------
 1393|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization
 1394|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1395|  24.4k|    memset(pv_buf, 0, size + 16);
 1396|  24.4k|    ps_codec->pu1_bitsbuf_static = pv_buf;
 1397|  24.4k|    ps_codec->u4_bitsbuf_size_static = size;
 1398|       |
 1399|       |    /* size for holding display manager context */
 1400|  24.4k|    size = sizeof(buf_mgr_t);
 1401|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1402|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1403|  24.4k|    memset(pv_buf, 0, size);
 1404|  24.4k|    ps_codec->pv_disp_buf_mgr = pv_buf;
 1405|       |
 1406|       |    /* size for holding dpb manager context */
 1407|  24.4k|    size = sizeof(dpb_mgr_t);
 1408|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1409|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1410|  24.4k|    memset(pv_buf, 0, size);
 1411|  24.4k|    ps_codec->pv_dpb_mgr = pv_buf;
 1412|       |
 1413|       |    /* size for holding buffer manager context */
 1414|  24.4k|    size = sizeof(buf_mgr_t);
 1415|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1416|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1417|  24.4k|    memset(pv_buf, 0, size);
 1418|  24.4k|    ps_codec->pv_pic_buf_mgr = pv_buf;
 1419|       |
 1420|       |    /* size for holding mv buffer manager context */
 1421|  24.4k|    size = sizeof(buf_mgr_t);
 1422|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1423|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1424|  24.4k|    memset(pv_buf, 0, size);
 1425|  24.4k|    ps_codec->pv_mv_buf_mgr = pv_buf;
 1426|       |
 1427|  24.4k|    size = MAX_VPS_CNT * sizeof(vps_t);
  ------------------
  |  |  299|  24.4k|#define MAX_VPS_CNT         16
  ------------------
 1428|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1429|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1430|  24.4k|    memset(pv_buf, 0, size);
 1431|  24.4k|    ps_codec->ps_vps_base = pv_buf;
 1432|  24.4k|    ps_codec->s_parse.ps_vps_base = ps_codec->ps_vps_base;
 1433|       |
 1434|  24.4k|    size = MAX_SPS_CNT * sizeof(sps_t);
  ------------------
  |  |  327|  24.4k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
 1435|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1436|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1437|  24.4k|    memset(pv_buf, 0, size);
 1438|  24.4k|    ps_codec->ps_sps_base = pv_buf;
 1439|  24.4k|    ps_codec->s_parse.ps_sps_base = ps_codec->ps_sps_base;
 1440|       |
 1441|  24.4k|    size = MAX_PPS_CNT * sizeof(pps_t);
  ------------------
  |  |  344|  24.4k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1442|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1443|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1444|  24.4k|    memset(pv_buf, 0, size);
 1445|  24.4k|    ps_codec->ps_pps_base = pv_buf;
 1446|  24.4k|    ps_codec->s_parse.ps_pps_base = ps_codec->ps_pps_base;
 1447|       |
 1448|  24.4k|    size = MAX_SLICE_HDR_CNT * sizeof(slice_header_t);
  ------------------
  |  |  153|  24.4k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  24.4k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1449|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1450|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1451|  24.4k|    memset(pv_buf, 0, size);
 1452|  24.4k|    ps_codec->ps_slice_hdr_base = (slice_header_t *)pv_buf;
 1453|  24.4k|    ps_codec->s_parse.ps_slice_hdr_base = ps_codec->ps_slice_hdr_base;
 1454|       |
 1455|       |
 1456|  24.4k|    SCALING_MAT_SIZE(size)
  ------------------
  |  |  186|  24.4k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  187|  24.4k|{                                                                            \
  |  |  188|  24.4k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.4k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.4k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  189|  24.4k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.4k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.4k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  190|  24.4k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.4k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.4k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  191|  24.4k|    m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.4k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.4k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  192|  24.4k|}
  ------------------
 1457|  24.4k|    size = (MAX_SPS_CNT + MAX_PPS_CNT) * size * sizeof(WORD16);
  ------------------
  |  |  327|  24.4k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
                  size = (MAX_SPS_CNT + MAX_PPS_CNT) * size * sizeof(WORD16);
  ------------------
  |  |  344|  24.4k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1458|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1459|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1460|  24.4k|    memset(pv_buf, 0, size);
 1461|  24.4k|    ps_codec->pi2_scaling_mat = (WORD16 *)pv_buf;
 1462|       |
 1463|       |
 1464|       |    /* Size for holding pic_buf_t for each reference picture
 1465|       |     * Since this is only a structure allocation and not actual buffer allocation,
 1466|       |     * it is allocated for BUF_MGR_MAX_CNT entries
 1467|       |     */
 1468|  24.4k|    size = BUF_MGR_MAX_CNT * sizeof(pic_buf_t);
  ------------------
  |  |   37|  24.4k|#define BUF_MGR_MAX_CNT 64
  ------------------
 1469|  24.4k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1470|  24.4k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1471|  24.4k|    memset(pv_buf, 0, size);
 1472|  24.4k|    ps_codec->pv_pic_buf_base = (UWORD8 *)pv_buf;
 1473|       |
 1474|       |    /* TO hold scratch buffers needed for each SAO context */
 1475|  24.4k|    size = (4 * MAX_CTB_SIZE * MAX_CTB_SIZE + 8 * MAX_CTB_SIZE * MAX_CTB_SIZE) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|  24.4k|#define MAX_CTB_SIZE        64
  ------------------
                  size = (4 * MAX_CTB_SIZE * MAX_CTB_SIZE + 8 * MAX_CTB_SIZE * MAX_CTB_SIZE) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|  24.4k|#define MAX_CTB_SIZE        64
  ------------------
                  size = (4 * MAX_CTB_SIZE * MAX_CTB_SIZE + 8 * MAX_CTB_SIZE * MAX_CTB_SIZE) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|  24.4k|#define MAX_CTB_SIZE        64
  ------------------
                  size = (4 * MAX_CTB_SIZE * MAX_CTB_SIZE + 8 * MAX_CTB_SIZE * MAX_CTB_SIZE) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|  24.4k|#define MAX_CTB_SIZE        64
  ------------------
                  size = (4 * MAX_CTB_SIZE * MAX_CTB_SIZE + 8 * MAX_CTB_SIZE * MAX_CTB_SIZE) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  280|  24.4k|#define PIXEL_SIZE_2BYTES   sizeof(UWORD16)
  ------------------
 1476|       |
 1477|  24.4k|    size *= MAX_PROCESS_THREADS;
  ------------------
  |  |  121|  24.4k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.4k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1478|       |
 1479|  24.4k|    pu1_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1480|  24.4k|    RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1481|  24.4k|    memset(pu1_buf, 0, size);
 1482|       |
 1483|   220k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   220k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   220k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1483:16): [True: 195k, False: 24.4k]
  ------------------
 1484|   195k|    {
 1485|   195k|        ps_codec->as_process[i].s_sao_ctxt.pu1_tmp_buf_luma = (UWORD8 *)pu1_buf;
 1486|   195k|        pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES ;
  ------------------
  |  |  351|   195k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES ;
  ------------------
  |  |  351|   195k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES ;
  ------------------
  |  |  280|   195k|#define PIXEL_SIZE_2BYTES   sizeof(UWORD16)
  ------------------
 1487|       |
 1488|   195k|        ps_codec->as_process[i].s_sao_ctxt.pu1_tmp_buf_chroma = (UWORD8 *)pu1_buf;
 1489|   195k|        pu1_buf += 8 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|   195k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 8 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  351|   195k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 8 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8) * PIXEL_SIZE_2BYTES;
  ------------------
  |  |  280|   195k|#define PIXEL_SIZE_2BYTES   sizeof(UWORD16)
  ------------------
 1490|   195k|    }
 1491|       |
 1492|       |    /* Allocate intra pred modes buffer */
 1493|       |    /* 8 bits per 4x4 */
 1494|       |    /* 16 bytes each for top and left 64 pixels and 16 bytes for default mode */
 1495|  24.4k|    size =  3 * 16 * sizeof(UWORD8);
 1496|  24.4k|    pu1_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1497|  24.4k|    RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1498|  24.4k|    memset(pu1_buf, 0, size);
 1499|  24.4k|    ps_codec->s_parse.pu1_luma_intra_pred_mode_left = pu1_buf;
 1500|  24.4k|    ps_codec->s_parse.pu1_luma_intra_pred_mode_top  = pu1_buf + 16;
 1501|       |
 1502|  24.4k|    {
 1503|  24.4k|        WORD32 inter_pred_tmp_buf_size, ntaps_luma;
 1504|  24.4k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1505|  24.4k|        WORD32 res_buf_size;
 1506|  24.4k|#endif
 1507|  24.4k|        WORD32 pic_pu_idx_map_size;
 1508|       |
 1509|       |        /* Max inter pred size */
 1510|  24.4k|        ntaps_luma = 8;
 1511|       |        // For yuv 4:4:4 chroma the inter pred buffer size for one CTB will be double of luma
 1512|  24.4k|        inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE * 2;
  ------------------
  |  |  351|  24.4k|#define MAX_CTB_SIZE        64
  ------------------
                      inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE * 2;
  ------------------
  |  |  351|  24.4k|#define MAX_CTB_SIZE        64
  ------------------
 1513|       |
 1514|  24.4k|        inter_pred_tmp_buf_size = ALIGN64(inter_pred_tmp_buf_size);
  ------------------
  |  |   50|  24.4k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1515|       |
 1516|  24.4k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1517|  24.4k|        res_buf_size = sizeof(WORD16) * (MAX_TU_SIZE * MAX_TU_SIZE);
  ------------------
  |  |  357|  24.4k|#define MAX_TU_SIZE         32
  ------------------
                      res_buf_size = sizeof(WORD16) * (MAX_TU_SIZE * MAX_TU_SIZE);
  ------------------
  |  |  357|  24.4k|#define MAX_TU_SIZE         32
  ------------------
 1518|  24.4k|        res_buf_size = ALIGN64(res_buf_size);
  ------------------
  |  |   50|  24.4k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1519|  24.4k|#endif
 1520|       |
 1521|       |        /* To hold pu_index w.r.t. frame level pu_t array for a CTB */
 1522|  24.4k|        pic_pu_idx_map_size = sizeof(WORD32) * (18 * 18);
 1523|  24.4k|        pic_pu_idx_map_size = ALIGN64(pic_pu_idx_map_size);
  ------------------
  |  |   50|  24.4k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1524|       |
 1525|  24.4k|        size =  inter_pred_tmp_buf_size * 2;
 1526|  24.4k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1527|  24.4k|        size += (res_buf_size * 4);
 1528|  24.4k|#endif
 1529|  24.4k|        size += pic_pu_idx_map_size;
 1530|  24.4k|        size *= MAX_PROCESS_THREADS;
  ------------------
  |  |  121|  24.4k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.4k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1531|       |
 1532|  24.4k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1533|  24.4k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.4k]
  |  |  ------------------
  ------------------
 1534|  24.4k|        memset(pu1_buf, 0, size);
 1535|       |
 1536|   220k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   220k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   220k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1536:20): [True: 195k, False: 24.4k]
  ------------------
 1537|   195k|        {
 1538|   195k|            ps_codec->as_process[i].pi2_inter_pred_tmp_buf1 = (WORD16 *)pu1_buf;
 1539|   195k|            pu1_buf += inter_pred_tmp_buf_size;
 1540|       |
 1541|   195k|            ps_codec->as_process[i].pi2_inter_pred_tmp_buf2 = (WORD16 *)pu1_buf;
 1542|   195k|            pu1_buf += inter_pred_tmp_buf_size;
 1543|       |
 1544|   195k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1545|   195k|            ps_codec->as_process[i].pi2_res_luma_buf = (WORD16 *)pu1_buf;
 1546|   195k|            pu1_buf += res_buf_size;
 1547|       |
 1548|   195k|            ps_codec->as_process[i].pi2_res_chroma_buf = (WORD16 *)pu1_buf;
 1549|   195k|            pu1_buf += res_buf_size;
 1550|       |
 1551|   195k|            ps_codec->as_process[i].pi2_invscan_out_subtu = (WORD16 *)pu1_buf;
 1552|   195k|            pu1_buf += (res_buf_size * 2);
 1553|   195k|#endif
 1554|       |
 1555|       |            /* Inverse transform intermediate and inverse scan output buffers reuse inter pred scratch buffers */
 1556|   195k|            ps_codec->as_process[i].pi2_itrans_intrmd_buf =
 1557|   195k|                            ps_codec->as_process[i].pi2_inter_pred_tmp_buf2;
 1558|   195k|            ps_codec->as_process[i].pi2_invscan_out =
 1559|   195k|                            ps_codec->as_process[i].pi2_inter_pred_tmp_buf1;
 1560|       |
 1561|   195k|            ps_codec->as_process[i].pu4_pic_pu_idx_map = (UWORD32 *)pu1_buf;
 1562|   195k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_pu_idx_map =
 1563|   195k|                            (UWORD32 *)pu1_buf;
 1564|   195k|            pu1_buf += pic_pu_idx_map_size;
 1565|       |
 1566|       |            //   ps_codec->as_process[i].pi2_inter_pred_tmp_buf3 = (WORD16 *)pu1_buf;
 1567|       |            //   pu1_buf += inter_pred_tmp_buf_size;
 1568|       |
 1569|   195k|            ps_codec->as_process[i].i4_inter_pred_tmp_buf_strd = MAX_CTB_SIZE;
  ------------------
  |  |  351|   195k|#define MAX_CTB_SIZE        64
  ------------------
 1570|       |
 1571|   195k|        }
 1572|  24.4k|    }
 1573|       |    /* Initialize pointers in PPS structures */
 1574|      0|    {
 1575|  24.4k|        sps_t *ps_sps = ps_codec->ps_sps_base;
 1576|  24.4k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1577|  24.4k|        WORD16 *pi2_scaling_mat =  ps_codec->pi2_scaling_mat;
 1578|  24.4k|        WORD32 scaling_mat_size;
 1579|       |
 1580|  24.4k|        SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  186|  24.4k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  187|  24.4k|{                                                                            \
  |  |  188|  24.4k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.4k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  24.4k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  189|  24.4k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.4k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  24.4k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  190|  24.4k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.4k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  24.4k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  191|  24.4k|    m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.4k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  24.4k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  192|  24.4k|}
  ------------------
 1581|       |
 1582|   440k|        for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  327|   440k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1582:20): [True: 415k, False: 24.4k]
  ------------------
 1583|   415k|        {
 1584|   415k|            ps_sps->pi2_scaling_mat  = pi2_scaling_mat;
 1585|   415k|            pi2_scaling_mat += scaling_mat_size;
 1586|   415k|            ps_sps++;
 1587|   415k|        }
 1588|       |
 1589|  1.61M|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  344|  1.61M|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1589:20): [True: 1.58M, False: 24.4k]
  ------------------
 1590|  1.58M|        {
 1591|  1.58M|            ps_pps->pi2_scaling_mat  = pi2_scaling_mat;
 1592|  1.58M|            pi2_scaling_mat += scaling_mat_size;
 1593|  1.58M|            ps_pps++;
 1594|  1.58M|        }
 1595|  24.4k|    }
 1596|       |
 1597|  24.4k|    return (status);
 1598|  24.4k|}
ihevcd_join_threads:
 1601|  27.1k|{
 1602|  27.1k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1602:8): [True: 27.1k, False: 0]
  ------------------
 1603|  27.1k|    {
 1604|  27.1k|        int i;
 1605|       |        /* Wait for threads */
 1606|  27.1k|        ps_codec->i4_break_threads = 1;
 1607|       |
 1608|   244k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   244k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   244k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1608:20): [True: 217k, False: 27.1k]
  ------------------
 1609|   217k|        {
 1610|   217k|            WORD32 ret;
 1611|   217k|            if(ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1611:16): [True: 26.3k, False: 190k]
  ------------------
 1612|  26.3k|            {
 1613|  26.3k|                ret = ithread_mutex_lock(ps_codec->apv_proc_start_mutex[i]);
 1614|  26.3k|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  26.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 26.3k]
  |  |  ------------------
  ------------------
 1615|       |
 1616|  26.3k|                ps_codec->ai4_process_start[i] = 1;
 1617|  26.3k|                ret = ithread_cond_signal(ps_codec->apv_proc_start_condition[i]);
 1618|  26.3k|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  26.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 26.3k]
  |  |  ------------------
  ------------------
 1619|       |
 1620|  26.3k|                ret = ithread_mutex_unlock(ps_codec->apv_proc_start_mutex[i]);
 1621|  26.3k|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  26.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 26.3k]
  |  |  ------------------
  ------------------
 1622|       |
 1623|  26.3k|                ithread_join(ps_codec->apv_process_thread_handle[i], NULL);
 1624|       |
 1625|  26.3k|                ps_codec->ai4_process_thread_created[i] = 0;
 1626|  26.3k|            }
 1627|   217k|        }
 1628|  27.1k|    }
 1629|  27.1k|    return IV_SUCCESS;
 1630|  27.1k|}
ihevcd_free_static_bufs:
 1651|  24.4k|{
 1652|  24.4k|    codec_t *ps_codec;
 1653|       |
 1654|  24.4k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1655|  24.4k|    void *pv_mem_ctxt;
 1656|       |
 1657|  24.4k|    ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 1658|  24.4k|    pf_aligned_free = ps_codec->pf_aligned_free;
 1659|  24.4k|    pv_mem_ctxt = ps_codec->pv_mem_ctxt;
 1660|       |
 1661|  24.4k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1661:8): [True: 24.4k, False: 0]
  ------------------
 1662|  24.4k|    {
 1663|       |        /* Wait for threads */
 1664|  24.4k|        ihevcd_join_threads(ps_codec);
 1665|       |
 1666|   220k|        for(int i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   220k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   220k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1666:24): [True: 195k, False: 24.4k]
  ------------------
 1667|   195k|        {
 1668|   195k|            WORD32 ret;
 1669|   195k|            ret = ithread_cond_destroy(ps_codec->apv_proc_start_condition[i]);
 1670|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1671|       |
 1672|   195k|            ret = ithread_cond_destroy(ps_codec->apv_proc_done_condition[i]);
 1673|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1674|       |
 1675|   195k|            ret = ithread_mutex_destroy(ps_codec->apv_proc_start_mutex[i]);
 1676|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1677|       |
 1678|   195k|            ret = ithread_mutex_destroy(ps_codec->apv_proc_done_mutex[i]);
 1679|   195k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   195k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 195k]
  |  |  ------------------
  ------------------
 1680|   195k|        }
 1681|  24.4k|        ALIGNED_FREE(ps_codec, ps_codec->apv_proc_start_mutex[0]);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1682|  24.4k|        ALIGNED_FREE(ps_codec, ps_codec->apv_proc_start_condition[0]);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1683|  24.4k|    }
 1684|       |
 1685|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->apv_process_thread_handle[0]);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1686|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_bitsbuf_static);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1687|       |
 1688|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pv_disp_buf_mgr);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1689|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pv_dpb_mgr);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1690|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pv_pic_buf_mgr);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1691|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pv_mv_buf_mgr);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1692|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->ps_vps_base);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1693|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->ps_sps_base);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1694|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->ps_pps_base);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1695|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->ps_slice_hdr_base);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1696|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pi2_scaling_mat);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1697|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->pv_pic_buf_base);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1698|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu1_luma_intra_pred_mode_left);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1699|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_sao_ctxt.pu1_tmp_buf_luma);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1700|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].pi2_inter_pred_tmp_buf1);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1701|  24.4k|    ALIGNED_FREE(ps_codec, ps_codec_obj->pv_codec_handle);
  ------------------
  |  |   96|  24.4k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  24.4k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1702|       |
 1703|  24.4k|    if(ps_codec_obj)
  ------------------
  |  Branch (1703:8): [True: 24.4k, False: 0]
  ------------------
 1704|  24.4k|    {
 1705|  24.4k|        pf_aligned_free(pv_mem_ctxt, ps_codec_obj);
 1706|  24.4k|    }
 1707|       |
 1708|  24.4k|    return IV_SUCCESS;
 1709|       |
 1710|  24.4k|}
ihevcd_allocate_dynamic_bufs:
 1733|  24.8k|{
 1734|  24.8k|    WORD32 max_tile_cols, max_tile_rows;
 1735|  24.8k|    WORD32 max_ctb_rows, max_ctb_cols;
 1736|  24.8k|    WORD32 max_num_cu_cols;
 1737|  24.8k|    WORD32 max_num_cu_rows;
 1738|  24.8k|    WORD32 max_num_4x4_cols;
 1739|  24.8k|    WORD32 max_ctb_cnt;
 1740|  24.8k|    WORD32 wd;
 1741|  24.8k|    WORD32 ht;
 1742|  24.8k|    WORD32 i;
 1743|  24.8k|    WORD32 max_dpb_size;
 1744|  24.8k|    void *pv_mem_ctxt = ps_codec->pv_mem_ctxt;
 1745|  24.8k|    void *pv_buf;
 1746|  24.8k|    UWORD8 *pu1_buf;
 1747|  24.8k|    WORD32 size;
 1748|  24.8k|    WORD32 pixel_size = ps_codec->i4_pixel_size_y;
 1749|       |
 1750|       |    /* Free any dynamic buffers that are allocated earlier. As ps_codec is memset to zero */
 1751|       |    /* at the beginning, it is safe to call this even if no memory was allocated earlier  */
 1752|  24.8k|    ihevcd_free_dynamic_bufs(ps_codec);
 1753|       |
 1754|  24.8k|    wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  24.8k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1755|  24.8k|    ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  24.8k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1756|       |
 1757|  24.8k|    max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  24.8k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  24.8k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 1758|  24.8k|    max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  24.8k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  24.8k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 1759|  24.8k|    max_ctb_rows  = ht / MIN_CTB_SIZE;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 1760|  24.8k|    max_ctb_cols  = wd / MIN_CTB_SIZE;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 1761|  24.8k|    max_ctb_cnt   = max_ctb_rows * max_ctb_cols;
 1762|  24.8k|    max_num_cu_cols = wd / MIN_CU_SIZE;
  ------------------
  |  |  373|  24.8k|#define MIN_CU_SIZE         8
  ------------------
 1763|  24.8k|    max_num_cu_rows = ht / MIN_CU_SIZE;
  ------------------
  |  |  373|  24.8k|#define MIN_CU_SIZE         8
  ------------------
 1764|  24.8k|    max_num_4x4_cols = wd / 4;
 1765|       |
 1766|       |    /* Allocate tile structures */
 1767|  24.8k|    size = max_tile_cols * max_tile_rows;
 1768|  24.8k|    size *= sizeof(tile_t);
 1769|  24.8k|    size *= MAX_PPS_CNT;
  ------------------
  |  |  344|  24.8k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1770|       |
 1771|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1772|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1773|  24.8k|    memset(pv_buf, 0, size);
 1774|  24.8k|    ps_codec->ps_tile = (tile_t *)pv_buf;
 1775|       |
 1776|       |
 1777|       |    /* Allocate memory to hold entry point offsets */
 1778|       |    /* One entry point per tile */
 1779|  24.8k|    size = max_tile_cols * max_tile_rows;
 1780|       |
 1781|       |    /* One entry point per row of CTBs */
 1782|       |    /*********************************************************************/
 1783|       |    /* Only tiles or entropy sync is enabled at a time in main           */
 1784|       |    /* profile, but since memory required does not increase too much,    */
 1785|       |    /* this allocation is done to handle both cases                      */
 1786|       |    /*********************************************************************/
 1787|  24.8k|    size  += max_ctb_rows;
 1788|  24.8k|    size *= sizeof(WORD32);
 1789|       |
 1790|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1791|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1792|  24.8k|    memset(pv_buf, 0, size);
 1793|  24.8k|    ps_codec->pi4_entry_ofst = (WORD32 *)pv_buf;
 1794|       |
 1795|       |    /* Allocate parse skip flag buffer */
 1796|       |    /* 1 bit per 8x8 */
 1797|  24.8k|    size = max_num_cu_cols / 8;
 1798|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1799|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1800|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1801|  24.8k|    memset(pv_buf, 0, size);
 1802|  24.8k|    ps_codec->s_parse.pu4_skip_cu_top = (UWORD32 *)pv_buf;
 1803|       |
 1804|       |    /* Allocate parse coding tree depth buffer */
 1805|       |    /* 2 bits per 8x8 */
 1806|  24.8k|    size =  max_num_cu_cols / 4;
 1807|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1808|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1809|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1810|  24.8k|    memset(pv_buf, 0, size);
 1811|  24.8k|    ps_codec->s_parse.pu4_ct_depth_top = (UWORD32 *)pv_buf;
 1812|       |
 1813|       |    /* Allocate intra flag buffer */
 1814|       |    /* 1 bit per 8x8 */
 1815|  24.8k|    size =  max_num_cu_cols * max_num_cu_rows / 8;
 1816|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1817|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1818|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1819|  24.8k|    memset(pv_buf, 0, size);
 1820|  24.8k|    ps_codec->pu1_pic_intra_flag = (UWORD8 *)pv_buf;
 1821|  24.8k|    ps_codec->s_parse.pu1_pic_intra_flag = ps_codec->pu1_pic_intra_flag;
 1822|       |
 1823|       |    /* Allocate transquant bypass flag buffer */
 1824|       |    /* 1 bit per 8x8 */
 1825|       |    /* Extra row and column are allocated for easy processing of top and left blocks while loop filtering */
 1826|  24.8k|    size =  ((max_num_cu_cols + 8) * (max_num_cu_rows + 8)) / 8;
 1827|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1828|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1829|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1830|  24.8k|    memset(pv_buf, 1, size);
 1831|  24.8k|    {
 1832|  24.8k|        WORD32 loop_filter_strd = (wd + 63) >> 6;
 1833|  24.8k|        ps_codec->pu1_pic_no_loop_filter_flag_base = pv_buf;
 1834|       |        /* The offset is added for easy processing of top and left blocks while loop filtering */
 1835|  24.8k|        ps_codec->pu1_pic_no_loop_filter_flag = (UWORD8 *)pv_buf + loop_filter_strd + 1;
 1836|  24.8k|        ps_codec->s_parse.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1837|  24.8k|        ps_codec->s_parse.s_deblk_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1838|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1839|  24.8k|    }
 1840|       |
 1841|       |    /* Initialize pointers in PPS structures */
 1842|  24.8k|    {
 1843|  24.8k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1844|  24.8k|        tile_t *ps_tile =  ps_codec->ps_tile;
 1845|       |
 1846|  1.63M|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  344|  1.63M|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1846:20): [True: 1.61M, False: 24.8k]
  ------------------
 1847|  1.61M|        {
 1848|  1.61M|            ps_pps->ps_tile = ps_tile;
 1849|  1.61M|            ps_tile += (max_tile_cols * max_tile_rows);
 1850|  1.61M|            ps_pps++;
 1851|  1.61M|        }
 1852|       |
 1853|  24.8k|    }
 1854|       |
 1855|       |    /* Allocate memory for job queue */
 1856|       |
 1857|       |    /* One job per row of CTBs */
 1858|  24.8k|    size  = max_ctb_rows;
 1859|       |
 1860|       |    /* One each tile a row of CTBs, num_jobs has to incremented */
 1861|  24.8k|    size  *= max_tile_cols;
 1862|       |
 1863|       |    /* One format convert/frame copy job per row of CTBs for non-shared mode*/
 1864|  24.8k|    size  += max_ctb_rows;
 1865|       |
 1866|  24.8k|    size *= sizeof(proc_job_t);
 1867|       |
 1868|  24.8k|    size += ihevcd_jobq_ctxt_size();
 1869|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1870|       |
 1871|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1872|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1873|  24.8k|    memset(pv_buf, 0, size);
 1874|  24.8k|    ps_codec->pv_proc_jobq_buf = pv_buf;
 1875|  24.8k|    ps_codec->i4_proc_jobq_buf_size = size;
 1876|       |
 1877|  24.8k|    size =  max_ctb_cnt;
 1878|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1879|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1880|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1881|  24.8k|    memset(pv_buf, 0, size);
 1882|  24.8k|    ps_codec->pu1_parse_map = (UWORD8 *)pv_buf;
 1883|       |
 1884|  24.8k|    size =  max_ctb_cnt;
 1885|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1886|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1887|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1888|  24.8k|    memset(pv_buf, 0, size);
 1889|  24.8k|    ps_codec->pu1_proc_map = (UWORD8 *)pv_buf;
 1890|       |
 1891|       |    /** Holds top and left neighbor's pu idx into picture level pu array */
 1892|       |    /* Only one top row is enough but left has to be replicated for each process context */
 1893|  24.8k|    size =  (max_num_4x4_cols  /* left */ + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4)/* top */ + 1/* top right */) * sizeof(WORD32);
  ------------------
  |  |  121|  24.8k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  24.8k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
                  size =  (max_num_4x4_cols  /* left */ + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4)/* top */ + 1/* top right */) * sizeof(WORD32);
  ------------------
  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  ------------------
 1894|  24.8k|    size = ALIGN4(size);
  ------------------
  |  |   54|  24.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1895|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1896|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1897|  24.8k|    memset(pv_buf, 0, size);
 1898|       |
 1899|   223k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1899:16): [True: 198k, False: 24.8k]
  ------------------
 1900|   198k|    {
 1901|   198k|        UWORD32 *pu4_buf = (UWORD32 *)pv_buf;
 1902|   198k|        ps_codec->as_process[i].pu4_pic_pu_idx_left = pu4_buf + i * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  351|   198k|#define MAX_CTB_SIZE        64
  ------------------
 1903|   198k|        memset(ps_codec->as_process[i].pu4_pic_pu_idx_left, 0, sizeof(UWORD32) * MAX_CTB_SIZE / 4);
  ------------------
  |  |  351|   198k|#define MAX_CTB_SIZE        64
  ------------------
 1904|   198k|        ps_codec->as_process[i].pu4_pic_pu_idx_top = pu4_buf + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  121|   198k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   198k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
                      ps_codec->as_process[i].pu4_pic_pu_idx_top = pu4_buf + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  351|   198k|#define MAX_CTB_SIZE        64
  ------------------
 1905|   198k|    }
 1906|  24.8k|    memset(ps_codec->as_process[0].pu4_pic_pu_idx_top, 0, sizeof(UWORD32) * (wd / 4 + 1));
 1907|       |
 1908|  24.8k|    {
 1909|  24.8k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
 1910|  24.8k|        WORD32 chroma_pixel_strd = 2;
 1911|  24.8k|        WORD32 h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (1911:32): [True: 0, False: 24.8k]
  ------------------
 1912|  24.8k|        WORD32 v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (1912:32): [True: 20.1k, False: 4.63k]
  ------------------
 1913|       |
 1914|       |        /* To hold SAO left buffer for luma */
 1915|  24.8k|        size  = ps_codec->i4_pixel_size_y * (MAX(ht, wd));
  ------------------
  |  |   42|  24.8k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.9k, False: 11.9k]
  |  |  ------------------
  ------------------
 1916|       |
 1917|       |        /* To hold SAO left buffer for chroma */
 1918|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1918:12): [True: 24.4k, False: 386]
  ------------------
 1919|  24.4k|        {
 1920|  24.4k|            size += ps_codec->i4_pixel_size_uv * (MAX(ht, wd)) * (chroma_pixel_strd / v_samp_factor);
  ------------------
  |  |   42|  24.4k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.6k, False: 11.8k]
  |  |  ------------------
  ------------------
 1921|  24.4k|        }
 1922|       |
 1923|       |        /* To hold SAO top buffer for luma */
 1924|  24.8k|        size += ps_codec->i4_pixel_size_y * wd;
 1925|       |
 1926|       |        /* To hold SAO top buffer for chroma */
 1927|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1927:12): [True: 24.4k, False: 386]
  ------------------
 1928|  24.4k|        {
 1929|  24.4k|            size += ps_codec->i4_pixel_size_uv * wd * (chroma_pixel_strd / h_samp_factor);
 1930|  24.4k|        }
 1931|       |
 1932|       |        /* To hold SAO top left luma pixel value for last output ctb in a row*/
 1933|  24.8k|        size += ps_codec->i4_pixel_size_y * max_ctb_rows;
 1934|       |
 1935|       |        /* To hold SAO top left chroma pixel value last output ctb in a row*/
 1936|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1936:12): [True: 24.4k, False: 386]
  ------------------
 1937|  24.4k|        {
 1938|  24.4k|            size += ps_codec->i4_pixel_size_uv * max_ctb_rows * 2;
 1939|  24.4k|        }
 1940|       |
 1941|       |        /* To hold SAO top left pixel luma for current ctb - column array*/
 1942|  24.8k|        size += ps_codec->i4_pixel_size_y * max_ctb_rows;
 1943|       |
 1944|       |        /* To hold SAO top left pixel chroma for current ctb-column array*/
 1945|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1945:12): [True: 24.4k, False: 386]
  ------------------
 1946|  24.4k|        {
 1947|  24.4k|            size += ps_codec->i4_pixel_size_uv * max_ctb_rows * 2;
 1948|  24.4k|        }
 1949|       |
 1950|       |        /* To hold SAO top right pixel luma pixel value last output ctb in a row*/
 1951|  24.8k|        size += ps_codec->i4_pixel_size_y * max_ctb_cols;
 1952|       |
 1953|       |        /* To hold SAO top right pixel chroma pixel value last output ctb in a row*/
 1954|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1954:12): [True: 24.4k, False: 386]
  ------------------
 1955|  24.4k|        {
 1956|  24.4k|            size += ps_codec->i4_pixel_size_uv * max_ctb_cols * 2;
 1957|  24.4k|        }
 1958|       |
 1959|       |        /*To hold SAO botton bottom left pixels for luma*/
 1960|  24.8k|        size += ps_codec->i4_pixel_size_y * max_ctb_rows;
 1961|       |
 1962|       |        /*To hold SAO botton bottom left pixels for chroma*/
 1963|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1963:12): [True: 24.4k, False: 386]
  ------------------
 1964|  24.4k|        {
 1965|  24.4k|            size += ps_codec->i4_pixel_size_uv * max_ctb_rows * 2;
 1966|  24.4k|        }
 1967|       |
 1968|  24.8k|        size = ALIGN64(size);
  ------------------
  |  |   50|  24.8k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1969|       |
 1970|  24.8k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1971|  24.8k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 1972|  24.8k|        memset(pu1_buf, 0, size);
 1973|       |
 1974|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1974:20): [True: 198k, False: 24.8k]
  ------------------
 1975|   198k|        {
 1976|   198k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf;
 1977|   198k|        }
 1978|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf;
 1979|  24.8k|        pu1_buf += MAX(ht, wd) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |   42|  24.8k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.9k, False: 11.9k]
  |  |  ------------------
  ------------------
 1980|       |
 1981|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1981:12): [True: 24.4k, False: 386]
  ------------------
 1982|  24.4k|        {
 1983|   219k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   219k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   219k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1983:24): [True: 195k, False: 24.4k]
  ------------------
 1984|   195k|            {
 1985|   195k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf;
 1986|   195k|            }
 1987|  24.4k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf;
 1988|  24.4k|            pu1_buf += MAX(ht, wd) * (chroma_pixel_strd / v_samp_factor) * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |   42|  24.4k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.6k, False: 11.8k]
  |  |  ------------------
  ------------------
 1989|  24.4k|        }
 1990|       |
 1991|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1991:20): [True: 198k, False: 24.8k]
  ------------------
 1992|   198k|        {
 1993|   198k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf;
 1994|   198k|        }
 1995|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf;
 1996|  24.8k|        pu1_buf += wd * ps_codec->i4_pixel_size_y;
 1997|       |
 1998|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1998:12): [True: 24.4k, False: 386]
  ------------------
 1999|  24.4k|        {
 2000|   219k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   219k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   219k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2000:24): [True: 195k, False: 24.4k]
  ------------------
 2001|   195k|            {
 2002|   195k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf;
 2003|   195k|            }
 2004|  24.4k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf;
 2005|  24.4k|            pu1_buf += wd * (chroma_pixel_strd / h_samp_factor) * ps_codec->i4_pixel_size_uv;
 2006|  24.4k|        }
 2007|       |
 2008|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2008:20): [True: 198k, False: 24.8k]
  ------------------
 2009|   198k|        {
 2010|   198k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf;
 2011|   198k|        }
 2012|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf;
 2013|  24.8k|        pu1_buf += (ht / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2014|       |
 2015|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2015:12): [True: 24.4k, False: 386]
  ------------------
 2016|  24.4k|        {
 2017|   219k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   219k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   219k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2017:24): [True: 195k, False: 24.4k]
  ------------------
 2018|   195k|            {
 2019|   195k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf;
 2020|   195k|            }
 2021|  24.4k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf;
 2022|  24.4k|            pu1_buf += (ht / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.4k|#define MIN_CTB_SIZE        16
  ------------------
 2023|  24.4k|        }
 2024|       |
 2025|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2025:20): [True: 198k, False: 24.8k]
  ------------------
 2026|   198k|        {
 2027|   198k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf;
 2028|   198k|        }
 2029|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf;
 2030|  24.8k|        pu1_buf += (ht / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2031|       |
 2032|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2032:12): [True: 24.4k, False: 386]
  ------------------
 2033|  24.4k|        {
 2034|   219k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   219k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   219k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2034:24): [True: 195k, False: 24.4k]
  ------------------
 2035|   195k|            {
 2036|   195k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf;
 2037|   195k|            }
 2038|  24.4k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf;
 2039|  24.4k|            pu1_buf += (ht / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.4k|#define MIN_CTB_SIZE        16
  ------------------
 2040|  24.4k|        }
 2041|       |
 2042|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2042:20): [True: 198k, False: 24.8k]
  ------------------
 2043|   198k|        {
 2044|   198k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf;
 2045|   198k|        }
 2046|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf;
 2047|  24.8k|        pu1_buf += (wd / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2048|       |
 2049|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2049:12): [True: 24.4k, False: 386]
  ------------------
 2050|  24.4k|        {
 2051|   219k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   219k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   219k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2051:24): [True: 195k, False: 24.4k]
  ------------------
 2052|   195k|            {
 2053|   195k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf;
 2054|   195k|            }
 2055|  24.4k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf;
 2056|  24.4k|            pu1_buf += (wd / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.4k|#define MIN_CTB_SIZE        16
  ------------------
 2057|  24.4k|        }
 2058|       |
 2059|       |        /*Per CTB, Store 1 value for luma , 2 values for chroma*/
 2060|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2060:20): [True: 198k, False: 24.8k]
  ------------------
 2061|   198k|        {
 2062|   198k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf;
 2063|   198k|        }
 2064|  24.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf;
 2065|  24.8k|        pu1_buf += (ht / MIN_CTB_SIZE) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2066|       |
 2067|  24.8k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (2067:12): [True: 24.4k, False: 386]
  ------------------
 2068|  24.4k|        {
 2069|   219k|            for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   219k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   219k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2069:24): [True: 195k, False: 24.4k]
  ------------------
 2070|   195k|            {
 2071|   195k|                ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf;
 2072|   195k|            }
 2073|  24.4k|            ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf;
 2074|  24.4k|            pu1_buf += (ht / MIN_CTB_SIZE) * 2 * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |  352|  24.4k|#define MIN_CTB_SIZE        16
  ------------------
 2075|  24.4k|        }
 2076|  24.8k|    }
 2077|       |
 2078|       |
 2079|      0|    {
 2080|  24.8k|        UWORD8 *pu1_buf = (UWORD8 *)pv_buf;
 2081|  24.8k|        WORD32 vert_bs_size, horz_bs_size;
 2082|  24.8k|        WORD32 qp_const_flag_size;
 2083|  24.8k|        WORD32 qp_size;
 2084|  24.8k|        WORD32 num_8x8;
 2085|       |
 2086|       |        /* Max Number of vertical edges */
 2087|  24.8k|        vert_bs_size = wd / 8 + 2 * MAX_CTB_SIZE / 8;
  ------------------
  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  ------------------
 2088|       |
 2089|       |        /* Max Number of horizontal edges - extra MAX_CTB_SIZE / 8 to handle the last 4 rows separately(shifted CTB processing) */
 2090|  24.8k|        vert_bs_size *= (ht + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  ------------------
                      vert_bs_size *= (ht + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  358|  24.8k|#define MIN_TU_SIZE         4
  ------------------
 2091|       |
 2092|       |        /* Number of bytes */
 2093|  24.8k|        vert_bs_size /= 8;
 2094|       |
 2095|       |        /* Two bits per edge */
 2096|  24.8k|        vert_bs_size *= 2;
 2097|       |
 2098|       |        /* Max Number of horizontal edges */
 2099|  24.8k|        horz_bs_size = ht / 8 + MAX_CTB_SIZE / 8;
  ------------------
  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  ------------------
 2100|       |
 2101|       |        /* Max Number of vertical edges - extra MAX_CTB_SIZE / 8 to handle the last 4 columns separately(shifted CTB processing) */
 2102|  24.8k|        horz_bs_size *= (wd + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  351|  24.8k|#define MAX_CTB_SIZE        64
  ------------------
                      horz_bs_size *= (wd + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  358|  24.8k|#define MIN_TU_SIZE         4
  ------------------
 2103|       |
 2104|       |        /* Number of bytes */
 2105|  24.8k|        horz_bs_size /= 8;
 2106|       |
 2107|       |        /* Two bits per edge */
 2108|  24.8k|        horz_bs_size *= 2;
 2109|       |
 2110|       |        /* Max CTBs in a row */
 2111|  24.8k|        qp_const_flag_size = wd / MIN_CTB_SIZE + 1 /* The last ctb row deblk is done in last ctb + 1 row.*/;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2112|       |
 2113|       |        /* Max CTBs in a column */
 2114|  24.8k|        qp_const_flag_size *= ht / MIN_CTB_SIZE;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2115|       |
 2116|       |        /* Number of bytes */
 2117|  24.8k|        qp_const_flag_size /= 8;
 2118|       |
 2119|       |        /* QP changes at CU level - So store at 8x8 level */
 2120|  24.8k|        num_8x8 = (wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE);
  ------------------
  |  |  373|  24.8k|#define MIN_CU_SIZE         8
  ------------------
                      num_8x8 = (wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE);
  ------------------
  |  |  373|  24.8k|#define MIN_CU_SIZE         8
  ------------------
 2121|  24.8k|        qp_size = num_8x8;
 2122|       |
 2123|       |        /* To hold vertical boundary strength */
 2124|  24.8k|        size += vert_bs_size;
 2125|       |
 2126|       |        /* To hold horizontal boundary strength */
 2127|  24.8k|        size += horz_bs_size;
 2128|       |
 2129|       |        /* To hold QP */
 2130|  24.8k|        size += qp_size;
 2131|       |
 2132|       |        /* To hold QP const in CTB flags */
 2133|  24.8k|        size += qp_const_flag_size;
 2134|       |
 2135|  24.8k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2136|  24.8k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2137|       |
 2138|  24.8k|        memset(pu1_buf, 0, size);
 2139|       |
 2140|   223k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2140:20): [True: 198k, False: 24.8k]
  ------------------
 2141|   198k|        {
 2142|   198k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2143|   198k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2144|   198k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2145|   198k|            pu1_buf += vert_bs_size;
 2146|       |
 2147|   198k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2148|   198k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2149|   198k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2150|   198k|            pu1_buf += horz_bs_size;
 2151|       |
 2152|   198k|            ps_codec->as_process[i].s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2153|   198k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2154|   198k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2155|   198k|            pu1_buf += qp_size;
 2156|       |
 2157|   198k|            ps_codec->as_process[i].s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2158|   198k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2159|   198k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2160|   198k|            pu1_buf += qp_const_flag_size;
 2161|       |
 2162|   198k|            pu1_buf -= (vert_bs_size + horz_bs_size + qp_size + qp_const_flag_size);
 2163|   198k|        }
 2164|  24.8k|        ps_codec->s_parse.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 2165|  24.8k|        pu1_buf += vert_bs_size;
 2166|       |
 2167|  24.8k|        ps_codec->s_parse.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 2168|  24.8k|        pu1_buf += horz_bs_size;
 2169|       |
 2170|  24.8k|        ps_codec->s_parse.s_bs_ctxt.pi1_pic_qp = (WORD8 *)pu1_buf;
 2171|  24.8k|        pu1_buf += qp_size;
 2172|       |
 2173|  24.8k|        ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 2174|  24.8k|        pu1_buf += qp_const_flag_size;
 2175|       |
 2176|  24.8k|    }
 2177|       |
 2178|       |    /* Max CTBs in a row */
 2179|  24.8k|    size  = wd / MIN_CTB_SIZE;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2180|       |    /* Max CTBs in a column */
 2181|  24.8k|    size *= (ht / MIN_CTB_SIZE + 2) /* Top row and bottom row extra. This ensures accessing left,top in first row
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2182|  24.8k|                                              and right in last row will not result in invalid access*/;
 2183|       |
 2184|  24.8k|    size *= sizeof(UWORD16);
 2185|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2186|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2187|  24.8k|    memset(pv_buf, 0, size);
 2188|       |
 2189|  24.8k|    ps_codec->pu1_tile_idx_base = pv_buf;
 2190|   223k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2190:16): [True: 198k, False: 24.8k]
  ------------------
 2191|   198k|    {
 2192|   198k|        ps_codec->as_process[i].pu1_tile_idx = (UWORD16 *)pv_buf + wd / MIN_CTB_SIZE /* Offset 1 row */;
  ------------------
  |  |  352|   198k|#define MIN_CTB_SIZE        16
  ------------------
 2193|   198k|    }
 2194|       |
 2195|  24.8k|    size = sizeof(sao_t);
 2196|       |
 2197|       |    /* MAX number of CTBs in a row */
 2198|  24.8k|    size *= wd / MIN_CTB_SIZE;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2199|       |
 2200|       |    /* MAX number of CTBs in a column */
 2201|  24.8k|    size *= ht / MIN_CTB_SIZE;
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
 2202|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2203|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2204|  24.8k|    memset(pv_buf, 0, size);
 2205|       |
 2206|  24.8k|    ps_codec->s_parse.ps_pic_sao = (sao_t *)pv_buf;
 2207|  24.8k|    ps_codec->s_parse.s_sao_ctxt.ps_pic_sao = (sao_t *)pv_buf;
 2208|   223k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2208:16): [True: 198k, False: 24.8k]
  ------------------
 2209|   198k|    {
 2210|   198k|        ps_codec->as_process[i].s_sao_ctxt.ps_pic_sao = ps_codec->s_parse.ps_pic_sao;
 2211|   198k|    }
 2212|       |
 2213|       |    /* Only if (frame size * compression factor) is greater than MIN_BITSBUF_SIZE,
 2214|       |    then allocate dynamic bistream buffer */
 2215|  24.8k|    ps_codec->pu1_bitsbuf_dynamic = NULL;
 2216|  24.8k|    {
 2217|  24.8k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
 2218|       |
 2219|  24.8k|        if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (2219:12): [True: 0, False: 24.8k]
  ------------------
 2220|      0|        {
 2221|      0|            size = wd * ht * 3 * pixel_size;
 2222|      0|        }
 2223|  24.8k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (2223:17): [True: 4.24k, False: 20.5k]
  ------------------
 2224|  4.24k|        {
 2225|  4.24k|            size = wd * ht * 2 * pixel_size;
 2226|  4.24k|        }
 2227|  20.5k|        else
 2228|  20.5k|        {
 2229|  20.5k|            size = wd * ht * pixel_size;
 2230|  20.5k|        }
 2231|       |
 2232|  24.8k|        if(size > MIN_BITSBUF_SIZE)
  ------------------
  |  |  180|  24.8k|#define MIN_BITSBUF_SIZE (1024 * 1024)
  ------------------
  |  Branch (2232:12): [True: 2.65k, False: 22.1k]
  ------------------
 2233|  2.65k|        {
 2234|       |            //Alloc extra for parse optimization
 2235|  2.65k|            pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size + 16);
 2236|  2.65k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  2.65k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.65k]
  |  |  ------------------
  ------------------
 2237|       |
 2238|  2.65k|            memset(pv_buf, 0, size + 16);
 2239|  2.65k|            ps_codec->pu1_bitsbuf_dynamic = pv_buf;
 2240|  2.65k|            ps_codec->u4_bitsbuf_size_dynamic = size;
 2241|  2.65k|        }
 2242|  24.8k|    }
 2243|       |
 2244|  24.8k|    size = ihevcd_get_tu_data_size(ps_codec, wd * ht);
 2245|  24.8k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2246|  24.8k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2247|  24.8k|    memset(pv_buf, 0, size);
 2248|  24.8k|    ps_codec->pv_tu_data = pv_buf;
 2249|       |
 2250|       |    /* CU info map to store qp and CU type at 8x8 level */
 2251|  24.8k|    if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2251:8): [True: 0, False: 24.8k]
  ------------------
 2252|      0|    {
 2253|      0|        size = ((wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE)) * BUF_MGR_MAX_CNT;
  ------------------
  |  |  373|      0|#define MIN_CU_SIZE         8
  ------------------
                      size = ((wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE)) * BUF_MGR_MAX_CNT;
  ------------------
  |  |  373|      0|#define MIN_CU_SIZE         8
  ------------------
                      size = ((wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE)) * BUF_MGR_MAX_CNT;
  ------------------
  |  |   37|      0|#define BUF_MGR_MAX_CNT 64
  ------------------
 2254|       |
 2255|      0|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2256|      0|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2257|      0|        memset(pv_buf, 0, size);
 2258|      0|        ps_codec->pu1_qp_map_base = pv_buf;
 2259|       |
 2260|      0|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2261|      0|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2262|      0|        memset(pv_buf, 0, size);
 2263|      0|        ps_codec->pu1_cu_type_map_base = pv_buf;
 2264|      0|    }
 2265|       |
 2266|  24.8k|    {
 2267|  24.8k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
 2268|       |
 2269|       |
 2270|       |        /* Allocate for pu_map, pu_t and pic_pu_idx for each MV bank */
 2271|       |        /* Note: Number of luma samples is not max_wd * max_ht here, instead it is
 2272|       |         * set to maximum number of luma samples allowed at the given level.
 2273|       |         * This is done to ensure that any stream with width and height lesser
 2274|       |         * than max_wd and max_ht is supported. Number of buffers required can be greater
 2275|       |         * for lower width and heights at a given level and this increased number of buffers
 2276|       |         * might require more memory than what max_wd and max_ht buffer would have required
 2277|       |         * Also note one extra buffer is allocted to store current pictures MV bank
 2278|       |         * In case of asynchronous parsing and processing, number of buffers should increase here
 2279|       |         * based on when parsing and processing threads are synchronized
 2280|       |         */
 2281|  24.8k|        max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
 2282|       |        /* Size for holding mv_buf_t for each MV Bank
 2283|       |         * One extra MV Bank is needed to hold current pics MV bank.
 2284|       |         */
 2285|  24.8k|        size = (max_dpb_size + 1) * sizeof(mv_buf_t);
 2286|       |
 2287|  24.8k|        size += (max_dpb_size + 1) *
 2288|  24.8k|                        ihevcd_get_pic_mv_bank_size(wd * ht);
 2289|       |
 2290|  24.8k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2291|  24.8k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2292|  24.8k|        memset(pv_buf, 0, size);
 2293|       |
 2294|  24.8k|        ps_codec->pv_mv_bank_buf_base = pv_buf;
 2295|  24.8k|        ps_codec->i4_total_mv_bank_size = size;
 2296|       |
 2297|  24.8k|    }
 2298|       |
 2299|       |    /* In case of non-shared mode allocate for reference picture buffers */
 2300|       |    /* In case of shared and 420p output, allocate for chroma samples */
 2301|  24.8k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (2301:8): [True: 24.8k, False: 0]
  ------------------
 2302|  24.8k|    {
 2303|       |        /* Number of buffers is doubled in order to return one frame at a time instead of sending
 2304|       |         * multiple outputs during dpb full case.
 2305|       |         * Also note one extra buffer is allocted to store current picture
 2306|       |         * In case of asynchronous parsing and processing, number of buffers should increase here
 2307|       |         * based on when parsing and processing threads are synchronized
 2308|       |         */
 2309|  24.8k|        size = ihevcd_get_total_pic_buf_size(ps_codec, wd, ht);
 2310|  24.8k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2311|  24.8k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2312|  24.8k|        memset(pv_buf, 0, size);
 2313|       |
 2314|  24.8k|        ps_codec->i4_total_pic_buf_size = size;
 2315|  24.8k|        ps_codec->pu1_ref_pic_buf_base = (UWORD8 *)pv_buf;
 2316|  24.8k|    }
 2317|       |
 2318|  24.8k|    ps_codec->pv_proc_jobq = ihevcd_jobq_init(ps_codec->pv_proc_jobq_buf, ps_codec->i4_proc_jobq_buf_size);
 2319|  24.8k|    RETURN_IF((ps_codec->pv_proc_jobq == NULL), IV_FAIL);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2320|       |
 2321|       |    /* Update the jobq context to all the threads */
 2322|  24.8k|    ps_codec->s_parse.pv_proc_jobq = ps_codec->pv_proc_jobq;
 2323|   223k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   223k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   223k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2323:16): [True: 198k, False: 24.8k]
  ------------------
 2324|   198k|    {
 2325|   198k|        ps_codec->as_process[i].pv_proc_jobq = ps_codec->pv_proc_jobq;
 2326|   198k|        ps_codec->as_process[i].i4_id = i;
 2327|   198k|        ps_codec->as_process[i].ps_codec = ps_codec;
 2328|       |
 2329|       |        /* Set the following to zero assuming it is a single core solution
 2330|       |         * When threads are launched these will be set appropriately
 2331|       |         */
 2332|   198k|        ps_codec->as_process[i].i4_check_parse_status = 0;
 2333|   198k|        ps_codec->as_process[i].i4_check_proc_status = 0;
 2334|   198k|    }
 2335|       |
 2336|  24.8k|    ps_codec->u4_allocate_dynamic_done = 1;
 2337|       |
 2338|  24.8k|    return IV_SUCCESS;
 2339|  24.8k|}
ihevcd_free_dynamic_bufs:
 2361|  76.9k|{
 2362|       |
 2363|  76.9k|    if(ps_codec->pv_proc_jobq)
  ------------------
  |  Branch (2363:8): [True: 24.8k, False: 52.1k]
  ------------------
 2364|  24.8k|    {
 2365|  24.8k|        ihevcd_jobq_deinit(ps_codec->pv_proc_jobq);
 2366|  24.8k|        ps_codec->pv_proc_jobq = NULL;
 2367|  24.8k|    }
 2368|       |
 2369|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->ps_tile);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2370|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pi4_entry_ofst);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2371|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu4_skip_cu_top);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2372|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu4_ct_depth_top);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2373|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_pic_intra_flag);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2374|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_pic_no_loop_filter_flag_base);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2375|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_proc_jobq_buf);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2376|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_parse_map);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2377|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_proc_map);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2378|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].pu4_pic_pu_idx_left);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2379|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_sao_ctxt.pu1_sao_src_left_luma);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2380|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_bs_ctxt.pu4_pic_vert_bs);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2381|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_tile_idx_base);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2382|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.ps_pic_sao);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2383|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_bitsbuf_dynamic);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 2.65k, False: 74.2k]
  |  |  ------------------
  ------------------
 2384|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_tu_data);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2385|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pv_mv_bank_buf_base);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2386|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_ref_pic_buf_base);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 24.8k, False: 52.1k]
  |  |  ------------------
  ------------------
 2387|  76.9k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_cur_chroma_ref_buf);
  ------------------
  |  |   96|  76.9k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  76.9k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 0, False: 76.9k]
  |  |  ------------------
  ------------------
 2388|  76.9k|    if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2388:8): [True: 0, False: 76.9k]
  ------------------
 2389|      0|    {
 2390|      0|        ALIGNED_FREE(ps_codec, ps_codec->pu1_qp_map_base);
  ------------------
  |  |   96|      0|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|      0|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2391|      0|        ALIGNED_FREE(ps_codec, ps_codec->pu1_cu_type_map_base);
  ------------------
  |  |   96|      0|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|      0|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2392|      0|    }
 2393|       |
 2394|  76.9k|    ps_codec->u4_allocate_dynamic_done = 0;
 2395|  76.9k|    return IV_SUCCESS;
 2396|  76.9k|}
ihevcd_create:
 2427|  24.4k|{
 2428|  24.4k|    ihevcd_cxa_create_ip_t *ps_create_ip;
 2429|  24.4k|    ihevcd_cxa_create_op_t *ps_create_op;
 2430|       |
 2431|  24.4k|    WORD32 ret;
 2432|  24.4k|    codec_t *ps_codec;
 2433|  24.4k|    ps_create_ip = (ihevcd_cxa_create_ip_t *)pv_api_ip;
 2434|  24.4k|    ps_create_op = (ihevcd_cxa_create_op_t *)pv_api_op;
 2435|       |
 2436|  24.4k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2437|  24.4k|    ps_codec_obj = NULL;
 2438|  24.4k|    ret = ihevcd_allocate_static_bufs(&ps_codec_obj, pv_api_ip, pv_api_op);
 2439|       |
 2440|       |    /* If allocation of some buffer fails, then free buffers allocated till then */
 2441|  24.4k|    if(IV_FAIL == ret)
  ------------------
  |  Branch (2441:8): [True: 0, False: 24.4k]
  ------------------
 2442|      0|    {
 2443|      0|        if(NULL != ps_codec_obj)
  ------------------
  |  Branch (2443:12): [True: 0, False: 0]
  ------------------
 2444|      0|        {
 2445|      0|            if(ps_codec_obj->pv_codec_handle)
  ------------------
  |  Branch (2445:16): [True: 0, False: 0]
  ------------------
 2446|      0|            {
 2447|      0|                ihevcd_free_static_bufs(ps_codec_obj);
 2448|      0|            }
 2449|      0|            else
 2450|      0|            {
 2451|      0|                void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2452|      0|                void *pv_mem_ctxt;
 2453|       |
 2454|      0|                pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2455|      0|                pv_mem_ctxt  = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2456|      0|                pf_aligned_free(pv_mem_ctxt, ps_codec_obj);
 2457|      0|            }
 2458|      0|        }
 2459|      0|        ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
 2460|      0|        ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
 2461|       |
 2462|      0|        return IV_FAIL;
 2463|      0|    }
 2464|  24.4k|    ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 2465|  24.4k|    if (ps_create_ip->u4_enable_yuv_formats == 0) {
  ------------------
  |  Branch (2465:9): [True: 0, False: 24.4k]
  ------------------
 2466|      0|        ps_create_ip->u4_enable_yuv_formats = 1 << CHROMA_FMT_IDC_YUV420;
 2467|      0|    }
 2468|  24.4k|    ps_codec->u4_enable_yuv_formats = ps_create_ip->u4_enable_yuv_formats;
 2469|  24.4k|    ps_codec->u4_enable_hbd = ps_create_ip->u4_enable_hbd;
 2470|       |
 2471|  24.4k|    ret = ihevcd_init(ps_codec);
 2472|       |
 2473|  24.4k|    TRACE_INIT(NULL);
 2474|  24.4k|    STATS_INIT();
  ------------------
  |  |  137|  24.4k|#define STATS_INIT()  ;
  ------------------
 2475|       |
 2476|  24.4k|    return ret;
 2477|  24.4k|}
ihevcd_delete:
 2504|  24.4k|{
 2505|  24.4k|    codec_t *ps_dec;
 2506|  24.4k|    ihevcd_cxa_delete_ip_t *ps_ip = (ihevcd_cxa_delete_ip_t *)pv_api_ip;
 2507|  24.4k|    ihevcd_cxa_delete_op_t *ps_op = (ihevcd_cxa_delete_op_t *)pv_api_op;
 2508|       |
 2509|  24.4k|    ps_dec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 2510|  24.4k|    UNUSED(ps_ip);
  ------------------
  |  |   38|  24.4k|#define UNUSED(x) ((void)(x))
  ------------------
 2511|  24.4k|    ps_op->s_ivd_delete_op_t.u4_error_code = 0;
 2512|  24.4k|    ihevcd_free_dynamic_bufs(ps_dec);
 2513|  24.4k|    ihevcd_free_static_bufs(ps_codec_obj);
 2514|  24.4k|    return IV_SUCCESS;
 2515|  24.4k|}
ihevcd_set_params:
 3089|  48.8k|{
 3090|       |
 3091|  48.8k|    codec_t *ps_codec;
 3092|  48.8k|    WORD32 ret = IV_SUCCESS;
 3093|  48.8k|    WORD32 strd;
 3094|  48.8k|    ivd_ctl_set_config_ip_t *s_ctl_dynparams_ip =
 3095|  48.8k|                    (ivd_ctl_set_config_ip_t *)pv_api_ip;
 3096|  48.8k|    ivd_ctl_set_config_op_t *s_ctl_dynparams_op =
 3097|  48.8k|                    (ivd_ctl_set_config_op_t *)pv_api_op;
 3098|       |
 3099|  48.8k|    ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 3100|       |
 3101|  48.8k|    s_ctl_dynparams_op->u4_error_code = 0;
 3102|       |
 3103|  48.8k|    ps_codec->e_pic_skip_mode = s_ctl_dynparams_ip->e_frm_skip_mode;
 3104|       |
 3105|  48.8k|    if(s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_NONE)
  ------------------
  |  Branch (3105:8): [True: 0, False: 48.8k]
  ------------------
 3106|      0|    {
 3107|       |
 3108|      0|        if((s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_P) &&
  ------------------
  |  Branch (3108:12): [True: 0, False: 0]
  ------------------
 3109|      0|           (s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_B) &&
  ------------------
  |  Branch (3109:12): [True: 0, False: 0]
  ------------------
 3110|      0|           (s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_PB))
  ------------------
  |  Branch (3110:12): [True: 0, False: 0]
  ------------------
 3111|      0|        {
 3112|      0|            s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 3113|      0|            ret = IV_FAIL;
 3114|      0|        }
 3115|      0|    }
 3116|       |
 3117|  48.8k|    strd = ps_codec->i4_disp_strd;
 3118|  48.8k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (3118:8): [True: 0, False: 48.8k]
  ------------------
 3119|      0|    {
 3120|      0|        strd = ps_codec->i4_strd;
 3121|      0|    }
 3122|       |
 3123|       |
 3124|  48.8k|    {
 3125|  48.8k|        if((WORD32)s_ctl_dynparams_ip->u4_disp_wd >= ps_codec->i4_disp_wd)
  ------------------
  |  Branch (3125:12): [True: 27.2k, False: 21.6k]
  ------------------
 3126|  27.2k|        {
 3127|  27.2k|            strd = s_ctl_dynparams_ip->u4_disp_wd;
 3128|  27.2k|        }
 3129|  21.6k|        else if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (3129:17): [True: 0, False: 21.6k]
  ------------------
 3130|      0|        {
 3131|      0|            strd = s_ctl_dynparams_ip->u4_disp_wd;
 3132|      0|        }
 3133|  21.6k|        else if(s_ctl_dynparams_ip->u4_disp_wd == 0)
  ------------------
  |  Branch (3133:17): [True: 21.6k, False: 0]
  ------------------
 3134|  21.6k|        {
 3135|  21.6k|            strd = ps_codec->i4_disp_strd;
 3136|  21.6k|        }
 3137|      0|        else
 3138|      0|        {
 3139|      0|            strd = 0;
 3140|      0|            s_ctl_dynparams_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 3141|      0|            s_ctl_dynparams_op->u4_error_code |= IHEVCD_INVALID_DISP_STRD;
 3142|      0|            ret = IV_FAIL;
 3143|      0|        }
 3144|  48.8k|    }
 3145|       |
 3146|       |    // output stride needs to be even for all formats other than 400 and 444
 3147|  48.8k|    if(ps_codec->e_chroma_fmt != IV_GRAY && ps_codec->e_chroma_fmt != IV_YUV_444P)
  ------------------
  |  Branch (3147:8): [True: 38.3k, False: 10.5k]
  |  Branch (3147:45): [True: 37.9k, False: 350]
  ------------------
 3148|  37.9k|    {
 3149|  37.9k|        if(strd & 1)
  ------------------
  |  Branch (3149:12): [True: 30, False: 37.9k]
  ------------------
 3150|     30|        {
 3151|     30|            s_ctl_dynparams_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 3152|     30|            s_ctl_dynparams_op->u4_error_code |= IHEVCD_INVALID_DISP_STRD;
 3153|     30|            ret = IV_FAIL;
 3154|     30|        }
 3155|  37.9k|    }
 3156|       |
 3157|  48.8k|    ps_codec->i4_disp_strd = strd;
 3158|  48.8k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (3158:8): [True: 0, False: 48.8k]
  ------------------
 3159|      0|    {
 3160|      0|        ps_codec->i4_strd = strd;
 3161|      0|    }
 3162|       |
 3163|  48.8k|    if(s_ctl_dynparams_ip->e_vid_dec_mode == IVD_DECODE_FRAME)
  ------------------
  |  Branch (3163:8): [True: 24.4k, False: 24.4k]
  ------------------
 3164|  24.4k|        ps_codec->i4_header_mode = 0;
 3165|  24.4k|    else if(s_ctl_dynparams_ip->e_vid_dec_mode == IVD_DECODE_HEADER)
  ------------------
  |  Branch (3165:13): [True: 24.4k, False: 0]
  ------------------
 3166|  24.4k|        ps_codec->i4_header_mode = 1;
 3167|      0|    else
 3168|      0|    {
 3169|       |
 3170|      0|        s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 3171|      0|        ps_codec->i4_header_mode = 1;
 3172|      0|        ret = IV_FAIL;
 3173|      0|    }
 3174|       |
 3175|  48.8k|    ps_codec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 3176|       |
 3177|  48.8k|    if((s_ctl_dynparams_ip->e_frm_out_mode != IVD_DECODE_FRAME_OUT) &&
  ------------------
  |  Branch (3177:8): [True: 48.8k, False: 0]
  ------------------
 3178|  48.8k|       (s_ctl_dynparams_ip->e_frm_out_mode != IVD_DISPLAY_FRAME_OUT))
  ------------------
  |  Branch (3178:8): [True: 0, False: 48.8k]
  ------------------
 3179|      0|    {
 3180|      0|        s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 3181|      0|        ret = IV_FAIL;
 3182|      0|    }
 3183|  48.8k|    ps_codec->e_frm_out_mode = s_ctl_dynparams_ip->e_frm_out_mode;
 3184|       |
 3185|  48.8k|    return ret;
 3186|       |
 3187|  48.8k|}
ihevcd_reset:
 3214|  2.69k|{
 3215|  2.69k|    codec_t *ps_codec;
 3216|  2.69k|    ivd_ctl_reset_op_t *s_ctl_reset_op = (ivd_ctl_reset_op_t *)pv_api_op;
 3217|  2.69k|    UNUSED(pv_api_ip);
  ------------------
  |  |   38|  2.69k|#define UNUSED(x) ((void)(x))
  ------------------
 3218|  2.69k|    ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 3219|       |
 3220|  2.69k|    if(ps_codec != NULL)
  ------------------
  |  Branch (3220:8): [True: 2.69k, False: 0]
  ------------------
 3221|  2.69k|    {
 3222|  2.69k|        DEBUG("\nReset called \n");
  ------------------
  |  |   49|  2.69k|#define DEBUG(...) {}
  ------------------
 3223|  2.69k|        ihevcd_join_threads(ps_codec);
 3224|       |
 3225|  2.69k|        ihevcd_init(ps_codec);
 3226|  2.69k|    }
 3227|      0|    else
 3228|      0|    {
 3229|      0|        DEBUG("\nReset called without Initializing the decoder\n");
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3230|      0|        s_ctl_reset_op->u4_error_code = IHEVCD_INIT_NOT_DONE;
 3231|      0|    }
 3232|       |
 3233|  2.69k|    return IV_SUCCESS;
 3234|  2.69k|}
ihevcd_set_processor:
 3728|  24.4k|{
 3729|  24.4k|    ihevcd_cxa_ctl_set_processor_ip_t *ps_ip;
 3730|  24.4k|    ihevcd_cxa_ctl_set_processor_op_t *ps_op;
 3731|  24.4k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3732|       |
 3733|  24.4k|    ps_ip = (ihevcd_cxa_ctl_set_processor_ip_t *)pv_api_ip;
 3734|  24.4k|    ps_op = (ihevcd_cxa_ctl_set_processor_op_t *)pv_api_op;
 3735|       |
 3736|  24.4k|    ps_codec->e_processor_arch = (IV_ARCH_T)ps_ip->u4_arch;
 3737|  24.4k|    ps_codec->e_processor_soc = (IV_SOC_T)ps_ip->u4_soc;
 3738|       |
 3739|  24.4k|    ihevcd_init_function_ptr(ps_codec);
 3740|       |
 3741|  24.4k|    ihevcd_update_function_ptr(ps_codec);
 3742|       |
 3743|  24.4k|    if(ps_codec->e_processor_soc && (ps_codec->e_processor_soc <= SOC_HISI_37X))
  ------------------
  |  Branch (3743:8): [True: 0, False: 24.4k]
  |  Branch (3743:37): [True: 0, False: 0]
  ------------------
 3744|      0|    {
 3745|       |        /* 8th bit indicates if format conversion is to be done ahead */
 3746|      0|        if(ps_codec->e_processor_soc & 0x80)
  ------------------
  |  Branch (3746:12): [True: 0, False: 0]
  ------------------
 3747|      0|            ps_codec->u4_enable_fmt_conv_ahead = 1;
 3748|       |
 3749|       |        /* Lower 7 bit indicate NCTB - if non-zero */
 3750|      0|        ps_codec->e_processor_soc &= 0x7F;
 3751|       |
 3752|      0|        if(ps_codec->e_processor_soc)
  ------------------
  |  Branch (3752:12): [True: 0, False: 0]
  ------------------
 3753|      0|            ps_codec->u4_nctb = ps_codec->e_processor_soc;
 3754|       |
 3755|       |
 3756|      0|    }
 3757|       |
 3758|  24.4k|    if((ps_codec->e_processor_soc == SOC_HISI_37X) && (ps_codec->i4_num_cores == 2))
  ------------------
  |  Branch (3758:8): [True: 0, False: 24.4k]
  |  Branch (3758:55): [True: 0, False: 0]
  ------------------
 3759|      0|    {
 3760|      0|        ps_codec->u4_nctb = 2;
 3761|      0|    }
 3762|       |
 3763|       |
 3764|  24.4k|    ps_op->u4_error_code = 0;
 3765|  24.4k|    return IV_SUCCESS;
 3766|  24.4k|}
ihevcd_set_num_cores:
 3798|  24.4k|{
 3799|  24.4k|    ihevcd_cxa_ctl_set_num_cores_ip_t *ps_ip;
 3800|  24.4k|    ihevcd_cxa_ctl_set_num_cores_op_t *ps_op;
 3801|  24.4k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3802|       |
 3803|  24.4k|    ps_ip = (ihevcd_cxa_ctl_set_num_cores_ip_t *)pv_api_ip;
 3804|  24.4k|    ps_op = (ihevcd_cxa_ctl_set_num_cores_op_t *)pv_api_op;
 3805|       |
 3806|  24.4k|    ps_codec->i4_num_cores = ps_ip->u4_num_cores;
 3807|  24.4k|    ps_op->u4_error_code = 0;
 3808|  24.4k|    return IV_SUCCESS;
 3809|  24.4k|}
ihevcd_ctl:
 3838|   100k|{
 3839|   100k|    ivd_ctl_set_config_ip_t *ps_ctl_ip;
 3840|   100k|    ivd_ctl_set_config_op_t *ps_ctl_op;
 3841|   100k|    WORD32 ret = 0;
 3842|   100k|    WORD32 subcommand;
 3843|   100k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3844|       |
 3845|   100k|    ps_ctl_ip = (ivd_ctl_set_config_ip_t *)pv_api_ip;
 3846|   100k|    ps_ctl_op = (ivd_ctl_set_config_op_t *)pv_api_op;
 3847|       |
 3848|   100k|    if(ps_codec->i4_init_done != 1)
  ------------------
  |  Branch (3848:8): [True: 0, False: 100k]
  ------------------
 3849|      0|    {
 3850|      0|        ps_ctl_op->u4_error_code |= 1 << IVD_FATALERROR;
 3851|      0|        ps_ctl_op->u4_error_code |= IHEVCD_INIT_NOT_DONE;
 3852|      0|        return IV_FAIL;
 3853|      0|    }
 3854|   100k|    subcommand = ps_ctl_ip->e_sub_cmd;
 3855|       |
 3856|   100k|    switch(subcommand)
 3857|   100k|    {
 3858|      0|        case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (3858:9): [True: 0, False: 100k]
  ------------------
 3859|      0|            ret = ihevcd_get_status(ps_codec_obj, (void *)pv_api_ip,
 3860|      0|                                    (void *)pv_api_op);
 3861|      0|            break;
 3862|  48.8k|        case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (3862:9): [True: 48.8k, False: 51.5k]
  ------------------
 3863|  48.8k|            ret = ihevcd_set_params(ps_codec_obj, (void *)pv_api_ip,
 3864|  48.8k|                                    (void *)pv_api_op);
 3865|  48.8k|            break;
 3866|  2.69k|        case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (3866:9): [True: 2.69k, False: 97.7k]
  ------------------
 3867|  2.69k|            ret = ihevcd_reset(ps_codec_obj, (void *)pv_api_ip,
 3868|  2.69k|                               (void *)pv_api_op);
 3869|  2.69k|            break;
 3870|      0|        case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (3870:9): [True: 0, False: 100k]
  ------------------
 3871|      0|        {
 3872|      0|            ivd_ctl_set_config_op_t *s_ctl_dynparams_op =
 3873|      0|                            (ivd_ctl_set_config_op_t *)pv_api_op;
 3874|       |
 3875|      0|            ret = ihevcd_set_default_params(ps_codec);
 3876|      0|            if(IV_SUCCESS == ret)
  ------------------
  |  Branch (3876:16): [True: 0, False: 0]
  ------------------
 3877|      0|                s_ctl_dynparams_op->u4_error_code = 0;
 3878|      0|            break;
 3879|      0|        }
 3880|      0|        case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (3880:9): [True: 0, False: 100k]
  ------------------
 3881|      0|            ret = ihevcd_set_flush_mode(ps_codec_obj, (void *)pv_api_ip,
 3882|      0|                                        (void *)pv_api_op);
 3883|      0|            break;
 3884|      0|        case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (3884:9): [True: 0, False: 100k]
  ------------------
 3885|      0|            ret = ihevcd_get_buf_info(ps_codec_obj, (void *)pv_api_ip,
 3886|      0|                                      (void *)pv_api_op);
 3887|      0|            break;
 3888|      0|        case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (3888:9): [True: 0, False: 100k]
  ------------------
 3889|      0|        {
 3890|      0|            ivd_ctl_getversioninfo_ip_t *ps_ip;
 3891|      0|            ivd_ctl_getversioninfo_op_t *ps_op;
 3892|      0|            IV_API_CALL_STATUS_T ret;
 3893|      0|            ps_ip = (ivd_ctl_getversioninfo_ip_t *)pv_api_ip;
 3894|      0|            ps_op = (ivd_ctl_getversioninfo_op_t *)pv_api_op;
 3895|       |
 3896|      0|            ps_op->u4_error_code = IV_SUCCESS;
 3897|       |
 3898|      0|            if((WORD32)ps_ip->u4_version_buffer_size <= 0)
  ------------------
  |  Branch (3898:16): [True: 0, False: 0]
  ------------------
 3899|      0|            {
 3900|      0|                ps_op->u4_error_code = IHEVCD_CXA_VERS_BUF_INSUFFICIENT;
 3901|      0|                ret = IV_FAIL;
 3902|      0|            }
 3903|      0|            else
 3904|      0|            {
 3905|      0|                ret = ihevcd_get_version((CHAR *)ps_ip->pv_version_buffer,
 3906|      0|                                         ps_ip->u4_version_buffer_size);
 3907|      0|                if(ret != IV_SUCCESS)
  ------------------
  |  Branch (3907:20): [True: 0, False: 0]
  ------------------
 3908|      0|                {
 3909|      0|                    ps_op->u4_error_code = IHEVCD_CXA_VERS_BUF_INSUFFICIENT;
 3910|      0|                    ret = IV_FAIL;
 3911|      0|                }
 3912|      0|            }
 3913|      0|        }
 3914|      0|            break;
 3915|      0|        case IHEVCD_CXA_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (3915:9): [True: 0, False: 100k]
  ------------------
 3916|      0|            ret = ihevcd_set_degrade(ps_codec_obj, (void *)pv_api_ip,
 3917|      0|                            (void *)pv_api_op);
 3918|      0|            break;
 3919|  24.4k|        case IHEVCD_CXA_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (3919:9): [True: 24.4k, False: 76.0k]
  ------------------
 3920|  24.4k|            ret = ihevcd_set_num_cores(ps_codec_obj, (void *)pv_api_ip,
 3921|  24.4k|                                       (void *)pv_api_op);
 3922|  24.4k|            break;
 3923|      0|        case IHEVCD_CXA_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (3923:9): [True: 0, False: 100k]
  ------------------
 3924|      0|            ret = ihevcd_get_frame_dimensions(ps_codec_obj, (void *)pv_api_ip,
 3925|      0|                                              (void *)pv_api_op);
 3926|      0|            break;
 3927|      0|        case IHEVCD_CXA_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (3927:9): [True: 0, False: 100k]
  ------------------
 3928|      0|            ret = ihevcd_get_vui_params(ps_codec_obj, (void *)pv_api_ip,
 3929|      0|                                        (void *)pv_api_op);
 3930|      0|            break;
 3931|      0|        case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS:
  ------------------
  |  Branch (3931:9): [True: 0, False: 100k]
  ------------------
 3932|      0|#ifndef DISABLE_SEI
 3933|      0|            ret = ihevcd_get_sei_mastering_params(ps_codec_obj, (void *)pv_api_ip,
 3934|      0|                                        (void *)pv_api_op);
 3935|       |#else
 3936|       |            {
 3937|       |                ihevcd_cxa_ctl_get_sei_mastering_params_op_t *ps_op =
 3938|       |                        (ihevcd_cxa_ctl_get_sei_mastering_params_op_t *)pv_api_op;
 3939|       |                ps_op->u4_error_code = IHEVCD_SEI_MASTERING_PARAMS_NOT_FOUND;
 3940|       |                return IV_FAIL;
 3941|       |            }
 3942|       |#endif
 3943|      0|            break;
 3944|  24.4k|        case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (3944:9): [True: 24.4k, False: 76.0k]
  ------------------
 3945|  24.4k|            ret = ihevcd_set_processor(ps_codec_obj, (void *)pv_api_ip,
 3946|  24.4k|                            (void *)pv_api_op);
 3947|  24.4k|            break;
 3948|      0|        default:
  ------------------
  |  Branch (3948:9): [True: 0, False: 100k]
  ------------------
 3949|      0|            DEBUG("\nDo nothing\n");
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3950|      0|            break;
 3951|   100k|    }
 3952|       |
 3953|   100k|    return ret;
 3954|   100k|}
ihevcd_cxa_api_function:
 3986|   431k|{
 3987|   431k|    WORD32 command;
 3988|   431k|    UWORD32 *pu4_ptr_cmd;
 3989|   431k|    WORD32 ret = 0;
 3990|   431k|    IV_API_CALL_STATUS_T e_status;
 3991|   431k|    e_status = api_check_struct_sanity(ps_handle, pv_api_ip, pv_api_op);
 3992|       |
 3993|   431k|    if(e_status != IV_SUCCESS)
  ------------------
  |  Branch (3993:8): [True: 0, False: 431k]
  ------------------
 3994|      0|    {
 3995|      0|        DEBUG("error code = %d\n", *((UWORD32 *)pv_api_op + 1));
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3996|      0|        return IV_FAIL;
 3997|      0|    }
 3998|       |
 3999|   431k|    pu4_ptr_cmd = (UWORD32 *)pv_api_ip;
 4000|   431k|    pu4_ptr_cmd++;
 4001|       |
 4002|   431k|    command = *pu4_ptr_cmd;
 4003|       |
 4004|   431k|    switch(command)
 4005|   431k|    {
 4006|  24.4k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (4006:9): [True: 24.4k, False: 406k]
  ------------------
 4007|  24.4k|            ret = ihevcd_create(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4008|  24.4k|            break;
 4009|  24.4k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (4009:9): [True: 24.4k, False: 406k]
  ------------------
 4010|  24.4k|            ret = ihevcd_delete(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4011|  24.4k|            break;
 4012|       |
 4013|   282k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (4013:9): [True: 282k, False: 149k]
  ------------------
 4014|   282k|            ret = ihevcd_decode(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4015|   282k|            break;
 4016|       |
 4017|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (4017:9): [True: 0, False: 431k]
  ------------------
 4018|       |            //ret = ihevcd_get_display_frame(ps_handle,(void *)pv_api_ip,(void *)pv_api_op);
 4019|      0|            break;
 4020|       |
 4021|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (4021:9): [True: 0, False: 431k]
  ------------------
 4022|      0|            ret = ihevcd_set_display_frame(ps_handle, (void *)pv_api_ip,
 4023|      0|                                           (void *)pv_api_op);
 4024|       |
 4025|      0|            break;
 4026|       |
 4027|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (4027:9): [True: 0, False: 431k]
  ------------------
 4028|      0|            ret = ihevcd_rel_display_frame(ps_handle, (void *)pv_api_ip,
 4029|      0|                                           (void *)pv_api_op);
 4030|      0|            break;
 4031|       |
 4032|   100k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (4032:9): [True: 100k, False: 330k]
  ------------------
 4033|   100k|            ret = ihevcd_ctl(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 4034|   100k|            break;
 4035|      0|        default:
  ------------------
  |  Branch (4035:9): [True: 0, False: 431k]
  ------------------
 4036|      0|            ret = IV_FAIL;
 4037|      0|            break;
 4038|   431k|    }
 4039|       |
 4040|   431k|    return (IV_API_CALL_STATUS_T)ret;
 4041|   431k|}
ihevcd_api.c:api_check_struct_sanity:
  136|   431k|{
  137|   431k|    IVD_API_COMMAND_TYPE_T e_cmd;
  138|   431k|    UWORD32 *pu4_api_ip;
  139|   431k|    UWORD32 *pu4_api_op;
  140|   431k|    WORD32 i;
  141|       |
  142|   431k|    if(NULL == pv_api_op)
  ------------------
  |  Branch (142:8): [True: 0, False: 431k]
  ------------------
  143|      0|        return (IV_FAIL);
  144|       |
  145|   431k|    if(NULL == pv_api_ip)
  ------------------
  |  Branch (145:8): [True: 0, False: 431k]
  ------------------
  146|      0|        return (IV_FAIL);
  147|       |
  148|   431k|    pu4_api_ip = (UWORD32 *)pv_api_ip;
  149|   431k|    pu4_api_op = (UWORD32 *)pv_api_op;
  150|   431k|    e_cmd = (IVD_API_COMMAND_TYPE_T)*(pu4_api_ip + 1);
  151|       |
  152|   431k|    *(pu4_api_op + 1) = 0;
  153|       |    /* error checks on handle */
  154|   431k|    switch((WORD32)e_cmd)
  155|   431k|    {
  156|  24.4k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (156:9): [True: 24.4k, False: 406k]
  ------------------
  157|  24.4k|            break;
  158|       |
  159|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (159:9): [True: 0, False: 431k]
  ------------------
  160|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (160:9): [True: 0, False: 431k]
  ------------------
  161|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (161:9): [True: 0, False: 431k]
  ------------------
  162|   282k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (162:9): [True: 282k, False: 149k]
  ------------------
  163|   306k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (163:9): [True: 24.4k, False: 406k]
  ------------------
  164|   406k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (164:9): [True: 100k, False: 330k]
  ------------------
  165|   406k|            if(ps_handle == NULL)
  ------------------
  |  Branch (165:16): [True: 0, False: 406k]
  ------------------
  166|      0|            {
  167|      0|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  168|      0|                *(pu4_api_op + 1) |= IVD_HANDLE_NULL;
  169|      0|                return IV_FAIL;
  170|      0|            }
  171|       |
  172|   406k|            if(ps_handle->u4_size != sizeof(iv_obj_t))
  ------------------
  |  Branch (172:16): [True: 0, False: 406k]
  ------------------
  173|      0|            {
  174|      0|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  175|      0|                *(pu4_api_op + 1) |= IVD_HANDLE_STRUCT_SIZE_INCORRECT;
  176|      0|                return IV_FAIL;
  177|      0|            }
  178|       |
  179|       |
  180|   406k|            if(ps_handle->pv_codec_handle == NULL)
  ------------------
  |  Branch (180:16): [True: 0, False: 406k]
  ------------------
  181|      0|            {
  182|      0|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  183|      0|                *(pu4_api_op + 1) |= IVD_INVALID_HANDLE_NULL;
  184|      0|                return IV_FAIL;
  185|      0|            }
  186|   406k|            break;
  187|   406k|        default:
  ------------------
  |  Branch (187:9): [True: 0, False: 431k]
  ------------------
  188|      0|            *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  189|      0|            *(pu4_api_op + 1) |= IVD_INVALID_API_CMD;
  190|      0|            return IV_FAIL;
  191|   431k|    }
  192|       |
  193|   431k|    switch((WORD32)e_cmd)
  194|   431k|    {
  195|  24.4k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (195:9): [True: 24.4k, False: 406k]
  ------------------
  196|  24.4k|        {
  197|  24.4k|            ihevcd_cxa_create_ip_t *ps_ip = (ihevcd_cxa_create_ip_t *)pv_api_ip;
  198|  24.4k|            ihevcd_cxa_create_op_t *ps_op = (ihevcd_cxa_create_op_t *)pv_api_op;
  199|       |
  200|       |
  201|  24.4k|            ps_op->s_ivd_create_op_t.u4_error_code = 0;
  202|       |
  203|  24.4k|            if((ps_ip->s_ivd_create_ip_t.u4_size > sizeof(ihevcd_cxa_create_ip_t))
  ------------------
  |  Branch (203:16): [True: 0, False: 24.4k]
  ------------------
  204|  24.4k|                            || (ps_ip->s_ivd_create_ip_t.u4_size
  ------------------
  |  Branch (204:32): [True: 0, False: 24.4k]
  ------------------
  205|  24.4k|                                            < sizeof(ivd_create_ip_t)))
  206|      0|            {
  207|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1
  208|      0|                                << IVD_UNSUPPORTEDPARAM;
  209|      0|                ps_op->s_ivd_create_op_t.u4_error_code |=
  210|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  211|       |
  212|      0|                return (IV_FAIL);
  213|      0|            }
  214|       |
  215|  24.4k|            if((ps_op->s_ivd_create_op_t.u4_size != sizeof(ihevcd_cxa_create_op_t))
  ------------------
  |  Branch (215:16): [True: 0, False: 24.4k]
  ------------------
  216|      0|                            && (ps_op->s_ivd_create_op_t.u4_size
  ------------------
  |  Branch (216:32): [True: 0, False: 0]
  ------------------
  217|      0|                                            != sizeof(ivd_create_op_t)))
  218|      0|            {
  219|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1
  220|      0|                                << IVD_UNSUPPORTEDPARAM;
  221|      0|                ps_op->s_ivd_create_op_t.u4_error_code |=
  222|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  223|       |
  224|      0|                return (IV_FAIL);
  225|      0|            }
  226|       |
  227|       |
  228|  24.4k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P)
  ------------------
  |  Branch (228:16): [True: 14.7k, False: 9.69k]
  ------------------
  229|  14.7k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (229:32): [True: 10.1k, False: 4.56k]
  ------------------
  230|  14.7k|                                            != IV_YUV_420SP_UV)
  231|  10.1k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (231:32): [True: 6.17k, False: 4.00k]
  ------------------
  232|  10.1k|                                            != IV_YUV_420SP_VU)
  233|  6.17k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (233:32): [True: 900, False: 5.27k]
  ------------------
  234|  6.17k|                                            != IV_GRAY)
  235|    900|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (235:32): [True: 725, False: 175]
  ------------------
  236|    900|                                            != IV_YUV_444P)
  237|    725|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (237:32): [True: 0, False: 725]
  ------------------
  238|    725|                                             != IV_YUV_422P))
  239|      0|            {
  240|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1
  241|      0|                                << IVD_UNSUPPORTEDPARAM;
  242|      0|                ps_op->s_ivd_create_op_t.u4_error_code |=
  243|      0|                                IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
  244|       |
  245|      0|                return (IV_FAIL);
  246|      0|            }
  247|       |
  248|       |            /* Shared display mode is supported only for 420SP and 420P formats */
  249|  24.4k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P)
  ------------------
  |  Branch (249:16): [True: 14.7k, False: 9.69k]
  ------------------
  250|  14.7k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV)
  ------------------
  |  Branch (250:32): [True: 10.1k, False: 4.56k]
  ------------------
  251|  10.1k|                            && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU)
  ------------------
  |  Branch (251:32): [True: 6.17k, False: 4.00k]
  ------------------
  252|  6.17k|                            && ps_ip->s_ivd_create_ip_t.u4_share_disp_buf == 1)
  ------------------
  |  Branch (252:32): [True: 0, False: 6.17k]
  ------------------
  253|      0|            {
  254|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1
  255|      0|                                << IVD_UNSUPPORTEDPARAM;
  256|      0|                ps_op->s_ivd_create_op_t.u4_error_code |=
  257|      0|                                IVD_INIT_DEC_FAILED;
  258|      0|                return (IV_FAIL);
  259|      0|            }
  260|       |
  261|  24.4k|        }
  262|  24.4k|            break;
  263|       |
  264|  24.4k|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (264:9): [True: 0, False: 431k]
  ------------------
  265|      0|        {
  266|      0|            ihevcd_cxa_get_display_frame_ip_t *ps_ip =
  267|      0|                            (ihevcd_cxa_get_display_frame_ip_t *)pv_api_ip;
  268|      0|            ihevcd_cxa_get_display_frame_op_t *ps_op =
  269|      0|                            (ihevcd_cxa_get_display_frame_op_t *)pv_api_op;
  270|       |
  271|      0|            ps_op->s_ivd_get_display_frame_op_t.u4_error_code = 0;
  272|       |
  273|      0|            if((ps_ip->s_ivd_get_display_frame_ip_t.u4_size
  ------------------
  |  Branch (273:16): [True: 0, False: 0]
  ------------------
  274|      0|                            != sizeof(ihevcd_cxa_get_display_frame_ip_t))
  275|      0|                            && (ps_ip->s_ivd_get_display_frame_ip_t.u4_size
  ------------------
  |  Branch (275:32): [True: 0, False: 0]
  ------------------
  276|      0|                                            != sizeof(ivd_get_display_frame_ip_t)))
  277|      0|            {
  278|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |= 1
  279|      0|                                << IVD_UNSUPPORTEDPARAM;
  280|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |=
  281|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  282|      0|                return (IV_FAIL);
  283|      0|            }
  284|       |
  285|      0|            if((ps_op->s_ivd_get_display_frame_op_t.u4_size
  ------------------
  |  Branch (285:16): [True: 0, False: 0]
  ------------------
  286|      0|                            != sizeof(ihevcd_cxa_get_display_frame_op_t))
  287|      0|                            && (ps_op->s_ivd_get_display_frame_op_t.u4_size
  ------------------
  |  Branch (287:32): [True: 0, False: 0]
  ------------------
  288|      0|                                            != sizeof(ivd_get_display_frame_op_t)))
  289|      0|            {
  290|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |= 1
  291|      0|                                << IVD_UNSUPPORTEDPARAM;
  292|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |=
  293|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  294|      0|                return (IV_FAIL);
  295|      0|            }
  296|       |
  297|      0|        }
  298|      0|            break;
  299|       |
  300|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (300:9): [True: 0, False: 431k]
  ------------------
  301|      0|        {
  302|      0|            ihevcd_cxa_rel_display_frame_ip_t *ps_ip =
  303|      0|                            (ihevcd_cxa_rel_display_frame_ip_t *)pv_api_ip;
  304|      0|            ihevcd_cxa_rel_display_frame_op_t *ps_op =
  305|      0|                            (ihevcd_cxa_rel_display_frame_op_t *)pv_api_op;
  306|       |
  307|      0|            ps_op->s_ivd_rel_display_frame_op_t.u4_error_code = 0;
  308|       |
  309|      0|            if((ps_ip->s_ivd_rel_display_frame_ip_t.u4_size
  ------------------
  |  Branch (309:16): [True: 0, False: 0]
  ------------------
  310|      0|                            != sizeof(ihevcd_cxa_rel_display_frame_ip_t))
  311|      0|                            && (ps_ip->s_ivd_rel_display_frame_ip_t.u4_size
  ------------------
  |  Branch (311:32): [True: 0, False: 0]
  ------------------
  312|      0|                                            != sizeof(ivd_rel_display_frame_ip_t)))
  313|      0|            {
  314|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |= 1
  315|      0|                                << IVD_UNSUPPORTEDPARAM;
  316|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |=
  317|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  318|      0|                return (IV_FAIL);
  319|      0|            }
  320|       |
  321|      0|            if((ps_op->s_ivd_rel_display_frame_op_t.u4_size
  ------------------
  |  Branch (321:16): [True: 0, False: 0]
  ------------------
  322|      0|                            != sizeof(ihevcd_cxa_rel_display_frame_op_t))
  323|      0|                            && (ps_op->s_ivd_rel_display_frame_op_t.u4_size
  ------------------
  |  Branch (323:32): [True: 0, False: 0]
  ------------------
  324|      0|                                            != sizeof(ivd_rel_display_frame_op_t)))
  325|      0|            {
  326|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |= 1
  327|      0|                                << IVD_UNSUPPORTEDPARAM;
  328|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |=
  329|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  330|      0|                return (IV_FAIL);
  331|      0|            }
  332|       |
  333|      0|        }
  334|      0|            break;
  335|       |
  336|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (336:9): [True: 0, False: 431k]
  ------------------
  337|      0|        {
  338|      0|            ihevcd_cxa_set_display_frame_ip_t *ps_ip =
  339|      0|                            (ihevcd_cxa_set_display_frame_ip_t *)pv_api_ip;
  340|      0|            ihevcd_cxa_set_display_frame_op_t *ps_op =
  341|      0|                            (ihevcd_cxa_set_display_frame_op_t *)pv_api_op;
  342|      0|            UWORD32 j;
  343|       |
  344|      0|            ps_op->s_ivd_set_display_frame_op_t.u4_error_code = 0;
  345|       |
  346|      0|            if((ps_ip->s_ivd_set_display_frame_ip_t.u4_size
  ------------------
  |  Branch (346:16): [True: 0, False: 0]
  ------------------
  347|      0|                            != sizeof(ihevcd_cxa_set_display_frame_ip_t))
  348|      0|                            && (ps_ip->s_ivd_set_display_frame_ip_t.u4_size
  ------------------
  |  Branch (348:32): [True: 0, False: 0]
  ------------------
  349|      0|                                            != sizeof(ivd_set_display_frame_ip_t)))
  350|      0|            {
  351|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  352|      0|                                << IVD_UNSUPPORTEDPARAM;
  353|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  354|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  355|      0|                return (IV_FAIL);
  356|      0|            }
  357|       |
  358|      0|            if((ps_op->s_ivd_set_display_frame_op_t.u4_size
  ------------------
  |  Branch (358:16): [True: 0, False: 0]
  ------------------
  359|      0|                            != sizeof(ihevcd_cxa_set_display_frame_op_t))
  360|      0|                            && (ps_op->s_ivd_set_display_frame_op_t.u4_size
  ------------------
  |  Branch (360:32): [True: 0, False: 0]
  ------------------
  361|      0|                                            != sizeof(ivd_set_display_frame_op_t)))
  362|      0|            {
  363|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  364|      0|                                << IVD_UNSUPPORTEDPARAM;
  365|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  366|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  367|      0|                return (IV_FAIL);
  368|      0|            }
  369|       |
  370|      0|            if(ps_ip->s_ivd_set_display_frame_ip_t.num_disp_bufs == 0)
  ------------------
  |  Branch (370:16): [True: 0, False: 0]
  ------------------
  371|      0|            {
  372|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  373|      0|                                << IVD_UNSUPPORTEDPARAM;
  374|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  375|      0|                                IVD_DISP_FRM_ZERO_OP_BUFS;
  376|      0|                return IV_FAIL;
  377|      0|            }
  378|       |
  379|      0|            for(j = 0; j < ps_ip->s_ivd_set_display_frame_ip_t.num_disp_bufs;
  ------------------
  |  Branch (379:24): [True: 0, False: 0]
  ------------------
  380|      0|                            j++)
  381|      0|            {
  382|      0|                if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_num_bufs
  ------------------
  |  Branch (382:20): [True: 0, False: 0]
  ------------------
  383|      0|                                == 0)
  384|      0|                {
  385|      0|                    ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  386|      0|                                    << IVD_UNSUPPORTEDPARAM;
  387|      0|                    ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  388|      0|                                    IVD_DISP_FRM_ZERO_OP_BUFS;
  389|      0|                    return IV_FAIL;
  390|      0|                }
  391|       |
  392|      0|                for(i = 0;
  393|      0|                                i
  ------------------
  |  Branch (393:33): [True: 0, False: 0]
  ------------------
  394|      0|                                                < (WORD32)ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_num_bufs;
  395|      0|                                i++)
  396|      0|                {
  397|      0|                    if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].pu1_bufs[i]
  ------------------
  |  Branch (397:24): [True: 0, False: 0]
  ------------------
  398|      0|                                    == NULL)
  399|      0|                    {
  400|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  401|      0|                                        << IVD_UNSUPPORTEDPARAM;
  402|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  403|      0|                                        IVD_DISP_FRM_OP_BUF_NULL;
  404|      0|                        return IV_FAIL;
  405|      0|                    }
  406|       |
  407|      0|                    if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_min_out_buf_size[i]
  ------------------
  |  Branch (407:24): [True: 0, False: 0]
  ------------------
  408|      0|                                    == 0)
  409|      0|                    {
  410|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  411|      0|                                        << IVD_UNSUPPORTEDPARAM;
  412|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  413|      0|                                        IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  414|      0|                        return IV_FAIL;
  415|      0|                    }
  416|      0|                }
  417|      0|            }
  418|      0|        }
  419|      0|            break;
  420|       |
  421|   282k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (421:9): [True: 282k, False: 149k]
  ------------------
  422|   282k|        {
  423|   282k|            ihevcd_cxa_video_decode_ip_t *ps_ip =
  424|   282k|                            (ihevcd_cxa_video_decode_ip_t *)pv_api_ip;
  425|   282k|            ihevcd_cxa_video_decode_op_t *ps_op =
  426|   282k|                            (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  427|       |
  428|   282k|            DEBUG("The input bytes is: %d",
  ------------------
  |  |   49|   282k|#define DEBUG(...) {}
  ------------------
  429|   282k|                            ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes);
  430|   282k|            ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
  431|       |
  432|   282k|            if(ps_ip->s_ivd_video_decode_ip_t.u4_size
  ------------------
  |  Branch (432:16): [True: 282k, False: 0]
  ------------------
  433|   282k|                            != sizeof(ihevcd_cxa_video_decode_ip_t)
  434|   282k|                            && ps_ip->s_ivd_video_decode_ip_t.u4_size
  ------------------
  |  Branch (434:32): [True: 0, False: 282k]
  ------------------
  435|   282k|                                            != sizeof(ivd_video_decode_ip_t))
  436|      0|            {
  437|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1
  438|      0|                                << IVD_UNSUPPORTEDPARAM;
  439|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  440|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  441|      0|                return (IV_FAIL);
  442|      0|            }
  443|       |
  444|   282k|            if(ps_op->s_ivd_video_decode_op_t.u4_size
  ------------------
  |  Branch (444:16): [True: 282k, False: 0]
  ------------------
  445|   282k|                            != sizeof(ihevcd_cxa_video_decode_op_t)
  446|   282k|                            && ps_op->s_ivd_video_decode_op_t.u4_size
  ------------------
  |  Branch (446:32): [True: 0, False: 282k]
  ------------------
  447|   282k|                                            != sizeof(ivd_video_decode_op_t))
  448|      0|            {
  449|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1
  450|      0|                                << IVD_UNSUPPORTEDPARAM;
  451|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  452|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  453|      0|                return (IV_FAIL);
  454|      0|            }
  455|       |
  456|   282k|            if(((codec_t *)(ps_handle->pv_codec_handle))->u1_enable_cu_info
  ------------------
  |  Branch (456:16): [True: 0, False: 282k]
  ------------------
  457|      0|                            && !ps_ip->pu1_8x8_blk_qp_map && !ps_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (457:32): [True: 0, False: 0]
  |  Branch (457:62): [True: 0, False: 0]
  ------------------
  458|      0|            {
  459|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1
  460|      0|                                << IVD_UNSUPPORTEDPARAM;
  461|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  462|      0|                                IHEVCD_FRAME_INFO_OP_BUF_NULL;
  463|      0|                return (IV_FAIL);
  464|      0|            }
  465|       |
  466|   282k|        }
  467|   282k|            break;
  468|       |
  469|   282k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (469:9): [True: 24.4k, False: 406k]
  ------------------
  470|  24.4k|        {
  471|  24.4k|            ihevcd_cxa_delete_ip_t *ps_ip =
  472|  24.4k|                            (ihevcd_cxa_delete_ip_t *)pv_api_ip;
  473|  24.4k|            ihevcd_cxa_delete_op_t *ps_op =
  474|  24.4k|                            (ihevcd_cxa_delete_op_t *)pv_api_op;
  475|       |
  476|  24.4k|            ps_op->s_ivd_delete_op_t.u4_error_code = 0;
  477|       |
  478|  24.4k|            if(ps_ip->s_ivd_delete_ip_t.u4_size
  ------------------
  |  Branch (478:16): [True: 0, False: 24.4k]
  ------------------
  479|  24.4k|                            != sizeof(ihevcd_cxa_delete_ip_t))
  480|      0|            {
  481|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= 1
  482|      0|                                << IVD_UNSUPPORTEDPARAM;
  483|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |=
  484|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  485|      0|                return (IV_FAIL);
  486|      0|            }
  487|       |
  488|  24.4k|            if(ps_op->s_ivd_delete_op_t.u4_size
  ------------------
  |  Branch (488:16): [True: 0, False: 24.4k]
  ------------------
  489|  24.4k|                            != sizeof(ihevcd_cxa_delete_op_t))
  490|      0|            {
  491|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= 1
  492|      0|                                << IVD_UNSUPPORTEDPARAM;
  493|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |=
  494|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  495|      0|                return (IV_FAIL);
  496|      0|            }
  497|       |
  498|  24.4k|        }
  499|  24.4k|            break;
  500|       |
  501|   100k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (501:9): [True: 100k, False: 330k]
  ------------------
  502|   100k|        {
  503|   100k|            UWORD32 *pu4_ptr_cmd;
  504|   100k|            UWORD32 sub_command;
  505|       |
  506|   100k|            pu4_ptr_cmd = (UWORD32 *)pv_api_ip;
  507|   100k|            pu4_ptr_cmd += 2;
  508|   100k|            sub_command = *pu4_ptr_cmd;
  509|       |
  510|   100k|            switch(sub_command)
  511|   100k|            {
  512|  48.8k|                case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (512:17): [True: 48.8k, False: 51.5k]
  ------------------
  513|  48.8k|                {
  514|  48.8k|                    ihevcd_cxa_ctl_set_config_ip_t *ps_ip;
  515|  48.8k|                    ihevcd_cxa_ctl_set_config_op_t *ps_op;
  516|  48.8k|                    ps_ip = (ihevcd_cxa_ctl_set_config_ip_t *)pv_api_ip;
  517|  48.8k|                    ps_op = (ihevcd_cxa_ctl_set_config_op_t *)pv_api_op;
  518|       |
  519|  48.8k|                    if(ps_ip->s_ivd_ctl_set_config_ip_t.u4_size
  ------------------
  |  Branch (519:24): [True: 0, False: 48.8k]
  ------------------
  520|  48.8k|                                    != sizeof(ihevcd_cxa_ctl_set_config_ip_t) &&
  521|      0|                                    ps_ip->s_ivd_ctl_set_config_ip_t.u4_size
  ------------------
  |  Branch (521:37): [True: 0, False: 0]
  ------------------
  522|      0|                                                != sizeof(ivd_ctl_set_config_ip_t))
  523|      0|                    {
  524|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |= 1
  525|      0|                                        << IVD_UNSUPPORTEDPARAM;
  526|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |=
  527|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  528|      0|                        return IV_FAIL;
  529|      0|                    }
  530|  48.8k|                }
  531|       |                    //no break; is needed here
  532|  48.8k|                case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (532:17): [True: 0, False: 100k]
  ------------------
  533|  48.8k|                {
  534|  48.8k|                    ihevcd_cxa_ctl_set_config_op_t *ps_op;
  535|  48.8k|                    ps_op = (ihevcd_cxa_ctl_set_config_op_t *)pv_api_op;
  536|  48.8k|                    if(ps_op->s_ivd_ctl_set_config_op_t.u4_size
  ------------------
  |  Branch (536:24): [True: 0, False: 48.8k]
  ------------------
  537|  48.8k|                                    != sizeof(ihevcd_cxa_ctl_set_config_op_t))
  538|      0|                    {
  539|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |= 1
  540|      0|                                        << IVD_UNSUPPORTEDPARAM;
  541|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |=
  542|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  543|      0|                        return IV_FAIL;
  544|      0|                    }
  545|  48.8k|                }
  546|  48.8k|                    break;
  547|       |
  548|  48.8k|                case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (548:17): [True: 0, False: 100k]
  ------------------
  549|      0|                {
  550|      0|                    ihevcd_cxa_ctl_getstatus_ip_t *ps_ip;
  551|      0|                    ihevcd_cxa_ctl_getstatus_op_t *ps_op;
  552|       |
  553|      0|                    ps_ip = (ihevcd_cxa_ctl_getstatus_ip_t *)pv_api_ip;
  554|      0|                    ps_op = (ihevcd_cxa_ctl_getstatus_op_t *)pv_api_op;
  555|      0|                    if(ps_ip->s_ivd_ctl_getstatus_ip_t.u4_size
  ------------------
  |  Branch (555:24): [True: 0, False: 0]
  ------------------
  556|      0|                                    != sizeof(ihevcd_cxa_ctl_getstatus_ip_t))
  557|      0|                    {
  558|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |= 1
  559|      0|                                        << IVD_UNSUPPORTEDPARAM;
  560|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |=
  561|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  562|      0|                        return IV_FAIL;
  563|      0|                    }
  564|      0|                    if((ps_op->s_ivd_ctl_getstatus_op_t.u4_size
  ------------------
  |  Branch (564:24): [True: 0, False: 0]
  ------------------
  565|      0|                                    != sizeof(ihevcd_cxa_ctl_getstatus_op_t)) &&
  566|      0|                       (ps_op->s_ivd_ctl_getstatus_op_t.u4_size
  ------------------
  |  Branch (566:24): [True: 0, False: 0]
  ------------------
  567|      0|                                    != sizeof(ivd_ctl_getstatus_op_t)))
  568|      0|                    {
  569|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |= 1
  570|      0|                                        << IVD_UNSUPPORTEDPARAM;
  571|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |=
  572|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  573|      0|                        return IV_FAIL;
  574|      0|                    }
  575|      0|                }
  576|      0|                    break;
  577|       |
  578|      0|                case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (578:17): [True: 0, False: 100k]
  ------------------
  579|      0|                {
  580|      0|                    ihevcd_cxa_ctl_getbufinfo_ip_t *ps_ip;
  581|      0|                    ihevcd_cxa_ctl_getbufinfo_op_t *ps_op;
  582|      0|                    ps_ip = (ihevcd_cxa_ctl_getbufinfo_ip_t *)pv_api_ip;
  583|      0|                    ps_op = (ihevcd_cxa_ctl_getbufinfo_op_t *)pv_api_op;
  584|       |
  585|      0|                    if(ps_ip->s_ivd_ctl_getbufinfo_ip_t.u4_size
  ------------------
  |  Branch (585:24): [True: 0, False: 0]
  ------------------
  586|      0|                                    != sizeof(ihevcd_cxa_ctl_getbufinfo_ip_t))
  587|      0|                    {
  588|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |= 1
  589|      0|                                        << IVD_UNSUPPORTEDPARAM;
  590|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |=
  591|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  592|      0|                        return IV_FAIL;
  593|      0|                    }
  594|      0|                    if(ps_op->s_ivd_ctl_getbufinfo_op_t.u4_size
  ------------------
  |  Branch (594:24): [True: 0, False: 0]
  ------------------
  595|      0|                                    != sizeof(ihevcd_cxa_ctl_getbufinfo_op_t))
  596|      0|                    {
  597|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |= 1
  598|      0|                                        << IVD_UNSUPPORTEDPARAM;
  599|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |=
  600|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  601|      0|                        return IV_FAIL;
  602|      0|                    }
  603|      0|                }
  604|      0|                    break;
  605|       |
  606|      0|                case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (606:17): [True: 0, False: 100k]
  ------------------
  607|      0|                {
  608|      0|                    ihevcd_cxa_ctl_getversioninfo_ip_t *ps_ip;
  609|      0|                    ihevcd_cxa_ctl_getversioninfo_op_t *ps_op;
  610|      0|                    ps_ip = (ihevcd_cxa_ctl_getversioninfo_ip_t *)pv_api_ip;
  611|      0|                    ps_op = (ihevcd_cxa_ctl_getversioninfo_op_t *)pv_api_op;
  612|      0|                    if(ps_ip->s_ivd_ctl_getversioninfo_ip_t.u4_size
  ------------------
  |  Branch (612:24): [True: 0, False: 0]
  ------------------
  613|      0|                                    != sizeof(ihevcd_cxa_ctl_getversioninfo_ip_t))
  614|      0|                    {
  615|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |= 1
  616|      0|                                        << IVD_UNSUPPORTEDPARAM;
  617|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  618|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  619|      0|                        return IV_FAIL;
  620|      0|                    }
  621|      0|                    if(ps_op->s_ivd_ctl_getversioninfo_op_t.u4_size
  ------------------
  |  Branch (621:24): [True: 0, False: 0]
  ------------------
  622|      0|                                    != sizeof(ihevcd_cxa_ctl_getversioninfo_op_t))
  623|      0|                    {
  624|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |= 1
  625|      0|                                        << IVD_UNSUPPORTEDPARAM;
  626|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  627|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  628|      0|                        return IV_FAIL;
  629|      0|                    }
  630|      0|                }
  631|      0|                    break;
  632|       |
  633|      0|                case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (633:17): [True: 0, False: 100k]
  ------------------
  634|      0|                {
  635|      0|                    ihevcd_cxa_ctl_flush_ip_t *ps_ip;
  636|      0|                    ihevcd_cxa_ctl_flush_op_t *ps_op;
  637|      0|                    ps_ip = (ihevcd_cxa_ctl_flush_ip_t *)pv_api_ip;
  638|      0|                    ps_op = (ihevcd_cxa_ctl_flush_op_t *)pv_api_op;
  639|      0|                    if(ps_ip->s_ivd_ctl_flush_ip_t.u4_size
  ------------------
  |  Branch (639:24): [True: 0, False: 0]
  ------------------
  640|      0|                                    != sizeof(ihevcd_cxa_ctl_flush_ip_t))
  641|      0|                    {
  642|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |= 1
  643|      0|                                        << IVD_UNSUPPORTEDPARAM;
  644|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |=
  645|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  646|      0|                        return IV_FAIL;
  647|      0|                    }
  648|      0|                    if(ps_op->s_ivd_ctl_flush_op_t.u4_size
  ------------------
  |  Branch (648:24): [True: 0, False: 0]
  ------------------
  649|      0|                                    != sizeof(ihevcd_cxa_ctl_flush_op_t))
  650|      0|                    {
  651|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |= 1
  652|      0|                                        << IVD_UNSUPPORTEDPARAM;
  653|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |=
  654|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  655|      0|                        return IV_FAIL;
  656|      0|                    }
  657|      0|                }
  658|      0|                    break;
  659|       |
  660|  2.69k|                case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (660:17): [True: 2.69k, False: 97.7k]
  ------------------
  661|  2.69k|                {
  662|  2.69k|                    ihevcd_cxa_ctl_reset_ip_t *ps_ip;
  663|  2.69k|                    ihevcd_cxa_ctl_reset_op_t *ps_op;
  664|  2.69k|                    ps_ip = (ihevcd_cxa_ctl_reset_ip_t *)pv_api_ip;
  665|  2.69k|                    ps_op = (ihevcd_cxa_ctl_reset_op_t *)pv_api_op;
  666|  2.69k|                    if(ps_ip->s_ivd_ctl_reset_ip_t.u4_size
  ------------------
  |  Branch (666:24): [True: 0, False: 2.69k]
  ------------------
  667|  2.69k|                                    != sizeof(ihevcd_cxa_ctl_reset_ip_t))
  668|      0|                    {
  669|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |= 1
  670|      0|                                        << IVD_UNSUPPORTEDPARAM;
  671|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |=
  672|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  673|      0|                        return IV_FAIL;
  674|      0|                    }
  675|  2.69k|                    if(ps_op->s_ivd_ctl_reset_op_t.u4_size
  ------------------
  |  Branch (675:24): [True: 0, False: 2.69k]
  ------------------
  676|  2.69k|                                    != sizeof(ihevcd_cxa_ctl_reset_op_t))
  677|      0|                    {
  678|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |= 1
  679|      0|                                        << IVD_UNSUPPORTEDPARAM;
  680|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |=
  681|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  682|      0|                        return IV_FAIL;
  683|      0|                    }
  684|  2.69k|                }
  685|  2.69k|                    break;
  686|  2.69k|                case IHEVCD_CXA_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (686:17): [True: 0, False: 100k]
  ------------------
  687|      0|                {
  688|      0|                    ihevcd_cxa_ctl_degrade_ip_t *ps_ip;
  689|      0|                    ihevcd_cxa_ctl_degrade_op_t *ps_op;
  690|       |
  691|      0|                    ps_ip = (ihevcd_cxa_ctl_degrade_ip_t *)pv_api_ip;
  692|      0|                    ps_op = (ihevcd_cxa_ctl_degrade_op_t *)pv_api_op;
  693|       |
  694|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (694:24): [True: 0, False: 0]
  ------------------
  695|      0|                                    != sizeof(ihevcd_cxa_ctl_degrade_ip_t))
  696|      0|                    {
  697|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  698|      0|                        ps_op->u4_error_code |=
  699|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  700|      0|                        return IV_FAIL;
  701|      0|                    }
  702|       |
  703|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (703:24): [True: 0, False: 0]
  ------------------
  704|      0|                                    != sizeof(ihevcd_cxa_ctl_degrade_op_t))
  705|      0|                    {
  706|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  707|      0|                        ps_op->u4_error_code |=
  708|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  709|      0|                        return IV_FAIL;
  710|      0|                    }
  711|       |
  712|      0|                    if((ps_ip->i4_degrade_pics < 0) ||
  ------------------
  |  Branch (712:24): [True: 0, False: 0]
  ------------------
  713|      0|                       (ps_ip->i4_degrade_pics > 4) ||
  ------------------
  |  Branch (713:24): [True: 0, False: 0]
  ------------------
  714|      0|                       (ps_ip->i4_nondegrade_interval < 0) ||
  ------------------
  |  Branch (714:24): [True: 0, False: 0]
  ------------------
  715|      0|                       (ps_ip->i4_degrade_type < 0) ||
  ------------------
  |  Branch (715:24): [True: 0, False: 0]
  ------------------
  716|      0|                       (ps_ip->i4_degrade_type > 15))
  ------------------
  |  Branch (716:24): [True: 0, False: 0]
  ------------------
  717|      0|                    {
  718|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  719|      0|                        return IV_FAIL;
  720|      0|                    }
  721|       |
  722|      0|                    break;
  723|      0|                }
  724|       |
  725|      0|                case IHEVCD_CXA_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (725:17): [True: 0, False: 100k]
  ------------------
  726|      0|                {
  727|      0|                    ihevcd_cxa_ctl_get_frame_dimensions_ip_t *ps_ip;
  728|      0|                    ihevcd_cxa_ctl_get_frame_dimensions_op_t *ps_op;
  729|       |
  730|      0|                    ps_ip =
  731|      0|                                    (ihevcd_cxa_ctl_get_frame_dimensions_ip_t *)pv_api_ip;
  732|      0|                    ps_op =
  733|      0|                                    (ihevcd_cxa_ctl_get_frame_dimensions_op_t *)pv_api_op;
  734|       |
  735|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (735:24): [True: 0, False: 0]
  ------------------
  736|      0|                                    != sizeof(ihevcd_cxa_ctl_get_frame_dimensions_ip_t))
  737|      0|                    {
  738|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  739|      0|                        ps_op->u4_error_code |=
  740|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  741|      0|                        return IV_FAIL;
  742|      0|                    }
  743|       |
  744|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (744:24): [True: 0, False: 0]
  ------------------
  745|      0|                                    != sizeof(ihevcd_cxa_ctl_get_frame_dimensions_op_t))
  746|      0|                    {
  747|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  748|      0|                        ps_op->u4_error_code |=
  749|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  750|      0|                        return IV_FAIL;
  751|      0|                    }
  752|       |
  753|      0|                    break;
  754|      0|                }
  755|       |
  756|      0|                case IHEVCD_CXA_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (756:17): [True: 0, False: 100k]
  ------------------
  757|      0|                {
  758|      0|                    ihevcd_cxa_ctl_get_vui_params_ip_t *ps_ip;
  759|      0|                    ihevcd_cxa_ctl_get_vui_params_op_t *ps_op;
  760|       |
  761|      0|                    ps_ip =
  762|      0|                                    (ihevcd_cxa_ctl_get_vui_params_ip_t *)pv_api_ip;
  763|      0|                    ps_op =
  764|      0|                                    (ihevcd_cxa_ctl_get_vui_params_op_t *)pv_api_op;
  765|       |
  766|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (766:24): [True: 0, False: 0]
  ------------------
  767|      0|                                    != sizeof(ihevcd_cxa_ctl_get_vui_params_ip_t))
  768|      0|                    {
  769|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  770|      0|                        ps_op->u4_error_code |=
  771|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  772|      0|                        return IV_FAIL;
  773|      0|                    }
  774|       |
  775|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (775:24): [True: 0, False: 0]
  ------------------
  776|      0|                                    != sizeof(ihevcd_cxa_ctl_get_vui_params_op_t))
  777|      0|                    {
  778|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  779|      0|                        ps_op->u4_error_code |=
  780|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  781|      0|                        return IV_FAIL;
  782|      0|                    }
  783|       |
  784|      0|                    break;
  785|      0|                }
  786|      0|#ifndef DISABLE_SEI
  787|      0|                case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS:
  ------------------
  |  Branch (787:17): [True: 0, False: 100k]
  ------------------
  788|      0|                {
  789|      0|                    ihevcd_cxa_ctl_get_sei_mastering_params_ip_t *ps_ip;
  790|      0|                    ihevcd_cxa_ctl_get_sei_mastering_params_op_t *ps_op;
  791|       |
  792|      0|                    ps_ip = (ihevcd_cxa_ctl_get_sei_mastering_params_ip_t *)pv_api_ip;
  793|      0|                    ps_op = (ihevcd_cxa_ctl_get_sei_mastering_params_op_t *)pv_api_op;
  794|       |
  795|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (795:24): [True: 0, False: 0]
  ------------------
  796|      0|                                    != sizeof(ihevcd_cxa_ctl_get_sei_mastering_params_ip_t))
  797|      0|                    {
  798|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  799|      0|                        ps_op->u4_error_code |=
  800|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  801|      0|                        return IV_FAIL;
  802|      0|                    }
  803|       |
  804|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (804:24): [True: 0, False: 0]
  ------------------
  805|      0|                                    != sizeof(ihevcd_cxa_ctl_get_sei_mastering_params_op_t))
  806|      0|                    {
  807|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  808|      0|                        ps_op->u4_error_code |=
  809|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  810|      0|                        return IV_FAIL;
  811|      0|                    }
  812|       |
  813|      0|                    break;
  814|      0|                }
  815|      0|#endif
  816|  24.4k|                case IHEVCD_CXA_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (816:17): [True: 24.4k, False: 76.0k]
  ------------------
  817|  24.4k|                {
  818|  24.4k|                    ihevcd_cxa_ctl_set_num_cores_ip_t *ps_ip;
  819|  24.4k|                    ihevcd_cxa_ctl_set_num_cores_op_t *ps_op;
  820|       |
  821|  24.4k|                    ps_ip = (ihevcd_cxa_ctl_set_num_cores_ip_t *)pv_api_ip;
  822|  24.4k|                    ps_op = (ihevcd_cxa_ctl_set_num_cores_op_t *)pv_api_op;
  823|       |
  824|  24.4k|                    if(ps_ip->u4_size
  ------------------
  |  Branch (824:24): [True: 0, False: 24.4k]
  ------------------
  825|  24.4k|                                    != sizeof(ihevcd_cxa_ctl_set_num_cores_ip_t))
  826|      0|                    {
  827|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  828|      0|                        ps_op->u4_error_code |=
  829|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  830|      0|                        return IV_FAIL;
  831|      0|                    }
  832|       |
  833|  24.4k|                    if(ps_op->u4_size
  ------------------
  |  Branch (833:24): [True: 0, False: 24.4k]
  ------------------
  834|  24.4k|                                    != sizeof(ihevcd_cxa_ctl_set_num_cores_op_t))
  835|      0|                    {
  836|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  837|      0|                        ps_op->u4_error_code |=
  838|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  839|      0|                        return IV_FAIL;
  840|      0|                    }
  841|       |
  842|  24.4k|                    if((ps_ip->u4_num_cores < 1) || (ps_ip->u4_num_cores > MAX_NUM_CORES))
  ------------------
  |  |  116|  24.4k|#define MAX_NUM_CORES       8
  ------------------
  |  Branch (842:24): [True: 0, False: 24.4k]
  |  Branch (842:53): [True: 0, False: 24.4k]
  ------------------
  843|      0|                    {
  844|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  845|      0|                        return IV_FAIL;
  846|      0|                    }
  847|  24.4k|                    break;
  848|  24.4k|                }
  849|  24.4k|                case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (849:17): [True: 24.4k, False: 76.0k]
  ------------------
  850|  24.4k|                {
  851|  24.4k|                    ihevcd_cxa_ctl_set_processor_ip_t *ps_ip;
  852|  24.4k|                    ihevcd_cxa_ctl_set_processor_op_t *ps_op;
  853|       |
  854|  24.4k|                    ps_ip = (ihevcd_cxa_ctl_set_processor_ip_t *)pv_api_ip;
  855|  24.4k|                    ps_op = (ihevcd_cxa_ctl_set_processor_op_t *)pv_api_op;
  856|       |
  857|  24.4k|                    if(ps_ip->u4_size
  ------------------
  |  Branch (857:24): [True: 0, False: 24.4k]
  ------------------
  858|  24.4k|                                    != sizeof(ihevcd_cxa_ctl_set_processor_ip_t))
  859|      0|                    {
  860|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  861|      0|                        ps_op->u4_error_code |=
  862|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  863|      0|                        return IV_FAIL;
  864|      0|                    }
  865|       |
  866|  24.4k|                    if(ps_op->u4_size
  ------------------
  |  Branch (866:24): [True: 0, False: 24.4k]
  ------------------
  867|  24.4k|                                    != sizeof(ihevcd_cxa_ctl_set_processor_op_t))
  868|      0|                    {
  869|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  870|      0|                        ps_op->u4_error_code |=
  871|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  872|      0|                        return IV_FAIL;
  873|      0|                    }
  874|       |
  875|  24.4k|                    break;
  876|  24.4k|                }
  877|  24.4k|                default:
  ------------------
  |  Branch (877:17): [True: 0, False: 100k]
  ------------------
  878|      0|                    *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  879|      0|                    *(pu4_api_op + 1) |= IVD_UNSUPPORTED_API_CMD;
  880|      0|                    return IV_FAIL;
  881|   100k|            }
  882|   100k|        }
  883|   100k|            break;
  884|   100k|        default:
  ------------------
  |  Branch (884:9): [True: 0, False: 431k]
  ------------------
  885|      0|            *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  886|      0|            *(pu4_api_op + 1) |= IVD_UNSUPPORTED_API_CMD;
  887|      0|            return IV_FAIL;
  888|   431k|    }
  889|       |
  890|   431k|    return IV_SUCCESS;
  891|   431k|}

ihevcd_bits_init:
  108|   544k|{
  109|   544k|    UWORD32 u4_cur_word;
  110|   544k|    UWORD32 u4_nxt_word;
  111|   544k|    UWORD32 u4_temp;
  112|   544k|    UWORD32 *pu4_buf;
  113|       |
  114|   544k|    pu4_buf     = (UWORD32 *)pu1_buf;
  115|   544k|    u4_temp = *pu4_buf++;
  116|   544k|    u4_cur_word = ITT_BIG_ENDIAN(u4_temp);
  ------------------
  |  |   63|   544k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |   64|   544k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |   65|   544k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |   66|   544k|                            ((UWORD32)x >> 24);
  ------------------
  117|   544k|    u4_temp = *pu4_buf++;
  118|   544k|    u4_nxt_word = ITT_BIG_ENDIAN(u4_temp);
  ------------------
  |  |   63|   544k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |   64|   544k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |   65|   544k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |   66|   544k|                            ((UWORD32)x >> 24);
  ------------------
  119|       |
  120|   544k|    ps_bitstrm->u4_bit_ofst     = 0;
  121|   544k|    ps_bitstrm->pu1_buf_base    = pu1_buf;
  122|   544k|    ps_bitstrm->pu4_buf         = pu4_buf;
  123|   544k|    ps_bitstrm->u4_cur_word     = u4_cur_word;
  124|   544k|    ps_bitstrm->u4_nxt_word     = u4_nxt_word;
  125|       |
  126|   544k|    ps_bitstrm->pu1_buf_max     = pu1_buf + u4_numbytes + 8;
  127|       |
  128|   544k|    return;
  129|   544k|}
ihevcd_bits_flush:
  156|  27.1k|{
  157|       |
  158|  27.1k|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|  27.1k|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  27.1k|{                                                           \
  |  |  129|  27.1k|    UWORD32 temp;                                           \
  |  |  130|  27.1k|                                                            \
  |  |  131|  27.1k|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  27.1k|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  54.2k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 7.11k, False: 20.0k]
  |  |  ------------------
  |  |  133|  27.1k|    {                                                       \
  |  |  134|  7.11k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|  7.11k|        /* Getting the next word */                         \
  |  |  136|  7.11k|        temp = *(m_pu4_buf++);                              \
  |  |  137|  7.11k|                                                            \
  |  |  138|  7.11k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|  7.11k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|  7.11k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|  7.11k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|  7.11k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  7.11k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  7.11k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  7.11k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|  7.11k|    }                                                       \
  |  |  142|  27.1k|}
  ------------------
  159|  27.1k|               ps_bitstrm->u4_bit_ofst,
  160|  27.1k|               ps_bitstrm->u4_cur_word,
  161|  27.1k|               ps_bitstrm->u4_nxt_word,
  162|  27.1k|               u4_numbits);
  163|       |
  164|  27.1k|    return;
  165|  27.1k|}
ihevcd_bits_flush_to_byte_boundary:
  188|   104k|{
  189|   104k|    UWORD32 u4_numbits;
  190|   104k|    u4_numbits = (ps_bitstrm->u4_bit_ofst) & 7;
  191|       |
  192|   104k|    u4_numbits = 8 - u4_numbits;
  193|       |
  194|   104k|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|   104k|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|   104k|{                                                           \
  |  |  129|   104k|    UWORD32 temp;                                           \
  |  |  130|   104k|                                                            \
  |  |  131|   104k|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|   104k|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|   209k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 36.2k, False: 68.5k]
  |  |  ------------------
  |  |  133|   104k|    {                                                       \
  |  |  134|  36.2k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|  36.2k|        /* Getting the next word */                         \
  |  |  136|  36.2k|        temp = *(m_pu4_buf++);                              \
  |  |  137|  36.2k|                                                            \
  |  |  138|  36.2k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|  36.2k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|  36.2k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|  36.2k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|  36.2k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  36.2k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  36.2k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  36.2k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|  36.2k|    }                                                       \
  |  |  142|   104k|}
  ------------------
  195|   104k|               ps_bitstrm->u4_bit_ofst,
  196|   104k|               ps_bitstrm->u4_cur_word,
  197|   104k|               ps_bitstrm->u4_nxt_word,
  198|   104k|               u4_numbits);
  199|       |
  200|   104k|    return;
  201|   104k|}
ihevcd_bits_seek:
  228|  10.5k|{
  229|  10.5k|    UWORD32 val;
  230|  10.5k|    ASSERT(numbits >= -32);
  ------------------
  |  |   55|  10.5k|#define ASSERT(x) {}
  ------------------
  231|  10.5k|    ASSERT(numbits <= 32);
  ------------------
  |  |   55|  10.5k|#define ASSERT(x) {}
  ------------------
  232|       |    /* Check if Seeking backwards*/
  233|  10.5k|    if(numbits < 0)
  ------------------
  |  Branch (233:8): [True: 9.97k, False: 573]
  ------------------
  234|  9.97k|    {
  235|  9.97k|        UWORD32 abs_numbits = -numbits;
  236|  9.97k|        if(ps_bitstrm->u4_bit_ofst >= abs_numbits)
  ------------------
  |  Branch (236:12): [True: 4.37k, False: 5.59k]
  ------------------
  237|  4.37k|        {
  238|       |            /* If the current offset is greater than number of bits to seek back,
  239|       |             * then subtract abs_numbits from offset and return.
  240|       |             */
  241|  4.37k|            ps_bitstrm->u4_bit_ofst -= abs_numbits;
  242|  4.37k|            return;
  243|  4.37k|        }
  244|  5.59k|        else
  245|  5.59k|        {
  246|       |            /* If the current offset is lesser than number of bits to seek back,
  247|       |             * then subtract abs_numbits from offset and add 32 and move cur_word to nxt_word
  248|       |             * and load cur_word appropriately and decrement pu4_buf
  249|       |             */
  250|  5.59k|            ps_bitstrm->u4_bit_ofst += 32;
  251|  5.59k|            ps_bitstrm->u4_bit_ofst -= abs_numbits;
  252|  5.59k|            ps_bitstrm->pu4_buf--;
  253|       |
  254|  5.59k|            val = *(ps_bitstrm->pu4_buf - 2);
  255|  5.59k|            ps_bitstrm->u4_nxt_word = ps_bitstrm->u4_cur_word;
  256|  5.59k|            ps_bitstrm->u4_cur_word = ITT_BIG_ENDIAN(val);
  ------------------
  |  |   63|  5.59k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |   64|  5.59k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |   65|  5.59k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |   66|  5.59k|                            ((UWORD32)x >> 24);
  ------------------
  257|  5.59k|            return;
  258|  5.59k|        }
  259|  9.97k|    }
  260|    573|    else
  261|    573|    {
  262|       |        /* Not supported/tested currently */
  263|    573|        ASSERT(1);
  ------------------
  |  |   55|    573|#define ASSERT(x) {}
  ------------------
  264|    573|        BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|    573|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|    573|{                                                           \
  |  |  129|    573|    UWORD32 temp;                                           \
  |  |  130|    573|                                                            \
  |  |  131|    573|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|    573|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  1.14k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 0, False: 573]
  |  |  ------------------
  |  |  133|    573|    {                                                       \
  |  |  134|      0|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|      0|        /* Getting the next word */                         \
  |  |  136|      0|        temp = *(m_pu4_buf++);                              \
  |  |  137|      0|                                                            \
  |  |  138|      0|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|      0|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|      0|        /* Swapping little endian to big endian conversion*/\
  |  |  140|      0|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|      0|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|      0|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|      0|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|      0|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|      0|    }                                                       \
  |  |  142|    573|}
  ------------------
  265|    573|                   ps_bitstrm->u4_bit_ofst,
  266|    573|                   ps_bitstrm->u4_cur_word,
  267|    573|                   ps_bitstrm->u4_nxt_word,
  268|    573|                   numbits);
  269|       |
  270|       |
  271|    573|    }
  272|    573|    return;
  273|  10.5k|}
ihevcd_bits_nxt:
  299|   663k|{
  300|   663k|    UWORD32 u4_bits_read;
  301|       |
  302|   663k|    BITS_NXT(u4_bits_read,
  ------------------
  |  |   91|   663k|                 m_u4_cur_word, m_u4_nxt_word, m_cnt)       \
  |  |   92|   663k|{                                                           \
  |  |   93|   663k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)  >>        \
  |  |   94|   663k|                              (WORD_SIZE - m_cnt);          \
  |  |  ------------------
  |  |  |  |   42|   663k|#define WORD_SIZE         32
  |  |  ------------------
  |  |   95|   663k|                                                            \
  |  |   96|   663k|    if(m_u4_bit_ofst > (WORD_SIZE - m_cnt))                 \
  |  |  ------------------
  |  |  |  |   42|   663k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (96:8): [True: 1.24k, False: 662k]
  |  |  ------------------
  |  |   97|   663k|    {                                                       \
  |  |   98|  1.24k|        m_u4_bits |= SHR(m_u4_nxt_word,                     \
  |  |  ------------------
  |  |  |  |   57|  1.24k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 1.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|  1.24k|                   (WORD_SIZE + WORD_SIZE - m_cnt           \
  |  |  100|  1.24k|                          - m_u4_bit_ofst));                \
  |  |  101|  1.24k|    }                                                       \
  |  |  102|   663k|}
  ------------------
  303|   663k|             ps_bitstrm->pu4_buf,
  304|   663k|             ps_bitstrm->u4_bit_ofst,
  305|   663k|             ps_bitstrm->u4_cur_word,
  306|   663k|             ps_bitstrm->u4_nxt_word,
  307|   663k|             u4_numbits);
  308|   663k|    return u4_bits_read;
  309|   663k|}
ihevcd_bits_get:
  371|  19.7M|{
  372|  19.7M|    UWORD32 u4_bits_read;
  373|       |
  374|  19.7M|    BITS_GET(u4_bits_read,
  ------------------
  |  |  150|  19.7M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  19.7M|{                                                               \
  |  |  152|  19.7M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  19.7M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  19.7M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  19.7M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  19.7M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  39.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 185k, False: 19.5M]
  |  |  ------------------
  |  |  156|  19.7M|    {                                                           \
  |  |  157|   185k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   185k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 185k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   185k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   185k|    }                                                           \
  |  |  160|  19.7M|                                                                \
  |  |  161|  19.7M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  39.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 912k, False: 18.8M]
  |  |  ------------------
  |  |  162|  19.7M|    {                                                           \
  |  |  163|   912k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   912k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   912k|        /* Getting the next word */                             \
  |  |  166|   912k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   912k|                                                                \
  |  |  168|   912k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   912k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   912k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   912k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   912k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   912k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   912k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   912k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   912k|    }                                                           \
  |  |  172|  19.7M|}
  ------------------
  375|  19.7M|             ps_bitstrm->pu4_buf,
  376|  19.7M|             ps_bitstrm->u4_bit_ofst,
  377|  19.7M|             ps_bitstrm->u4_cur_word,
  378|  19.7M|             ps_bitstrm->u4_nxt_word,
  379|  19.7M|             u4_numbits);
  380|  19.7M|    return u4_bits_read;
  381|       |
  382|  19.7M|}
ihevcd_bits_num_bits_remaining:
  406|   673k|{
  407|   673k|    UWORD32 u4_bits_consumed;
  408|   673k|    UWORD32 u4_size_in_bits;
  409|       |
  410|       |    /* 8 bytes are read in cur_word and nxt_word at the start. Hence */
  411|       |    /* subtract 8 bytes */
  412|   673k|    u4_bits_consumed = (UWORD32)(((UWORD8 *)ps_bitstrm->pu4_buf -
  413|   673k|                                  (UWORD8 *)ps_bitstrm->pu1_buf_base - 8) <<
  414|   673k|                                 3) + ps_bitstrm->u4_bit_ofst;
  415|       |
  416|   673k|    u4_size_in_bits = (UWORD32)(ps_bitstrm->pu1_buf_max -
  417|   673k|                    ps_bitstrm->pu1_buf_base) - 8;
  418|   673k|    u4_size_in_bits <<= 3;
  419|   673k|    if(u4_size_in_bits > u4_bits_consumed)
  ------------------
  |  Branch (419:8): [True: 658k, False: 14.2k]
  ------------------
  420|   658k|    {
  421|   658k|        return (u4_size_in_bits - u4_bits_consumed);
  422|   658k|    }
  423|  14.2k|    else
  424|  14.2k|    {
  425|  14.2k|        return 0;
  426|  14.2k|    }
  427|   673k|}
ihevcd_uev:
  484|  2.74M|{
  485|  2.74M|    UWORD32 u4_bits_read;
  486|  2.74M|    UWORD32 u4_clz;
  487|       |
  488|       |
  489|       |    /***************************************************************/
  490|       |    /* Find leading zeros in next 32 bits                          */
  491|       |    /***************************************************************/
  492|  2.74M|    BITS_NXT32(u4_bits_read,
  ------------------
  |  |  112|  2.74M|                 m_u4_cur_word, m_u4_nxt_word)                      \
  |  |  113|  2.74M|{                                                                   \
  |  |  114|  2.74M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst);                   \
  |  |  115|  2.74M|                                                                    \
  |  |  116|  2.74M|    m_u4_bits |= SHR(m_u4_nxt_word, (WORD_SIZE - m_u4_bit_ofst));   \
  |  |  ------------------
  |  |  |  |   57|  2.74M|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 2.67M, False: 69.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  2.74M|}
  ------------------
  493|  2.74M|               ps_bitstrm->pu4_buf,
  494|  2.74M|               ps_bitstrm->u4_bit_ofst,
  495|  2.74M|               ps_bitstrm->u4_cur_word,
  496|  2.74M|               ps_bitstrm->u4_nxt_word);
  497|       |
  498|       |
  499|  2.74M|    u4_clz = CLZ(u4_bits_read);
  500|       |
  501|  2.74M|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|  2.74M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  2.74M|{                                                           \
  |  |  129|  2.74M|    UWORD32 temp;                                           \
  |  |  130|  2.74M|                                                            \
  |  |  131|  2.74M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  2.74M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  5.49M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 286k, False: 2.46M]
  |  |  ------------------
  |  |  133|  2.74M|    {                                                       \
  |  |  134|   286k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|   286k|        /* Getting the next word */                         \
  |  |  136|   286k|        temp = *(m_pu4_buf++);                              \
  |  |  137|   286k|                                                            \
  |  |  138|   286k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|   286k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|   286k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|   286k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|   286k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   286k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   286k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   286k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|   286k|    }                                                       \
  |  |  142|  2.74M|}
  ------------------
  502|  2.74M|               ps_bitstrm->u4_bit_ofst,
  503|  2.74M|               ps_bitstrm->u4_cur_word,
  504|  2.74M|               ps_bitstrm->u4_nxt_word,
  505|  2.74M|               (u4_clz + 1));
  506|       |
  507|  2.74M|    u4_bits_read = 0;
  508|  2.74M|    if(u4_clz)
  ------------------
  |  Branch (508:8): [True: 1.22M, False: 1.52M]
  ------------------
  509|  1.22M|    {
  510|  1.22M|        BITS_GET(u4_bits_read,
  ------------------
  |  |  150|  1.22M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  1.22M|{                                                               \
  |  |  152|  1.22M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  1.22M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  1.22M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  1.22M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  1.22M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  2.45M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 81.2k, False: 1.14M]
  |  |  ------------------
  |  |  156|  1.22M|    {                                                           \
  |  |  157|  81.2k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  81.2k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 81.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  81.2k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  81.2k|    }                                                           \
  |  |  160|  1.22M|                                                                \
  |  |  161|  1.22M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  2.45M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 140k, False: 1.08M]
  |  |  ------------------
  |  |  162|  1.22M|    {                                                           \
  |  |  163|   140k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   140k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   140k|        /* Getting the next word */                             \
  |  |  166|   140k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   140k|                                                                \
  |  |  168|   140k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   140k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   140k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   140k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   140k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   140k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   140k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   140k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   140k|    }                                                           \
  |  |  172|  1.22M|}
  ------------------
  511|  1.22M|                 ps_bitstrm->pu4_buf,
  512|  1.22M|                 ps_bitstrm->u4_bit_ofst,
  513|  1.22M|                 ps_bitstrm->u4_cur_word,
  514|  1.22M|                 ps_bitstrm->u4_nxt_word,
  515|  1.22M|                 u4_clz);
  516|  1.22M|    }
  517|  2.74M|    return ((1 << u4_clz) + u4_bits_read - 1);
  518|       |
  519|  2.74M|}
ihevcd_sev:
  543|  1.47M|{
  544|  1.47M|    UWORD32 u4_bits_read;
  545|  1.47M|    UWORD32 u4_clz;
  546|  1.47M|    UWORD32 u4_abs_val;
  547|       |
  548|       |
  549|       |    /***************************************************************/
  550|       |    /* Find leading zeros in next 32 bits                          */
  551|       |    /***************************************************************/
  552|  1.47M|    BITS_NXT32(u4_bits_read,
  ------------------
  |  |  112|  1.47M|                 m_u4_cur_word, m_u4_nxt_word)                      \
  |  |  113|  1.47M|{                                                                   \
  |  |  114|  1.47M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst);                   \
  |  |  115|  1.47M|                                                                    \
  |  |  116|  1.47M|    m_u4_bits |= SHR(m_u4_nxt_word, (WORD_SIZE - m_u4_bit_ofst));   \
  |  |  ------------------
  |  |  |  |   57|  1.47M|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 1.42M, False: 43.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  1.47M|}
  ------------------
  553|  1.47M|               ps_bitstrm->pu4_buf,
  554|  1.47M|               ps_bitstrm->u4_bit_ofst,
  555|  1.47M|               ps_bitstrm->u4_cur_word,
  556|  1.47M|               ps_bitstrm->u4_nxt_word);
  557|       |
  558|       |
  559|  1.47M|    u4_clz = CLZ(u4_bits_read);
  560|       |
  561|  1.47M|    BITS_FLUSH(ps_bitstrm->pu4_buf,
  ------------------
  |  |  127|  1.47M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  1.47M|{                                                           \
  |  |  129|  1.47M|    UWORD32 temp;                                           \
  |  |  130|  1.47M|                                                            \
  |  |  131|  1.47M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  1.47M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  2.94M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 98.6k, False: 1.37M]
  |  |  ------------------
  |  |  133|  1.47M|    {                                                       \
  |  |  134|  98.6k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|  98.6k|        /* Getting the next word */                         \
  |  |  136|  98.6k|        temp = *(m_pu4_buf++);                              \
  |  |  137|  98.6k|                                                            \
  |  |  138|  98.6k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|  98.6k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|  98.6k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|  98.6k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|  98.6k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  98.6k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  98.6k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  98.6k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|  98.6k|    }                                                       \
  |  |  142|  1.47M|}
  ------------------
  562|  1.47M|               ps_bitstrm->u4_bit_ofst,
  563|  1.47M|               ps_bitstrm->u4_cur_word,
  564|  1.47M|               ps_bitstrm->u4_nxt_word,
  565|  1.47M|               (u4_clz + 1));
  566|       |
  567|  1.47M|    u4_bits_read = 0;
  568|  1.47M|    if(u4_clz)
  ------------------
  |  Branch (568:8): [True: 296k, False: 1.17M]
  ------------------
  569|   296k|    {
  570|   296k|        BITS_GET(u4_bits_read,
  ------------------
  |  |  150|   296k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   296k|{                                                               \
  |  |  152|   296k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   296k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   296k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   296k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   296k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|   593k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 25.8k, False: 270k]
  |  |  ------------------
  |  |  156|   296k|    {                                                           \
  |  |  157|  25.8k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  25.8k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 25.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  25.8k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  25.8k|    }                                                           \
  |  |  160|   296k|                                                                \
  |  |  161|   296k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|   593k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 35.4k, False: 261k]
  |  |  ------------------
  |  |  162|   296k|    {                                                           \
  |  |  163|  35.4k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  35.4k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  35.4k|        /* Getting the next word */                             \
  |  |  166|  35.4k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  35.4k|                                                                \
  |  |  168|  35.4k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  35.4k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  35.4k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  35.4k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  35.4k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  35.4k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  35.4k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  35.4k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  35.4k|    }                                                           \
  |  |  172|   296k|}
  ------------------
  571|   296k|                 ps_bitstrm->pu4_buf,
  572|   296k|                 ps_bitstrm->u4_bit_ofst,
  573|   296k|                 ps_bitstrm->u4_cur_word,
  574|   296k|                 ps_bitstrm->u4_nxt_word,
  575|   296k|                 u4_clz);
  576|   296k|    }
  577|  1.47M|    u4_abs_val = ((1 << u4_clz) + u4_bits_read) >> 1;
  578|  1.47M|    if(u4_bits_read & 0x1)
  ------------------
  |  Branch (578:8): [True: 123k, False: 1.34M]
  ------------------
  579|   123k|        return (-(WORD32)u4_abs_val);
  580|  1.34M|    else
  581|  1.34M|        return (u4_abs_val);
  582|  1.47M|}

ihevcd_pu_boundary_strength:
   87|  52.6M|{
   88|  52.6M|    WORD32 i4_bs;
   89|  52.6M|    UWORD32 l0_ref_pic_buf_id, l1_ref_pic_buf_id;
   90|  52.6M|    UWORD32 ngbr_l0_ref_pic_buf_id, ngbr_l1_ref_pic_buf_id;
   91|       |
   92|  52.6M|    WORD16 i2_mv_x0, i2_mv_y0, i2_mv_x1, i2_mv_y1;
   93|  52.6M|    WORD16 i2_ngbr_mv_x0, i2_ngbr_mv_y0, i2_ngbr_mv_x1, i2_ngbr_mv_y1;
   94|       |
   95|  52.6M|    WORD32 num_mv, ngbr_num_mv;
   96|       |
   97|  52.6M|    num_mv = (PRED_BI == ps_pu->b2_pred_mode) ? 2 : 1;
  ------------------
  |  Branch (97:14): [True: 43.1M, False: 9.57M]
  ------------------
   98|  52.6M|    ngbr_num_mv = (PRED_BI == ps_ngbr_pu->b2_pred_mode) ? 2 : 1;
  ------------------
  |  Branch (98:19): [True: 43.1M, False: 9.53M]
  ------------------
   99|       |
  100|  52.6M|    l0_ref_pic_buf_id = ps_pu->mv.i1_l0_ref_pic_buf_id;
  101|  52.6M|    l1_ref_pic_buf_id = ps_pu->mv.i1_l1_ref_pic_buf_id;
  102|  52.6M|    ngbr_l0_ref_pic_buf_id = ps_ngbr_pu->mv.i1_l0_ref_pic_buf_id;
  103|  52.6M|    ngbr_l1_ref_pic_buf_id = ps_ngbr_pu->mv.i1_l1_ref_pic_buf_id;
  104|       |
  105|       |
  106|  52.6M|    i2_mv_x0 = ps_pu->mv.s_l0_mv.i2_mvx;
  107|  52.6M|    i2_mv_y0 = ps_pu->mv.s_l0_mv.i2_mvy;
  108|  52.6M|    i2_mv_x1 = ps_pu->mv.s_l1_mv.i2_mvx;
  109|  52.6M|    i2_mv_y1 = ps_pu->mv.s_l1_mv.i2_mvy;
  110|       |
  111|  52.6M|    i2_ngbr_mv_x0 = ps_ngbr_pu->mv.s_l0_mv.i2_mvx;
  112|  52.6M|    i2_ngbr_mv_y0 = ps_ngbr_pu->mv.s_l0_mv.i2_mvy;
  113|  52.6M|    i2_ngbr_mv_x1 = ps_ngbr_pu->mv.s_l1_mv.i2_mvx;
  114|  52.6M|    i2_ngbr_mv_y1 = ps_ngbr_pu->mv.s_l1_mv.i2_mvy;
  115|       |
  116|       |
  117|       |    /* If two motion vectors are used */
  118|  52.6M|    if((2 == num_mv) &&
  ------------------
  |  Branch (118:8): [True: 43.1M, False: 9.54M]
  ------------------
  119|  43.1M|            (2 == ngbr_num_mv))
  ------------------
  |  Branch (119:13): [True: 42.5M, False: 592k]
  ------------------
  120|  42.5M|    {
  121|  42.5M|        if((l0_ref_pic_buf_id == ngbr_l0_ref_pic_buf_id && l1_ref_pic_buf_id == ngbr_l1_ref_pic_buf_id) ||
  ------------------
  |  Branch (121:13): [True: 42.4M, False: 74.6k]
  |  Branch (121:60): [True: 42.4M, False: 35.3k]
  ------------------
  122|   112k|                (l0_ref_pic_buf_id == ngbr_l1_ref_pic_buf_id && l1_ref_pic_buf_id == ngbr_l0_ref_pic_buf_id))
  ------------------
  |  Branch (122:18): [True: 66.9k, False: 45.7k]
  |  Branch (122:65): [True: 35.9k, False: 30.9k]
  ------------------
  123|  42.4M|        {
  124|  42.4M|            if(l0_ref_pic_buf_id != l1_ref_pic_buf_id) /* Different L0 and L1 */
  ------------------
  |  Branch (124:16): [True: 1.51M, False: 40.9M]
  ------------------
  125|  1.51M|            {
  126|  1.51M|                if(l0_ref_pic_buf_id == ngbr_l0_ref_pic_buf_id)
  ------------------
  |  Branch (126:20): [True: 1.48M, False: 33.0k]
  ------------------
  127|  1.48M|                {
  128|  1.48M|                    i4_bs = (ABS(i2_mv_x0 - i2_ngbr_mv_x0) < 4) &&
  ------------------
  |  |   45|  1.48M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 57.0k, False: 1.42M]
  |  |  ------------------
  ------------------
  |  Branch (128:29): [True: 1.42M, False: 55.4k]
  ------------------
  129|  1.42M|                            (ABS(i2_mv_y0 - i2_ngbr_mv_y0) < 4) &&
  ------------------
  |  |   45|  1.42M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 47.0k, False: 1.38M]
  |  |  ------------------
  ------------------
  |  Branch (129:29): [True: 1.37M, False: 48.9k]
  ------------------
  130|  1.37M|                            (ABS(i2_mv_x1 - i2_ngbr_mv_x1) < 4) &&
  ------------------
  |  |   45|  1.37M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 19.8k, False: 1.35M]
  |  |  ------------------
  ------------------
  |  Branch (130:29): [True: 1.37M, False: 5.11k]
  ------------------
  131|  1.37M|                            (ABS(i2_mv_y1 - i2_ngbr_mv_y1) < 4) ? 0 : 1;
  ------------------
  |  |   45|  1.37M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 18.4k, False: 1.35M]
  |  |  ------------------
  ------------------
  |  Branch (131:29): [True: 1.36M, False: 6.40k]
  ------------------
  132|  1.48M|                }
  133|  33.0k|                else
  134|  33.0k|                {
  135|  33.0k|                    i4_bs = (ABS(i2_mv_x0 - i2_ngbr_mv_x1) < 4) &&
  ------------------
  |  |   45|  33.0k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 8.14k, False: 24.8k]
  |  |  ------------------
  ------------------
  |  Branch (135:29): [True: 29.4k, False: 3.60k]
  ------------------
  136|  29.4k|                            (ABS(i2_mv_y0 - i2_ngbr_mv_y1) < 4) &&
  ------------------
  |  |   45|  29.4k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 6.91k, False: 22.5k]
  |  |  ------------------
  ------------------
  |  Branch (136:29): [True: 15.2k, False: 14.1k]
  ------------------
  137|  15.2k|                            (ABS(i2_mv_x1 - i2_ngbr_mv_x0) < 4) &&
  ------------------
  |  |   45|  15.2k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.56k, False: 13.6k]
  |  |  ------------------
  ------------------
  |  Branch (137:29): [True: 14.3k, False: 867]
  ------------------
  138|  20.4k|                            (ABS(i2_mv_y1 - i2_ngbr_mv_y0) < 4) ? 0 : 1;
  ------------------
  |  |   45|  14.3k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.46k, False: 11.9k]
  |  |  ------------------
  ------------------
  |  Branch (138:29): [True: 12.6k, False: 1.69k]
  ------------------
  139|  33.0k|                }
  140|  1.51M|            }
  141|  40.9M|            else /* Same L0 and L1 */
  142|  40.9M|            {
  143|  40.9M|                i4_bs = ((ABS(i2_mv_x0 - i2_ngbr_mv_x0) >= 4) ||
  ------------------
  |  |   45|  40.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 163k, False: 40.7M]
  |  |  ------------------
  ------------------
  |  Branch (143:26): [True: 102k, False: 40.8M]
  ------------------
  144|  40.8M|                         (ABS(i2_mv_y0 - i2_ngbr_mv_y0) >= 4) ||
  ------------------
  |  |   45|  40.8M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 146k, False: 40.7M]
  |  |  ------------------
  ------------------
  |  Branch (144:26): [True: 114k, False: 40.7M]
  ------------------
  145|  40.7M|                         (ABS(i2_mv_x1 - i2_ngbr_mv_x1) >= 4) ||
  ------------------
  |  |   45|  40.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 65.1k, False: 40.6M]
  |  |  ------------------
  ------------------
  |  Branch (145:26): [True: 17.1k, False: 40.7M]
  ------------------
  146|  40.7M|                         (ABS(i2_mv_y1 - i2_ngbr_mv_y1) >= 4)) &&
  ------------------
  |  |   45|  40.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 60.8k, False: 40.6M]
  |  |  ------------------
  ------------------
  |  Branch (146:26): [True: 34.9k, False: 40.6M]
  ------------------
  147|   294k|                                ((ABS(i2_mv_x0 - i2_ngbr_mv_x1) >= 4) ||
  ------------------
  |  |   45|   294k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 103k, False: 191k]
  |  |  ------------------
  ------------------
  |  Branch (147:34): [True: 94.4k, False: 200k]
  ------------------
  148|   200k|                                 (ABS(i2_mv_y0 - i2_ngbr_mv_y1) >= 4) ||
  ------------------
  |  |   45|   200k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 74.3k, False: 125k]
  |  |  ------------------
  ------------------
  |  Branch (148:34): [True: 136k, False: 63.1k]
  ------------------
  149|  63.1k|                                 (ABS(i2_mv_x1 - i2_ngbr_mv_x0) >= 4) ||
  ------------------
  |  |   45|  63.1k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 24.3k, False: 38.8k]
  |  |  ------------------
  ------------------
  |  Branch (149:34): [True: 29.7k, False: 33.4k]
  ------------------
  150|  40.6M|                                 (ABS(i2_mv_y1 - i2_ngbr_mv_y0) >= 4)) ? 1 : 0;
  ------------------
  |  |   45|  33.4k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 18.1k, False: 15.3k]
  |  |  ------------------
  ------------------
  |  Branch (150:34): [True: 30.6k, False: 2.83k]
  ------------------
  151|  40.9M|            }
  152|  42.4M|        }
  153|  76.4k|        else /* If the reference pictures used are different */
  154|  76.4k|        {
  155|  76.4k|            i4_bs = 1;
  156|  76.4k|        }
  157|  42.5M|    }
  158|       |
  159|       |    /* If one motion vector is used in both PUs */
  160|  10.1M|    else if((1 == num_mv) &&
  ------------------
  |  Branch (160:13): [True: 9.63M, False: 507k]
  ------------------
  161|  9.63M|            (1 == ngbr_num_mv))
  ------------------
  |  Branch (161:13): [True: 8.99M, False: 632k]
  ------------------
  162|  8.99M|    {
  163|  8.99M|        WORD16 i2_mv_x, i2_mv_y;
  164|  8.99M|        WORD16 i2_ngbr_mv_x, i2_ngbr_mv_y;
  165|  8.99M|        UWORD32 ref_pic_buf_id, ngbr_ref_pic_buf_id;
  166|       |
  167|  8.99M|        if(PRED_L0 == ps_pu->b2_pred_mode)
  ------------------
  |  Branch (167:12): [True: 7.37M, False: 1.61M]
  ------------------
  168|  7.37M|        {
  169|  7.37M|            i2_mv_x = i2_mv_x0;
  170|  7.37M|            i2_mv_y = i2_mv_y0;
  171|  7.37M|            ref_pic_buf_id = l0_ref_pic_buf_id;
  172|  7.37M|        }
  173|  1.61M|        else
  174|  1.61M|        {
  175|  1.61M|            i2_mv_x = i2_mv_x1;
  176|  1.61M|            i2_mv_y = i2_mv_y1;
  177|  1.61M|            ref_pic_buf_id = l1_ref_pic_buf_id;
  178|  1.61M|        }
  179|       |
  180|  8.99M|        if(PRED_L0 == ps_ngbr_pu->b2_pred_mode)
  ------------------
  |  Branch (180:12): [True: 7.37M, False: 1.61M]
  ------------------
  181|  7.37M|        {
  182|  7.37M|            i2_ngbr_mv_x = i2_ngbr_mv_x0;
  183|  7.37M|            i2_ngbr_mv_y = i2_ngbr_mv_y0;
  184|  7.37M|            ngbr_ref_pic_buf_id = ngbr_l0_ref_pic_buf_id;
  185|  7.37M|        }
  186|  1.61M|        else
  187|  1.61M|        {
  188|  1.61M|            i2_ngbr_mv_x = i2_ngbr_mv_x1;
  189|  1.61M|            i2_ngbr_mv_y = i2_ngbr_mv_y1;
  190|  1.61M|            ngbr_ref_pic_buf_id = ngbr_l1_ref_pic_buf_id;
  191|  1.61M|        }
  192|       |
  193|  8.99M|        i4_bs = (ref_pic_buf_id == ngbr_ref_pic_buf_id) &&
  ------------------
  |  Branch (193:17): [True: 8.74M, False: 253k]
  ------------------
  194|  8.74M|                (ABS(i2_mv_x - i2_ngbr_mv_x) < 4)  &&
  ------------------
  |  |   45|  8.74M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 330k, False: 8.41M]
  |  |  ------------------
  ------------------
  |  Branch (194:17): [True: 8.54M, False: 203k]
  ------------------
  195|  8.54M|                (ABS(i2_mv_y - i2_ngbr_mv_y) < 4) ? 0 : 1;
  ------------------
  |  |   45|  8.54M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 253k, False: 8.28M]
  |  |  ------------------
  ------------------
  |  Branch (195:17): [True: 8.42M, False: 120k]
  ------------------
  196|  8.99M|    }
  197|       |
  198|       |    /* If the no. of motion vectors is not the same */
  199|  1.14M|    else
  200|  1.14M|    {
  201|  1.14M|        i4_bs = 1;
  202|  1.14M|    }
  203|       |
  204|       |
  205|  52.6M|    return i4_bs;
  206|  52.6M|}
ihevcd_ctb_boundary_strength_islice:
  210|  5.67M|{
  211|  5.67M|    pps_t *ps_pps;
  212|  5.67M|    sps_t *ps_sps;
  213|  5.67M|    tu_t *ps_tu;
  214|  5.67M|    UWORD32 *pu4_vert_bs;
  215|  5.67M|    UWORD32 *pu4_horz_bs;
  216|  5.67M|    WORD32 bs_strd;
  217|  5.67M|    WORD32 vert_bs0_tmp;
  218|  5.67M|    WORD32 horz_bs0_tmp;
  219|  5.67M|    WORD8 *pi1_qp;
  220|  5.67M|    WORD32 qp_strd;
  221|  5.67M|    UWORD32 u4_qp_const_in_ctb;
  222|  5.67M|    WORD32 ctb_indx;
  223|  5.67M|    WORD32 i4_tu_cnt;
  224|  5.67M|    WORD32 log2_ctb_size;
  225|  5.67M|    WORD32 ctb_size;
  226|       |
  227|  5.67M|    WORD8 i1_loop_filter_across_tiles_enabled_flag;
  228|  5.67M|    WORD8 i1_loop_filter_across_slices_enabled_flag;
  229|       |
  230|  5.67M|    WORD32 i;
  231|       |
  232|  5.67M|    PROFILE_DISABLE_BOUNDARY_STRENGTH();
  ------------------
  |  |   84|  5.67M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  233|       |
  234|  5.67M|    ps_pps = ps_bs_ctxt->ps_pps;
  235|  5.67M|    ps_sps = ps_bs_ctxt->ps_sps;
  236|  5.67M|    i1_loop_filter_across_tiles_enabled_flag = ps_pps->i1_loop_filter_across_tiles_enabled_flag;
  237|  5.67M|    i1_loop_filter_across_slices_enabled_flag = ps_bs_ctxt->ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag;
  238|  5.67M|    i4_tu_cnt = ps_bs_ctxt->i4_ctb_tu_cnt;
  239|       |
  240|  5.67M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  241|  5.67M|    ctb_size = (1 << log2_ctb_size);
  242|       |
  243|       |    /* strides are in units of number of bytes */
  244|       |    /* ctb_size * ctb_size / 8 / 16 is the number of bytes needed per CTB */
  245|  5.67M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  246|       |
  247|  5.67M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_vert_bs +
  248|  5.67M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  249|  5.67M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  250|  5.67M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_horz_bs +
  251|  5.67M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  252|  5.67M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  253|       |
  254|       |    /* ctb_size/8 elements per CTB */
  255|  5.67M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  256|  5.67M|    pi1_qp = ps_bs_ctxt->pi1_pic_qp + ((ps_bs_ctxt->i4_ctb_x + ps_bs_ctxt->i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
  257|       |
  258|  5.67M|    ctb_indx = ps_bs_ctxt->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_bs_ctxt->i4_ctb_y;
  259|  5.67M|    u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[ctb_indx >> 3] & (1 << (ctb_indx & 7));
  260|       |
  261|  5.67M|    vert_bs0_tmp = pu4_vert_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  262|  5.67M|    horz_bs0_tmp = pu4_horz_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  263|       |
  264|       |    /* ctb_size/8 is the number of edges per CTB
  265|       |     * ctb_size/4 is the number of BS values needed per edge
  266|       |     * divided by 8 for the number of bytes
  267|       |     * 2 is the number of bits needed for each BS value */
  268|       |/*
  269|       |    memset(pu4_vert_bs, 0, (ctb_size / 8 + 1) * (ctb_size / 4) / 8 * 2 );
  270|       |    memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2 );
  271|       |*/
  272|  5.67M|    memset(pu4_vert_bs, 0, (1 << (2 * log2_ctb_size - 7)) + ((ctb_size >> 5) << 1));
  273|  5.67M|    memset(pu4_horz_bs, 0, (1 << (2 * log2_ctb_size - 7)));
  274|       |
  275|       |    /* pu4_vert_bs[0] has information about the left CTB which is not required when ctb_x = 0 */
  276|  5.67M|    if(0 != ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (276:8): [True: 5.42M, False: 247k]
  ------------------
  277|  5.42M|    {
  278|  5.42M|        pu4_vert_bs[0] |= vert_bs0_tmp;
  279|  5.42M|    }
  280|       |
  281|       |    /* pu4_horz_bs[0] has information about the top CTB which is not required when ctb_y = 0 */
  282|  5.67M|    if(0 != ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (282:8): [True: 5.53M, False: 135k]
  ------------------
  283|  5.53M|    {
  284|  5.53M|        pu4_horz_bs[0] |= horz_bs0_tmp;
  285|  5.53M|    }
  286|       |
  287|  5.67M|    ps_tu = ps_bs_ctxt->ps_tu;
  288|       |
  289|       |    /* Populating the QP array - if const_qp_in_ctb flag is one, set only the first element */
  290|  5.67M|    if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (290:8): [True: 5.71M, False: 18.4E]
  ------------------
  291|  5.71M|        pi1_qp[0] = ps_tu->b7_qp;
  292|       |
  293|   108M|    for(i = 0; i < i4_tu_cnt; i++)
  ------------------
  |  Branch (293:16): [True: 103M, False: 5.67M]
  ------------------
  294|   103M|    {
  295|   103M|        WORD32 start_pos_x;
  296|   103M|        WORD32 start_pos_y;
  297|   103M|        WORD32 tu_size;
  298|       |
  299|       |
  300|   103M|        UWORD32 u4_bs;
  301|   103M|        ps_tu = ps_bs_ctxt->ps_tu + i;
  302|       |
  303|       |        /* start_pos_x and start_pos_y are in units of min TU size (4x4) */
  304|   103M|        start_pos_x = ps_tu->b4_pos_x;
  305|   103M|        start_pos_y = ps_tu->b4_pos_y;
  306|       |
  307|   103M|        tu_size = 1 << (ps_tu->b3_size + 2);
  308|   103M|        tu_size >>= 2; /* TU size divided by 4 */
  309|       |
  310|   103M|        u4_bs = DUP_LSB_10(tu_size);
  ------------------
  |  |   78|   103M|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  311|       |
  312|       |        /* Only if the current edge falls on 8 pixel grid set BS */
  313|   103M|        if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (313:12): [True: 101M, False: 1.27M]
  ------------------
  314|   101M|        {
  315|   101M|            WORD32 shift;
  316|   101M|            shift = start_pos_y * 2;
  317|       |            /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  318|       |             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  319|       |             *  and deblocking is done on 8x8 grid
  320|       |             */
  321|   101M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (321:16): [True: 23.0M, False: 78.6M]
  ------------------
  322|  23.0M|                shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  323|   101M|            pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  324|   101M|        }
  325|       |        /* Only if the current edge falls on 8 pixel grid set BS */
  326|   103M|        if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (326:12): [True: 101M, False: 1.17M]
  ------------------
  327|   101M|        {
  328|   101M|            WORD32 shift;
  329|   101M|            shift = start_pos_x * 2;
  330|       |            /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  331|       |             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  332|       |             *  and deblocking is done on 8x8 grid
  333|       |             */
  334|   101M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (334:16): [True: 23.0M, False: 78.8M]
  ------------------
  335|  23.0M|                shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  336|   101M|            pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  337|   101M|        }
  338|       |
  339|       |        /* Populating the QP array */
  340|   103M|        if(0 == u4_qp_const_in_ctb)
  ------------------
  |  Branch (340:12): [True: 1.53M, False: 101M]
  ------------------
  341|  1.53M|        {
  342|  1.53M|            if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (342:16): [True: 963k, False: 573k]
  |  Branch (342:42): [True: 676k, False: 286k]
  ------------------
  343|   676k|            {
  344|   676k|                WORD32 row, col;
  345|  1.62M|                for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (345:40): [True: 947k, False: 676k]
  ------------------
  346|   947k|                {
  347|  2.70M|                    for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (347:44): [True: 1.75M, False: 947k]
  ------------------
  348|  1.75M|                    {
  349|  1.75M|                        pi1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
  350|  1.75M|                    }
  351|   947k|                }
  352|   676k|            }
  353|  1.53M|        }
  354|       |
  355|   103M|    }
  356|  5.67M|    {
  357|       |        /*Determine if the slice is dependent, and is its left neighbor belongs to the same slice, in a different tile*/
  358|  5.67M|        UWORD32 ctb_addr;
  359|  5.67M|        WORD32 slice_idx, left_slice_idx = -1, top_slice_idx = -1;
  360|       |        /* If left neighbor is not available, then set BS for entire first column to zero */
  361|  5.67M|        if(!ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (361:12): [True: 3.00M, False: 2.66M]
  ------------------
  362|  3.00M|        {
  363|  3.00M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x) ||
  ------------------
  |  Branch (363:17): [True: 3.00M, False: 17]
  |  Branch (363:66): [True: 234k, False: 2.77M]
  ------------------
  364|  2.77M|                            (0 == i1_loop_filter_across_slices_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_slice_x && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (364:30): [True: 2.49M, False: 281k]
  |  Branch (364:80): [True: 7.10k, False: 2.48M]
  |  Branch (364:115): [True: 1.38k, False: 5.72k]
  ------------------
  365|  2.77M|                            (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (365:29): [True: 18.4E, False: 2.77M]
  ------------------
  366|   235k|            {
  367|   235k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (367:35): [True: 94.1k, False: 141k]
  ------------------
  368|   235k|            }
  369|  3.00M|        }
  370|  2.66M|        else
  371|  2.66M|        {
  372|       |            //If across-tiles is disabled
  373|  2.66M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x))
  ------------------
  |  Branch (373:17): [True: 803k, False: 1.86M]
  |  Branch (373:66): [True: 98.2k, False: 705k]
  ------------------
  374|  98.2k|            {
  375|  98.2k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (375:35): [True: 13.6k, False: 84.5k]
  ------------------
  376|  98.2k|            }
  377|  2.56M|            else
  378|  2.56M|            {
  379|  2.56M|                ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  380|  2.56M|                slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  381|  2.56M|                if(ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (381:20): [True: 2.43M, False: 133k]
  ------------------
  382|  2.43M|                {
  383|  2.43M|                    ctb_addr = (ps_bs_ctxt->i4_ctb_x - 1) + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  384|  2.43M|                    left_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  385|  2.43M|                }
  386|       |                /*If the 1st slice in a new tile is a dependent slice*/
  387|  2.56M|                if(!((ps_bs_ctxt->ps_slice_hdr->i1_dependent_slice_flag == 1) && (slice_idx == left_slice_idx)))
  ------------------
  |  Branch (387:22): [True: 43.1k, False: 2.52M]
  |  Branch (387:82): [True: 42.1k, False: 933]
  ------------------
  388|  2.40M|                {
  389|       |                    /* Removed reduntant checks */
  390|  2.40M|                    if((0 == i1_loop_filter_across_slices_enabled_flag && (
  ------------------
  |  Branch (390:25): [True: 1.13M, False: 1.27M]
  ------------------
  391|  1.13M|                                    ((slice_idx != left_slice_idx) && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (391:38): [True: 6.56k, False: 1.12M]
  |  Branch (391:71): [True: 2.23k, False: 4.32k]
  ------------------
  392|  1.13M|                                    ((0 == ps_bs_ctxt->i4_ctb_tile_x) && (slice_idx != left_slice_idx)))) ||
  ------------------
  |  Branch (392:38): [True: 31.7k, False: 1.10M]
  |  Branch (392:74): [True: 4.32k, False: 27.4k]
  ------------------
  393|  2.40M|                                    (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (393:37): [True: 8.64k, False: 2.39M]
  ------------------
  394|  15.9k|                    {
  395|  15.9k|                        pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (395:43): [True: 3.70k, False: 12.2k]
  ------------------
  396|  15.9k|                    }
  397|  2.40M|                }
  398|  2.56M|            }
  399|  2.66M|        }
  400|       |
  401|  5.67M|        ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  402|  5.67M|        slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  403|  5.67M|        if(ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (403:12): [True: 5.35M, False: 323k]
  ------------------
  404|  5.35M|        {
  405|  5.35M|            ctb_addr = (ps_bs_ctxt->i4_ctb_x) + ((ps_bs_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  406|  5.35M|            top_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  407|  5.35M|        }
  408|       |
  409|       |        /* If top neighbor is not available, then set BS for entire first row to zero */
  410|       |        /* Removed reduntant checks */
  411|  5.67M|        if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_y)
  ------------------
  |  Branch (411:13): [True: 3.81M, False: 1.86M]
  |  Branch (411:62): [True: 224k, False: 3.58M]
  ------------------
  412|  5.33M|                        || (0 == i1_loop_filter_across_slices_enabled_flag && ((slice_idx != top_slice_idx)))
  ------------------
  |  Branch (412:29): [True: 3.72M, False: 1.60M]
  |  Branch (412:79): [True: 6.15k, False: 3.72M]
  ------------------
  413|  5.32M|                        || (0 == ps_bs_ctxt->i4_ctb_y))
  ------------------
  |  Branch (413:28): [True: 5.05k, False: 5.32M]
  ------------------
  414|   234k|        {
  415|   234k|            pu4_horz_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (415:31): [True: 167k, False: 66.6k]
  ------------------
  416|   234k|        }
  417|  5.67M|    }
  418|       |
  419|       |    /**
  420|       |     *  Set BS of bottom and right frame boundaries to zero if it is an incomplete CTB
  421|       |     *   (They might have been set to  non zero values because of CBF of the current CTB)
  422|       |     *   This block might not be needed for I slices*/
  423|  5.67M|    {
  424|  5.67M|        WORD32 num_rows_remaining = (ps_sps->i2_pic_height_in_luma_samples - (ps_bs_ctxt->i4_ctb_y << log2_ctb_size)) >> 3;
  425|  5.67M|        WORD32 num_cols_remaining = (ps_sps->i2_pic_width_in_luma_samples - (ps_bs_ctxt->i4_ctb_x << log2_ctb_size)) >> 3;
  426|  5.67M|        if(num_rows_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (426:12): [True: 263k, False: 5.41M]
  ------------------
  427|   263k|        {
  428|       |            /* WORD32 offset = (((num_rows_remaining >> 3) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 4));
  429|       |             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  430|       |             *  and deblocking is done on 8x8 grid
  431|       |             */
  432|   263k|            WORD32 offset;
  433|   263k|            offset = (num_rows_remaining >> (6 - log2_ctb_size)) << 2;
  434|   263k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (434:16): [True: 67.6k, False: 195k]
  ------------------
  435|  67.6k|                offset += (num_rows_remaining & 1) << (log2_ctb_size - 4);
  436|       |
  437|   263k|            memset(((UWORD8 *)pu4_horz_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  438|   263k|        }
  439|       |
  440|  5.67M|        if(num_cols_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (440:12): [True: 194k, False: 5.48M]
  ------------------
  441|   194k|        {
  442|       |            /* WORD32 offset = (((num_cols_remaining >> 3) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 4));
  443|       |             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  444|       |             *  and deblocking is done on 8x8 grid
  445|       |             */
  446|       |
  447|   194k|            WORD32 offset;
  448|   194k|            offset = (num_cols_remaining >> (6 - log2_ctb_size)) << 2;
  449|   194k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (449:16): [True: 137k, False: 57.1k]
  ------------------
  450|   137k|                offset += (num_cols_remaining & 1) << (log2_ctb_size - 4);
  451|       |
  452|   194k|            memset(((UWORD8 *)pu4_vert_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  453|   194k|        }
  454|  5.67M|    }
  455|       |
  456|  5.67M|    return 0;
  457|  5.67M|}
ihevcd_ctb_boundary_strength_pbslice:
  459|  1.99M|{
  460|  1.99M|    sps_t *ps_sps;
  461|  1.99M|    pps_t *ps_pps;
  462|  1.99M|    WORD32 cur_ctb_idx, next_ctb_idx = 0;
  463|  1.99M|    WORD32 i4_tu_cnt;
  464|  1.99M|    WORD32 i4_pu_cnt;
  465|  1.99M|    tu_t *ps_tu;
  466|       |
  467|  1.99M|    UWORD32 *pu4_vert_bs;
  468|  1.99M|    UWORD32 *pu4_horz_bs;
  469|  1.99M|    WORD32 bs_strd;
  470|  1.99M|    WORD32 vert_bs0_tmp;
  471|  1.99M|    WORD32 horz_bs0_tmp;
  472|  1.99M|    WORD8 *pi1_qp;
  473|  1.99M|    WORD32 qp_strd;
  474|  1.99M|    UWORD32 u4_qp_const_in_ctb;
  475|  1.99M|    WORD32 ctb_indx;
  476|  1.99M|    WORD32 log2_ctb_size;
  477|  1.99M|    WORD32 ctb_size;
  478|       |
  479|  1.99M|    WORD32 i;
  480|  1.99M|    WORD8 i1_loop_filter_across_tiles_enabled_flag;
  481|  1.99M|    WORD8 i1_loop_filter_across_slices_enabled_flag;
  482|       |
  483|  1.99M|    PROFILE_DISABLE_BOUNDARY_STRENGTH();
  ------------------
  |  |   84|  1.99M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  484|       |
  485|  1.99M|    ps_sps = ps_bs_ctxt->ps_sps;
  486|  1.99M|    ps_pps = ps_bs_ctxt->ps_pps;
  487|       |
  488|  1.99M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  489|  1.99M|    ctb_size = (1 << log2_ctb_size);
  490|       |
  491|       |    /* strides are in units of number of bytes */
  492|       |    /* ctb_size * ctb_size / 8 / 16 is the number of bytes needed per CTB */
  493|  1.99M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  494|       |
  495|  1.99M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_vert_bs +
  496|  1.99M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  497|  1.99M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  498|  1.99M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_horz_bs +
  499|  1.99M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  500|  1.99M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  501|       |
  502|  1.99M|    vert_bs0_tmp = pu4_vert_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  503|  1.99M|    horz_bs0_tmp = pu4_horz_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  504|       |
  505|  1.99M|    ps_tu = ps_bs_ctxt->ps_tu;
  506|       |
  507|       |    /* ctb_size/8 elements per CTB */
  508|  1.99M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  509|  1.99M|    pi1_qp = ps_bs_ctxt->pi1_pic_qp + ((ps_bs_ctxt->i4_ctb_x + ps_bs_ctxt->i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
  510|       |
  511|  1.99M|    ctb_indx = ps_bs_ctxt->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_bs_ctxt->i4_ctb_y;
  512|  1.99M|    u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[ctb_indx >> 3] & (1 << (ctb_indx & 7));
  513|       |
  514|  1.99M|    i1_loop_filter_across_tiles_enabled_flag = ps_pps->i1_loop_filter_across_tiles_enabled_flag;
  515|  1.99M|    i1_loop_filter_across_slices_enabled_flag = ps_bs_ctxt->ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag;
  516|       |
  517|       |    /* ctb_size/8 is the number of edges per CTB
  518|       |     * ctb_size/4 is the number of BS values needed per edge
  519|       |     * divided by 8 for the number of bytes
  520|       |     * 2 is the number of bits needed for each BS value */
  521|       |/*
  522|       |    memset(pu4_vert_bs, 0, (ctb_size / 8 + 1) * (ctb_size / 4) * 2 / 8 );
  523|       |    memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) * 2 / 8 );
  524|       |*/
  525|  1.99M|    memset(pu4_vert_bs, 0, (1 << (2 * log2_ctb_size - 7)) + (ctb_size >> 4));
  526|  1.99M|    memset(pu4_horz_bs, 0, (1 << (2 * log2_ctb_size - 7)));
  527|       |
  528|       |    /* pu4_vert_bs[0] has information about the left CTB which is not required when ctb_x = 0 */
  529|  1.99M|    if(0 != ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (529:8): [True: 1.84M, False: 157k]
  ------------------
  530|  1.84M|    {
  531|  1.84M|        pu4_vert_bs[0] |= vert_bs0_tmp;
  532|  1.84M|    }
  533|       |
  534|       |    /* pu4_horz_bs[0] has information about the top CTB which is not required when ctb_y = 0 */
  535|  1.99M|    if(0 != ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (535:8): [True: 1.88M, False: 109k]
  ------------------
  536|  1.88M|    {
  537|  1.88M|        pu4_horz_bs[0] |= horz_bs0_tmp;
  538|  1.88M|    }
  539|       |    /* pu4_horz_bs[bs_strd / 4] corresponds to pu4_horz_bs[0] of the bottom CTB */
  540|  1.99M|    *(UWORD32 *)((UWORD8 *)pu4_horz_bs + bs_strd) = 0;
  541|       |
  542|  1.99M|    cur_ctb_idx = ps_bs_ctxt->i4_ctb_x
  543|  1.99M|                    + ps_bs_ctxt->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  544|  1.99M|    next_ctb_idx = ps_bs_ctxt->i4_next_tu_ctb_cnt;
  545|  1.99M|    if(1 == ps_bs_ctxt->ps_codec->i4_num_cores)
  ------------------
  |  Branch (545:8): [True: 223k, False: 1.77M]
  ------------------
  546|   223k|    {
  547|   223k|        i4_tu_cnt = ps_bs_ctxt->pu4_pic_tu_idx[next_ctb_idx] - ps_bs_ctxt->pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   223k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   223k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   223k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   223k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   223k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   223k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|   223k|    }
  549|  1.77M|    else
  550|  1.77M|    {
  551|  1.77M|        i4_tu_cnt = ps_bs_ctxt->pu4_pic_tu_idx[next_ctb_idx] - ps_bs_ctxt->pu4_pic_tu_idx[cur_ctb_idx];
  552|  1.77M|    }
  553|       |
  554|  1.99M|    ps_tu = ps_bs_ctxt->ps_tu;
  555|  1.99M|    if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (555:8): [True: 1.95M, False: 43.4k]
  ------------------
  556|  1.95M|        pi1_qp[0] = ps_tu->b7_qp;
  557|       |
  558|       |    /* For all TUs in the CTB For left and top edges, check if there are coded coefficients on either sides of the edge */
  559|  31.5M|    for(i = 0; i < i4_tu_cnt; i++)
  ------------------
  |  Branch (559:16): [True: 29.5M, False: 1.99M]
  ------------------
  560|  29.5M|    {
  561|  29.5M|        WORD32 start_pos_x;
  562|  29.5M|        WORD32 start_pos_y;
  563|  29.5M|        WORD32 end_pos_x;
  564|  29.5M|        WORD32 end_pos_y;
  565|  29.5M|        WORD32 tu_size;
  566|  29.5M|        UWORD32 u4_bs;
  567|  29.5M|        WORD32 intra_flag;
  568|  29.5M|        UWORD8 *pu1_pic_intra_flag;
  569|       |
  570|  29.5M|        ps_tu = ps_bs_ctxt->ps_tu + i;
  571|       |
  572|  29.5M|        start_pos_x = ps_tu->b4_pos_x;
  573|  29.5M|        start_pos_y = ps_tu->b4_pos_y;
  574|       |
  575|  29.5M|        tu_size = 1 << (ps_tu->b3_size + 2);
  576|  29.5M|        tu_size >>= 2;
  577|       |
  578|  29.5M|        end_pos_x = start_pos_x + tu_size;
  579|  29.5M|        end_pos_y = start_pos_y + tu_size;
  580|       |
  581|  29.5M|        {
  582|  29.5M|            WORD32 tu_abs_x = (ps_bs_ctxt->i4_ctb_x << log2_ctb_size) + (start_pos_x << 2);
  583|  29.5M|            WORD32 tu_abs_y = (ps_bs_ctxt->i4_ctb_y << log2_ctb_size) + (start_pos_y << 2);
  584|       |
  585|  29.5M|            WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  586|       |
  587|  29.5M|            pu1_pic_intra_flag = ps_bs_ctxt->ps_codec->pu1_pic_intra_flag;
  588|  29.5M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
  589|  29.5M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
  590|       |
  591|  29.5M|            intra_flag = *pu1_pic_intra_flag;
  592|  29.5M|            intra_flag &= (1 << ((tu_abs_x >> 3) % 8));
  593|  29.5M|        }
  594|  29.5M|        if(intra_flag)
  ------------------
  |  Branch (594:12): [True: 287k, False: 29.2M]
  ------------------
  595|   287k|        {
  596|   287k|            u4_bs = DUP_LSB_10(tu_size);
  ------------------
  |  |   78|   287k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  597|       |
  598|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  599|   287k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (599:16): [True: 204k, False: 83.0k]
  ------------------
  600|   204k|            {
  601|   204k|                WORD32 shift;
  602|   204k|                shift = start_pos_y * 2;
  603|       |                /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  604|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  605|       |                 *  and deblocking is done on 8x8 grid
  606|       |                 */
  607|   204k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (607:20): [True: 24.3k, False: 179k]
  ------------------
  608|  24.3k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  609|   204k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  610|   204k|            }
  611|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  612|   287k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (612:16): [True: 204k, False: 83.0k]
  ------------------
  613|   204k|            {
  614|   204k|                WORD32 shift;
  615|   204k|                shift = start_pos_x * 2;
  616|       |                /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  617|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  618|       |                 *  and deblocking is done on 8x8 grid
  619|       |                 */
  620|   204k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (620:20): [True: 24.3k, False: 179k]
  ------------------
  621|  24.3k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  622|   204k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  623|   204k|            }
  624|   287k|        }
  625|       |
  626|       |
  627|       |        /* If the current TU is coded then set both top edge and left edge BS to 1 and go to next TU */
  628|  29.5M|        if(ps_tu->b1_y_cbf)
  ------------------
  |  Branch (628:12): [True: 416k, False: 29.1M]
  ------------------
  629|   416k|        {
  630|   416k|            u4_bs = DUP_LSB_01(tu_size);
  ------------------
  |  |   75|   416k|#define DUP_LSB_01(x) ((UWORD32)0x55555555 >> (32 - ((x) * 2)))
  ------------------
  631|       |
  632|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  633|   416k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (633:16): [True: 314k, False: 101k]
  ------------------
  634|   314k|            {
  635|   314k|                WORD32 shift;
  636|   314k|                shift = start_pos_y * 2;
  637|       |                /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  638|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  639|       |                 *  and deblocking is done on 8x8 grid
  640|       |                 */
  641|   314k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (641:20): [True: 31.9k, False: 282k]
  ------------------
  642|  31.9k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  643|   314k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  644|   314k|            }
  645|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  646|   416k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (646:16): [True: 314k, False: 101k]
  ------------------
  647|   314k|            {
  648|   314k|                WORD32 shift;
  649|   314k|                shift = start_pos_x * 2;
  650|       |                /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  651|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  652|       |                 *  and deblocking is done on 8x8 grid
  653|       |                 */
  654|   314k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (654:20): [True: 32.0k, False: 282k]
  ------------------
  655|  32.0k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  656|   314k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  657|   314k|            }
  658|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  659|   416k|            if(0 == (end_pos_x & 1))
  ------------------
  |  Branch (659:16): [True: 313k, False: 102k]
  ------------------
  660|   313k|            {
  661|   313k|                if(!(ctb_size / 8 == (end_pos_x >> 1) && ps_bs_ctxt->i4_ctb_x == ps_sps->i2_pic_wd_in_ctb - 1))
  ------------------
  |  Branch (661:22): [True: 79.8k, False: 233k]
  |  Branch (661:58): [True: 3.36k, False: 76.5k]
  ------------------
  662|   310k|                {
  663|   310k|                    WORD32 shift;
  664|   310k|                    shift = start_pos_y * 2;
  665|   310k|                    shift += (((end_pos_x >> 1) & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1));
  ------------------
  |  |  351|   310k|#define MAX_CTB_SIZE        64
  ------------------
  666|   310k|                    pu4_vert_bs[end_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  667|   310k|                }
  668|   313k|            }
  669|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  670|   416k|            if(0 == (end_pos_y & 1))
  ------------------
  |  Branch (670:16): [True: 313k, False: 102k]
  ------------------
  671|   313k|            {
  672|       |                /* If end_pos_y corresponds to the bottom of the CTB, write to pu4_horz_bs[0] of the bottom CTB */
  673|   313k|                if(ctb_size / 8 == (end_pos_y >> 1))
  ------------------
  |  Branch (673:20): [True: 78.9k, False: 234k]
  ------------------
  674|  78.9k|                {
  675|  78.9k|                    *(UWORD32 *)((UWORD8 *)pu4_horz_bs + bs_strd) |= (u4_bs << (start_pos_x * 2));
  676|  78.9k|                }
  677|   234k|                else
  678|   234k|                {
  679|   234k|                    WORD32 shift;
  680|   234k|                    shift = start_pos_x * 2;
  681|   234k|                    shift += (((end_pos_y >> 1) & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1));
  ------------------
  |  |  351|   234k|#define MAX_CTB_SIZE        64
  ------------------
  682|   234k|                    pu4_horz_bs[end_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  683|   234k|                }
  684|   313k|            }
  685|   416k|        }
  686|       |
  687|  29.5M|        if(0 == u4_qp_const_in_ctb)
  ------------------
  |  Branch (687:12): [True: 555k, False: 28.9M]
  ------------------
  688|   555k|        {
  689|   555k|            if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (689:16): [True: 439k, False: 116k]
  |  Branch (689:42): [True: 381k, False: 58.0k]
  ------------------
  690|   381k|            {
  691|   381k|                WORD32 row, col;
  692|  1.05M|                for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (692:40): [True: 669k, False: 381k]
  ------------------
  693|   669k|                {
  694|  2.39M|                    for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (694:44): [True: 1.72M, False: 669k]
  ------------------
  695|  1.72M|                    {
  696|  1.72M|                        pi1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
  697|  1.72M|                    }
  698|   669k|                }
  699|   381k|            }
  700|   555k|        }
  701|  29.5M|    }
  702|       |
  703|       |    /* For all PUs in the CTB,
  704|       |    For left and top edges, compute BS */
  705|       |
  706|  1.99M|    cur_ctb_idx = ps_bs_ctxt->i4_ctb_x
  707|  1.99M|                    + ps_bs_ctxt->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  708|       |
  709|  1.99M|    {
  710|  1.99M|        WORD32 next_ctb_idx;
  711|  1.99M|        next_ctb_idx = ps_bs_ctxt->i4_next_pu_ctb_cnt;
  712|  1.99M|        i4_pu_cnt = ps_bs_ctxt->pu4_pic_pu_idx[next_ctb_idx] - ps_bs_ctxt->pu4_pic_pu_idx[cur_ctb_idx];
  713|  1.99M|    }
  714|       |
  715|  28.7M|    for(i = 0; i < i4_pu_cnt; i++)
  ------------------
  |  Branch (715:16): [True: 26.7M, False: 1.99M]
  ------------------
  716|  26.7M|    {
  717|  26.7M|        WORD32 start_pos_x;
  718|  26.7M|        WORD32 start_pos_y;
  719|  26.7M|        WORD32 end_pos_x;
  720|  26.7M|        WORD32 end_pos_y;
  721|  26.7M|        WORD32 pu_wd, pu_ht;
  722|  26.7M|        UWORD32 u4_bs;
  723|  26.7M|        pu_t *ps_pu = ps_bs_ctxt->ps_pu + i;
  724|  26.7M|        pu_t *ps_ngbr_pu;
  725|  26.7M|        UWORD32 u4_ngbr_pu_indx;
  726|       |
  727|  26.7M|        start_pos_x = ps_pu->b4_pos_x;
  728|  26.7M|        start_pos_y = ps_pu->b4_pos_y;
  729|       |
  730|  26.7M|        pu_wd = (ps_pu->b4_wd + 1);
  731|  26.7M|        pu_ht = (ps_pu->b4_ht + 1);
  732|       |
  733|  26.7M|        end_pos_x = start_pos_x + pu_wd;
  734|  26.7M|        end_pos_y = start_pos_y + pu_ht;
  735|       |
  736|       |        /* If the current PU is intra, set Boundary strength as 2 for both top and left edge */
  737|       |        /* Need not mask the BS to zero even if it was set to 1 already since BS 2 and 3 are assumed to be the same in leaf level functions */
  738|  26.7M|        if(ps_pu->b1_intra_flag)
  ------------------
  |  Branch (738:12): [True: 85.0k, False: 26.6M]
  ------------------
  739|  85.0k|        {
  740|  85.0k|            u4_bs = DUP_LSB_10(pu_ht);
  ------------------
  |  |   78|  85.0k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  741|       |
  742|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  743|  85.0k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (743:16): [True: 85.0k, False: 0]
  ------------------
  744|  85.0k|            {
  745|  85.0k|                WORD32 shift;
  746|  85.0k|                shift = start_pos_y * 2;
  747|       |                /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  748|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  749|       |                 *  and deblocking is done on 8x8 grid
  750|       |                 */
  751|  85.0k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (751:20): [True: 6.66k, False: 78.4k]
  ------------------
  752|  6.66k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  753|  85.0k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  754|  85.0k|            }
  755|       |
  756|  85.0k|            u4_bs = DUP_LSB_10(pu_wd);
  ------------------
  |  |   78|  85.0k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  757|       |
  758|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  759|  85.0k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (759:16): [True: 85.0k, False: 18.4E]
  ------------------
  760|  85.0k|            {
  761|  85.0k|                WORD32 shift;
  762|  85.0k|                shift = start_pos_x * 2;
  763|       |                /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  764|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  765|       |                 *  and deblocking is done on 8x8 grid
  766|       |                 */
  767|  85.0k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (767:20): [True: 6.66k, False: 78.4k]
  ------------------
  768|  6.66k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  769|  85.0k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  770|  85.0k|            }
  771|  85.0k|        }
  772|       |
  773|  26.6M|        else
  774|  26.6M|        {
  775|       |            /* Vertical edge */
  776|       |            /* Process only if the edge is not a frame edge */
  777|  26.6M|            if(0 != ps_bs_ctxt->i4_ctb_x + start_pos_x)
  ------------------
  |  Branch (777:16): [True: 26.2M, False: 433k]
  ------------------
  778|  26.2M|            {
  779|  26.2M|                do
  780|  26.4M|                {
  781|  26.4M|                    WORD32 pu_ngbr_ht;
  782|  26.4M|                    WORD32 min_pu_ht;
  783|  26.4M|                    WORD32 ngbr_end_pos_y;
  784|  26.4M|                    UWORD32 ngbr_pu_idx_strd;
  785|  26.4M|                    ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  26.4M|#define MAX_CTB_SIZE        64
  ------------------
                                  ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  26.4M|#define MIN_PU_SIZE         4
  ------------------
  786|  26.4M|                    u4_ngbr_pu_indx = ps_bs_ctxt->pu4_pic_pu_idx_map[(start_pos_y + 1) * ngbr_pu_idx_strd + (start_pos_x)];
  787|  26.4M|                    ps_ngbr_pu = ps_bs_ctxt->ps_pic_pu + u4_ngbr_pu_indx;
  788|       |
  789|  26.4M|                    pu_ngbr_ht = ps_ngbr_pu->b4_ht + 1;
  790|  26.4M|                    ngbr_end_pos_y = ps_ngbr_pu->b4_pos_y + pu_ngbr_ht;
  791|       |
  792|  26.4M|                    min_pu_ht = MIN(ngbr_end_pos_y, end_pos_y) - start_pos_y;
  ------------------
  |  |   43|  26.4M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 224k, False: 26.2M]
  |  |  ------------------
  ------------------
  793|       |
  794|  26.4M|                    if(ps_ngbr_pu->b1_intra_flag)
  ------------------
  |  Branch (794:24): [True: 44.9k, False: 26.4M]
  ------------------
  795|  44.9k|                    {
  796|  44.9k|                        u4_bs = DUP_LSB_10(min_pu_ht);
  ------------------
  |  |   78|  44.9k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  797|       |
  798|       |                        /* Only if the current edge falls on 8 pixel grid set BS */
  799|  44.9k|                        if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (799:28): [True: 44.9k, False: 18.4E]
  ------------------
  800|  44.9k|                        {
  801|  44.9k|                            WORD32 shift;
  802|  44.9k|                            shift = start_pos_y * 2;
  803|       |                            /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  804|       |                             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  805|       |                             *  and deblocking is done on 8x8 grid
  806|       |                             */
  807|  44.9k|                            if(6 != log2_ctb_size)
  ------------------
  |  Branch (807:32): [True: 5.32k, False: 39.6k]
  ------------------
  808|  5.32k|                                shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  809|  44.9k|                            pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  810|  44.9k|                        }
  811|  44.9k|                    }
  812|  26.4M|                    else
  813|  26.4M|                    {
  814|  26.4M|                        u4_bs = ihevcd_pu_boundary_strength(ps_pu, ps_ngbr_pu);
  815|  26.4M|                        if(u4_bs)
  ------------------
  |  Branch (815:28): [True: 1.14M, False: 25.2M]
  ------------------
  816|  1.14M|                        {
  817|  1.14M|                            u4_bs = DUP_LSB_01(min_pu_ht);
  ------------------
  |  |   75|  1.14M|#define DUP_LSB_01(x) ((UWORD32)0x55555555 >> (32 - ((x) * 2)))
  ------------------
  818|  1.14M|                            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (818:32): [True: 1.06M, False: 79.0k]
  ------------------
  819|  1.06M|                            {
  820|  1.06M|                                WORD32 shift;
  821|  1.06M|                                shift = start_pos_y * 2;
  822|       |                                /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  823|       |                                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  824|       |                                 *  and deblocking is done on 8x8 grid
  825|       |                                 */
  826|  1.06M|                                if(6 != log2_ctb_size)
  ------------------
  |  Branch (826:36): [True: 378k, False: 683k]
  ------------------
  827|   378k|                                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  828|  1.06M|                                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  829|  1.06M|                            }
  830|  1.14M|                        }
  831|  26.4M|                    }
  832|       |
  833|  26.4M|                    pu_ht -= min_pu_ht;
  834|  26.4M|                    start_pos_y += min_pu_ht;
  835|  26.4M|                }while(pu_ht > 0);
  ------------------
  |  Branch (835:24): [True: 224k, False: 26.2M]
  ------------------
  836|       |
  837|       |                /* Reinitialising since the values are updated in the previous loop */
  838|  26.2M|                pu_ht = ps_pu->b4_ht + 1;
  839|  26.2M|                start_pos_y = ps_pu->b4_pos_y;
  840|  26.2M|            }
  841|       |
  842|       |            /* Horizontal edge */
  843|       |            /* Process only if the edge is not a frame edge */
  844|  26.6M|            if(0 != ps_bs_ctxt->i4_ctb_y + start_pos_y)
  ------------------
  |  Branch (844:16): [True: 26.3M, False: 386k]
  ------------------
  845|  26.3M|            {
  846|  26.3M|                do
  847|  26.6M|                {
  848|  26.6M|                    WORD32 pu_ngbr_wd;
  849|  26.6M|                    WORD32 min_pu_wd;
  850|  26.6M|                    WORD32 ngbr_end_pos_x;
  851|  26.6M|                    UWORD32 ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  26.6M|#define MAX_CTB_SIZE        64
  ------------------
                                  UWORD32 ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  26.6M|#define MIN_PU_SIZE         4
  ------------------
  852|  26.6M|                    u4_ngbr_pu_indx = ps_bs_ctxt->pu4_pic_pu_idx_map[(start_pos_y)*ngbr_pu_idx_strd + (start_pos_x + 1)];
  853|  26.6M|                    ps_ngbr_pu = ps_bs_ctxt->ps_pic_pu + u4_ngbr_pu_indx;
  854|       |
  855|  26.6M|                    pu_ngbr_wd = ps_ngbr_pu->b4_wd + 1;
  856|  26.6M|                    ngbr_end_pos_x = ps_ngbr_pu->b4_pos_x + pu_ngbr_wd;
  857|       |
  858|  26.6M|                    min_pu_wd = MIN(ngbr_end_pos_x, end_pos_x) - start_pos_x;
  ------------------
  |  |   43|  26.6M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 324k, False: 26.3M]
  |  |  ------------------
  ------------------
  859|       |
  860|  26.6M|                    if(ps_ngbr_pu->b1_intra_flag)
  ------------------
  |  Branch (860:24): [True: 50.0k, False: 26.5M]
  ------------------
  861|  50.0k|                    {
  862|  50.0k|                        u4_bs = DUP_LSB_10(min_pu_wd);
  ------------------
  |  |   78|  50.0k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  863|       |
  864|       |                        /* Only if the current edge falls on 8 pixel grid set BS */
  865|  50.0k|                        if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (865:28): [True: 50.0k, False: 0]
  ------------------
  866|  50.0k|                        {
  867|  50.0k|                            WORD32 shift;
  868|  50.0k|                            shift = start_pos_x * 2;
  869|       |                            /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  870|       |                             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  871|       |                             *  and deblocking is done on 8x8 grid
  872|       |                             */
  873|  50.0k|                            if(6 != log2_ctb_size)
  ------------------
  |  Branch (873:32): [True: 6.49k, False: 43.5k]
  ------------------
  874|  6.49k|                                shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  875|  50.0k|                            pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  876|  50.0k|                        }
  877|  50.0k|                    }
  878|  26.5M|                    else
  879|  26.5M|                    {
  880|  26.5M|                        u4_bs = ihevcd_pu_boundary_strength(ps_pu, ps_ngbr_pu);
  881|  26.5M|                        if(u4_bs)
  ------------------
  |  Branch (881:28): [True: 1.20M, False: 25.3M]
  ------------------
  882|  1.20M|                        {
  883|  1.20M|                            u4_bs = DUP_LSB_01(min_pu_wd);
  ------------------
  |  |   75|  1.20M|#define DUP_LSB_01(x) ((UWORD32)0x55555555 >> (32 - ((x) * 2)))
  ------------------
  884|       |
  885|       |                            /* Only if the current edge falls on 8 pixel grid set BS */
  886|  1.20M|                            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (886:32): [True: 1.14M, False: 58.0k]
  ------------------
  887|  1.14M|                            {
  888|  1.14M|                                WORD32 shift;
  889|  1.14M|                                shift = start_pos_x * 2;
  890|       |                                /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  891|       |                                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  892|       |                                 *  and deblocking is done on 8x8 grid
  893|       |                                 */
  894|  1.14M|                                if(6 != log2_ctb_size)
  ------------------
  |  Branch (894:36): [True: 251k, False: 890k]
  ------------------
  895|   251k|                                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  896|  1.14M|                                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  897|  1.14M|                            }
  898|  1.20M|                        }
  899|  26.5M|                    }
  900|       |
  901|  26.6M|                    pu_wd -= min_pu_wd;
  902|  26.6M|                    start_pos_x += min_pu_wd;
  903|  26.6M|                }while(pu_wd > 0);
  ------------------
  |  Branch (903:24): [True: 324k, False: 26.3M]
  ------------------
  904|       |
  905|       |                /* Reinitialising since the values are updated in the previous loop */
  906|  26.3M|                pu_wd = ps_pu->b4_wd + 1;
  907|  26.3M|                start_pos_x = ps_pu->b4_pos_x;
  908|  26.3M|            }
  909|  26.6M|        }
  910|  26.7M|    }
  911|       |
  912|  1.99M|    {
  913|       |        /* If left neighbor is not available, then set BS for entire first column to zero */
  914|  1.99M|        UWORD32 ctb_addr;
  915|  1.99M|        WORD32 slice_idx, left_slice_idx = -1, top_slice_idx = -1;
  916|       |
  917|  1.99M|        if(!ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (917:12): [True: 931k, False: 1.06M]
  ------------------
  918|   931k|        {
  919|   931k|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x) ||
  ------------------
  |  Branch (919:17): [True: 931k, False: 96]
  |  Branch (919:66): [True: 121k, False: 810k]
  ------------------
  920|   813k|                            (0 == i1_loop_filter_across_slices_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_slice_x && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (920:30): [True: 533k, False: 280k]
  |  Branch (920:80): [True: 2.78k, False: 530k]
  |  Branch (920:115): [True: 230, False: 2.55k]
  ------------------
  921|   813k|                            (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (921:29): [True: 18.4E, False: 813k]
  ------------------
  922|   121k|            {
  923|   121k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (923:35): [True: 18.0k, False: 103k]
  ------------------
  924|   121k|            }
  925|   931k|        }
  926|  1.06M|        else
  927|  1.06M|        {
  928|  1.06M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x))
  ------------------
  |  Branch (928:17): [True: 281k, False: 786k]
  |  Branch (928:66): [True: 40.4k, False: 241k]
  ------------------
  929|  40.4k|            {
  930|  40.4k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (930:35): [True: 7.45k, False: 32.9k]
  ------------------
  931|  40.4k|            }
  932|  1.02M|            else
  933|  1.02M|            {
  934|       |
  935|  1.02M|                ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  936|  1.02M|                slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  937|       |
  938|  1.02M|                if(ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (938:20): [True: 960k, False: 67.4k]
  ------------------
  939|   960k|                {
  940|   960k|                    ctb_addr = (ps_bs_ctxt->i4_ctb_x - 1) + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  941|   960k|                    left_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  942|   960k|                }
  943|       |
  944|  1.02M|                if(!((ps_bs_ctxt->ps_slice_hdr->i1_dependent_slice_flag == 1) && (slice_idx == left_slice_idx)))
  ------------------
  |  Branch (944:22): [True: 93.8k, False: 933k]
  |  Branch (944:82): [True: 91.4k, False: 2.36k]
  ------------------
  945|   879k|                {
  946|       |                    /* Removed reduntant checks */
  947|   879k|                    if((0 == i1_loop_filter_across_slices_enabled_flag && (
  ------------------
  |  Branch (947:25): [True: 435k, False: 444k]
  ------------------
  948|   435k|                                    (0 == ps_bs_ctxt->i4_ctb_slice_x && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (948:38): [True: 10.0k, False: 425k]
  |  Branch (948:73): [True: 1.16k, False: 8.85k]
  ------------------
  949|   869k|                                    ((0 == ps_bs_ctxt->i4_ctb_tile_x) && (slice_idx != left_slice_idx)))) || (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (949:38): [True: 13.4k, False: 420k]
  |  Branch (949:74): [True: 8.96k, False: 4.47k]
  |  Branch (949:110): [True: 3.95k, False: 865k]
  ------------------
  950|  14.4k|                    {
  951|  14.4k|                        pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (951:43): [True: 2.36k, False: 12.0k]
  ------------------
  952|  14.4k|                    }
  953|   879k|                }
  954|  1.02M|            }
  955|  1.06M|        }
  956|       |
  957|  1.99M|        ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  958|  1.99M|        slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  959|  1.99M|        if(ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (959:12): [True: 1.83M, False: 160k]
  ------------------
  960|  1.83M|        {
  961|  1.83M|            ctb_addr = (ps_bs_ctxt->i4_ctb_x) + ((ps_bs_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  962|  1.83M|            top_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  963|  1.83M|        }
  964|       |        /* If top neighbor is not available, then set BS for entire first row to zero */
  965|       |        /* Removed reduntant checks */
  966|  1.99M|        if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_y)
  ------------------
  |  Branch (966:13): [True: 1.21M, False: 786k]
  |  Branch (966:62): [True: 130k, False: 1.08M]
  ------------------
  967|  1.81M|                        || (0 == i1_loop_filter_across_slices_enabled_flag && ((slice_idx != top_slice_idx)))
  ------------------
  |  Branch (967:29): [True: 1.07M, False: 740k]
  |  Branch (967:79): [True: 20.7k, False: 1.05M]
  ------------------
  968|  1.79M|                        || (0 == ps_bs_ctxt->i4_ctb_y))
  ------------------
  |  Branch (968:28): [True: 787, False: 1.79M]
  ------------------
  969|   153k|        {
  970|   153k|            pu4_horz_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (970:31): [True: 61.9k, False: 91.7k]
  ------------------
  971|   153k|        }
  972|  1.99M|    }
  973|       |
  974|       |    /**
  975|       |     *  Set BS of bottom and right frame boundaries to zero if it is an incomplete CTB
  976|       |     *   (They might have set to  non zero values because of CBF of the current CTB)*/
  977|  1.99M|    {
  978|  1.99M|        WORD32 num_rows_remaining = (ps_sps->i2_pic_height_in_luma_samples - (ps_bs_ctxt->i4_ctb_y << log2_ctb_size)) >> 3;
  979|  1.99M|        WORD32 num_cols_remaining = (ps_sps->i2_pic_width_in_luma_samples - (ps_bs_ctxt->i4_ctb_x << log2_ctb_size)) >> 3;
  980|  1.99M|        if(num_rows_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (980:12): [True: 67.2k, False: 1.93M]
  ------------------
  981|  67.2k|        {
  982|       |            /* WORD32 offset = (((num_rows_remaining >> 3) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 4));
  983|       |             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  984|       |             *  and deblocking is done on 8x8 grid
  985|       |             */
  986|  67.2k|            WORD32 offset;
  987|  67.2k|            offset = (num_rows_remaining >> (6 - log2_ctb_size)) << 2;
  988|  67.2k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (988:16): [True: 27.1k, False: 40.1k]
  ------------------
  989|  27.1k|                offset += (num_rows_remaining & 1) << (log2_ctb_size - 4);
  990|       |
  991|  67.2k|            memset(((UWORD8 *)pu4_horz_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  992|  67.2k|        }
  993|       |
  994|  1.99M|        if(num_cols_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (994:12): [True: 117k, False: 1.88M]
  ------------------
  995|   117k|        {
  996|       |            /* WORD32 offset = (((num_cols_remaining >> 3) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 4));
  997|       |             *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  998|       |             *  and deblocking is done on 8x8 grid
  999|       |             */
 1000|       |
 1001|   117k|            WORD32 offset;
 1002|   117k|            offset = (num_cols_remaining >> (6 - log2_ctb_size)) << 2;
 1003|   117k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (1003:16): [True: 101k, False: 15.7k]
  ------------------
 1004|   101k|                offset += (num_cols_remaining & 1) << (log2_ctb_size - 4);
 1005|       |
 1006|   117k|            memset(((UWORD8 *)pu4_vert_bs) + offset, 0, 1 << (log2_ctb_size - 4));
 1007|   117k|        }
 1008|  1.99M|    }
 1009|  1.99M|    return 0;
 1010|  1.99M|}

ihevcd_cabac_init:
  142|  78.6k|{
  143|       |    /* Sanity checks */
  144|  78.6k|    ASSERT(ps_cabac != NULL);
  ------------------
  |  |   55|  78.6k|#define ASSERT(x) {}
  ------------------
  145|  78.6k|    ASSERT(ps_bitstrm != NULL);
  ------------------
  |  |   55|  78.6k|#define ASSERT(x) {}
  ------------------
  146|  78.6k|    ASSERT((qp >= 0) && (qp < 52));
  ------------------
  |  |   55|  78.6k|#define ASSERT(x) {}
  ------------------
  147|  78.6k|    ASSERT((cabac_init_idc >= 0) && (cabac_init_idc < 3));
  ------------------
  |  |   55|  78.6k|#define ASSERT(x) {}
  ------------------
  148|  78.6k|    UNUSED(qp);
  ------------------
  |  |   38|  78.6k|#define UNUSED(x) ((void)(x))
  ------------------
  149|  78.6k|    UNUSED(cabac_init_idc);
  ------------------
  |  |   38|  78.6k|#define UNUSED(x) ((void)(x))
  ------------------
  150|       |    /* CABAC engine uses 32 bit range instead of 9 bits as specified by
  151|       |     * the spec. This is done to reduce number of renormalizations
  152|       |     */
  153|       |    /* cabac engine initialization */
  154|  78.6k|#if FULLRANGE
  155|  78.6k|    ps_cabac->u4_range = (UWORD32)510 << RANGE_SHIFT;
  ------------------
  |  |   41|  78.6k|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  78.6k|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  156|  78.6k|    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  78.6k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  78.6k|{                                                               \
  |  |  152|  78.6k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  78.6k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  78.6k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  78.6k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  78.6k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|   157k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 50.5k, False: 28.0k]
  |  |  ------------------
  |  |  156|  78.6k|    {                                                           \
  |  |  157|  50.5k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  50.5k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 50.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  50.5k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  50.5k|    }                                                           \
  |  |  160|  78.6k|                                                                \
  |  |  161|  78.6k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|   157k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 50.5k, False: 28.0k]
  |  |  ------------------
  |  |  162|  78.6k|    {                                                           \
  |  |  163|  50.5k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  50.5k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  50.5k|        /* Getting the next word */                             \
  |  |  166|  50.5k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  50.5k|                                                                \
  |  |  168|  50.5k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  50.5k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  50.5k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  50.5k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  50.5k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  50.5k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  50.5k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  50.5k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  50.5k|    }                                                           \
  |  |  172|  78.6k|}
  ------------------
  157|  78.6k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (9 + RANGE_SHIFT));
  158|       |
  159|       |#else
  160|       |    ps_cabac->u4_range = (UWORD32)510;
  161|       |    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  162|       |                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, 9);
  163|       |
  164|       |#endif
  165|       |
  166|       |    /* cabac context initialization based on init idc and slice qp */
  167|  78.6k|    memcpy(ps_cabac->au1_ctxt_models,
  168|  78.6k|           pu1_init_ctxt,
  169|  78.6k|           IHEVC_CAB_CTXT_END);
  170|       |
  171|  78.6k|#ifdef ENABLE_MAIN_REXT_PROFILE
  172|       |    /* golomb rice statistics */
  173|  78.6k|    if(pi4_rice_stat_coeff)
  ------------------
  |  Branch (173:8): [True: 1.61k, False: 76.9k]
  ------------------
  174|  1.61k|    {
  175|  1.61k|        memcpy(ps_cabac->ai4_rice_stat_coeff, pi4_rice_stat_coeff,
  176|  1.61k|               sizeof(ps_cabac->ai4_rice_stat_coeff));
  177|  1.61k|    }
  178|  78.6k|#endif
  179|       |
  180|  78.6k|    DEBUG_RANGE_OFST("init", ps_cabac->u4_range, ps_cabac->u4_ofst);
  181|       |
  182|       |    /*
  183|       |     * If the offset is greater than or equal to range, return fail.
  184|       |     */
  185|  78.6k|    if(ps_cabac->u4_ofst >= ps_cabac->u4_range)
  ------------------
  |  Branch (185:8): [True: 1.57k, False: 77.0k]
  ------------------
  186|  1.57k|    {
  187|  1.57k|        return ((IHEVCD_ERROR_T)IHEVCD_FAIL);
  188|  1.57k|    }
  189|       |
  190|  77.0k|    return ((IHEVCD_ERROR_T)IHEVCD_SUCCESS);
  191|  78.6k|}
ihevcd_cabac_reset:
  195|  7.49k|{
  196|       |    /* Sanity checks */
  197|  7.49k|    ASSERT(ps_cabac != NULL);
  ------------------
  |  |   55|  7.49k|#define ASSERT(x) {}
  ------------------
  198|  7.49k|    ASSERT(ps_bitstrm != NULL);
  ------------------
  |  |   55|  7.49k|#define ASSERT(x) {}
  ------------------
  199|       |
  200|       |    /* CABAC engine uses 32 bit range instead of 9 bits as specified by
  201|       |     * the spec. This is done to reduce number of renormalizations
  202|       |     */
  203|       |    /* cabac engine initialization */
  204|  7.49k|#if FULLRANGE
  205|  7.49k|    ps_cabac->u4_range = (UWORD32)510 << RANGE_SHIFT;
  ------------------
  |  |   41|  7.49k|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  7.49k|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  206|  7.49k|    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  7.49k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  7.49k|{                                                               \
  |  |  152|  7.49k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  7.49k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  7.49k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  7.49k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  7.49k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  14.9k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 4.52k, False: 2.96k]
  |  |  ------------------
  |  |  156|  7.49k|    {                                                           \
  |  |  157|  4.52k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  4.52k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 4.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  4.52k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  4.52k|    }                                                           \
  |  |  160|  7.49k|                                                                \
  |  |  161|  7.49k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  14.9k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 4.52k, False: 2.96k]
  |  |  ------------------
  |  |  162|  7.49k|    {                                                           \
  |  |  163|  4.52k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  4.52k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  4.52k|        /* Getting the next word */                             \
  |  |  166|  4.52k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  4.52k|                                                                \
  |  |  168|  4.52k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  4.52k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  4.52k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  4.52k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  4.52k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  4.52k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  4.52k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  4.52k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  4.52k|    }                                                           \
  |  |  172|  7.49k|}
  ------------------
  207|  7.49k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (9 + RANGE_SHIFT));
  208|       |
  209|       |#else
  210|       |    ps_cabac->u4_range = (UWORD32)510;
  211|       |    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  212|       |                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, 9);
  213|       |
  214|       |#endif
  215|       |
  216|  7.49k|    return ((IHEVCD_ERROR_T)IHEVCD_SUCCESS);
  217|  7.49k|}
ihevcd_cabac_decode_bin:
  249|  49.3M|{
  250|  49.3M|    UWORD32 u4_range = ps_cabac->u4_range;
  251|  49.3M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  252|  49.3M|    UWORD32 u4_rlps;
  253|  49.3M|    UWORD32 u4_bin;
  254|  49.3M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];
  255|  49.3M|    WORD32 state_mps = *pu1_ctxt_model;
  256|  49.3M|#if FULLRANGE
  257|  49.3M|    WORD32 clz;
  258|  49.3M|#endif
  259|  49.3M|    UWORD32 u4_qnt_range;
  260|       |
  261|       |    /* Sanity checks */
  262|  49.3M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  49.3M|#define ASSERT(x) {}
  ------------------
  263|  49.3M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));
  ------------------
  |  |   55|  49.3M|#define ASSERT(x) {}
  ------------------
  264|  49.3M|    ASSERT(state_mps < 128);
  ------------------
  |  |   55|  49.3M|#define ASSERT(x) {}
  ------------------
  265|  49.3M|#if FULLRANGE
  266|  49.3M|    clz = CLZ(u4_range);
  267|  49.3M|    clz -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  49.3M|#define RANGE_NUMBITS 31
  ------------------
  268|  49.3M|    u4_qnt_range = u4_range << clz;
  269|  49.3M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;
  ------------------
  |  |   41|  49.3M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  49.3M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  270|       |#else
  271|       |    u4_qnt_range = (u4_range >> 6) & 0x3;
  272|       |#endif
  273|       |    /* Get the lps range from LUT based on quantized range and state */
  274|  49.3M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];
  275|  49.3M|#if FULLRANGE
  276|  49.3M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);
  ------------------
  |  |   41|  49.3M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  49.3M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  277|  49.3M|#endif
  278|  49.3M|    u4_range -= u4_rlps;
  279|       |
  280|  49.3M|    u4_bin = state_mps & 1;
  281|       |
  282|  49.3M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (282:8): [True: 7.09M, False: 42.2M]
  ------------------
  283|  7.09M|    {
  284|  7.09M|        u4_bin = 1 - u4_bin;
  285|  7.09M|        u4_ofst -= u4_range;
  286|  7.09M|        u4_range = u4_rlps;
  287|  7.09M|    }
  288|       |
  289|  49.3M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];
  290|       |
  291|       |    /*****************************************************************/
  292|       |    /* Re-normalization; calculate bits generated based on range(R)  */
  293|       |    /*****************************************************************/
  294|  49.3M|    if(u4_range < (1 << 8))
  ------------------
  |  Branch (294:8): [True: 738k, False: 48.6M]
  ------------------
  295|   738k|    {
  296|   738k|        UWORD32 u4_bits;
  297|   738k|        WORD32 numbits;
  298|   738k|        numbits = CLZ(u4_range);
  299|   738k|        numbits -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|   738k|#define RANGE_NUMBITS 31
  ------------------
  300|       |#if !FULLRANGE
  301|       |        numbits -= RANGE_SHIFT;
  302|       |#endif
  303|   738k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|   738k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   738k|{                                                               \
  |  |  152|   738k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   738k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   738k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   738k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   738k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  1.47M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 511k, False: 227k]
  |  |  ------------------
  |  |  156|   738k|    {                                                           \
  |  |  157|   511k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   511k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 511k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   511k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   511k|    }                                                           \
  |  |  160|   738k|                                                                \
  |  |  161|   738k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  1.47M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 536k, False: 202k]
  |  |  ------------------
  |  |  162|   738k|    {                                                           \
  |  |  163|   536k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   536k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   536k|        /* Getting the next word */                             \
  |  |  166|   536k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   536k|                                                                \
  |  |  168|   536k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   536k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   536k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   536k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   536k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   536k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   536k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   536k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   536k|    }                                                           \
  |  |  172|   738k|}
  ------------------
  304|   738k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);
  305|       |
  306|   738k|        u4_ofst <<= numbits;
  307|   738k|        u4_ofst |= u4_bits;
  308|   738k|        u4_range <<= numbits;
  309|       |
  310|   738k|    }
  311|       |    /* Update the cabac context */
  312|  49.3M|    ps_cabac->u4_range = u4_range;
  313|  49.3M|    ps_cabac->u4_ofst = u4_ofst;
  314|  49.3M|    DEBUG_RANGE_OFST("bin", ps_cabac->u4_range, ps_cabac->u4_ofst);
  315|       |
  316|  49.3M|    return (u4_bin);
  317|       |
  318|       |
  319|  49.3M|}
ihevcd_cabac_decode_bypass_bin:
  341|  1.52M|{
  342|       |
  343|  1.52M|    UWORD32 u4_bin;
  344|  1.52M|    UWORD32 u4_range = ps_cabac->u4_range;
  345|  1.52M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  346|  1.52M|    UWORD32 u4_bits;
  347|       |
  348|       |    /* Sanity checks */
  349|  1.52M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  1.52M|#define ASSERT(x) {}
  ------------------
  350|       |
  351|  1.52M|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  182|  1.52M|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  183|  1.52M|{                                                               \
  |  |  184|  1.52M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  185|  1.52M|                             >> (WORD_SIZE_MINUS1);             \
  |  |  ------------------
  |  |  |  |   51|  1.52M|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.52M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|  1.52M|    m_u4_bit_ofst++;                                            \
  |  |  187|  1.52M|                                                                \
  |  |  188|  1.52M|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  ------------------
  |  |  |  |   42|  3.05M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (188:8): [True: 60.8k, False: 1.46M]
  |  |  ------------------
  |  |  189|  1.52M|    {                                                           \
  |  |  190|  60.8k|        UWORD32 pu4_word_tmp;                                   \
  |  |  191|  60.8k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  192|  60.8k|        /* Getting the next word */                             \
  |  |  193|  60.8k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  194|  60.8k|                                                                \
  |  |  195|  60.8k|        m_u4_bit_ofst = 0;                                      \
  |  |  196|  60.8k|        /* Swapping little endian to big endian conversion*/    \
  |  |  197|  60.8k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  60.8k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  60.8k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  60.8k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  60.8k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  198|  60.8k|    }                                                           \
  |  |  199|  1.52M|}
  ------------------
  352|  1.52M|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);
  353|       |
  354|  1.52M|    u4_ofst <<= 1;
  355|  1.52M|    u4_ofst |= u4_bits;
  356|       |
  357|  1.52M|    u4_bin = 0;
  358|  1.52M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (358:8): [True: 683k, False: 844k]
  ------------------
  359|   683k|    {
  360|   683k|        u4_bin = 1;
  361|   683k|        u4_ofst -= u4_range;
  362|   683k|    }
  363|       |
  364|       |    /* Update the cabac context */
  365|  1.52M|    ps_cabac->u4_ofst = u4_ofst;
  366|  1.52M|    DEBUG_RANGE_OFST("bypass end", ps_cabac->u4_range, ps_cabac->u4_ofst);
  367|  1.52M|    return (u4_bin);
  368|  1.52M|}
ihevcd_cabac_decode_terminate:
  391|  1.10M|{
  392|  1.10M|    UWORD32 u4_range = ps_cabac->u4_range;
  393|  1.10M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  394|  1.10M|    UWORD32 u4_bin;
  395|  1.10M|#if FULLRANGE
  396|  1.10M|    WORD32 clz;
  397|  1.10M|#endif
  398|       |    /* Sanity checks */
  399|  1.10M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  1.10M|#define ASSERT(x) {}
  ------------------
  400|  1.10M|#if FULLRANGE
  401|  1.10M|    clz = CLZ(u4_range);
  402|  1.10M|    clz -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  1.10M|#define RANGE_NUMBITS 31
  ------------------
  403|  1.10M|    u4_range -= 2 << (RANGE_SHIFT - clz);
  ------------------
  |  |   41|  1.10M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  1.10M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  404|       |#else
  405|       |    u4_range -= 2;
  406|       |#endif
  407|       |
  408|  1.10M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (408:8): [True: 10.5k, False: 1.09M]
  ------------------
  409|  10.5k|    {
  410|  10.5k|        u4_bin = 1;
  411|       |
  412|  10.5k|#if FULLRANGE
  413|       |        /* In case of FULLRANGE extra bits read earlier need to pushed back to the bitstream */
  414|  10.5k|        {
  415|  10.5k|            WORD32 clz;
  416|  10.5k|            WORD32 numbits;
  417|  10.5k|            clz = CLZ(ps_cabac->u4_range);
  418|       |
  419|  10.5k|            numbits = (32 - clz);
  420|  10.5k|            numbits -= 9;
  421|       |
  422|  10.5k|            ihevcd_bits_seek(ps_bitstrm, -numbits);
  423|  10.5k|        }
  424|  10.5k|#endif
  425|       |
  426|  10.5k|    }
  427|  1.09M|    else
  428|  1.09M|    {
  429|  1.09M|        u4_bin = 0;
  430|  1.09M|    }
  431|  1.10M|    if(0 == u4_bin)
  ------------------
  |  Branch (431:8): [True: 1.09M, False: 10.5k]
  ------------------
  432|  1.09M|    {
  433|  1.09M|        UWORD32 u4_bits;
  434|  1.09M|        WORD32 numbits;
  435|  1.09M|        numbits = CLZ(u4_range);
  436|  1.09M|        numbits -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  1.09M|#define RANGE_NUMBITS 31
  ------------------
  437|       |#if !FULLRANGE
  438|       |        numbits -= RANGE_SHIFT;
  439|       |#endif
  440|       |        /* Renormalize if required */
  441|  1.09M|        if(numbits)
  ------------------
  |  Branch (441:12): [True: 886k, False: 204k]
  ------------------
  442|   886k|        {
  443|   886k|            BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|   886k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   886k|{                                                               \
  |  |  152|   886k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   886k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   886k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   886k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   886k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  1.77M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 203k, False: 683k]
  |  |  ------------------
  |  |  156|   886k|    {                                                           \
  |  |  157|   203k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   203k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 203k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   203k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   203k|    }                                                           \
  |  |  160|   886k|                                                                \
  |  |  161|   886k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  1.77M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 233k, False: 653k]
  |  |  ------------------
  |  |  162|   886k|    {                                                           \
  |  |  163|   233k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   233k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   233k|        /* Getting the next word */                             \
  |  |  166|   233k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   233k|                                                                \
  |  |  168|   233k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   233k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   233k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   233k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   233k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   233k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   233k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   233k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   233k|    }                                                           \
  |  |  172|   886k|}
  ------------------
  444|   886k|                     ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);
  445|       |
  446|   886k|            u4_ofst <<= numbits;
  447|   886k|            u4_ofst |= u4_bits;
  448|   886k|            u4_range <<= numbits;
  449|   886k|        }
  450|  1.09M|    }
  451|       |    /* bits to be inserted in the bitstream */
  452|  1.10M|    ps_cabac->u4_range = u4_range;
  453|  1.10M|    ps_cabac->u4_ofst = u4_ofst;
  454|  1.10M|    DEBUG_RANGE_OFST("term", ps_cabac->u4_range, ps_cabac->u4_ofst);
  455|       |
  456|  1.10M|    return (u4_bin);
  457|  1.10M|}
ihevcd_cabac_decode_bypass_bins:
  486|  5.04M|{
  487|  5.04M|    UWORD32 u4_bins;
  488|       |
  489|       |
  490|  5.04M|    UWORD32 u4_range = ps_cabac->u4_range;
  491|  5.04M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  492|  5.04M|    UWORD32 u4_bits;
  493|  5.04M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  5.04M|#define ASSERT(x) {}
  ------------------
  494|  5.04M|    ASSERT(numbins > 0);
  ------------------
  |  |   55|  5.04M|#define ASSERT(x) {}
  ------------------
  495|       |
  496|       |    /* Sanity checks */
  497|  5.04M|    ASSERT(numbins < 17);
  ------------------
  |  |   55|  5.04M|#define ASSERT(x) {}
  ------------------
  498|       |
  499|  5.04M|    u4_bins = 0;
  500|       |
  501|  5.04M|    BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  5.04M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  5.04M|{                                                               \
  |  |  152|  5.04M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  5.04M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  5.04M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  5.04M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  5.04M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  10.0M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 347k, False: 4.69M]
  |  |  ------------------
  |  |  156|  5.04M|    {                                                           \
  |  |  157|   347k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   347k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 347k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   347k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   347k|    }                                                           \
  |  |  160|  5.04M|                                                                \
  |  |  161|  5.04M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  10.0M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 500k, False: 4.54M]
  |  |  ------------------
  |  |  162|  5.04M|    {                                                           \
  |  |  163|   500k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   500k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   500k|        /* Getting the next word */                             \
  |  |  166|   500k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   500k|                                                                \
  |  |  168|   500k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   500k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   500k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   500k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   500k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   500k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   500k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   500k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   500k|    }                                                           \
  |  |  172|  5.04M|}
  ------------------
  502|  5.04M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins);
  503|       |
  504|  5.04M|    do
  505|  16.0M|    {
  506|  16.0M|        UWORD32 u4_bit;
  507|  16.0M|        numbins--;
  508|  16.0M|        u4_bit = (u4_bits >> numbins) & 1;
  509|  16.0M|        u4_ofst <<= 1;
  510|  16.0M|        u4_ofst |= u4_bit;
  511|       |
  512|  16.0M|        u4_bins <<= 1;
  513|  16.0M|        if(u4_ofst >= u4_range)
  ------------------
  |  Branch (513:12): [True: 4.49M, False: 11.5M]
  ------------------
  514|  4.49M|        {
  515|  4.49M|            u4_bins += 1;
  516|  4.49M|            u4_ofst -= u4_range;
  517|  4.49M|        }
  518|  16.0M|    }while(numbins);
  ------------------
  |  Branch (518:12): [True: 10.9M, False: 5.04M]
  ------------------
  519|       |
  520|       |    /* Update the cabac context */
  521|  5.04M|    ps_cabac->u4_ofst = u4_ofst;
  522|  5.04M|    DEBUG_RANGE_OFST("bypass", ps_cabac->u4_range, ps_cabac->u4_ofst);
  523|  5.04M|    return (u4_bins);
  524|  5.04M|}
ihevcd_cabac_decode_bins_tunary:
  571|  16.9M|{
  572|  16.9M|    UWORD32 u4_sym;
  573|  16.9M|    WORD32 bin;
  574|       |
  575|       |    /* Sanity checks */
  576|  16.9M|    ASSERT(c_max > 0);
  ------------------
  |  |   55|  16.9M|#define ASSERT(x) {}
  ------------------
  577|  16.9M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));
  ------------------
  |  |   55|  16.9M|#define ASSERT(x) {}
  ------------------
  578|  16.9M|    ASSERT((ctxt_index + (c_max >> ctxt_shift)) < IHEVC_CAB_CTXT_END);
  ------------------
  |  |   55|  16.9M|#define ASSERT(x) {}
  ------------------
  579|       |
  580|  16.9M|    u4_sym = 0;
  581|  16.9M|    do
  582|  38.6M|    {
  583|  38.6M|        WORD32 bin_index;
  584|  38.6M|        bin_index = ctxt_index + MIN((u4_sym >> ctxt_shift), (UWORD32)ctxt_inc_max);
  ------------------
  |  |   43|  38.6M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 38.1M, False: 480k]
  |  |  ------------------
  ------------------
  585|  38.6M|        IHEVCD_CABAC_DECODE_BIN(bin, ps_cabac, ps_bitstrm,  bin_index);
  ------------------
  |  |   59|  38.6M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  38.6M|{                                                                               \
  |  |   61|  38.6M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  38.6M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  38.6M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  38.6M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  38.6M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  38.6M|    WORD32 clz;                                                                 \
  |  |   67|  38.6M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  38.6M|                                                                                \
  |  |   69|  38.6M|    /* Sanity checks */                                                         \
  |  |   70|  38.6M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  38.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  38.6M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  38.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  38.6M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  38.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  38.6M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  38.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  38.6M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  38.6M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  38.6M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  38.6M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  38.6M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  38.6M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  38.6M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  38.6M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  38.6M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  38.6M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  38.6M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  38.6M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  38.6M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  38.6M|                                                                                \
  |  |   83|  38.6M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  38.6M|                                                                                \
  |  |   85|  38.6M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 4.39M, False: 34.2M]
  |  |  ------------------
  |  |   86|  38.6M|    {                                                                           \
  |  |   87|  4.39M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  4.39M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  4.39M|        u4_range = u4_rlps;                                                     \
  |  |   90|  4.39M|    }                                                                           \
  |  |   91|  38.6M|                                                                                \
  |  |   92|  38.6M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  38.6M|                                                                                \
  |  |   94|  38.6M|    /*****************************************************************/         \
  |  |   95|  38.6M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  38.6M|    /*****************************************************************/         \
  |  |   97|  38.6M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 561k, False: 38.0M]
  |  |  ------------------
  |  |   98|  38.6M|    {                                                                           \
  |  |   99|   561k|        UWORD32 u4_bits;                                                        \
  |  |  100|   561k|        WORD32 numbits;                                                         \
  |  |  101|   561k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   561k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   561k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   561k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   561k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   561k|{                                                               \
  |  |  |  |  152|   561k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   561k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   561k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   561k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   561k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.12M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 390k, False: 171k]
  |  |  |  |  ------------------
  |  |  |  |  156|   561k|    {                                                           \
  |  |  |  |  157|   390k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   390k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 390k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   390k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   390k|    }                                                           \
  |  |  |  |  160|   561k|                                                                \
  |  |  |  |  161|   561k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.12M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 408k, False: 152k]
  |  |  |  |  ------------------
  |  |  |  |  162|   561k|    {                                                           \
  |  |  |  |  163|   408k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   408k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   408k|        /* Getting the next word */                             \
  |  |  |  |  166|   408k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   408k|                                                                \
  |  |  |  |  168|   408k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   408k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   408k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   408k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   408k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   408k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   408k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   408k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   408k|    }                                                           \
  |  |  |  |  172|   561k|}
  |  |  ------------------
  |  |  104|   561k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   561k|                                                                                \
  |  |  106|   561k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   561k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   561k|        u4_range <<= numbits;                                                   \
  |  |  109|   561k|                                                                                \
  |  |  110|   561k|    }                                                                           \
  |  |  111|  38.6M|    /* Update the cabac context */                                              \
  |  |  112|  38.6M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  38.6M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  38.6M|                                                                                \
  |  |  115|  38.6M|}
  ------------------
  586|  38.6M|        u4_sym++;
  587|  38.6M|    }while(((WORD32)u4_sym < c_max) && bin);
  ------------------
  |  Branch (587:12): [True: 33.8M, False: 4.83M]
  |  Branch (587:40): [True: 21.6M, False: 12.1M]
  ------------------
  588|       |
  589|  16.9M|    u4_sym = u4_sym - 1 + bin;
  590|       |
  591|  16.9M|    return (u4_sym);
  592|  16.9M|}
ihevcd_cabac_decode_bypass_bins_tunary:
  621|  4.99M|{
  622|       |
  623|  4.99M|    UWORD32 u4_sym;
  624|  4.99M|    WORD32 bin;
  625|  4.99M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  626|  4.99M|    UWORD32 u4_range = ps_cabac->u4_range;
  627|  4.99M|    UWORD32 u4_bits;
  628|       |    /* Sanity checks */
  629|  4.99M|    ASSERT(c_max > 0);
  ------------------
  |  |   55|  4.99M|#define ASSERT(x) {}
  ------------------
  630|  4.99M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  4.99M|#define ASSERT(x) {}
  ------------------
  631|  4.99M|    u4_sym = 0;
  632|  4.99M|    BITS_NXT(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |   91|  4.99M|                 m_u4_cur_word, m_u4_nxt_word, m_cnt)       \
  |  |   92|  4.99M|{                                                           \
  |  |   93|  4.99M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)  >>        \
  |  |   94|  4.99M|                              (WORD_SIZE - m_cnt);          \
  |  |  ------------------
  |  |  |  |   42|  4.99M|#define WORD_SIZE         32
  |  |  ------------------
  |  |   95|  4.99M|                                                            \
  |  |   96|  4.99M|    if(m_u4_bit_ofst > (WORD_SIZE - m_cnt))                 \
  |  |  ------------------
  |  |  |  |   42|  4.99M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (96:8): [True: 1.10M, False: 3.88M]
  |  |  ------------------
  |  |   97|  4.99M|    {                                                       \
  |  |   98|  1.10M|        m_u4_bits |= SHR(m_u4_nxt_word,                     \
  |  |  ------------------
  |  |  |  |   57|  1.10M|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 1.10M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|  1.10M|                   (WORD_SIZE + WORD_SIZE - m_cnt           \
  |  |  100|  1.10M|                          - m_u4_bit_ofst));                \
  |  |  101|  1.10M|    }                                                       \
  |  |  102|  4.99M|}
  ------------------
  633|  4.99M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (UWORD32)c_max);
  634|  4.99M|    u4_bits <<= (32 - c_max);
  635|  4.99M|    do
  636|  7.72M|    {
  637|  7.72M|        u4_ofst <<= 1;
  638|  7.72M|        u4_ofst |= (u4_bits >> 31);
  639|  7.72M|        u4_bits <<= 1;
  640|       |
  641|  7.72M|        bin = 0;
  642|  7.72M|        if(u4_ofst >= u4_range)
  ------------------
  |  Branch (642:12): [True: 3.26M, False: 4.45M]
  ------------------
  643|  3.26M|        {
  644|  3.26M|            bin = 1;
  645|  3.26M|            u4_ofst -= u4_range;
  646|  3.26M|        }
  647|  7.72M|        u4_sym++;
  648|  7.72M|    }while(((WORD32)u4_sym < c_max) && bin);
  ------------------
  |  Branch (648:12): [True: 6.67M, False: 1.04M]
  |  Branch (648:40): [True: 2.73M, False: 3.94M]
  ------------------
  649|  4.99M|    BITS_FLUSH(ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  127|  4.99M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  4.99M|{                                                           \
  |  |  129|  4.99M|    UWORD32 temp;                                           \
  |  |  130|  4.99M|                                                            \
  |  |  131|  4.99M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  4.99M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  9.98M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 232k, False: 4.75M]
  |  |  ------------------
  |  |  133|  4.99M|    {                                                       \
  |  |  134|   232k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|   232k|        /* Getting the next word */                         \
  |  |  136|   232k|        temp = *(m_pu4_buf++);                              \
  |  |  137|   232k|                                                            \
  |  |  138|   232k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|   232k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|   232k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|   232k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|   232k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   232k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   232k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   232k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|   232k|    }                                                       \
  |  |  142|  4.99M|}
  ------------------
  650|  4.99M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, u4_sym);
  651|       |
  652|  4.99M|    u4_sym = u4_sym - 1 + bin;
  653|       |    /* Update the cabac context */
  654|  4.99M|    ps_cabac->u4_ofst = u4_ofst;
  655|       |
  656|  4.99M|    return (u4_sym);
  657|  4.99M|}
ihevcd_cabac_decode_bypass_bins_egk:
  684|   369k|{
  685|       |
  686|   369k|    UWORD32 u4_sym;
  687|   369k|    WORD32 numones;
  688|   369k|    WORD32 bin;
  689|       |
  690|       |    /* Sanity checks */
  691|   369k|    ASSERT((k >= 0));
  ------------------
  |  |   55|   369k|#define ASSERT(x) {}
  ------------------
  692|       |
  693|   369k|    numones = k;
  694|   369k|    bin = 1;
  695|   369k|    u4_sym = 0;
  696|  1.03M|    while(bin && (numones <= 16))
  ------------------
  |  Branch (696:11): [True: 662k, False: 369k]
  |  Branch (696:18): [True: 662k, False: 164]
  ------------------
  697|   662k|    {
  698|   662k|        IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
  ------------------
  |  |  122|   662k|#define IHEVCD_CABAC_DECODE_BYPASS_BIN(u4_bin, ps_cabac, ps_bitstrm)            \
  |  |  123|   662k|{                                                                               \
  |  |  124|   662k|                                                                                \
  |  |  125|   662k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  126|   662k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  127|   662k|    UWORD32 u4_bits;                                                            \
  |  |  128|   662k|                                                                                \
  |  |  129|   662k|    /* Sanity checks */                                                         \
  |  |  130|   662k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   662k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  131|   662k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   662k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  132|   662k|                                                                                \
  |  |  133|   662k|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,              \
  |  |  ------------------
  |  |  |  |  182|   662k|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  |  |  183|   662k|{                                                               \
  |  |  |  |  184|   662k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  185|   662k|                             >> (WORD_SIZE_MINUS1);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|   662k|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|   662k|#define WORD_SIZE         32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  186|   662k|    m_u4_bit_ofst++;                                            \
  |  |  |  |  187|   662k|                                                                \
  |  |  |  |  188|   662k|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.32M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (188:8): [True: 20.1k, False: 642k]
  |  |  |  |  ------------------
  |  |  |  |  189|   662k|    {                                                           \
  |  |  |  |  190|  20.1k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  191|  20.1k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  192|  20.1k|        /* Getting the next word */                             \
  |  |  |  |  193|  20.1k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  |  |  194|  20.1k|                                                                \
  |  |  |  |  195|  20.1k|        m_u4_bit_ofst = 0;                                      \
  |  |  |  |  196|  20.1k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  197|  20.1k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  20.1k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  20.1k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  20.1k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  20.1k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  198|  20.1k|    }                                                           \
  |  |  |  |  199|   662k|}
  |  |  ------------------
  |  |  134|   662k|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);                  \
  |  |  135|   662k|                                                                                \
  |  |  136|   662k|    u4_ofst <<= 1;                                                              \
  |  |  137|   662k|    u4_ofst |= u4_bits;                                                         \
  |  |  138|   662k|                                                                                \
  |  |  139|   662k|    u4_bin = 0;                                                                 \
  |  |  140|   662k|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 292k, False: 369k]
  |  |  ------------------
  |  |  141|   662k|    {                                                                           \
  |  |  142|   292k|        u4_bin = 1;                                                             \
  |  |  143|   292k|        u4_ofst -= u4_range;                                                    \
  |  |  144|   292k|    }                                                                           \
  |  |  145|   662k|                                                                                \
  |  |  146|   662k|    /* Update the cabac context */                                              \
  |  |  147|   662k|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  148|   662k|}
  ------------------
  699|   662k|        u4_sym += bin << numones++;
  700|   662k|    }
  701|       |
  702|   369k|    numones -= 1;
  703|       |
  704|   369k|    if(numones)
  ------------------
  |  Branch (704:8): [True: 295k, False: 73.9k]
  ------------------
  705|   295k|    {
  706|   295k|        UWORD32 u4_suffix;
  707|       |
  708|   295k|        IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, numones);
  ------------------
  |  |  156|   295k|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|   295k|{                                                                               \
  |  |  158|   295k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|   295k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|   295k|    UWORD32 u4_bits;                                                            \
  |  |  161|   295k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   295k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|   295k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   295k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|   295k|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|   295k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|   295k|    {                                                                           \
  |  |  165|   295k|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|   295k|        /* Sanity checks */                                                     \
  |  |  167|   295k|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|   295k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|   295k|                                                                                \
  |  |  169|   295k|        u4_bins = 0;                                                            \
  |  |  170|   295k|                                                                                \
  |  |  171|   295k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   295k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   295k|{                                                               \
  |  |  |  |  152|   295k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   295k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   295k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   295k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   295k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   591k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 8.93k, False: 286k]
  |  |  |  |  ------------------
  |  |  |  |  156|   295k|    {                                                           \
  |  |  |  |  157|  8.93k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  8.93k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 8.93k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  8.93k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  8.93k|    }                                                           \
  |  |  |  |  160|   295k|                                                                \
  |  |  |  |  161|   295k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   591k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 18.0k, False: 277k]
  |  |  |  |  ------------------
  |  |  |  |  162|   295k|    {                                                           \
  |  |  |  |  163|  18.0k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  18.0k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  18.0k|        /* Getting the next word */                             \
  |  |  |  |  166|  18.0k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  18.0k|                                                                \
  |  |  |  |  168|  18.0k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  18.0k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  18.0k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  18.0k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  18.0k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  18.0k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  18.0k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  18.0k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  18.0k|    }                                                           \
  |  |  |  |  172|   295k|}
  |  |  ------------------
  |  |  172|   295k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|   295k|        do                                                                      \
  |  |  174|   583k|        {                                                                       \
  |  |  175|   583k|            UWORD32 u4_bit;                                                     \
  |  |  176|   583k|            numbins_tmp--;                                                      \
  |  |  177|   583k|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|   583k|            u4_ofst <<= 1;                                                      \
  |  |  179|   583k|            u4_ofst |= u4_bit;                                                  \
  |  |  180|   583k|                                                                                \
  |  |  181|   583k|            u4_bins <<= 1;                                                      \
  |  |  182|   583k|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 285k, False: 298k]
  |  |  ------------------
  |  |  183|   583k|            {                                                                   \
  |  |  184|   285k|                u4_bins += 1;                                                   \
  |  |  185|   285k|                u4_ofst -= u4_range;                                            \
  |  |  186|   285k|            }                                                                   \
  |  |  187|   583k|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 287k, False: 295k]
  |  |  ------------------
  |  |  188|   295k|                                                                                \
  |  |  189|   295k|        /* Update the cabac context */                                          \
  |  |  190|   295k|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|   295k|    }                                                                           \
  |  |  192|   295k|}
  ------------------
  709|   295k|        u4_sym += u4_suffix;
  710|   295k|    }
  711|   369k|    return (u4_sym);
  712|   369k|}

ihevcd_deblk_ctb:
  100|  19.5M|{
  101|  19.5M|    WORD32 ctb_size;
  102|  19.5M|    WORD32 log2_ctb_size;
  103|  19.5M|    UWORD32 u4_bs;
  104|  19.5M|    WORD32 bs_tz; /*Leading zeros in boundary strength*/
  105|  19.5M|    WORD32 qp_p, qp_q;
  106|       |
  107|  19.5M|    WORD32 filter_p, filter_q;
  108|       |
  109|  19.5M|    UWORD8 *pu1_src;
  110|  19.5M|    WORD32 qp_strd;
  111|  19.5M|    UWORD32 *pu4_vert_bs, *pu4_horz_bs;
  112|  19.5M|    UWORD32 *pu4_ctb_vert_bs, *pu4_ctb_horz_bs;
  113|  19.5M|    WORD32 bs_strd;
  114|  19.5M|    WORD32 src_strd, chroma_strd;
  115|  19.5M|    WORD8 *pi1_qp;
  116|  19.5M|    UWORD16 *pu2_ctb_no_loop_filter_flag;
  117|  19.5M|    UWORD16 au2_ctb_no_loop_filter_flag[9];
  118|  19.5M|    WORD32 pixel_size_y, pixel_size_uv;
  119|  19.5M|    UWORD8 u1_bit_depth_luma, u1_bit_depth_chroma;
  120|       |
  121|  19.5M|    WORD32 col, row;
  122|       |
  123|       |    /* Flag to indicate if QP is constant in CTB
  124|       |     * 0 - top_left, 1 - top, 2 - left, 3 - current */
  125|  19.5M|    UWORD32 u4_qp_const_in_ctb[4] = { 0, 0, 0, 0 };
  126|  19.5M|    WORD32 ctb_indx;
  127|  19.5M|    WORD32  chroma_yuv420sp_vu = ps_deblk->is_chroma_yuv420sp_vu;
  128|  19.5M|    sps_t *ps_sps;
  129|  19.5M|    pps_t *ps_pps;
  130|  19.5M|    codec_t *ps_codec;
  131|  19.5M|    slice_header_t *ps_slice_hdr;
  132|       |
  133|  19.5M|    ihevc_deblk_chroma_horz_ft *pf_deblk_chroma_horz;
  134|  19.5M|    ihevc_deblk_chroma_vert_ft *pf_deblk_chroma_vert;
  135|  19.5M|    ihevc_hbd_deblk_chroma_horz_ft *pf_hbd_deblk_chroma_horz;
  136|  19.5M|    ihevc_hbd_deblk_chroma_vert_ft *pf_hbd_deblk_chroma_vert;
  137|       |
  138|  19.5M|    PROFILE_DISABLE_DEBLK();
  ------------------
  |  |   57|  19.5M|#define PROFILE_DISABLE_DEBLK() ;
  ------------------
  139|       |
  140|  19.5M|    ps_sps = ps_deblk->ps_sps;
  141|  19.5M|    ps_pps = ps_deblk->ps_pps;
  142|  19.5M|    ps_codec = ps_deblk->ps_codec;
  143|  19.5M|    ps_slice_hdr = ps_deblk->ps_slice_hdr;
  144|       |
  145|  19.5M|    WORD32 is_yuv422 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 ? 1 : 0;
  ------------------
  |  Branch (145:24): [True: 795k, False: 18.7M]
  ------------------
  146|  19.5M|    WORD32 is_yuv444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 1 : 0;
  ------------------
  |  Branch (146:24): [True: 0, False: 19.5M]
  ------------------
  147|  19.5M|    WORD32 h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (147:28): [True: 0, False: 19.5M]
  ------------------
  148|  19.5M|    WORD32 v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (148:28): [True: 18.7M, False: 816k]
  ------------------
  149|  19.5M|    WORD32 chroma_pixel_strd = 2;
  150|       |
  151|  19.5M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  152|  19.5M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  153|  19.5M|    pixel_size_y     = ps_codec->i4_pixel_size_y;
  154|  19.5M|    pixel_size_uv    = ps_codec->i4_pixel_size_uv;
  155|  19.5M|    u1_bit_depth_luma   = (UWORD8)ps_codec->i4_bit_depth_luma;
  156|  19.5M|    u1_bit_depth_chroma = (UWORD8)ps_codec->i4_bit_depth_chroma;
  157|       |
  158|       |
  159|  19.5M|    if(is_yuv422)
  ------------------
  |  Branch (159:8): [True: 793k, False: 18.7M]
  ------------------
  160|   793k|    {
  161|   793k|        pf_deblk_chroma_horz = ps_codec->s_func_selector.ihevc_deblk_422chroma_horz_fptr;
  162|   793k|        pf_deblk_chroma_vert = ps_codec->s_func_selector.ihevc_deblk_422chroma_vert_fptr;
  163|   793k|    }
  164|  18.7M|    else
  165|  18.7M|    {
  166|  18.7M|        pf_deblk_chroma_horz = ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr;
  167|  18.7M|        pf_deblk_chroma_vert = ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr;
  168|  18.7M|    }
  169|       |
  170|  19.5M|    pf_hbd_deblk_chroma_horz = ps_codec->s_func_selector.ihevc_hbd_deblk_chroma_horz_fptr;
  171|  19.5M|    pf_hbd_deblk_chroma_vert = ps_codec->s_func_selector.ihevc_hbd_deblk_chroma_vert_fptr;
  172|       |
  173|       |    /* strides are in units of number of bytes */
  174|       |    /* ctb_size * ctb_size / 8 / 16 is the number of bytes needed per CTB */
  175|  19.5M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  176|       |
  177|  19.5M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_deblk->s_bs_ctxt.pu4_pic_vert_bs +
  178|  19.5M|                    (ps_deblk->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  179|  19.5M|                    ps_deblk->i4_ctb_y * bs_strd);
  180|  19.5M|    pu4_ctb_vert_bs = pu4_vert_bs;
  181|       |
  182|  19.5M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_deblk->s_bs_ctxt.pu4_pic_horz_bs +
  183|  19.5M|                    (ps_deblk->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  184|  19.5M|                    ps_deblk->i4_ctb_y * bs_strd);
  185|  19.5M|    pu4_ctb_horz_bs = pu4_horz_bs;
  186|       |
  187|  19.5M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  188|  19.5M|    pi1_qp = ps_deblk->s_bs_ctxt.pi1_pic_qp + ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
  189|       |
  190|  19.5M|    pu2_ctb_no_loop_filter_flag = ps_deblk->au2_ctb_no_loop_filter_flag;
  191|       |
  192|  19.5M|    ctb_indx = ps_deblk->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_deblk->i4_ctb_y;
  193|  19.5M|    if(i4_is_last_ctb_y)
  ------------------
  |  Branch (193:8): [True: 94.3k, False: 19.4M]
  ------------------
  194|  94.3k|    {
  195|  94.3k|        pu4_vert_bs = (UWORD32 *)((UWORD8 *)pu4_vert_bs + bs_strd);
  196|  94.3k|        pu4_ctb_vert_bs = pu4_vert_bs;
  197|       |        /* ctb_size/8 is the number of edges per CTB
  198|       |         * ctb_size/4 is the number of BS values needed per edge
  199|       |         * divided by 8 for the number of bytes
  200|       |         * 2 is the number of bits needed for each BS value */
  201|  94.3k|        memset(pu4_vert_bs, 0, 1 << (2 * log2_ctb_size - 7));
  202|       |
  203|  94.3k|        pi1_qp += (qp_strd << (log2_ctb_size - 3));
  204|  94.3k|        pu2_ctb_no_loop_filter_flag += (ctb_size >> 3);
  205|  94.3k|        ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  206|  94.3k|    }
  207|       |
  208|  19.5M|    if(i4_is_last_ctb_x)
  ------------------
  |  Branch (208:8): [True: 216k, False: 19.3M]
  ------------------
  209|   216k|    {
  210|   216k|        pu4_horz_bs = (UWORD32 *)((UWORD8 *)pu4_horz_bs + (1 << (2 * log2_ctb_size - 7)));
  211|   216k|        pu4_ctb_horz_bs = pu4_horz_bs;
  212|   216k|        memset(pu4_horz_bs, 0, 1 << (2 * log2_ctb_size - 7));
  213|       |
  214|   216k|        pi1_qp += (ctb_size >> 3);
  215|       |
  216|  1.67M|        for(row = 0; row < (ctb_size >> 3) + 1; row++)
  ------------------
  |  Branch (216:22): [True: 1.45M, False: 216k]
  ------------------
  217|  1.45M|            au2_ctb_no_loop_filter_flag[row] = ps_deblk->au2_ctb_no_loop_filter_flag[row] >> (ctb_size >> 3);
  218|   216k|        pu2_ctb_no_loop_filter_flag = au2_ctb_no_loop_filter_flag;
  219|   216k|        ctb_indx += 1;
  220|   216k|    }
  221|       |
  222|  19.5M|    u4_qp_const_in_ctb[3] = ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx) >> 3] & (1 << (ctb_indx & 7));
  223|       |
  224|  19.5M|    if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (224:8): [True: 18.4M, False: 1.14M]
  |  Branch (224:30): [True: 87.7k, False: 1.05M]
  ------------------
  225|  18.6M|    {
  226|  18.6M|        u4_qp_const_in_ctb[2] = ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - 1) >> 3] & (1 << ((ctb_indx - 1) & 7));
  227|  18.6M|    }
  228|       |
  229|  19.5M|    if((ps_deblk->i4_ctb_x || i4_is_last_ctb_x) && (ps_deblk->i4_ctb_y || i4_is_last_ctb_y))
  ------------------
  |  Branch (229:9): [True: 18.4M, False: 1.14M]
  |  Branch (229:31): [True: 87.7k, False: 1.05M]
  |  Branch (229:53): [True: 17.8M, False: 723k]
  |  Branch (229:75): [True: 8.48k, False: 714k]
  ------------------
  230|  17.8M|    {
  231|  17.8M|        u4_qp_const_in_ctb[0] =
  232|  17.8M|                        ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - ps_sps->i2_pic_wd_in_ctb - 1) >> 3] &
  233|  17.8M|                        (1 << ((ctb_indx - ps_sps->i2_pic_wd_in_ctb - 1) & 7));
  234|  17.8M|    }
  235|       |
  236|       |
  237|       |
  238|  19.5M|    if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (238:8): [True: 18.7M, False: 794k]
  |  Branch (238:30): [True: 10.2k, False: 784k]
  ------------------
  239|  18.7M|    {
  240|  18.7M|        u4_qp_const_in_ctb[1] =
  241|  18.7M|                        ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - ps_sps->i2_pic_wd_in_ctb) >> 3] &
  242|  18.7M|                        (1 << ((ctb_indx - ps_sps->i2_pic_wd_in_ctb) & 7));
  243|  18.7M|    }
  244|       |
  245|  19.5M|    src_strd = ps_codec->i4_strd;
  246|  19.5M|    chroma_strd = src_strd * chroma_pixel_strd / h_samp_factor;
  247|       |
  248|       |    /* Luma Vertical Edge */
  249|       |
  250|  19.5M|    if(0 == i4_is_last_ctb_x)
  ------------------
  |  Branch (250:8): [True: 19.3M, False: 214k]
  ------------------
  251|  19.3M|    {
  252|       |        /* Top CTB's slice header */
  253|  19.3M|        slice_header_t *ps_slice_hdr_top;
  254|  19.3M|        {
  255|  19.3M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  256|  19.3M|            if(i4_is_last_ctb_y)
  ------------------
  |  Branch (256:16): [True: 94.3k, False: 19.2M]
  ------------------
  257|  94.3k|                cur_ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  258|  19.3M|            ps_slice_hdr_top = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - ps_sps->i2_pic_wd_in_ctb];
  259|  19.3M|        }
  260|       |
  261|  19.3M|        pu1_src = ps_deblk->pu1_cur_pic_luma +
  262|  19.3M|            ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_codec->i4_strd) << (log2_ctb_size)) * pixel_size_y;
  263|  19.3M|        pu1_src += i4_is_last_ctb_y ? ((ps_codec->i4_strd << log2_ctb_size) * pixel_size_y) : 0;
  ------------------
  |  Branch (263:20): [True: 94.3k, False: 19.2M]
  ------------------
  264|       |
  265|       |        /** Deblocking is done on a shifted CTB -
  266|       |         *  Vertical edge processing is done by shifting the CTB up by four pixels */
  267|  19.3M|        pu1_src -= 4 * src_strd * pixel_size_y;
  268|       |
  269|  88.2M|        for(col = 0; col < ctb_size / 8; col++)
  ------------------
  |  Branch (269:22): [True: 68.8M, False: 19.3M]
  ------------------
  270|  68.8M|        {
  271|  68.8M|            WORD32 shift = 0;
  272|       |
  273|       |            /*  downshift vert_bs by ctb_size/2 for each column
  274|       |             *  shift = (col & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1);
  275|       |             *  which will reduce to the following assuming ctb size is one of 16, 32 and 64
  276|       |             *  and deblocking is done on 8x8 grid
  277|       |             */
  278|  68.8M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (278:16): [True: 39.0M, False: 29.8M]
  ------------------
  279|  39.0M|                shift = (col & 1) << (log2_ctb_size - 1);
  280|       |
  281|       |            /* BS for the column - Last row is excluded and the top row is included*/
  282|  68.8M|            u4_bs = (pu4_vert_bs[0] >> shift) << 2;
  283|       |
  284|  68.8M|            if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (284:16): [True: 64.3M, False: 4.51M]
  |  Branch (284:38): [True: 26.9k, False: 4.48M]
  ------------------
  285|  64.6M|            {
  286|       |                /* Picking the last BS of the previous CTB corresponding to the same column */
  287|  64.6M|                UWORD32 *pu4_vert_bs_top = (UWORD32 *)((UWORD8 *)pu4_vert_bs - bs_strd);
  288|  64.6M|                UWORD32 u4_top_bs = (*pu4_vert_bs_top) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  289|  64.6M|                u4_bs |= u4_top_bs & 3;
  290|  64.6M|            }
  291|       |
  292|   259M|            for(row = 0; row < ctb_size / 4;)
  ------------------
  |  Branch (292:26): [True: 190M, False: 68.8M]
  ------------------
  293|   190M|            {
  294|   190M|                WORD8 i1_beta_offset_div2 = ps_slice_hdr->i1_beta_offset_div2;
  295|   190M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  296|       |
  297|       |                /* Trailing zeros are computed and the corresponding rows are not processed */
  298|   190M|                bs_tz = CTZ(u4_bs) >> 1;
  299|   190M|                if(0 != bs_tz)
  ------------------
  |  Branch (299:20): [True: 80.6M, False: 109M]
  ------------------
  300|  80.6M|                {
  301|  80.6M|                    u4_bs = u4_bs >> (bs_tz << 1);
  302|  80.6M|                    if((row + bs_tz) >= (ctb_size / 4))
  ------------------
  |  Branch (302:24): [True: 56.4M, False: 24.1M]
  ------------------
  303|  56.4M|                        pu1_src += 4 * (ctb_size / 4 - row) * src_strd * pixel_size_y;
  304|  24.1M|                    else
  305|  24.1M|                        pu1_src += 4 * bs_tz  * src_strd * pixel_size_y;
  306|       |
  307|  80.6M|                    row += bs_tz;
  308|  80.6M|                    continue;
  309|  80.6M|                }
  310|       |
  311|   109M|                if(0 == row)
  ------------------
  |  Branch (311:20): [True: 12.4M, False: 97.3M]
  ------------------
  312|  12.4M|                {
  313|  12.4M|                    i1_beta_offset_div2 = ps_slice_hdr_top->i1_beta_offset_div2;
  314|  12.4M|                    i1_tc_offset_div2 = ps_slice_hdr_top->i1_tc_offset_div2;
  315|       |
  316|  12.4M|                    if(0 == col)
  ------------------
  |  Branch (316:24): [True: 3.96M, False: 8.44M]
  ------------------
  317|  3.96M|                    {
  318|  3.96M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (318:32): [True: 3.92M, False: 36.3k]
  ------------------
  319|  3.92M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  320|  3.96M|                                        pi1_qp[-qp_strd - 1];
  321|  3.96M|                    }
  322|  8.44M|                    else
  323|  8.44M|                    {
  324|  8.44M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (324:32): [True: 8.58M, False: 18.4E]
  ------------------
  325|  8.58M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  326|  18.4E|                                        pi1_qp[col - 1 - qp_strd];
  327|  8.44M|                    }
  328|       |
  329|  12.4M|                    qp_q = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (329:28): [True: 12.2M, False: 154k]
  ------------------
  330|  12.2M|                                    pi1_qp[-ctb_size / 8 * qp_strd] :
  331|  12.4M|                                    pi1_qp[col - qp_strd];
  332|  12.4M|                }
  333|  97.3M|                else
  334|  97.3M|                {
  335|  97.3M|                    if(0 == col)
  ------------------
  |  Branch (335:24): [True: 26.6M, False: 70.7M]
  ------------------
  336|  26.6M|                    {
  337|  26.6M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (337:32): [True: 26.0M, False: 546k]
  ------------------
  338|  26.0M|                                        pi1_qp[-ctb_size / 8] :
  339|  26.6M|                                        pi1_qp[((row - 1) >> 1) * qp_strd - 1];
  340|  26.6M|                    }
  341|  70.7M|                    else
  342|  70.7M|                    {
  343|  70.7M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (343:32): [True: 79.8M, False: 18.4E]
  ------------------
  344|  79.8M|                                        pi1_qp[0] :
  345|  18.4E|                                        pi1_qp[((row - 1) >> 1) * qp_strd + col - 1];
  346|  70.7M|                    }
  347|       |
  348|  97.3M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (348:28): [True: 100M, False: 18.4E]
  ------------------
  349|   100M|                                    pi1_qp[0] :
  350|  18.4E|                                    pi1_qp[((row - 1) >> 1) * qp_strd + col];
  351|  97.3M|                }
  352|       |
  353|   109M|                filter_p = (pu2_ctb_no_loop_filter_flag[(row + 1) >> 1] >> col) & 1;
  354|   109M|                filter_q = (pu2_ctb_no_loop_filter_flag[(row + 1) >> 1] >> col) & 2;
  355|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  356|   109M|                filter_p = !filter_p;
  357|   109M|                filter_q = !filter_q;
  358|       |
  359|   109M|                if(filter_p || filter_q)
  ------------------
  |  Branch (359:20): [True: 108M, False: 896k]
  |  Branch (359:32): [True: 216k, False: 680k]
  ------------------
  360|   111M|                {
  361|   111M|                    DUMP_DEBLK_LUMA_VERT(pu1_src, src_strd,
  362|   111M|                                         u4_bs & 3, qp_p, qp_q,
  363|   111M|                                         ps_slice_hdr->i1_beta_offset_div2,
  364|   111M|                                         ps_slice_hdr->i1_tc_offset_div2,
  365|   111M|                                         filter_p, filter_q);
  366|   111M|                    if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   111M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (366:24): [True: 83.8M, False: 27.8M]
  ------------------
  367|  83.8M|                    {
  368|  83.8M|                        ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr(pu1_src, src_strd,
  369|  83.8M|                                                                             u4_bs & 3, qp_p, qp_q,
  370|  83.8M|                                                                             i1_beta_offset_div2,
  371|  83.8M|                                                                             i1_tc_offset_div2,
  372|  83.8M|                                                                             filter_p, filter_q);
  373|  83.8M|                    }
  374|  27.8M|                    else
  375|  27.8M|                    {
  376|  27.8M|                        ps_codec->s_func_selector.ihevc_hbd_deblk_luma_vert_fptr((UWORD16 *)pu1_src,
  377|  27.8M|                                                                                 src_strd,
  378|  27.8M|                                                                                 u4_bs & 3, qp_p, qp_q,
  379|  27.8M|                                                                                 i1_beta_offset_div2,
  380|  27.8M|                                                                                 i1_tc_offset_div2,
  381|  27.8M|                                                                                 filter_p, filter_q,
  382|  27.8M|                                                                                 u1_bit_depth_luma);
  383|  27.8M|                    }
  384|   111M|                }
  385|       |
  386|   109M|                pu1_src += 4 * src_strd * pixel_size_y;
  387|   109M|                u4_bs = u4_bs >> 2;
  388|   109M|                row++;
  389|   109M|            }
  390|       |
  391|  68.8M|            if((64 == ctb_size) ||
  ------------------
  |  Branch (391:16): [True: 30.2M, False: 38.6M]
  ------------------
  392|  38.6M|                            ((32 == ctb_size) && (col & 1)))
  ------------------
  |  Branch (392:30): [True: 17.1M, False: 21.5M]
  |  Branch (392:50): [True: 8.60M, False: 8.51M]
  ------------------
  393|  38.4M|            {
  394|  38.4M|                pu4_vert_bs++;
  395|  38.4M|            }
  396|  68.8M|            pu1_src -= ((src_strd << log2_ctb_size) * pixel_size_y);
  397|  68.8M|            pu1_src += 8 * pixel_size_y;
  398|  68.8M|        }
  399|  19.3M|        pu4_vert_bs = pu4_ctb_vert_bs;
  400|  19.3M|    }
  401|       |
  402|       |
  403|       |    /* Luma Horizontal Edge */
  404|       |
  405|  19.5M|    if(0 == i4_is_last_ctb_y)
  ------------------
  |  Branch (405:8): [True: 19.1M, False: 408k]
  ------------------
  406|  19.1M|    {
  407|       |
  408|       |        /* Left CTB's slice header */
  409|  19.1M|        slice_header_t *ps_slice_hdr_left;
  410|  19.1M|        {
  411|  19.1M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  412|  19.1M|            if(i4_is_last_ctb_x)
  ------------------
  |  Branch (412:16): [True: 216k, False: 18.9M]
  ------------------
  413|   216k|                cur_ctb_indx += 1;
  414|  19.1M|            ps_slice_hdr_left = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - 1];
  415|  19.1M|        }
  416|  19.1M|        pu1_src = ps_deblk->pu1_cur_pic_luma +
  417|  19.1M|            ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_codec->i4_strd) << log2_ctb_size) * pixel_size_y;
  418|  19.1M|        pu1_src += i4_is_last_ctb_x ? (ctb_size * pixel_size_y) : 0;
  ------------------
  |  Branch (418:20): [True: 216k, False: 18.9M]
  ------------------
  419|       |
  420|       |        /** Deblocking is done on a shifted CTB -
  421|       |         *  Horizontal edge processing is done by shifting the CTB left by four pixels */
  422|  19.1M|        pu1_src -= 4 * pixel_size_y;
  423|  88.9M|        for(row = 0; row < ctb_size / 8; row++)
  ------------------
  |  Branch (423:22): [True: 69.7M, False: 19.1M]
  ------------------
  424|  69.7M|        {
  425|  69.7M|            WORD32 shift = 0;
  426|       |
  427|       |            /* downshift vert_bs by ctb_size/2 for each column
  428|       |             *  shift = (row & (MAX_CTB_SIZE / ctb_size - 1)) * ctb_size / 2;
  429|       |             *  which will reduce to the following assuming ctb size is one of 16, 32 and 64
  430|       |             *  and deblocking is done on 8x8 grid
  431|       |             */
  432|  69.7M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (432:16): [True: 39.1M, False: 30.6M]
  ------------------
  433|  39.1M|                shift = (row & 1) << (log2_ctb_size - 1);
  434|       |
  435|       |            /* BS for the row - Last column is excluded and the left column is included*/
  436|  69.7M|            u4_bs = (pu4_horz_bs[0] >> shift) << 2;
  437|       |
  438|  69.7M|            if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (438:16): [True: 64.5M, False: 5.23M]
  |  Branch (438:38): [True: 689k, False: 4.54M]
  ------------------
  439|  65.3M|            {
  440|       |                /** Picking the last BS of the previous CTB corresponding to the same row
  441|       |                * UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  442|       |                */
  443|  65.3M|                UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (1 << (2 * log2_ctb_size - 7)));
  444|  65.3M|                UWORD32 u4_left_bs = (*pu4_horz_bs_left) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  445|  65.3M|                u4_bs |= u4_left_bs & 3;
  446|  65.3M|            }
  447|       |
  448|   265M|            for(col = 0; col < ctb_size / 4;)
  ------------------
  |  Branch (448:26): [True: 195M, False: 69.7M]
  ------------------
  449|   195M|            {
  450|   195M|                WORD8 i1_beta_offset_div2 = ps_slice_hdr->i1_beta_offset_div2;
  451|   195M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  452|       |
  453|   195M|                bs_tz = CTZ(u4_bs) >> 1;
  454|   195M|                if(0 != bs_tz)
  ------------------
  |  Branch (454:20): [True: 81.0M, False: 114M]
  ------------------
  455|  81.0M|                {
  456|  81.0M|                    u4_bs = u4_bs >> (bs_tz << 1);
  457|       |
  458|  81.0M|                    if((col + bs_tz) >= (ctb_size / 4))
  ------------------
  |  Branch (458:24): [True: 56.4M, False: 24.5M]
  ------------------
  459|  56.4M|                        pu1_src += 4 * (ctb_size / 4 - col) * pixel_size_y;
  460|  24.5M|                    else
  461|  24.5M|                        pu1_src += 4 * bs_tz * pixel_size_y;
  462|       |
  463|  81.0M|                    col += bs_tz;
  464|  81.0M|                    continue;
  465|  81.0M|                }
  466|       |
  467|   114M|                if(0 == col)
  ------------------
  |  Branch (467:20): [True: 13.2M, False: 101M]
  ------------------
  468|  13.2M|                {
  469|  13.2M|                    i1_beta_offset_div2 = ps_slice_hdr_left->i1_beta_offset_div2;
  470|  13.2M|                    i1_tc_offset_div2 = ps_slice_hdr_left->i1_tc_offset_div2;
  471|       |
  472|  13.2M|                    if(0 == row)
  ------------------
  |  Branch (472:24): [True: 4.03M, False: 9.17M]
  ------------------
  473|  4.03M|                    {
  474|  4.03M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (474:32): [True: 3.99M, False: 35.7k]
  ------------------
  475|  3.99M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  476|  4.03M|                                        pi1_qp[-qp_strd - 1];
  477|  4.03M|                    }
  478|  9.17M|                    else
  479|  9.17M|                    {
  480|  9.17M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (480:32): [True: 9.26M, False: 18.4E]
  ------------------
  481|  9.26M|                                        pi1_qp[-ctb_size / 8] :
  482|  18.4E|                                        pi1_qp[(row - 1) * qp_strd - 1];
  483|  9.17M|                    }
  484|       |
  485|  13.2M|                    qp_q = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (485:28): [True: 13.0M, False: 160k]
  ------------------
  486|  13.0M|                                    pi1_qp[-ctb_size / 8] :
  487|  13.2M|                                    pi1_qp[row * qp_strd - 1];
  488|  13.2M|                }
  489|   101M|                else
  490|   101M|                {
  491|   101M|                    if(0 == row)
  ------------------
  |  Branch (491:24): [True: 27.9M, False: 73.5M]
  ------------------
  492|  27.9M|                    {
  493|  27.9M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (493:32): [True: 27.3M, False: 597k]
  ------------------
  494|  27.3M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  495|  27.9M|                                        pi1_qp[((col - 1) >> 1) - qp_strd];
  496|  27.9M|                    }
  497|  73.5M|                    else
  498|  73.5M|                    {
  499|  73.5M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (499:32): [True: 82.2M, False: 18.4E]
  ------------------
  500|  82.2M|                                        pi1_qp[0] :
  501|  18.4E|                                        pi1_qp[((col - 1) >> 1) + (row - 1) * qp_strd];
  502|  73.5M|                    }
  503|       |
  504|   101M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (504:28): [True: 103M, False: 18.4E]
  ------------------
  505|   103M|                                    pi1_qp[0] :
  506|  18.4E|                                    pi1_qp[((col - 1) >> 1) + row * qp_strd];
  507|   101M|                }
  508|       |
  509|   114M|                filter_p = (pu2_ctb_no_loop_filter_flag[row] >> ((col + 1) >> 1)) & 1;
  510|   114M|                filter_q = (pu2_ctb_no_loop_filter_flag[row + 1] >> ((col + 1) >> 1)) & 1;
  511|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  512|   114M|                filter_p = !filter_p;
  513|   114M|                filter_q = !filter_q;
  514|       |
  515|   114M|                if(filter_p || filter_q)
  ------------------
  |  Branch (515:20): [True: 113M, False: 894k]
  |  Branch (515:32): [True: 295k, False: 598k]
  ------------------
  516|   115M|                {
  517|   115M|                    DUMP_DEBLK_LUMA_HORZ(pu1_src, src_strd,
  518|   115M|                                         u4_bs & 3, qp_p, qp_q,
  519|   115M|                                         ps_slice_hdr->i1_beta_offset_div2,
  520|   115M|                                         ps_slice_hdr->i1_tc_offset_div2,
  521|   115M|                                         filter_p, filter_q);
  522|   115M|                    if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   115M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (522:24): [True: 87.0M, False: 28.0M]
  ------------------
  523|  87.0M|                    {
  524|  87.0M|                        ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr(pu1_src, src_strd,
  525|  87.0M|                                                                             u4_bs & 3, qp_p, qp_q,
  526|  87.0M|                                                                             i1_beta_offset_div2,
  527|  87.0M|                                                                             i1_tc_offset_div2, filter_p, filter_q);
  528|  87.0M|                    }
  529|  28.0M|                    else
  530|  28.0M|                    {
  531|  28.0M|                        ps_codec->s_func_selector.ihevc_hbd_deblk_luma_horz_fptr((UWORD16 *)pu1_src,
  532|  28.0M|                                                                                 src_strd,
  533|  28.0M|                                                                                 u4_bs & 3, qp_p, qp_q,
  534|  28.0M|                                                                                 i1_beta_offset_div2,
  535|  28.0M|                                                                                 i1_tc_offset_div2,
  536|  28.0M|                                                                                 filter_p, filter_q,
  537|  28.0M|                                                                                 u1_bit_depth_luma);
  538|  28.0M|                    }
  539|   115M|                }
  540|       |
  541|   114M|                pu1_src += 4 * pixel_size_y;
  542|   114M|                u4_bs = u4_bs >> 2;
  543|   114M|                col++;
  544|   114M|            }
  545|       |
  546|  69.7M|            if((64 == ctb_size) ||
  ------------------
  |  Branch (546:16): [True: 30.5M, False: 39.2M]
  ------------------
  547|  39.2M|                            ((32 == ctb_size) && (row & 1)))
  ------------------
  |  Branch (547:30): [True: 17.2M, False: 21.9M]
  |  Branch (547:50): [True: 8.66M, False: 8.62M]
  ------------------
  548|  39.3M|            {
  549|  39.3M|                pu4_horz_bs++;
  550|  39.3M|            }
  551|  69.7M|            pu1_src -= ctb_size * pixel_size_y;
  552|  69.7M|            pu1_src += ((src_strd << 3) * pixel_size_y);
  553|  69.7M|        }
  554|  19.1M|        pu4_horz_bs = pu4_ctb_horz_bs;
  555|  19.1M|    }
  556|       |
  557|       |
  558|       |    /* Chroma Veritcal Edge */
  559|       |
  560|  19.5M|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 == i4_is_last_ctb_x)
  ------------------
  |  Branch (560:8): [True: 19.3M, False: 234k]
  |  Branch (560:69): [True: 19.1M, False: 208k]
  ------------------
  561|  19.1M|    {
  562|       |
  563|       |        /* Top CTB's slice header */
  564|  19.1M|        slice_header_t *ps_slice_hdr_top;
  565|  19.1M|        {
  566|  19.1M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  567|  19.1M|            if(i4_is_last_ctb_y)
  ------------------
  |  Branch (567:16): [True: 92.5k, False: 19.0M]
  ------------------
  568|  92.5k|                cur_ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  569|  19.1M|            ps_slice_hdr_top = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - ps_sps->i2_pic_wd_in_ctb];
  570|  19.1M|        }
  571|       |
  572|  19.1M|        pu1_src = ps_deblk->pu1_cur_pic_chroma +
  573|  19.1M|            ((((ps_deblk->i4_ctb_x * chroma_pixel_strd / h_samp_factor) +
  574|  19.1M|               ps_deblk->i4_ctb_y * ps_deblk->ps_codec->i4_strd * chroma_pixel_strd / (h_samp_factor * v_samp_factor)) << log2_ctb_size) * pixel_size_uv);
  575|  19.1M|        pu1_src += i4_is_last_ctb_y ?
  ------------------
  |  Branch (575:20): [True: 92.5k, False: 19.0M]
  ------------------
  576|  19.0M|            ((((ps_codec->i4_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_ctb_size) * pixel_size_uv) : 0;
  577|       |
  578|       |        /** Deblocking is done on a shifted CTB -
  579|       |         *  Vertical edge processing is done by shifting the CTB up by four pixels */
  580|  19.1M|        pu1_src -= 4 * chroma_strd * pixel_size_uv;
  581|       |
  582|  53.7M|        for(col = 0; col < ctb_size / (8 * h_samp_factor); col++)
  ------------------
  |  Branch (582:22): [True: 34.6M, False: 19.1M]
  ------------------
  583|  34.6M|        {
  584|  34.6M|            WORD32 shift = 0;
  585|       |
  586|  34.6M|            if(is_yuv444 && 6 != log2_ctb_size)
  ------------------
  |  Branch (586:16): [True: 0, False: 34.6M]
  |  Branch (586:29): [True: 0, False: 0]
  ------------------
  587|      0|                shift = (col & 1) << (log2_ctb_size - 1);
  588|       |
  589|       |            /* BS for the column - Last row is excluded and the top row is included*/
  590|  34.6M|            u4_bs = (pu4_vert_bs[0] >> shift) << 2;
  591|       |
  592|  34.6M|            if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (592:16): [True: 32.4M, False: 2.24M]
  |  Branch (592:38): [True: 13.4k, False: 2.23M]
  ------------------
  593|  32.5M|            {
  594|       |                /* Picking the last BS of the previous CTB corresponding to the same column */
  595|  32.5M|                UWORD32 *pu4_vert_bs_top = (UWORD32 *)((UWORD8 *)pu4_vert_bs - bs_strd);
  596|  32.5M|                UWORD32 u4_top_bs = (*pu4_vert_bs_top) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  597|  32.5M|                u4_bs |= u4_top_bs & 3;
  598|  32.5M|            }
  599|       |
  600|  34.6M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) {
  ------------------
  |  Branch (600:16): [True: 31.9M, False: 2.76M]
  ------------------
  601|       |                /* Every alternate boundary strength value is used for chroma */
  602|  31.9M|                u4_bs &= 0x22222222;
  603|  31.9M|            } else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 || ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) {
  ------------------
  |  Branch (603:23): [True: 18.4E, False: 2.77M]
  |  Branch (603:80): [True: 2.77M, False: 0]
  ------------------
  604|       |                /* Every boundary strength value is used for chroma */
  605|  2.77M|                u4_bs &= 0xAAAAAAAA;
  606|  2.77M|            }
  607|       |
  608|   121M|            for(row = 0; row < ctb_size / (4 * v_samp_factor);)
  ------------------
  |  Branch (608:26): [True: 86.4M, False: 34.6M]
  ------------------
  609|  86.4M|            {
  610|  86.4M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  611|       |
  612|  86.4M|                bs_tz = CTZ(u4_bs) >> v_samp_factor;
  613|  86.4M|                if(0 != bs_tz)
  ------------------
  |  Branch (613:20): [True: 39.0M, False: 47.4M]
  ------------------
  614|  39.0M|                {
  615|  39.0M|                    if((row + bs_tz) >= (ctb_size / (4 * v_samp_factor)))
  ------------------
  |  Branch (615:24): [True: 27.5M, False: 11.4M]
  ------------------
  616|  27.5M|                        pu1_src += 4 * (ctb_size / (4 * v_samp_factor) - row) * chroma_strd * pixel_size_uv;
  617|  11.4M|                    else
  618|  11.4M|                        pu1_src += 4 * bs_tz  * chroma_strd * pixel_size_uv;
  619|  39.0M|                    row += bs_tz;
  620|  39.0M|                    u4_bs = u4_bs >> (bs_tz << v_samp_factor);
  621|  39.0M|                    continue;
  622|  39.0M|                }
  623|       |
  624|  47.4M|                if(0 == row)
  ------------------
  |  Branch (624:20): [True: 7.01M, False: 40.4M]
  ------------------
  625|  7.01M|                {
  626|  7.01M|                    i1_tc_offset_div2 = ps_slice_hdr_top->i1_tc_offset_div2;
  627|       |
  628|  7.01M|                    if(0 == col)
  ------------------
  |  Branch (628:24): [True: 3.95M, False: 3.05M]
  ------------------
  629|  3.95M|                    {
  630|  3.95M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (630:32): [True: 3.92M, False: 29.0k]
  ------------------
  631|  3.92M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  632|  3.95M|                                        pi1_qp[-qp_strd - 1];
  633|  3.95M|                    }
  634|  3.05M|                    else
  635|  3.05M|                    {
  636|  3.05M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (636:32): [True: 3.02M, False: 37.6k]
  ------------------
  637|  3.02M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  638|  3.05M|                                        pi1_qp[h_samp_factor * col - 1 - qp_strd];
  639|  3.05M|                    }
  640|       |
  641|  7.01M|                    qp_q = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (641:28): [True: 6.91M, False: 100k]
  ------------------
  642|  6.91M|                                    pi1_qp[-ctb_size / 8 * qp_strd] :
  643|  7.01M|                                    pi1_qp[h_samp_factor * col - qp_strd];
  644|  7.01M|                }
  645|  40.4M|                else
  646|  40.4M|                {
  647|  40.4M|                    if(0 == col)
  ------------------
  |  Branch (647:24): [True: 14.8M, False: 25.5M]
  ------------------
  648|  14.8M|                    {
  649|  14.8M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (649:32): [True: 14.6M, False: 223k]
  ------------------
  650|  14.6M|                                        pi1_qp[-ctb_size / 8] :
  651|  14.8M|                                        pi1_qp[((row - 1) >> (2 - v_samp_factor)) * qp_strd - 1];
  652|  14.8M|                    }
  653|  25.5M|                    else
  654|  25.5M|                    {
  655|  25.5M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (655:32): [True: 26.7M, False: 18.4E]
  ------------------
  656|  26.7M|                                        pi1_qp[0] :
  657|  18.4E|                                        pi1_qp[((row - 1) >> (2 - v_samp_factor)) * qp_strd + h_samp_factor * col - 1];
  658|  25.5M|                    }
  659|       |
  660|  40.4M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (660:28): [True: 40.2M, False: 179k]
  ------------------
  661|  40.2M|                                    pi1_qp[0] :
  662|  40.4M|                                    pi1_qp[((row - 1) >> (2 - v_samp_factor)) * qp_strd + h_samp_factor * col];
  663|  40.4M|                }
  664|       |
  665|  47.4M|                filter_p = (pu2_ctb_no_loop_filter_flag[(row + (2 - v_samp_factor)) >> (2 - v_samp_factor)] >> (col << (h_samp_factor - 1))) & 1;
  666|  47.4M|                filter_q = (pu2_ctb_no_loop_filter_flag[(row + (2 - v_samp_factor)) >> (2 - v_samp_factor)] >> (col << (h_samp_factor - 1))) & 2;
  667|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  668|  47.4M|                filter_p = !filter_p;
  669|  47.4M|                filter_q = !filter_q;
  670|       |
  671|  47.4M|                if(filter_p || filter_q)
  ------------------
  |  Branch (671:20): [True: 46.8M, False: 575k]
  |  Branch (671:32): [True: 168k, False: 407k]
  ------------------
  672|  47.2M|                {
  673|  47.2M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) {
  ------------------
  |  Branch (673:24): [True: 28.8M, False: 18.4M]
  ------------------
  674|  28.8M|                        ASSERT(1 == ((u4_bs & 3) >> 1));
  ------------------
  |  |   55|  28.8M|#define ASSERT(x) {}
  ------------------
  675|  28.8M|                    }
  676|  47.2M|                    DUMP_DEBLK_CHROMA_VERT(pu1_src, chroma_strd,
  677|  47.2M|                                           u4_bs & 3, qp_p, qp_q,
  678|  47.2M|                                           ps_pps->i1_pic_cb_qp_offset,
  679|  47.2M|                                           ps_pps->i1_pic_cr_qp_offset,
  680|  47.2M|                                           ps_slice_hdr->i1_tc_offset_div2,
  681|  47.2M|                                           filter_p, filter_q);
  682|  47.2M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (682:24): [True: 5.57M, False: 41.6M]
  ------------------
  683|  5.57M|                    {
  684|  5.57M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  5.57M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (684:28): [True: 5.04M, False: 531k]
  ------------------
  685|  5.04M|                        {
  686|  5.04M|                            pf_deblk_chroma_vert(pu1_src,
  687|  5.04M|                                                 chroma_strd,
  688|  5.04M|                                                 qp_q,
  689|  5.04M|                                                 qp_p,
  690|  5.04M|                                                 ps_pps->i1_pic_cr_qp_offset,
  691|  5.04M|                                                 ps_pps->i1_pic_cb_qp_offset,
  692|  5.04M|                                                 i1_tc_offset_div2,
  693|  5.04M|                                                 filter_q,
  694|  5.04M|                                                 filter_p,
  695|  5.04M|                                                 ps_sps->i1_chroma_format_idc);
  696|  5.04M|                        }
  697|   531k|                        else
  698|   531k|                        {
  699|   531k|                            pf_hbd_deblk_chroma_vert((UWORD16 *)pu1_src,
  700|   531k|                                                     chroma_strd,
  701|   531k|                                                     qp_q,
  702|   531k|                                                     qp_p,
  703|   531k|                                                     ps_pps->i1_pic_cr_qp_offset,
  704|   531k|                                                     ps_pps->i1_pic_cb_qp_offset,
  705|   531k|                                                     i1_tc_offset_div2,
  706|   531k|                                                     filter_q,
  707|   531k|                                                     filter_p,
  708|   531k|                                                     u1_bit_depth_chroma,
  709|   531k|                                                     ps_sps->i1_chroma_format_idc);
  710|   531k|                        }
  711|  5.57M|                    }
  712|  41.6M|                    else
  713|  41.6M|                    {
  714|  41.6M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  41.6M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (714:28): [True: 24.1M, False: 17.5M]
  ------------------
  715|  24.1M|                        {
  716|  24.1M|                            pf_deblk_chroma_vert(pu1_src,
  717|  24.1M|                                                 chroma_strd,
  718|  24.1M|                                                 qp_p,
  719|  24.1M|                                                 qp_q,
  720|  24.1M|                                                 ps_pps->i1_pic_cb_qp_offset,
  721|  24.1M|                                                 ps_pps->i1_pic_cr_qp_offset,
  722|  24.1M|                                                 i1_tc_offset_div2,
  723|  24.1M|                                                 filter_p,
  724|  24.1M|                                                 filter_q,
  725|  24.1M|                                                 ps_sps->i1_chroma_format_idc);
  726|  24.1M|                        }
  727|  17.5M|                        else
  728|  17.5M|                        {
  729|  17.5M|                            pf_hbd_deblk_chroma_vert((UWORD16 *)pu1_src,
  730|  17.5M|                                                     chroma_strd,
  731|  17.5M|                                                     qp_p,
  732|  17.5M|                                                     qp_q,
  733|  17.5M|                                                     ps_pps->i1_pic_cb_qp_offset,
  734|  17.5M|                                                     ps_pps->i1_pic_cr_qp_offset,
  735|  17.5M|                                                     i1_tc_offset_div2,
  736|  17.5M|                                                     filter_p,
  737|  17.5M|                                                     filter_q,
  738|  17.5M|                                                     u1_bit_depth_chroma,
  739|  17.5M|                                                     ps_sps->i1_chroma_format_idc);
  740|  17.5M|                        }
  741|  41.6M|                    }
  742|  47.2M|                }
  743|       |
  744|  47.4M|                pu1_src += 4 * chroma_strd * pixel_size_uv;
  745|  47.4M|                u4_bs = u4_bs >> (2 * v_samp_factor);
  746|  47.4M|                row++;
  747|  47.4M|            }
  748|       |
  749|  34.6M|            pu1_src -= ((((src_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_ctb_size) * pixel_size_uv);
  750|  34.6M|            if(is_yuv444)
  ------------------
  |  Branch (750:16): [True: 0, False: 34.6M]
  ------------------
  751|      0|            {
  752|      0|                if((64 ==ctb_size) || ((32 == ctb_size) && (col & 1))) pu4_vert_bs++;
  ------------------
  |  Branch (752:20): [True: 0, False: 0]
  |  Branch (752:40): [True: 0, False: 0]
  |  Branch (752:60): [True: 0, False: 0]
  ------------------
  753|      0|            }
  754|  34.6M|            else
  755|  34.6M|            {
  756|  34.6M|                pu4_vert_bs += (64 == ctb_size) ? 2 : 1;
  ------------------
  |  Branch (756:32): [True: 15.0M, False: 19.6M]
  ------------------
  757|  34.6M|            }
  758|  34.6M|            pu1_src += 16 * pixel_size_uv;
  759|  34.6M|        }
  760|  19.1M|    }
  761|       |
  762|       |    /* Chroma Horizontal Edge */
  763|       |
  764|  19.5M|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 == i4_is_last_ctb_y)
  ------------------
  |  Branch (764:8): [True: 19.2M, False: 328k]
  |  Branch (764:69): [True: 19.1M, False: 89.5k]
  ------------------
  765|  19.1M|    {
  766|       |
  767|       |        /* Left CTB's slice header */
  768|  19.1M|        slice_header_t *ps_slice_hdr_left;
  769|  19.1M|        {
  770|  19.1M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  771|  19.1M|            if(i4_is_last_ctb_x)
  ------------------
  |  Branch (771:16): [True: 211k, False: 18.9M]
  ------------------
  772|   211k|                cur_ctb_indx += 1;
  773|  19.1M|            ps_slice_hdr_left = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - 1];
  774|  19.1M|        }
  775|       |
  776|  19.1M|        pu1_src = ps_deblk->pu1_cur_pic_chroma +
  777|  19.1M|            ((((ps_deblk->i4_ctb_x * chroma_pixel_strd / h_samp_factor) +
  778|  19.1M|               ps_deblk->i4_ctb_y * ps_deblk->ps_codec->i4_strd * chroma_pixel_strd / (v_samp_factor * h_samp_factor)) << log2_ctb_size) * pixel_size_uv);
  779|  19.1M|        pu1_src += i4_is_last_ctb_x ? (ctb_size * chroma_pixel_strd / h_samp_factor * pixel_size_uv) : 0;
  ------------------
  |  Branch (779:20): [True: 211k, False: 18.9M]
  ------------------
  780|       |
  781|       |        /** Deblocking is done on a shifted CTB -
  782|       |         * Vertical edge processing is done by shifting the CTB up by four pixels (8 here beacuse UV are interleaved) */
  783|  19.1M|        pu1_src -= 8 * pixel_size_uv;
  784|  56.9M|        for(row = 0; row < ctb_size / (8 * v_samp_factor); row++)
  ------------------
  |  Branch (784:22): [True: 37.8M, False: 19.1M]
  ------------------
  785|  37.8M|        {
  786|  37.8M|            WORD32 shift = 0;
  787|       |
  788|  37.8M|            if((is_yuv444 || is_yuv422) && 6 != log2_ctb_size)
  ------------------
  |  Branch (788:17): [True: 29.3k, False: 37.7M]
  |  Branch (788:30): [True: 5.61M, False: 32.1M]
  |  Branch (788:44): [True: 268k, False: 5.35M]
  ------------------
  789|   268k|                shift = (row & 1) << (log2_ctb_size - 1);
  790|       |
  791|       |            /* BS for the row - Last column is excluded and the left column is included*/
  792|  37.8M|            u4_bs = (pu4_horz_bs[0] >> shift) << 2;
  793|       |
  794|  37.8M|            if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (794:16): [True: 34.7M, False: 3.02M]
  |  Branch (794:38): [True: 372k, False: 2.65M]
  ------------------
  795|  35.1M|            {
  796|       |                /** Picking the last BS of the previous CTB corresponding to the same row
  797|       |                * UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  798|       |                */
  799|  35.1M|                UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (1 << (2 * log2_ctb_size - 7)));
  800|  35.1M|                UWORD32 u4_left_bs = (*pu4_horz_bs_left) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  801|  35.1M|                u4_bs |= u4_left_bs & 3;
  802|  35.1M|            }
  803|       |
  804|  37.8M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420 || ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) {
  ------------------
  |  Branch (804:16): [True: 32.1M, False: 5.63M]
  |  Branch (804:73): [True: 5.63M, False: 0]
  ------------------
  805|       |                /* Every alternate boundary strength value is used for chroma */
  806|  37.8M|                u4_bs &= 0x22222222;
  807|  18.4E|            } else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) {
  ------------------
  |  Branch (807:23): [True: 0, False: 18.4E]
  ------------------
  808|       |                /* Every boundary strength value is used for chroma */
  809|      0|                u4_bs &= 0xAAAAAAAA;
  810|      0|            }
  811|       |
  812|   125M|            for(col = 0; col < ctb_size / (4 * h_samp_factor);)
  ------------------
  |  Branch (812:26): [True: 88.1M, False: 37.8M]
  ------------------
  813|  88.1M|            {
  814|  88.1M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  815|       |
  816|  88.1M|                bs_tz = CTZ(u4_bs) >> h_samp_factor;
  817|  88.1M|                if(0 != bs_tz)
  ------------------
  |  Branch (817:20): [True: 42.8M, False: 45.2M]
  ------------------
  818|  42.8M|                {
  819|  42.8M|                    u4_bs = u4_bs >> (bs_tz << h_samp_factor);
  820|       |
  821|  42.8M|                    if((col + bs_tz) >= (ctb_size / (4 * h_samp_factor)))
  ------------------
  |  Branch (821:24): [True: 29.4M, False: 13.4M]
  ------------------
  822|  29.4M|                        pu1_src += 8 * (ctb_size / (4 * h_samp_factor) - col) * pixel_size_uv;
  823|  13.4M|                    else
  824|  13.4M|                        pu1_src += 8 * bs_tz * pixel_size_uv;
  825|       |
  826|  42.8M|                    col += bs_tz;
  827|  42.8M|                    continue;
  828|  42.8M|                }
  829|       |
  830|  45.2M|                if(0 == col)
  ------------------
  |  Branch (830:20): [True: 8.24M, False: 37.0M]
  ------------------
  831|  8.24M|                {
  832|  8.24M|                    i1_tc_offset_div2 = ps_slice_hdr_left->i1_tc_offset_div2;
  833|       |
  834|  8.24M|                    if(0 == row)
  ------------------
  |  Branch (834:24): [True: 4.00M, False: 4.24M]
  ------------------
  835|  4.00M|                    {
  836|  4.00M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (836:32): [True: 3.97M, False: 25.2k]
  ------------------
  837|  3.97M|                                        pi1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  838|  4.00M|                                        pi1_qp[-qp_strd - 1];
  839|  4.00M|                    }
  840|  4.24M|                    else
  841|  4.24M|                    {
  842|  4.24M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (842:32): [True: 4.20M, False: 39.5k]
  ------------------
  843|  4.20M|                                        pi1_qp[-ctb_size / 8] :
  844|  4.24M|                                        pi1_qp[(v_samp_factor * row - 1) * qp_strd - 1];
  845|  4.24M|                    }
  846|       |
  847|  8.24M|                    qp_q = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (847:28): [True: 8.14M, False: 98.8k]
  ------------------
  848|  8.14M|                                    pi1_qp[-ctb_size / 8] :
  849|  8.24M|                                    pi1_qp[(v_samp_factor * row) * qp_strd - 1];
  850|  8.24M|                }
  851|  37.0M|                else
  852|  37.0M|                {
  853|  37.0M|                    if(0 == row)
  ------------------
  |  Branch (853:24): [True: 12.0M, False: 24.9M]
  ------------------
  854|  12.0M|                    {
  855|  12.0M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (855:32): [True: 11.9M, False: 186k]
  ------------------
  856|  11.9M|                                        pi1_qp[-ctb_size / 8 * qp_strd] :
  857|  12.0M|                                        pi1_qp[((col - 1) >> (2 - h_samp_factor)) - qp_strd];
  858|  12.0M|                    }
  859|  24.9M|                    else
  860|  24.9M|                    {
  861|  24.9M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (861:32): [True: 25.8M, False: 18.4E]
  ------------------
  862|  25.8M|                                        pi1_qp[0] :
  863|  18.4E|                                        pi1_qp[((col - 1) >> (2 - h_samp_factor)) +  (v_samp_factor * row - 1) * qp_strd];
  864|  24.9M|                    }
  865|       |
  866|  37.0M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (866:28): [True: 37.0M, False: 18.4E]
  ------------------
  867|  37.0M|                                    pi1_qp[0] :
  868|  18.4E|                                    pi1_qp[((col - 1) >> (2 - h_samp_factor)) + v_samp_factor * row * qp_strd];
  869|  37.0M|                }
  870|  45.2M|                filter_p = (pu2_ctb_no_loop_filter_flag[row * v_samp_factor] >> ((col + 2 - h_samp_factor) >> (2 - h_samp_factor))) & 1;
  871|  45.2M|                filter_q = (pu2_ctb_no_loop_filter_flag[(row * v_samp_factor) + 1] >> ((col + 2 - h_samp_factor) >> (2 - h_samp_factor))) & 1;
  872|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  873|  45.2M|                filter_p = !filter_p;
  874|  45.2M|                filter_q = !filter_q;
  875|       |
  876|  45.2M|                if(filter_p || filter_q)
  ------------------
  |  Branch (876:20): [True: 44.8M, False: 382k]
  |  Branch (876:32): [True: 137k, False: 244k]
  ------------------
  877|  45.2M|                {
  878|  45.2M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) {
  ------------------
  |  Branch (878:24): [True: 29.2M, False: 16.0M]
  ------------------
  879|  29.2M|                        ASSERT(1 == ((u4_bs & 3) >> 1));
  ------------------
  |  |   55|  29.2M|#define ASSERT(x) {}
  ------------------
  880|  29.2M|                    }
  881|  45.2M|                    DUMP_DEBLK_CHROMA_HORZ(pu1_src, chroma_strd,
  882|  45.2M|                                           u4_bs & 3, qp_p, qp_q,
  883|  45.2M|                                           ps_pps->i1_pic_cb_qp_offset,
  884|  45.2M|                                           ps_pps->i1_pic_cr_qp_offset,
  885|  45.2M|                                           ps_slice_hdr->i1_tc_offset_div2,
  886|  45.2M|                                           filter_p, filter_q);
  887|  45.2M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (887:24): [True: 5.77M, False: 39.4M]
  ------------------
  888|  5.77M|                    {
  889|  5.77M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  5.77M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (889:28): [True: 5.15M, False: 615k]
  ------------------
  890|  5.15M|                        {
  891|  5.15M|                            pf_deblk_chroma_horz(pu1_src,
  892|  5.15M|                                                 chroma_strd,
  893|  5.15M|                                                 qp_q,
  894|  5.15M|                                                 qp_p,
  895|  5.15M|                                                 ps_pps->i1_pic_cr_qp_offset,
  896|  5.15M|                                                 ps_pps->i1_pic_cb_qp_offset,
  897|  5.15M|                                                 i1_tc_offset_div2,
  898|  5.15M|                                                 filter_q,
  899|  5.15M|                                                 filter_p,
  900|  5.15M|                                                 ps_sps->i1_chroma_format_idc);
  901|  5.15M|                        }
  902|   615k|                        else
  903|   615k|                        {
  904|   615k|                            pf_hbd_deblk_chroma_horz((UWORD16 *)pu1_src,
  905|   615k|                                                     chroma_strd,
  906|   615k|                                                     qp_q,
  907|   615k|                                                     qp_p,
  908|   615k|                                                     ps_pps->i1_pic_cr_qp_offset,
  909|   615k|                                                     ps_pps->i1_pic_cb_qp_offset,
  910|   615k|                                                     i1_tc_offset_div2,
  911|   615k|                                                     filter_q,
  912|   615k|                                                     filter_p,
  913|   615k|                                                     u1_bit_depth_chroma,
  914|   615k|                                                     ps_sps->i1_chroma_format_idc);
  915|   615k|                        }
  916|  5.77M|                    }
  917|  39.4M|                    else
  918|  39.4M|                    {
  919|  39.4M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  39.4M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (919:28): [True: 24.1M, False: 15.3M]
  ------------------
  920|  24.1M|                        {
  921|  24.1M|                            pf_deblk_chroma_horz(pu1_src,
  922|  24.1M|                                                 chroma_strd,
  923|  24.1M|                                                 qp_p,
  924|  24.1M|                                                 qp_q,
  925|  24.1M|                                                 ps_pps->i1_pic_cb_qp_offset,
  926|  24.1M|                                                 ps_pps->i1_pic_cr_qp_offset,
  927|  24.1M|                                                 i1_tc_offset_div2,
  928|  24.1M|                                                 filter_p,
  929|  24.1M|                                                 filter_q,
  930|  24.1M|                                                 ps_sps->i1_chroma_format_idc);
  931|  24.1M|                        }
  932|  15.3M|                        else
  933|  15.3M|                        {
  934|  15.3M|                            pf_hbd_deblk_chroma_horz((UWORD16 *)pu1_src,
  935|  15.3M|                                                     chroma_strd,
  936|  15.3M|                                                     qp_p,
  937|  15.3M|                                                     qp_q,
  938|  15.3M|                                                     ps_pps->i1_pic_cb_qp_offset,
  939|  15.3M|                                                     ps_pps->i1_pic_cr_qp_offset,
  940|  15.3M|                                                     i1_tc_offset_div2,
  941|  15.3M|                                                     filter_p,
  942|  15.3M|                                                     filter_q,
  943|  15.3M|                                                     u1_bit_depth_chroma,
  944|  15.3M|                                                     ps_sps->i1_chroma_format_idc);
  945|  15.3M|                        }
  946|  39.4M|                    }
  947|  45.2M|                }
  948|       |
  949|  45.2M|                pu1_src += 8 * pixel_size_uv;
  950|  45.2M|                u4_bs = u4_bs >> (2 * h_samp_factor);
  951|  45.2M|                col++;
  952|  45.2M|            }
  953|  37.8M|            if(is_yuv444 || is_yuv422)
  ------------------
  |  Branch (953:16): [True: 128k, False: 37.6M]
  |  Branch (953:29): [True: 5.62M, False: 32.0M]
  ------------------
  954|  5.61M|            {
  955|  5.61M|                if((64 == ctb_size) || ((32 == ctb_size) && (row & 1))) pu4_horz_bs++;
  ------------------
  |  Branch (955:20): [True: 5.34M, False: 267k]
  |  Branch (955:41): [True: 105k, False: 161k]
  |  Branch (955:61): [True: 53.4k, False: 52.3k]
  ------------------
  956|  5.61M|            }
  957|  32.2M|            else
  958|  32.2M|            {
  959|  32.2M|                pu4_horz_bs += (64 == ctb_size) ? 2 : 1;
  ------------------
  |  Branch (959:32): [True: 12.6M, False: 19.5M]
  ------------------
  960|  32.2M|            }
  961|  37.8M|            pu1_src -= ctb_size * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  962|  37.8M|            pu1_src += 8 * chroma_strd * pixel_size_uv;
  963|       |
  964|  37.8M|        }
  965|  19.1M|    }
  966|  19.5M|}

ihevcd_decode:
  462|   282k|{
  463|   282k|    WORD32 ret = IV_SUCCESS;
  464|   282k|    codec_t *ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
  465|   282k|    ihevcd_cxa_video_decode_ip_t s_hevcd_dec_ip = {};
  466|   282k|    ihevcd_cxa_video_decode_ip_t *ps_hevcd_dec_ip;
  467|   282k|    ihevcd_cxa_video_decode_op_t *ps_hevcd_dec_op;
  468|   282k|    ivd_video_decode_ip_t *ps_dec_ip;
  469|   282k|    ivd_video_decode_op_t *ps_dec_op;
  470|       |
  471|   282k|    WORD32 proc_idx = 0;
  472|   282k|    WORD32 prev_proc_idx = 0;
  473|       |
  474|       |    /* Initialize error code */
  475|   282k|    ps_codec->i4_error_code = 0;
  476|       |    /* Initialize bytes remaining */
  477|   282k|    ps_codec->i4_bytes_remaining = 0;
  478|       |
  479|   282k|    ps_dec_ip = (ivd_video_decode_ip_t *)pv_api_ip;
  480|   282k|    memcpy(&s_hevcd_dec_ip, ps_dec_ip, ps_dec_ip->u4_size);
  481|   282k|    s_hevcd_dec_ip.s_ivd_video_decode_ip_t.u4_size = sizeof(ihevcd_cxa_video_decode_ip_t);
  482|       |
  483|   282k|    ps_hevcd_dec_ip = &s_hevcd_dec_ip;
  484|   282k|    ps_dec_ip = &ps_hevcd_dec_ip->s_ivd_video_decode_ip_t;
  485|       |
  486|   282k|    ps_hevcd_dec_op = (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  487|   282k|    ps_dec_op = &ps_hevcd_dec_op->s_ivd_video_decode_op_t;
  488|       |
  489|   282k|    {
  490|   282k|        UWORD32 u4_size = ps_dec_op->u4_size;
  491|   282k|        memset(ps_hevcd_dec_op, 0, u4_size);
  492|   282k|        ps_dec_op->u4_size = u4_size; //Restore size field
  493|   282k|    }
  494|   282k|    if(ps_codec->i4_init_done != 1)
  ------------------
  |  Branch (494:8): [True: 0, False: 282k]
  ------------------
  495|      0|    {
  496|      0|        ps_dec_op->u4_error_code |= 1 << IVD_FATALERROR;
  497|      0|        ps_dec_op->u4_error_code |= IHEVCD_INIT_NOT_DONE;
  498|      0|        return IV_FAIL;
  499|      0|    }
  500|       |
  501|   282k|    if(ps_codec->u4_pic_cnt >= NUM_FRAMES_LIMIT)
  ------------------
  |  |   82|   282k|#define NUM_FRAMES_LIMIT 0x7FFFFFFF
  ------------------
  |  Branch (501:8): [True: 0, False: 282k]
  ------------------
  502|      0|    {
  503|      0|        ps_dec_op->u4_error_code |= 1 << IVD_FATALERROR;
  504|      0|        ps_dec_op->u4_error_code |= IHEVCD_NUM_FRAMES_LIMIT_REACHED;
  505|      0|        return IV_FAIL;
  506|      0|    }
  507|       |
  508|   282k|    if(ps_codec->u1_enable_cu_info && ps_codec->i4_sps_done)
  ------------------
  |  Branch (508:8): [True: 0, False: 282k]
  |  Branch (508:39): [True: 0, False: 0]
  ------------------
  509|      0|    {
  510|      0|        UWORD32 blk_qp_map_size = ps_hevcd_dec_ip->u4_8x8_blk_qp_map_size;
  511|      0|        UWORD32 blk_type_map_size = ps_hevcd_dec_ip->u4_8x8_blk_type_map_size;
  512|      0|        UWORD32 blk_8x8_map_size = (ALIGN8(ps_codec->i4_wd) * ALIGN8(ps_codec->i4_ht)) >> 6;
  ------------------
  |  |   53|      0|#define ALIGN8(x)   ((((x) + 7) >> 3) << 3)
  ------------------
                      UWORD32 blk_8x8_map_size = (ALIGN8(ps_codec->i4_wd) * ALIGN8(ps_codec->i4_ht)) >> 6;
  ------------------
  |  |   53|      0|#define ALIGN8(x)   ((((x) + 7) >> 3) << 3)
  ------------------
  513|       |
  514|      0|        if ((ps_hevcd_dec_ip->pu1_8x8_blk_qp_map && blk_qp_map_size < blk_8x8_map_size) ||
  ------------------
  |  Branch (514:14): [True: 0, False: 0]
  |  Branch (514:53): [True: 0, False: 0]
  ------------------
  515|      0|            (ps_hevcd_dec_ip->pu1_8x8_blk_type_map && blk_type_map_size < blk_8x8_map_size))
  ------------------
  |  Branch (515:14): [True: 0, False: 0]
  |  Branch (515:55): [True: 0, False: 0]
  ------------------
  516|      0|        {
  517|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  518|      0|            ps_dec_op->u4_error_code |= IHEVCD_INSUFFICIENT_METADATA_BUFFER;
  519|      0|            return IV_FAIL;
  520|      0|        }
  521|      0|     }
  522|       |
  523|       |    /* If reset flag is set, flush the existing buffers */
  524|   282k|    if(ps_codec->i4_reset_flag)
  ------------------
  |  Branch (524:8): [True: 535, False: 281k]
  ------------------
  525|    535|    {
  526|    535|        ps_codec->i4_flush_mode = 1;
  527|    535|    }
  528|       |
  529|       |    /*Data memory barries instruction,so that bitstream write by the application is complete*/
  530|       |    //arm_dsb();
  531|       |    /* In case the decoder is not in flush mode check for input buffer validity */
  532|   282k|    if(0 == ps_codec->i4_flush_mode)
  ------------------
  |  Branch (532:8): [True: 281k, False: 535]
  ------------------
  533|   281k|    {
  534|   281k|        if(ps_dec_ip->pv_stream_buffer == NULL)
  ------------------
  |  Branch (534:12): [True: 0, False: 281k]
  ------------------
  535|      0|        {
  536|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  537|      0|            ps_dec_op->u4_error_code |= IVD_DEC_FRM_BS_BUF_NULL;
  538|      0|            return IV_FAIL;
  539|      0|        }
  540|   281k|        if(ps_dec_ip->u4_num_Bytes <= MIN_START_CODE_LEN)
  ------------------
  |  |   43|   281k|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (540:12): [True: 1.14k, False: 280k]
  ------------------
  541|  1.14k|        {
  542|  1.14k|            if((WORD32)ps_dec_ip->u4_num_Bytes > 0)
  ------------------
  |  Branch (542:16): [True: 1.14k, False: 0]
  ------------------
  543|  1.14k|                ps_dec_op->u4_num_bytes_consumed = ps_dec_ip->u4_num_Bytes;
  544|      0|            else
  545|      0|                ps_dec_op->u4_num_bytes_consumed = 0;
  546|       |
  547|  1.14k|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  548|  1.14k|            ps_dec_op->u4_error_code |= IVD_DEC_NUMBYTES_INV;
  549|  1.14k|            return IV_FAIL;
  550|       |
  551|  1.14k|        }
  552|   281k|    }
  553|       |
  554|       |#ifdef APPLY_CONCEALMENT
  555|       |    {
  556|       |        WORD32 num_mbs;
  557|       |
  558|       |        num_mbs = (ps_codec->i4_wd * ps_codec->i4_ht + 255) >> 8;
  559|       |        /* Reset MB Count at the beginning of every process call */
  560|       |        ps_codec->mb_count = 0;
  561|       |        memset(ps_codec->mb_map, 0, ((num_mbs + 7) >> 3));
  562|       |    }
  563|       |#endif
  564|       |
  565|   280k|    if(0 == ps_codec->i4_share_disp_buf && ps_codec->i4_header_mode == 0)
  ------------------
  |  Branch (565:8): [True: 280k, False: 0]
  |  Branch (565:44): [True: 167k, False: 113k]
  ------------------
  566|   167k|    {
  567|   167k|        UWORD32 i;
  568|   167k|        if((ps_dec_ip->s_out_buffer.u4_num_bufs <= 0) ||
  ------------------
  |  Branch (568:12): [True: 0, False: 167k]
  ------------------
  569|   167k|           (ps_dec_ip->s_out_buffer.u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
  ------------------
  |  |   43|   167k|#define IVD_VIDDEC_MAX_IO_BUFFERS 64
  ------------------
  |  Branch (569:12): [True: 0, False: 167k]
  ------------------
  570|      0|        {
  571|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  572|      0|            ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;
  573|      0|            return IV_FAIL;
  574|      0|        }
  575|       |
  576|   548k|        for(i = 0; i < ps_dec_ip->s_out_buffer.u4_num_bufs; i++)
  ------------------
  |  Branch (576:20): [True: 380k, False: 167k]
  ------------------
  577|   380k|        {
  578|   380k|            if(ps_dec_ip->s_out_buffer.pu1_bufs[i] == NULL)
  ------------------
  |  Branch (578:16): [True: 0, False: 380k]
  ------------------
  579|      0|            {
  580|      0|                ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  581|      0|                ps_dec_op->u4_error_code |= IVD_DISP_FRM_OP_BUF_NULL;
  582|      0|                return IV_FAIL;
  583|      0|            }
  584|       |
  585|   380k|            if(ps_dec_ip->s_out_buffer.u4_min_out_buf_size[i] == 0)
  ------------------
  |  Branch (585:16): [True: 0, False: 380k]
  ------------------
  586|      0|            {
  587|      0|                ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  588|      0|                ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  589|      0|                return IV_FAIL;
  590|      0|            }
  591|   380k|        }
  592|   167k|    }
  593|       |
  594|   280k|    ps_codec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
  595|   280k|    ps_codec->u4_ts = ps_dec_ip->u4_ts;
  596|   280k|    if(ps_codec->i4_flush_mode)
  ------------------
  |  Branch (596:8): [True: 535, False: 280k]
  ------------------
  597|    535|    {
  598|       |
  599|    535|        ps_dec_op->u4_pic_wd = ps_codec->i4_disp_wd;
  600|    535|        ps_dec_op->u4_pic_ht = ps_codec->i4_disp_ht;
  601|       |
  602|    535|        ps_dec_op->u4_new_seq = 0;
  603|       |
  604|    535|        ps_codec->ps_disp_buf = (pic_buf_t *)ihevc_disp_mgr_get(
  605|    535|                        (disp_mgr_t *)ps_codec->pv_disp_buf_mgr, &ps_codec->i4_disp_buf_id);
  606|       |        /* In case of non-shared mode, then convert/copy the frame to output buffer */
  607|       |        /* Only if the codec is in non-shared mode or in shared mode but needs 420P output */
  608|    535|        if((ps_codec->ps_disp_buf)
  ------------------
  |  Branch (608:12): [True: 0, False: 535]
  ------------------
  609|      0|                        && ((0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (609:29): [True: 0, False: 0]
  ------------------
  610|      0|                                        || (IV_YUV_420P
  ------------------
  |  Branch (610:44): [True: 0, False: 0]
  ------------------
  611|      0|                                                        == ps_codec->e_chroma_fmt)))
  612|      0|        {
  613|       |
  614|      0|            process_ctxt_t *ps_proc = &ps_codec->as_process[prev_proc_idx];
  615|      0|            if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (615:16): [True: 0, False: 0]
  ------------------
  616|      0|            {
  617|      0|                ihevcd_init_proc_ctxt(ps_proc, 0);
  618|      0|            }
  619|       |
  620|       |            /* Output buffer check */
  621|      0|            ret = ihevcd_check_out_buf_size(ps_codec);
  622|      0|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  623|       |
  624|       |            /* Set remaining number of rows to be processed */
  625|      0|            ret = ihevcd_fmt_conv(ps_codec, &ps_codec->as_process[prev_proc_idx],
  626|      0|                                  ps_dec_ip->s_out_buffer.pu1_bufs[0],
  627|      0|                                  ps_dec_ip->s_out_buffer.pu1_bufs[1],
  628|      0|                                  ps_dec_ip->s_out_buffer.pu1_bufs[2], 0,
  629|      0|                                  ps_codec->i4_disp_ht);
  630|       |
  631|      0|            ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
  632|      0|                                  ps_codec->i4_disp_buf_id, BUF_MGR_DISP);
  ------------------
  |  |   41|      0|#define BUF_MGR_DISP        (1 << 2)
  ------------------
  633|      0|        }
  634|       |
  635|    535|        ihevcd_fill_outargs(ps_codec, ps_hevcd_dec_ip, ps_hevcd_dec_op);
  636|       |
  637|    535|        if(1 == ps_dec_op->u4_output_present)
  ------------------
  |  Branch (637:12): [True: 0, False: 535]
  ------------------
  638|      0|        {
  639|      0|            WORD32 xpos = ps_codec->i4_disp_wd - 32 - LOGO_WD;
  ------------------
  |  |   41|      0|#define LOGO_WD 90
  ------------------
  640|      0|            WORD32 ypos = ps_codec->i4_disp_ht - 32 - LOGO_HT;
  ------------------
  |  |   42|      0|#define LOGO_HT 36
  ------------------
  641|       |
  642|      0|            if(ypos < 0)
  ------------------
  |  Branch (642:16): [True: 0, False: 0]
  ------------------
  643|      0|                ypos = 0;
  644|       |
  645|      0|            if(xpos < 0)
  ------------------
  |  Branch (645:16): [True: 0, False: 0]
  ------------------
  646|      0|                xpos = 0;
  647|       |
  648|      0|            INSERT_LOGO(ps_dec_ip->s_out_buffer.pu1_bufs[0],
  649|      0|                        ps_dec_ip->s_out_buffer.pu1_bufs[1],
  650|      0|                        ps_dec_ip->s_out_buffer.pu1_bufs[2], ps_codec->i4_disp_strd,
  651|      0|                        xpos,
  652|      0|                        ypos,
  653|      0|                        ps_codec->e_chroma_fmt,
  654|      0|                        ps_codec->i4_disp_wd,
  655|      0|                        ps_codec->i4_disp_ht);
  656|      0|        }
  657|       |
  658|       |
  659|    535|        if(NULL == ps_codec->ps_disp_buf)
  ------------------
  |  Branch (659:12): [True: 535, False: 0]
  ------------------
  660|    535|        {
  661|       |            /* If in flush mode and there are no more buffers to flush,
  662|       |             * check for the reset flag and reset the decoder */
  663|    535|            if(ps_codec->i4_reset_flag)
  ------------------
  |  Branch (663:16): [True: 535, False: 0]
  ------------------
  664|    535|            {
  665|    535|                ihevcd_init(ps_codec);
  666|    535|            }
  667|    535|            return (IV_FAIL);
  668|    535|        }
  669|       |
  670|      0|        return (IV_SUCCESS);
  671|       |
  672|    535|    }
  673|       |    /* In case of shared mode, check if there is a free buffer for reconstruction */
  674|   280k|    if((0 == ps_codec->i4_header_mode) && (1 == ps_codec->i4_share_disp_buf))
  ------------------
  |  Branch (674:8): [True: 166k, False: 113k]
  |  Branch (674:43): [True: 0, False: 166k]
  ------------------
  675|      0|    {
  676|      0|        WORD32 buf_status;
  677|      0|        buf_status = 1;
  678|      0|        if(ps_codec->pv_pic_buf_mgr)
  ------------------
  |  Branch (678:12): [True: 0, False: 0]
  ------------------
  679|      0|            buf_status = ihevc_buf_mgr_check_free((buf_mgr_t *)ps_codec->pv_pic_buf_mgr);
  680|       |
  681|       |        /* If there is no free buffer, then return with an error code */
  682|      0|        if(0 == buf_status)
  ------------------
  |  Branch (682:12): [True: 0, False: 0]
  ------------------
  683|      0|        {
  684|      0|            ps_dec_op->u4_error_code = IVD_DEC_REF_BUF_NULL;
  685|      0|            ps_dec_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
  686|      0|            return IV_FAIL;
  687|      0|        }
  688|      0|    }
  689|   280k|    ps_codec->i4_bytes_remaining = ps_dec_ip->u4_num_Bytes;
  690|   280k|    ps_codec->pu1_inp_bitsbuf = (UWORD8 *)ps_dec_ip->pv_stream_buffer;
  691|   280k|    ps_codec->s_parse.i4_end_of_frame = 0;
  692|       |
  693|   280k|    ps_codec->i4_pic_present = 0;
  694|   280k|    ps_codec->i4_slice_error = 0;
  695|   280k|    ps_codec->ps_disp_buf = NULL;
  696|       |
  697|   280k|    if(ps_codec->i4_num_cores > 1)
  ------------------
  |  Branch (697:8): [True: 189k, False: 90.7k]
  ------------------
  698|   189k|    {
  699|   189k|        ithread_set_affinity(0);
  700|   189k|    }
  701|   549k|    while(MIN_START_CODE_LEN < ps_codec->i4_bytes_remaining)
  ------------------
  |  |   43|   549k|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (701:11): [True: 545k, False: 4.58k]
  ------------------
  702|   545k|    {
  703|   545k|        WORD32 nal_len;
  704|   545k|        WORD32 nal_ofst;
  705|   545k|        WORD32 bits_len;
  706|       |
  707|   545k|        if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (707:12): [True: 30.3k, False: 514k]
  ------------------
  708|  30.3k|        {
  709|  30.3k|            slice_header_t *ps_slice_hdr_next = ps_codec->s_parse.ps_slice_hdr_base + (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  30.3k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  30.3k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  710|  30.3k|            WORD32 next_slice_addr = ps_slice_hdr_next->i2_ctb_x +
  711|  30.3k|                            ps_slice_hdr_next->i2_ctb_y * ps_codec->s_parse.ps_sps->i2_pic_wd_in_ctb;
  712|  30.3k|            if(ps_codec->s_parse.i4_next_ctb_indx == next_slice_addr)
  ------------------
  |  Branch (712:16): [True: 0, False: 30.3k]
  ------------------
  713|      0|                ps_codec->i4_slice_error = 0;
  714|  30.3k|        }
  715|       |
  716|   545k|        if(ps_codec->pu1_bitsbuf_dynamic)
  ------------------
  |  Branch (716:12): [True: 55.0k, False: 490k]
  ------------------
  717|  55.0k|        {
  718|  55.0k|            ps_codec->pu1_bitsbuf = ps_codec->pu1_bitsbuf_dynamic;
  719|  55.0k|            ps_codec->u4_bitsbuf_size = ps_codec->u4_bitsbuf_size_dynamic;
  720|  55.0k|        }
  721|   490k|        else
  722|   490k|        {
  723|   490k|            ps_codec->pu1_bitsbuf = ps_codec->pu1_bitsbuf_static;
  724|   490k|            ps_codec->u4_bitsbuf_size = ps_codec->u4_bitsbuf_size_static;
  725|   490k|        }
  726|       |
  727|   545k|        nal_ofst = ihevcd_nal_search_start_code(ps_codec->pu1_inp_bitsbuf,
  728|   545k|                                                ps_codec->i4_bytes_remaining);
  729|       |        /* If there is no start code found, consume the data and break */
  730|   545k|        if(nal_ofst == ps_codec->i4_bytes_remaining)
  ------------------
  |  Branch (730:12): [True: 396, False: 544k]
  ------------------
  731|    396|        {
  732|    396|            ps_codec->pu1_inp_bitsbuf += nal_ofst;
  733|    396|            ps_codec->i4_bytes_remaining -= nal_ofst;
  734|    396|            break;
  735|    396|        }
  736|       |
  737|   544k|        ps_codec->i4_nal_ofst = nal_ofst;
  738|   544k|        {
  739|   544k|            WORD32 bytes_remaining = ps_codec->i4_bytes_remaining - nal_ofst;
  740|       |
  741|   544k|            bytes_remaining = MIN((UWORD32)bytes_remaining, ps_codec->u4_bitsbuf_size);
  ------------------
  |  |   43|   544k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 544k, False: 0]
  |  |  ------------------
  ------------------
  742|   544k|            ihevcd_nal_remv_emuln_bytes(ps_codec->pu1_inp_bitsbuf + nal_ofst,
  743|   544k|                                        ps_codec->pu1_bitsbuf,
  744|   544k|                                        bytes_remaining,
  745|   544k|                                        &nal_len, &bits_len);
  746|       |
  747|       |            /* Decoder may read upto 8 extra bytes at the end of frame */
  748|       |            /* These are not used, but still set them to zero to avoid uninitialized reads */
  749|   544k|            if(bits_len < (WORD32)(ps_codec->u4_bitsbuf_size - 8))
  ------------------
  |  Branch (749:16): [True: 544k, False: 4]
  ------------------
  750|   544k|            {
  751|   544k|                memset(ps_codec->pu1_bitsbuf + bits_len, 0, 2 * sizeof(UWORD32));
  752|   544k|            }
  753|   544k|        }
  754|       |        /* This may be used to update the offsets for tiles and entropy sync row offsets */
  755|   544k|        ps_codec->i4_num_emln_bytes = nal_len - bits_len;
  756|   544k|        ps_codec->i4_nal_len = nal_len;
  757|       |
  758|   544k|        ihevcd_bits_init(&ps_codec->s_parse.s_bitstrm, ps_codec->pu1_bitsbuf,
  759|   544k|                         bits_len);
  760|       |
  761|   544k|        ret = ihevcd_nal_unit(ps_codec);
  762|       |
  763|       |        /* If the frame is incomplete and
  764|       |         * the bytes remaining is zero or a header is received,
  765|       |         * complete the frame treating it to be in error */
  766|   544k|        if(ps_codec->i4_pic_present &&
  ------------------
  |  Branch (766:12): [True: 169k, False: 375k]
  ------------------
  767|   169k|                        (ps_codec->s_parse.i4_next_ctb_indx != ps_codec->s_parse.ps_sps->i4_pic_size_in_ctb))
  ------------------
  |  Branch (767:25): [True: 116k, False: 53.0k]
  ------------------
  768|   116k|        {
  769|   116k|            if((ps_codec->i4_bytes_remaining - (nal_len + nal_ofst) <= MIN_START_CODE_LEN) ||
  ------------------
  |  |   43|   116k|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (769:16): [True: 13.7k, False: 102k]
  ------------------
  770|   102k|                            (ps_codec->i4_header_in_slice_mode))
  ------------------
  |  Branch (770:29): [True: 15.8k, False: 86.4k]
  ------------------
  771|  29.6k|            {
  772|  29.6k|                slice_header_t *ps_slice_hdr_next;
  773|       |
  774|  29.6k|                ps_codec->s_parse.i4_cur_slice_idx--;
  775|  29.6k|                if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (775:20): [True: 34, False: 29.5k]
  ------------------
  776|     34|                    ps_codec->s_parse.i4_cur_slice_idx = 0;
  777|       |
  778|  29.6k|                ps_slice_hdr_next = ps_codec->s_parse.ps_slice_hdr_base + ((ps_codec->s_parse.i4_cur_slice_idx + 1) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  29.6k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  29.6k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  779|  29.6k|                ps_slice_hdr_next->i2_ctb_x = 0;
  780|  29.6k|                ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  781|  29.6k|                ps_codec->i4_slice_error = 1;
  782|  29.6k|                continue;
  783|  29.6k|            }
  784|   116k|        }
  785|       |
  786|   515k|        if(IHEVCD_IGNORE_SLICE == ret)
  ------------------
  |  Branch (786:12): [True: 38.5k, False: 476k]
  ------------------
  787|  38.5k|        {
  788|  38.5k|            ps_codec->pu1_inp_bitsbuf += (nal_ofst + nal_len);
  789|  38.5k|            ps_codec->i4_bytes_remaining -= (nal_ofst + nal_len);
  790|       |
  791|  38.5k|            continue;
  792|  38.5k|        }
  793|       |
  794|   476k|        if(IVD_RES_CHANGED == ret)
  ------------------
  |  Branch (794:12): [True: 3.22k, False: 473k]
  ------------------
  795|  3.22k|        {
  796|  3.22k|            break;
  797|  3.22k|        }
  798|       |
  799|       |        /* Update bytes remaining and bytes consumed and input bitstream pointer */
  800|       |        /* Do not consume the NAL in the following cases */
  801|       |        /* Slice header reached during header decode mode */
  802|       |        /* TODO: Next picture's slice reached */
  803|   473k|        if(ret != IHEVCD_SLICE_IN_HEADER_MODE)
  ------------------
  |  Branch (803:12): [True: 391k, False: 81.9k]
  ------------------
  804|   391k|        {
  805|   391k|            if((0 == ps_codec->i4_slice_error) ||
  ------------------
  |  Branch (805:16): [True: 391k, False: 172]
  ------------------
  806|    172|                            (ps_codec->i4_bytes_remaining - (nal_len + nal_ofst) <= MIN_START_CODE_LEN))
  ------------------
  |  |   43|    172|#define MIN_START_CODE_LEN          4
  ------------------
  |  Branch (806:29): [True: 6, False: 166]
  ------------------
  807|   391k|            {
  808|   391k|                ps_codec->pu1_inp_bitsbuf += (nal_ofst + nal_len);
  809|   391k|                ps_codec->i4_bytes_remaining -= (nal_ofst + nal_len);
  810|   391k|            }
  811|   391k|            if(ret != IHEVCD_SUCCESS)
  ------------------
  |  Branch (811:16): [True: 137k, False: 254k]
  ------------------
  812|   137k|                break;
  813|       |
  814|   254k|            if(ps_codec->s_parse.i4_end_of_frame)
  ------------------
  |  Branch (814:16): [True: 53.0k, False: 201k]
  ------------------
  815|  53.0k|                break;
  816|   254k|        }
  817|  81.9k|        else
  818|  81.9k|        {
  819|  81.9k|            ret = IHEVCD_SUCCESS;
  820|  81.9k|            break;
  821|  81.9k|        }
  822|       |
  823|       |        /* Allocate dynamic bitstream buffer once SPS is decoded */
  824|   201k|        if((ps_codec->u4_allocate_dynamic_done == 0) && ps_codec->i4_sps_done)
  ------------------
  |  Branch (824:12): [True: 31.8k, False: 169k]
  |  Branch (824:57): [True: 24.8k, False: 7.06k]
  ------------------
  825|  24.8k|        {
  826|  24.8k|            WORD32 ret;
  827|  24.8k|            ret = ihevcd_allocate_dynamic_bufs(ps_codec);
  828|  24.8k|            if(ret != IV_SUCCESS)
  ------------------
  |  Branch (828:16): [True: 0, False: 24.8k]
  ------------------
  829|      0|            {
  830|       |                /* Free any dynamic buffers that are allocated */
  831|      0|                ihevcd_free_dynamic_bufs(ps_codec);
  832|      0|                ps_codec->i4_error_code = IVD_MEM_ALLOC_FAILED;
  833|      0|                ps_dec_op->u4_error_code = 1 << IVD_FATALERROR;
  834|      0|                ps_dec_op->u4_error_code |= IVD_MEM_ALLOC_FAILED;
  835|       |
  836|      0|                return IV_FAIL;
  837|      0|            }
  838|  24.8k|        }
  839|       |
  840|   201k|        BREAK_AFTER_SLICE_NAL();
  ------------------
  |  |   81|   201k|#define BREAK_AFTER_SLICE_NAL()     ;
  ------------------
  841|   201k|    }
  842|       |
  843|   280k|    if(1 == ps_codec->i4_pic_present && 0 == ps_codec->s_parse.i4_end_of_frame)
  ------------------
  |  Branch (843:8): [True: 69.8k, False: 210k]
  |  Branch (843:41): [True: 16.8k, False: 53.0k]
  ------------------
  844|  16.8k|    {
  845|  16.8k|        slice_header_t *ps_slice_hdr_next;
  846|  16.8k|        ps_codec->i4_slice_error = 1;
  847|  16.8k|        ps_codec->s_parse.i4_cur_slice_idx--;
  848|  16.8k|        if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (848:12): [True: 1, False: 16.8k]
  ------------------
  849|      1|            ps_codec->s_parse.i4_cur_slice_idx = 0;
  850|       |
  851|  16.8k|        ps_slice_hdr_next = ps_codec->s_parse.ps_slice_hdr_base + ((ps_codec->s_parse.i4_cur_slice_idx + 1) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  16.8k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  16.8k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  852|  16.8k|        ps_slice_hdr_next->i2_ctb_x = -1;
  853|  16.8k|        ps_slice_hdr_next->i2_ctb_y = -1;
  854|       |
  855|  16.8k|        ihevcd_parse_slice_data(ps_codec);
  856|  16.8k|        ASSERT(ps_codec->s_parse.i4_end_of_frame != 0);
  ------------------
  |  |   55|  16.8k|#define ASSERT(x) {}
  ------------------
  857|  16.8k|    }
  858|       |
  859|   280k|    if(1 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (859:8): [True: 69.8k, False: 210k]
  ------------------
  860|  69.8k|    {
  861|  69.8k|        WORD32 i;
  862|  69.8k|        sps_t *ps_sps = ps_codec->s_parse.ps_sps;
  863|  69.8k|        ps_codec->i4_first_pic_done = 1;
  864|       |
  865|       |        /*TODO temporary fix: end_of_frame is checked before adding format conversion to job queue         */
  866|  69.8k|        if(ps_codec->i4_num_cores > 1 && ps_codec->s_parse.i4_end_of_frame)
  ------------------
  |  Branch (866:12): [True: 48.1k, False: 21.7k]
  |  Branch (866:42): [True: 48.1k, False: 0]
  ------------------
  867|  48.1k|        {
  868|       |
  869|       |            /* Add job queue for format conversion / frame copy for each ctb row */
  870|       |            /* Only if the codec is in non-shared mode or in shared mode but needs 420P output */
  871|  48.1k|            process_ctxt_t *ps_proc;
  872|       |
  873|       |            /* i4_num_cores - 1 contexts are currently being used by other threads */
  874|  48.1k|            ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1];
  875|       |
  876|  48.1k|            if((ps_codec->ps_disp_buf) &&
  ------------------
  |  Branch (876:16): [True: 46.5k, False: 1.65k]
  ------------------
  877|  46.5k|               ((0 == ps_codec->i4_share_disp_buf) || (IV_YUV_420P == ps_codec->e_chroma_fmt)))
  ------------------
  |  Branch (877:17): [True: 46.5k, False: 0]
  |  Branch (877:55): [True: 0, False: 0]
  ------------------
  878|  46.5k|            {
  879|       |                /* If format conversion jobs were not issued in pic_init() add them here */
  880|  46.5k|                if((0 == ps_codec->u4_enable_fmt_conv_ahead) ||
  ------------------
  |  Branch (880:20): [True: 46.5k, False: 0]
  ------------------
  881|      0|                                (ps_codec->i4_disp_buf_id == ps_proc->i4_cur_pic_buf_id))
  ------------------
  |  Branch (881:33): [True: 0, False: 0]
  ------------------
  882|   730k|                    for(i = 0; i < ps_sps->i2_pic_ht_in_ctb; i++)
  ------------------
  |  Branch (882:32): [True: 684k, False: 46.5k]
  ------------------
  883|   684k|                    {
  884|   684k|                        proc_job_t s_job;
  885|   684k|                        IHEVCD_ERROR_T ret;
  886|   684k|                        s_job.i4_cmd = CMD_FMTCONV;
  887|   684k|                        s_job.i2_ctb_cnt = 0;
  888|   684k|                        s_job.i2_ctb_x = 0;
  889|   684k|                        s_job.i2_ctb_y = i;
  890|   684k|                        s_job.i2_slice_idx = 0;
  891|   684k|                        s_job.i4_tu_coeff_data_ofst = 0;
  892|   684k|                        ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq,
  893|   684k|                                                &s_job, sizeof(proc_job_t), 1);
  894|   684k|                        if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (894:28): [True: 0, False: 684k]
  ------------------
  895|      0|                            return (WORD32)ret;
  896|   684k|                    }
  897|  46.5k|            }
  898|       |            /* Reached end of frame : Signal terminate */
  899|       |            /* The terminate flag is checked only after all the jobs are dequeued */
  900|  48.1k|            ret = ihevcd_jobq_terminate((jobq_t *)ps_codec->s_parse.pv_proc_jobq);
  901|       |
  902|   626k|            while(1)
  ------------------
  |  Branch (902:19): [True: 626k, Folded]
  ------------------
  903|   626k|            {
  904|   626k|                IHEVCD_ERROR_T ret;
  905|   626k|                proc_job_t s_job;
  906|   626k|                process_ctxt_t *ps_proc;
  907|       |
  908|       |                /* i4_num_cores - 1 contexts are currently being used by other threads */
  909|   626k|                ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1];
  910|       |
  911|   626k|                ret = ihevcd_jobq_dequeue((jobq_t *)ps_proc->pv_proc_jobq, &s_job,
  912|   626k|                                          sizeof(proc_job_t), 1);
  913|   626k|                if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (913:20): [True: 48.1k, False: 577k]
  ------------------
  914|  48.1k|                    break;
  915|       |
  916|   577k|                ps_proc->i4_ctb_cnt = s_job.i2_ctb_cnt;
  917|   577k|                ps_proc->i4_ctb_x = s_job.i2_ctb_x;
  918|   577k|                ps_proc->i4_ctb_y = s_job.i2_ctb_y;
  919|   577k|                ps_proc->i4_cur_slice_idx = s_job.i2_slice_idx;
  920|       |
  921|   577k|                if(CMD_PROCESS == s_job.i4_cmd)
  ------------------
  |  Branch (921:20): [True: 292k, False: 285k]
  ------------------
  922|   292k|                {
  923|   292k|                    ihevcd_init_proc_ctxt(ps_proc, s_job.i4_tu_coeff_data_ofst);
  924|       |
  925|   292k|                    ihevcd_process(ps_proc);
  926|   292k|                }
  927|   285k|                else if(CMD_FMTCONV == s_job.i4_cmd)
  ------------------
  |  Branch (927:25): [True: 285k, False: 0]
  ------------------
  928|   285k|                {
  929|   285k|                    sps_t *ps_sps = ps_codec->s_parse.ps_sps;
  930|   285k|                    WORD32 num_rows = 1 << ps_sps->i1_log2_ctb_size;
  931|   285k|                    if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (931:24): [True: 5.00k, False: 280k]
  ------------------
  932|  5.00k|                    {
  933|  5.00k|                        ihevcd_init_proc_ctxt(ps_proc, 0);
  934|  5.00k|                    }
  935|       |
  936|   285k|                    num_rows = MIN(num_rows, (ps_codec->i4_disp_ht - (s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size)));
  ------------------
  |  |   43|   285k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 265k, False: 20.3k]
  |  |  ------------------
  ------------------
  937|   285k|                    if(num_rows < 0)
  ------------------
  |  Branch (937:24): [True: 366, False: 285k]
  ------------------
  938|    366|                        num_rows = 0;
  939|       |
  940|   285k|                    ihevcd_fmt_conv(ps_codec, ps_proc,
  941|   285k|                                    ps_dec_ip->s_out_buffer.pu1_bufs[0],
  942|   285k|                                    ps_dec_ip->s_out_buffer.pu1_bufs[1],
  943|   285k|                                    ps_dec_ip->s_out_buffer.pu1_bufs[2],
  944|   285k|                                    s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size,
  945|   285k|                                    num_rows);
  946|   285k|                }
  947|   577k|            }
  948|  48.1k|        }
  949|       |        /* In case of non-shared mode and while running in single core mode, then convert/copy the frame to output buffer */
  950|       |        /* Only if the codec is in non-shared mode or in shared mode but needs 420P output */
  951|  21.7k|        else if((ps_codec->ps_disp_buf) && ((0 == ps_codec->i4_share_disp_buf) ||
  ------------------
  |  Branch (951:17): [True: 21.1k, False: 524]
  |  Branch (951:45): [True: 21.1k, False: 0]
  ------------------
  952|      0|                                            (IV_YUV_420P == ps_codec->e_chroma_fmt)) &&
  ------------------
  |  Branch (952:45): [True: 0, False: 0]
  ------------------
  953|  21.1k|                        (ps_codec->s_parse.i4_end_of_frame))
  ------------------
  |  Branch (953:25): [True: 21.1k, False: 0]
  ------------------
  954|  21.1k|        {
  955|  21.1k|            process_ctxt_t *ps_proc = &ps_codec->as_process[proc_idx];
  956|       |            /* Set remaining number of rows to be processed */
  957|  21.1k|            ps_codec->s_fmt_conv.i4_num_rows = ps_codec->i4_disp_ht
  958|  21.1k|                            - ps_codec->s_fmt_conv.i4_cur_row;
  959|  21.1k|            if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (959:16): [True: 0, False: 21.1k]
  ------------------
  960|      0|            {
  961|      0|                ihevcd_init_proc_ctxt(ps_proc, 0);
  962|      0|            }
  963|       |
  964|  21.1k|            if(ps_codec->s_fmt_conv.i4_num_rows < 0)
  ------------------
  |  Branch (964:16): [True: 0, False: 21.1k]
  ------------------
  965|      0|                ps_codec->s_fmt_conv.i4_num_rows = 0;
  966|       |
  967|  21.1k|            ret = ihevcd_fmt_conv(ps_codec, ps_proc,
  968|  21.1k|                                  ps_dec_ip->s_out_buffer.pu1_bufs[0],
  969|  21.1k|                                  ps_dec_ip->s_out_buffer.pu1_bufs[1],
  970|  21.1k|                                  ps_dec_ip->s_out_buffer.pu1_bufs[2],
  971|  21.1k|                                  ps_codec->s_fmt_conv.i4_cur_row,
  972|  21.1k|                                  ps_codec->s_fmt_conv.i4_num_rows);
  973|  21.1k|            ps_codec->s_fmt_conv.i4_cur_row += ps_codec->s_fmt_conv.i4_num_rows;
  974|       |
  975|  21.1k|        }
  976|       |
  977|       |
  978|  69.8k|        DEBUG_DUMP_MV_MAP(ps_codec);
  979|       |
  980|       |        /* Mark MV Buf as needed for reference */
  981|  69.8k|        ihevc_buf_mgr_set_status((buf_mgr_t *)ps_codec->pv_mv_buf_mgr,
  982|  69.8k|                                 ps_codec->as_process[proc_idx].i4_cur_mv_bank_buf_id,
  983|  69.8k|                                 BUF_MGR_REF);
  ------------------
  |  |   40|  69.8k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  984|       |
  985|       |        /* Mark pic buf as needed for reference */
  986|  69.8k|        ihevc_buf_mgr_set_status((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
  987|  69.8k|                                 ps_codec->as_process[proc_idx].i4_cur_pic_buf_id,
  988|  69.8k|                                 BUF_MGR_REF);
  ------------------
  |  |   40|  69.8k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  989|       |
  990|       |        /* Mark pic buf as needed for display */
  991|  69.8k|        ihevc_buf_mgr_set_status((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
  992|  69.8k|                                 ps_codec->as_process[proc_idx].i4_cur_pic_buf_id,
  993|  69.8k|                                 BUF_MGR_DISP);
  ------------------
  |  |   41|  69.8k|#define BUF_MGR_DISP        (1 << 2)
  ------------------
  994|       |
  995|       |        /* Insert the current picture as short term reference */
  996|  69.8k|        ihevc_dpb_mgr_insert_ref((dpb_mgr_t *)ps_codec->pv_dpb_mgr,
  997|  69.8k|                                 ps_codec->as_process[proc_idx].ps_cur_pic,
  998|  69.8k|                                 ps_codec->as_process[proc_idx].i4_cur_pic_buf_id);
  999|       |
 1000|       |        /* If a frame was displayed (in non-shared mode), then release it from display manager */
 1001|  69.8k|        if((0 == ps_codec->i4_share_disp_buf) && (ps_codec->ps_disp_buf))
  ------------------
  |  Branch (1001:12): [True: 69.8k, False: 0]
  |  Branch (1001:50): [True: 67.7k, False: 2.17k]
  ------------------
 1002|  67.7k|            ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_pic_buf_mgr,
 1003|  67.7k|                                  ps_codec->i4_disp_buf_id, BUF_MGR_DISP);
  ------------------
  |  |   41|  67.7k|#define BUF_MGR_DISP        (1 << 2)
  ------------------
 1004|       |
 1005|       |        /* Wait for threads */
 1006|   159k|        for(i = 0; i < (ps_codec->i4_num_cores - 1); i++)
  ------------------
  |  Branch (1006:20): [True: 89.3k, False: 69.8k]
  ------------------
 1007|  89.3k|        {
 1008|  89.3k|            if(ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1008:16): [True: 89.3k, False: 0]
  ------------------
 1009|  89.3k|            {
 1010|  89.3k|                if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1010:20): [True: 89.3k, False: 0]
  ------------------
 1011|  89.3k|                {
 1012|  89.3k|                    ret = ithread_mutex_lock(ps_codec->apv_proc_done_mutex[i]);
 1013|  89.3k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  89.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 89.3k]
  |  |  ------------------
  ------------------
 1014|       |
 1015|   119k|                    while(!ps_codec->ai4_process_done[i])
  ------------------
  |  Branch (1015:27): [True: 29.8k, False: 89.3k]
  ------------------
 1016|  29.8k|                    {
 1017|  29.8k|                        ithread_cond_wait(ps_codec->apv_proc_done_condition[i],
 1018|  29.8k|                                          ps_codec->apv_proc_done_mutex[i]);
 1019|  29.8k|                    }
 1020|  89.3k|                    ps_codec->ai4_process_done[i] = 0;
 1021|  89.3k|                    ret = ithread_mutex_unlock(ps_codec->apv_proc_done_mutex[i]);
 1022|  89.3k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  89.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 89.3k]
  |  |  ------------------
  ------------------
 1023|  89.3k|                }
 1024|      0|                else
 1025|      0|                {
 1026|      0|                    ithread_join(ps_codec->apv_process_thread_handle[i], NULL);
 1027|      0|                    ps_codec->ai4_process_thread_created[i] = 0;
 1028|      0|                }
 1029|  89.3k|            }
 1030|  89.3k|        }
 1031|       |
 1032|  69.8k|        DEBUG_VALIDATE_PADDED_REGION(&ps_codec->as_process[proc_idx]);
 1033|  69.8k|        if(ps_codec->u4_pic_cnt > 0)
  ------------------
  |  Branch (1033:12): [True: 49.3k, False: 20.5k]
  ------------------
 1034|  49.3k|        {
 1035|  49.3k|            DEBUG_DUMP_PIC_PU(ps_codec);
 1036|  49.3k|        }
 1037|  69.8k|        DEBUG_DUMP_PIC_BUFFERS(ps_codec);
 1038|       |
 1039|       |        /* Increment the number of pictures decoded */
 1040|  69.8k|        ps_codec->u4_pic_cnt++;
 1041|  69.8k|    }
 1042|   280k|    ihevcd_fill_outargs(ps_codec, ps_hevcd_dec_ip, ps_hevcd_dec_op);
 1043|       |
 1044|   280k|    if(1 == ps_dec_op->u4_output_present)
  ------------------
  |  Branch (1044:8): [True: 67.7k, False: 212k]
  ------------------
 1045|  67.7k|    {
 1046|  67.7k|        WORD32 xpos = ps_codec->i4_disp_wd - 32 - LOGO_WD;
  ------------------
  |  |   41|  67.7k|#define LOGO_WD 90
  ------------------
 1047|  67.7k|        WORD32 ypos = ps_codec->i4_disp_ht - 32 - LOGO_HT;
  ------------------
  |  |   42|  67.7k|#define LOGO_HT 36
  ------------------
 1048|       |
 1049|  67.7k|        if(ypos < 0)
  ------------------
  |  Branch (1049:12): [True: 16.0k, False: 51.6k]
  ------------------
 1050|  16.0k|            ypos = 0;
 1051|       |
 1052|  67.7k|        if(xpos < 0)
  ------------------
  |  Branch (1052:12): [True: 47.4k, False: 20.3k]
  ------------------
 1053|  47.4k|            xpos = 0;
 1054|       |
 1055|  67.7k|        INSERT_LOGO(ps_dec_ip->s_out_buffer.pu1_bufs[0],
 1056|  67.7k|                    ps_dec_ip->s_out_buffer.pu1_bufs[1],
 1057|  67.7k|                    ps_dec_ip->s_out_buffer.pu1_bufs[2], ps_codec->i4_disp_strd,
 1058|  67.7k|                    xpos,
 1059|  67.7k|                    ypos,
 1060|  67.7k|                    ps_codec->e_chroma_fmt,
 1061|  67.7k|                    ps_codec->i4_disp_wd,
 1062|  67.7k|                    ps_codec->i4_disp_ht);
 1063|  67.7k|    }
 1064|       |
 1065|       |
 1066|   280k|    return ret;
 1067|   280k|}
ihevcd_decode.c:ihevcd_fill_outargs:
  188|   280k|{
  189|       |
  190|   280k|    ihevcd_cxa_video_decode_ip_t *ps_hevcd_dec_ip;
  191|   280k|    ihevcd_cxa_video_decode_op_t *ps_hevcd_dec_op;
  192|   280k|    ivd_video_decode_ip_t *ps_dec_ip;
  193|   280k|    ivd_video_decode_op_t *ps_dec_op;
  194|       |
  195|   280k|    ps_hevcd_dec_ip = (ihevcd_cxa_video_decode_ip_t *)pv_api_ip;
  196|   280k|    ps_hevcd_dec_op = (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  197|   280k|    ps_dec_ip = &ps_hevcd_dec_ip->s_ivd_video_decode_ip_t;
  198|   280k|    ps_dec_op = &ps_hevcd_dec_op->s_ivd_video_decode_op_t;
  199|       |
  200|   280k|    ps_dec_op->u4_error_code = ihevcd_map_error((IHEVCD_ERROR_T)ps_codec->i4_error_code);
  201|   280k|    ps_dec_op->u4_num_bytes_consumed = ps_dec_ip->u4_num_Bytes
  202|   280k|                    - ps_codec->i4_bytes_remaining;
  203|   280k|    if(ps_codec->i4_sps_done)
  ------------------
  |  Branch (203:8): [True: 169k, False: 111k]
  ------------------
  204|   169k|    {
  205|   169k|        ps_dec_op->u4_pic_wd = ps_codec->i4_disp_wd;
  206|   169k|        ps_dec_op->u4_pic_ht = ps_codec->i4_disp_ht;
  207|   169k|        ps_dec_op->u4_bit_depth = ps_codec->i4_bit_depth_luma;
  208|   169k|    }
  209|   111k|    else
  210|   111k|    {
  211|   111k|        ps_dec_op->u4_pic_wd = 0;
  212|   111k|        ps_dec_op->u4_pic_ht = 0;
  213|   111k|        ps_dec_op->u4_bit_depth = 0;
  214|   111k|    }
  215|       |
  216|   280k|    ps_dec_op->e_pic_type = ps_codec->e_dec_pic_type;
  217|   280k|    ps_dec_op->u4_frame_decoded_flag = ps_codec->i4_pic_present;
  218|   280k|    ps_dec_op->u4_new_seq = 0;
  219|       |
  220|   280k|    ps_dec_op->u4_output_present = 0;
  221|   280k|    ps_dec_op->u4_progressive_frame_flag = 1;
  222|   280k|    ps_dec_op->i4_display_index = -1;
  223|   280k|    ps_dec_op->i4_reorder_depth = -1;
  224|   280k|    if(ps_codec->i4_sps_done)
  ------------------
  |  Branch (224:8): [True: 169k, False: 111k]
  ------------------
  225|   169k|    {
  226|   169k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
  227|   169k|        profile_tier_lvl_info_t *ps_ptl;
  228|   169k|        ps_ptl = &ps_sps->s_ptl;
  229|   169k|        if((0 == ps_ptl->s_ptl_gen.i1_general_progressive_source_flag) &&
  ------------------
  |  Branch (229:12): [True: 125k, False: 43.7k]
  ------------------
  230|   125k|           (1 == ps_ptl->s_ptl_gen.i1_general_interlaced_source_flag))
  ------------------
  |  Branch (230:12): [True: 15.8k, False: 109k]
  ------------------
  231|  15.8k|        {
  232|  15.8k|            ps_dec_op->u4_progressive_frame_flag = 0;
  233|  15.8k|        }
  234|   169k|        ps_dec_op->i4_reorder_depth =
  235|   169k|                        ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
  236|   169k|    }
  237|       |
  238|   280k|    ps_dec_op->u4_is_ref_flag = 1;
  239|   280k|    ps_dec_op->e_output_format = ps_codec->e_chroma_fmt;
  240|   280k|    ps_dec_op->u4_is_ref_flag = 1;
  241|       |
  242|   280k|    ps_dec_op->e4_fld_type = IV_FLD_TYPE_DEFAULT;
  243|   280k|    ps_dec_op->u4_ts = (UWORD32)(-1);
  244|   280k|    ps_dec_op->u4_disp_buf_id = ps_codec->i4_disp_buf_id;
  245|   280k|    if(ps_codec->i4_flush_mode)
  ------------------
  |  Branch (245:8): [True: 535, False: 280k]
  ------------------
  246|    535|    {
  247|    535|        ps_dec_op->u4_num_bytes_consumed = 0;
  248|       |        /*In the case of flush ,since no frame is decoded set pic type as invalid*/
  249|    535|        ps_dec_op->u4_is_ref_flag = 0;
  250|    535|        ps_dec_op->e_pic_type = IV_NA_FRAME;
  251|    535|        ps_dec_op->u4_frame_decoded_flag = 0;
  252|       |
  253|    535|    }
  254|   280k|    ps_dec_op->s_disp_frm_buf.u4_bit_depth      = ps_dec_op->u4_bit_depth;
  255|       |
  256|       |    /* If there is a display buffer */
  257|   280k|    if(ps_codec->ps_disp_buf)
  ------------------
  |  Branch (257:8): [True: 67.7k, False: 213k]
  ------------------
  258|  67.7k|    {
  259|  67.7k|        pic_buf_t *ps_disp_buf = ps_codec->ps_disp_buf;
  260|  67.7k|#ifndef DISABLE_SEI
  261|  67.7k|        sei_params_t *ps_sei = &ps_disp_buf->s_sei_params;
  262|       |
  263|  67.7k|        if(ps_sei->i1_sei_parameters_present_flag &&
  ------------------
  |  Branch (263:12): [True: 442, False: 67.2k]
  ------------------
  264|    442|           ps_sei->i1_pic_timing_params_present_flag)
  ------------------
  |  Branch (264:12): [True: 303, False: 139]
  ------------------
  265|    303|        {
  266|    303|            UWORD32 u4_pic_struct;
  267|    303|            u4_pic_struct = ps_sei->s_pic_timing_sei_params.u4_pic_struct;
  268|    303|            switch(u4_pic_struct)
  269|    303|            {
  270|     76|                case 1:
  ------------------
  |  Branch (270:17): [True: 76, False: 227]
  ------------------
  271|     76|                    ps_dec_op->e4_fld_type = IV_TOP_FLD;
  272|     76|                    ps_dec_op->u4_progressive_frame_flag = 0;
  273|     76|                    break;
  274|     34|                case 2:
  ------------------
  |  Branch (274:17): [True: 34, False: 269]
  ------------------
  275|     34|                    ps_dec_op->e4_fld_type = IV_BOT_FLD;
  276|     34|                    ps_dec_op->u4_progressive_frame_flag = 0;
  277|     34|                    break;
  278|    193|                case 0:
  ------------------
  |  Branch (278:17): [True: 193, False: 110]
  ------------------
  279|    193|                default:
  ------------------
  |  Branch (279:17): [True: 0, False: 303]
  ------------------
  280|    193|                    ps_dec_op->e4_fld_type = IV_FLD_TYPE_DEFAULT;
  281|    193|                    ps_dec_op->u4_progressive_frame_flag = 1;
  282|    193|                    break;
  283|    303|            }
  284|    303|        }
  285|  67.7k|#endif
  286|  67.7k|        ps_dec_op->i4_display_index = ps_disp_buf->i4_abs_poc;
  287|  67.7k|        ps_dec_op->u4_output_present = 1;
  288|  67.7k|        ps_dec_op->u4_ts = ps_disp_buf->u4_ts;
  289|  67.7k|        if((ps_codec->i4_flush_mode == 0) && (ps_codec->s_parse.i4_end_of_frame == 0))
  ------------------
  |  Branch (289:12): [True: 67.7k, False: 0]
  |  Branch (289:46): [True: 0, False: 67.7k]
  ------------------
  290|      0|            ps_dec_op->u4_output_present = 0;
  291|  67.7k|        ps_dec_op->s_disp_frm_buf.u4_y_wd = ps_codec->i4_disp_wd;
  292|  67.7k|        ps_dec_op->s_disp_frm_buf.u4_y_ht = ps_codec->i4_disp_ht;
  293|       |
  294|  67.7k|        if(ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (294:12): [True: 0, False: 67.7k]
  ------------------
  295|      0|        {
  296|      0|            ps_dec_op->s_disp_frm_buf.pv_y_buf = ps_disp_buf->pu1_luma;
  297|      0|            if(ps_codec->e_chroma_fmt != IV_YUV_420P)
  ------------------
  |  Branch (297:16): [True: 0, False: 0]
  ------------------
  298|      0|            {
  299|      0|                ps_dec_op->s_disp_frm_buf.pv_u_buf = ps_disp_buf->pu1_chroma;
  300|      0|                ps_dec_op->s_disp_frm_buf.pv_v_buf = NULL;
  301|      0|            }
  302|      0|            else
  303|      0|            {
  304|      0|                WORD32 i;
  305|      0|                UWORD8 *pu1_u_dst = NULL, *pu1_v_dst = NULL;
  306|      0|                for(i = 0; i < ps_codec->i4_share_disp_buf_cnt; i++)
  ------------------
  |  Branch (306:28): [True: 0, False: 0]
  ------------------
  307|      0|                {
  308|      0|                    WORD32 diff = ps_disp_buf->pu1_luma - ps_codec->s_disp_buffer[i].pu1_bufs[0];
  309|      0|                    if(diff == (ps_codec->i4_strd * PAD_TOP + PAD_LEFT))
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                                  if(diff == (ps_codec->i4_strd * PAD_TOP + PAD_LEFT))
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  |  Branch (309:24): [True: 0, False: 0]
  ------------------
  310|      0|                    {
  311|      0|                        pu1_u_dst = ps_codec->s_disp_buffer[i].pu1_bufs[1];
  312|      0|                        pu1_u_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                                      pu1_u_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  313|       |
  314|      0|                        pu1_v_dst = ps_codec->s_disp_buffer[i].pu1_bufs[2];
  315|      0|                        pu1_v_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                                      pu1_v_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  316|      0|                        break;
  317|      0|                    }
  318|      0|                }
  319|      0|                ps_dec_op->s_disp_frm_buf.pv_u_buf = pu1_u_dst;
  320|      0|                ps_dec_op->s_disp_frm_buf.pv_v_buf = pu1_v_dst;
  321|      0|            }
  322|      0|            ps_dec_op->s_disp_frm_buf.u4_y_strd = ps_codec->i4_strd;
  323|      0|        }
  324|  67.7k|        else
  325|  67.7k|        {
  326|  67.7k|            ps_dec_op->s_disp_frm_buf.pv_y_buf =
  327|  67.7k|                            ps_dec_ip->s_out_buffer.pu1_bufs[0];
  328|  67.7k|            ps_dec_op->s_disp_frm_buf.pv_u_buf =
  329|  67.7k|                            ps_dec_ip->s_out_buffer.pu1_bufs[1];
  330|  67.7k|            ps_dec_op->s_disp_frm_buf.pv_v_buf =
  331|  67.7k|                            ps_dec_ip->s_out_buffer.pu1_bufs[2];
  332|  67.7k|            ps_dec_op->s_disp_frm_buf.u4_y_strd = ps_codec->i4_disp_strd;
  333|  67.7k|        }
  334|       |
  335|  67.7k|        if((IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (335:12): [True: 9.73k, False: 57.9k]
  ------------------
  336|  57.9k|                        || (IV_YUV_420SP_UV == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (336:28): [True: 8.01k, False: 49.9k]
  ------------------
  337|  17.7k|        {
  338|  17.7k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = ALIGN2(ps_dec_op->s_disp_frm_buf.u4_y_strd);
  ------------------
  |  |   55|  17.7k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  339|  17.7k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = 0;
  340|  17.7k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = ALIGN2(ps_dec_op->s_disp_frm_buf.u4_y_wd);
  ------------------
  |  |   55|  17.7k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  341|  17.7k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = 0;
  342|  17.7k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = (ps_dec_op->s_disp_frm_buf.u4_y_ht + 1) / 2;
  343|  17.7k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = 0;
  344|  17.7k|        }
  345|  49.9k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (345:17): [True: 34.4k, False: 15.4k]
  ------------------
  346|  34.4k|        {
  347|  34.4k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  348|  34.4k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  349|  34.4k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  350|  34.4k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  351|  34.4k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = (ps_dec_op->s_disp_frm_buf.u4_y_ht + 1) / 2;
  352|  34.4k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = (ps_dec_op->s_disp_frm_buf.u4_y_ht + 1) / 2;
  353|  34.4k|        }
  354|  15.4k|        else if(IV_YUV_444P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (354:17): [True: 0, False: 15.4k]
  ------------------
  355|      0|        {
  356|      0|            ps_dec_op->s_disp_frm_buf.u4_u_strd = ps_dec_op->s_disp_frm_buf.u4_y_strd;
  357|      0|            ps_dec_op->s_disp_frm_buf.u4_v_strd = ps_dec_op->s_disp_frm_buf.u4_y_strd;
  358|      0|            ps_dec_op->s_disp_frm_buf.u4_u_wd = ps_dec_op->s_disp_frm_buf.u4_y_wd;
  359|      0|            ps_dec_op->s_disp_frm_buf.u4_v_wd = ps_dec_op->s_disp_frm_buf.u4_y_wd;
  360|      0|            ps_dec_op->s_disp_frm_buf.u4_u_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht;
  361|      0|            ps_dec_op->s_disp_frm_buf.u4_v_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht;
  362|      0|        }
  363|  15.4k|        else if(IV_GRAY == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (363:17): [True: 13.8k, False: 1.59k]
  ------------------
  364|  13.8k|        {
  365|  13.8k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = 0;
  366|  13.8k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = 0;
  367|  13.8k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = 0;
  368|  13.8k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = 0;
  369|  13.8k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = 0;
  370|  13.8k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = 0;
  371|  13.8k|        }
  372|  1.59k|        else if(IV_YUV_422P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (372:17): [True: 1.59k, False: 0]
  ------------------
  373|  1.59k|        {
  374|  1.59k|            ps_dec_op->s_disp_frm_buf.u4_u_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  375|  1.59k|            ps_dec_op->s_disp_frm_buf.u4_v_strd = (ps_dec_op->s_disp_frm_buf.u4_y_strd + 1) / 2;
  376|  1.59k|            ps_dec_op->s_disp_frm_buf.u4_u_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  377|  1.59k|            ps_dec_op->s_disp_frm_buf.u4_v_wd = (ps_dec_op->s_disp_frm_buf.u4_y_wd + 1) / 2;
  378|  1.59k|            ps_dec_op->s_disp_frm_buf.u4_u_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht;
  379|  1.59k|            ps_dec_op->s_disp_frm_buf.u4_v_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht;
  380|  1.59k|        }
  381|       |
  382|  67.7k|    }
  383|   213k|    else if(ps_codec->i4_flush_mode)
  ------------------
  |  Branch (383:13): [True: 535, False: 212k]
  ------------------
  384|    535|    {
  385|    535|        ps_dec_op->u4_error_code = IHEVCD_END_OF_SEQUENCE;
  386|       |        /* Come out of flush mode */
  387|    535|        ps_codec->i4_flush_mode = 0;
  388|    535|    }
  389|       |
  390|   280k|    if(ps_codec->u1_enable_cu_info && ps_dec_op->u4_output_present)
  ------------------
  |  Branch (390:8): [True: 0, False: 280k]
  |  Branch (390:39): [True: 0, False: 0]
  ------------------
  391|      0|    {
  392|      0|        WORD32 info_map_dst_strd = ALIGN8(ps_codec->i4_wd) >> 3;
  ------------------
  |  |   53|      0|#define ALIGN8(x)   ((((x) + 7) >> 3) << 3)
  ------------------
  393|      0|        WORD32 info_map_src_strd = ALIGN64(ps_codec->i4_wd) >> 3;
  ------------------
  |  |   50|      0|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  394|      0|        WORD32 info_map_ht = ALIGN8(ps_codec->i4_ht);
  ------------------
  |  |   53|      0|#define ALIGN8(x)   ((((x) + 7) >> 3) << 3)
  ------------------
  395|      0|        UWORD32 info_map_size = (ALIGN8(ps_codec->i4_wd) * info_map_ht) >> 6;
  ------------------
  |  |   53|      0|#define ALIGN8(x)   ((((x) + 7) >> 3) << 3)
  ------------------
  396|      0|        WORD32 vert_8x8;
  397|      0|        UWORD8 *pu1_out_qp_map, *pu1_qp_map;
  398|      0|        UWORD8 *pu1_out_blk_type_map, *pu1_type_map;
  399|       |
  400|      0|        if(ps_hevcd_dec_ip->pu1_8x8_blk_qp_map)
  ------------------
  |  Branch (400:12): [True: 0, False: 0]
  ------------------
  401|      0|        {
  402|      0|            ps_hevcd_dec_op->pu1_8x8_blk_qp_map = ps_hevcd_dec_ip->pu1_8x8_blk_qp_map;
  403|      0|            ps_hevcd_dec_op->u4_8x8_blk_qp_map_size = info_map_size;
  404|       |
  405|      0|            pu1_out_qp_map = ps_hevcd_dec_op->pu1_8x8_blk_qp_map;
  406|      0|            pu1_qp_map = ps_codec->as_buf_id_info_map[ps_codec->i4_disp_buf_id].pu1_qp_map;
  407|      0|            for(vert_8x8 = 0; vert_8x8 < info_map_ht; vert_8x8++)
  ------------------
  |  Branch (407:31): [True: 0, False: 0]
  ------------------
  408|      0|            {
  409|      0|                memcpy(pu1_out_qp_map, pu1_qp_map, info_map_dst_strd);
  410|      0|                pu1_out_qp_map += info_map_dst_strd;
  411|      0|                pu1_qp_map += info_map_src_strd;
  412|      0|            }
  413|      0|        }
  414|       |
  415|      0|        if(ps_hevcd_dec_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (415:12): [True: 0, False: 0]
  ------------------
  416|      0|        {
  417|      0|            ps_hevcd_dec_op->pu1_8x8_blk_type_map = ps_hevcd_dec_ip->pu1_8x8_blk_type_map;
  418|      0|            ps_hevcd_dec_op->u4_8x8_blk_type_map_size = info_map_size;
  419|       |
  420|      0|            pu1_out_blk_type_map = ps_hevcd_dec_op->pu1_8x8_blk_type_map;
  421|      0|            pu1_type_map =
  422|      0|                ps_codec->as_buf_id_info_map[ps_codec->i4_disp_buf_id].pu1_cu_type_map;
  423|      0|            for(vert_8x8 = 0; vert_8x8 < info_map_ht; vert_8x8++)
  ------------------
  |  Branch (423:31): [True: 0, False: 0]
  ------------------
  424|      0|            {
  425|      0|                memcpy(pu1_out_blk_type_map, pu1_type_map, info_map_dst_strd);
  426|      0|                pu1_out_blk_type_map += info_map_dst_strd;
  427|      0|                pu1_type_map += info_map_src_strd;
  428|      0|            }
  429|      0|        }
  430|      0|    }
  431|   280k|}
ihevcd_decode.c:ihevcd_map_error:
  126|   280k|{
  127|   280k|    UWORD32 error_code = 0;
  128|   280k|    error_code = e_error;
  129|   280k|    switch(error_code)
  130|   280k|    {
  131|   196k|        case IHEVCD_SUCCESS :
  ------------------
  |  Branch (131:9): [True: 196k, False: 84.7k]
  ------------------
  132|   196k|            break;
  133|      0|        case IHEVCD_INIT_NOT_DONE:
  ------------------
  |  Branch (133:9): [True: 0, False: 280k]
  ------------------
  134|      0|        case IHEVCD_LEVEL_UNSUPPORTED:
  ------------------
  |  Branch (134:9): [True: 0, False: 280k]
  ------------------
  135|      0|        case IHEVCD_NUM_REF_UNSUPPORTED:
  ------------------
  |  Branch (135:9): [True: 0, False: 280k]
  ------------------
  136|      0|        case IHEVCD_NUM_REORDER_UNSUPPORTED:
  ------------------
  |  Branch (136:9): [True: 0, False: 280k]
  ------------------
  137|      0|        case IHEVCD_NUM_EXTRA_DISP_UNSUPPORTED:
  ------------------
  |  Branch (137:9): [True: 0, False: 280k]
  ------------------
  138|      0|        case IHEVCD_INSUFFICIENT_MEM_MVBANK:
  ------------------
  |  Branch (138:9): [True: 0, False: 280k]
  ------------------
  139|      0|        case IHEVCD_INSUFFICIENT_MEM_PICBUF:
  ------------------
  |  Branch (139:9): [True: 0, False: 280k]
  ------------------
  140|     66|        case IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC:
  ------------------
  |  Branch (140:9): [True: 66, False: 280k]
  ------------------
  141|  2.31k|        case IHEVCD_UNSUPPORTED_BIT_DEPTH:
  ------------------
  |  Branch (141:9): [True: 2.25k, False: 278k]
  ------------------
  142|  2.31k|        case IVD_MEM_ALLOC_FAILED:
  ------------------
  |  Branch (142:9): [True: 0, False: 280k]
  ------------------
  143|  3.61k|        case IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED:
  ------------------
  |  Branch (143:9): [True: 1.29k, False: 279k]
  ------------------
  144|  3.61k|            error_code |= 1 << IVD_FATALERROR;
  145|  3.61k|            break;
  146|      0|        case IHEVCD_INVALID_DISP_STRD:
  ------------------
  |  Branch (146:9): [True: 0, False: 280k]
  ------------------
  147|      0|        case IHEVCD_CXA_VERS_BUF_INSUFFICIENT:
  ------------------
  |  Branch (147:9): [True: 0, False: 280k]
  ------------------
  148|      0|        case IHEVCD_UNSUPPORTED_VPS_ID:
  ------------------
  |  Branch (148:9): [True: 0, False: 280k]
  ------------------
  149|  22.4k|        case IHEVCD_UNSUPPORTED_SPS_ID:
  ------------------
  |  Branch (149:9): [True: 22.4k, False: 258k]
  ------------------
  150|  23.3k|        case IHEVCD_UNSUPPORTED_PPS_ID:
  ------------------
  |  Branch (150:9): [True: 941, False: 279k]
  ------------------
  151|  23.3k|        case IHEVCD_BUF_MGR_ERROR:
  ------------------
  |  Branch (151:9): [True: 0, False: 280k]
  ------------------
  152|  23.9k|        case IHEVCD_NO_FREE_MVBANK:
  ------------------
  |  Branch (152:9): [True: 610, False: 280k]
  ------------------
  153|  23.9k|        case IHEVCD_NO_FREE_PICBUF:
  ------------------
  |  Branch (153:9): [True: 25, False: 280k]
  ------------------
  154|  23.9k|        case IHEVCD_SLICE_IN_HEADER_MODE:
  ------------------
  |  Branch (154:9): [True: 0, False: 280k]
  ------------------
  155|  23.9k|        case IHEVCD_END_OF_SEQUENCE:
  ------------------
  |  Branch (155:9): [True: 0, False: 280k]
  ------------------
  156|  23.9k|            break;
  157|  57.0k|        default:
  ------------------
  |  Branch (157:9): [True: 57.0k, False: 223k]
  ------------------
  158|  57.0k|            break;
  159|   280k|    }
  160|   280k|    return error_code;
  161|   280k|}

ihevcd_fmt_conv_420sp_to_420sp:
  127|   161k|{
  128|   161k|    UWORD8 *pu1_src, *pu1_dst;
  129|   161k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  130|   161k|    WORD32 i;
  131|       |
  132|       |    /* copy luma */
  133|   161k|    pu1_src = (UWORD8 *)pu1_y_src;
  134|   161k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  135|       |
  136|   161k|    num_rows = ht;
  137|   161k|    num_cols = wd;
  138|       |
  139|   161k|    src_strd = src_y_strd;
  140|   161k|    dst_strd = dst_y_strd;
  141|       |
  142|  7.08M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (142:16): [True: 6.92M, False: 161k]
  ------------------
  143|  6.92M|    {
  144|  6.92M|        memcpy(pu1_dst, pu1_src, num_cols);
  145|  6.92M|        pu1_dst += dst_strd;
  146|  6.92M|        pu1_src += src_strd;
  147|  6.92M|    }
  148|       |
  149|       |    /* copy U and V */
  150|   161k|    pu1_src = (UWORD8 *)pu1_uv_src;
  151|   161k|    pu1_dst = (UWORD8 *)pu1_uv_dst;
  152|       |
  153|   161k|    num_rows = ht >> 1;
  154|   161k|    num_cols = wd;
  155|       |
  156|   161k|    src_strd = src_uv_strd;
  157|   161k|    dst_strd = dst_uv_strd;
  158|       |
  159|  3.89M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (159:16): [True: 3.73M, False: 161k]
  ------------------
  160|  3.73M|    {
  161|  3.73M|        memcpy(pu1_dst, pu1_src, num_cols);
  162|  3.73M|        pu1_dst += dst_strd;
  163|  3.73M|        pu1_src += src_strd;
  164|  3.73M|    }
  165|   161k|    return;
  166|   161k|}
ihevcd_hbd_fmt_conv_420sp_to_420sp:
  178|  32.9k|{
  179|  32.9k|    UWORD8 *pu1_src, *pu1_dst;
  180|  32.9k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  181|  32.9k|    WORD32 i;
  182|       |
  183|       |    /* copy luma */
  184|  32.9k|    pu1_src = (UWORD8 *)pu2_y_src;
  185|  32.9k|    pu1_dst = (UWORD8 *)pu2_y_dst;
  186|       |
  187|  32.9k|    num_rows = ht;
  188|  32.9k|    num_cols = wd * sizeof(UWORD16);
  189|       |
  190|  32.9k|    src_strd = src_y_strd * sizeof(UWORD16);
  191|  32.9k|    dst_strd = dst_y_strd * sizeof(UWORD16);
  192|       |
  193|  1.46M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (193:16): [True: 1.43M, False: 32.9k]
  ------------------
  194|  1.43M|    {
  195|  1.43M|        memcpy(pu1_dst, pu1_src, num_cols);
  196|  1.43M|        pu1_dst += dst_strd;
  197|  1.43M|        pu1_src += src_strd;
  198|  1.43M|    }
  199|       |
  200|       |    /* copy U and V */
  201|  32.9k|    pu1_src = (UWORD8 *)pu2_uv_src;
  202|  32.9k|    pu1_dst = (UWORD8 *)pu2_uv_dst;
  203|       |
  204|  32.9k|    num_rows = ht >> 1;
  205|  32.9k|    num_cols = wd * sizeof(UWORD16);
  206|       |
  207|  32.9k|    src_strd = src_uv_strd * sizeof(UWORD16);
  208|  32.9k|    dst_strd = dst_uv_strd * sizeof(UWORD16);
  209|       |
  210|   767k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (210:16): [True: 734k, False: 32.9k]
  ------------------
  211|   734k|    {
  212|   734k|        memcpy(pu1_dst, pu1_src, num_cols);
  213|   734k|        pu1_dst += dst_strd;
  214|   734k|        pu1_src += src_strd;
  215|   734k|    }
  216|  32.9k|    return;
  217|  32.9k|}
ihevcd_fmt_conv_luma_copy:
  260|   316k|{
  261|   316k|    UWORD8 *pu1_src, *pu1_dst;
  262|   316k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  263|   316k|    WORD32 i;
  264|       |
  265|       |    /* copy luma */
  266|   316k|    pu1_src = (UWORD8 *)pu1_y_src;
  267|   316k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  268|       |
  269|   316k|    num_rows = ht;
  270|   316k|    num_cols = wd;
  271|       |
  272|   316k|    src_strd = src_y_strd;
  273|   316k|    dst_strd = dst_y_strd;
  274|       |
  275|  8.58M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (275:16): [True: 8.26M, False: 316k]
  ------------------
  276|  8.26M|    {
  277|  8.26M|        memcpy(pu1_dst, pu1_src, num_cols);
  278|  8.26M|        pu1_dst += dst_strd;
  279|  8.26M|        pu1_src += src_strd;
  280|  8.26M|    }
  281|   316k|    return;
  282|   316k|}
ihevcd_fmt_conv_400_to_420p:
  330|  1.25k|{
  331|  1.25k|    ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd);
  332|  51.8k|    for(int i = 0; i < ALIGN2(ht) / 2; i++)
  ------------------
  |  |   55|  51.8k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  |  Branch (332:20): [True: 50.6k, False: 1.25k]
  ------------------
  333|  50.6k|    {
  334|  50.6k|        memset(pu1_u_dst, 128, ALIGN2(wd) / 2);
  ------------------
  |  |   55|  50.6k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  335|  50.6k|        memset(pu1_v_dst, 128, ALIGN2(wd) / 2);
  ------------------
  |  |   55|  50.6k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  336|  50.6k|        pu1_u_dst += dst_uv_strd;
  337|  50.6k|        pu1_v_dst += dst_uv_strd;
  338|  50.6k|    }
  339|  1.25k|    return;
  340|  1.25k|}
ihevcd_hbd_fmt_conv_400_to_420p:
  372|  1.04k|{
  373|  1.04k|    UWORD16 *pu2_src = pu2_y_src;
  374|  1.04k|    UWORD16 *pu2_dst = pu2_y_dst;
  375|  1.04k|    WORD32 num_rows = ht;
  376|  1.04k|    WORD32 num_cols = wd;
  377|  1.04k|    WORD32 src_strd = src_y_strd;
  378|  1.04k|    WORD32 dst_strd = dst_y_strd;
  379|  1.04k|    WORD32 i, j;
  380|  1.04k|    UWORD16 neutral;
  381|       |
  382|  85.7k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (382:16): [True: 84.6k, False: 1.04k]
  ------------------
  383|  84.6k|    {
  384|  84.6k|        memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
  385|  84.6k|        pu2_dst += dst_strd;
  386|  84.6k|        pu2_src += src_strd;
  387|  84.6k|    }
  388|       |
  389|  1.04k|    neutral = (UWORD16)(1 << (bit_depth - 1));
  390|  44.8k|    for(i = 0; i < ALIGN2(ht) / 2; i++)
  ------------------
  |  |   55|  44.8k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  |  Branch (390:16): [True: 43.8k, False: 1.04k]
  ------------------
  391|  43.8k|    {
  392|  2.11M|        for(j = 0; j < ALIGN2(wd) / 2; j++)
  ------------------
  |  |   55|  2.11M|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  |  Branch (392:20): [True: 2.07M, False: 43.8k]
  ------------------
  393|  2.07M|        {
  394|  2.07M|            pu2_u_dst[j] = neutral;
  395|  2.07M|            pu2_v_dst[j] = neutral;
  396|  2.07M|        }
  397|  43.8k|        pu2_u_dst += dst_uv_strd;
  398|  43.8k|        pu2_v_dst += dst_uv_strd;
  399|  43.8k|    }
  400|  1.04k|    return;
  401|  1.04k|}
ihevcd_fmt_conv_420sp_to_420p:
  609|  82.8k|{
  610|  82.8k|    UWORD8 *pu1_src, *pu1_dst;
  611|  82.8k|    UWORD8 *pu1_u_src, *pu1_v_src;
  612|  82.8k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  613|  82.8k|    WORD32 i, j;
  614|       |
  615|  82.8k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (615:8): [True: 0, False: 82.8k]
  ------------------
  616|      0|    {
  617|       |        /* copy luma */
  618|      0|        pu1_src = (UWORD8 *)pu1_y_src;
  619|      0|        pu1_dst = (UWORD8 *)pu1_y_dst;
  620|       |
  621|      0|        num_rows = ht;
  622|      0|        num_cols = wd;
  623|       |
  624|      0|        src_strd = src_y_strd;
  625|      0|        dst_strd = dst_y_strd;
  626|       |
  627|      0|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (627:20): [True: 0, False: 0]
  ------------------
  628|      0|        {
  629|      0|            memcpy(pu1_dst, pu1_src, num_cols);
  630|      0|            pu1_dst += dst_strd;
  631|      0|            pu1_src += src_strd;
  632|      0|        }
  633|      0|    }
  634|       |    /* de-interleave U and V and copy to destination */
  635|  82.8k|    if(is_u_first)
  ------------------
  |  Branch (635:8): [True: 82.8k, False: 18.4E]
  ------------------
  636|  82.8k|    {
  637|  82.8k|        pu1_u_src = (UWORD8 *)pu1_uv_src;
  638|  82.8k|        pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  639|  82.8k|    }
  640|  18.4E|    else
  641|  18.4E|    {
  642|  18.4E|        pu1_u_src = (UWORD8 *)pu1_uv_src + 1;
  643|  18.4E|        pu1_v_src = (UWORD8 *)pu1_uv_src;
  644|  18.4E|    }
  645|       |
  646|       |
  647|  82.8k|    num_rows = ht >> 1;
  648|  82.8k|    num_cols = wd >> 1;
  649|       |
  650|  82.8k|    src_strd = src_uv_strd;
  651|  82.8k|    dst_strd = dst_uv_strd;
  652|       |
  653|  3.39M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (653:16): [True: 3.31M, False: 82.8k]
  ------------------
  654|  3.31M|    {
  655|   818M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (655:20): [True: 815M, False: 3.31M]
  ------------------
  656|   815M|        {
  657|   815M|            pu1_u_dst[j] = pu1_u_src[j * 2];
  658|   815M|            pu1_v_dst[j] = pu1_v_src[j * 2];
  659|   815M|        }
  660|       |
  661|  3.31M|        pu1_u_dst += dst_strd;
  662|  3.31M|        pu1_v_dst += dst_strd;
  663|  3.31M|        pu1_u_src += src_strd;
  664|  3.31M|        pu1_v_src += src_strd;
  665|  3.31M|    }
  666|  82.8k|    return;
  667|  82.8k|}
ihevcd_fmt_conv_422sp_to_422p:
  930|  10.7k|{
  931|  10.7k|    UWORD8 *pu1_u_src, *pu1_v_src;
  932|  10.7k|    WORD32 i, j;
  933|       |
  934|  10.7k|    ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd);
  935|       |
  936|  10.7k|    pu1_u_src = (UWORD8 *)pu1_uv_src;
  937|  10.7k|    pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  938|       |
  939|   380k|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (939:16): [True: 369k, False: 10.7k]
  ------------------
  940|   369k|    {
  941|  23.7M|        for(j = 0; j < (wd >> 1); j++)
  ------------------
  |  Branch (941:20): [True: 23.4M, False: 369k]
  ------------------
  942|  23.4M|        {
  943|  23.4M|            pu1_u_dst[j] = pu1_u_src[j * 2];
  944|  23.4M|            pu1_v_dst[j] = pu1_v_src[j * 2];
  945|  23.4M|        }
  946|       |
  947|   369k|        pu1_u_dst += dst_uv_strd;
  948|   369k|        pu1_v_dst += dst_uv_strd;
  949|   369k|        pu1_u_src += src_uv_strd;
  950|   369k|        pu1_v_src += src_uv_strd;
  951|   369k|    }
  952|  10.7k|    return;
  953|  10.7k|}
ihevcd_fmt_conv_422sp_to_420p:
  966|  9.13k|{
  967|  9.13k|    ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd);
  968|       |
  969|   224k|    for(WORD32 i = 0; i < ht; i += 2)
  ------------------
  |  Branch (969:23): [True: 215k, False: 9.13k]
  ------------------
  970|   215k|    {
  971|  12.8M|        for(WORD32 j = 0; j < wd; j += 2)
  ------------------
  |  Branch (971:27): [True: 12.5M, False: 215k]
  ------------------
  972|  12.5M|        {
  973|  12.5M|            WORD32 cb_sum = pu1_uv_src[j];
  974|  12.5M|            WORD32 cr_sum = pu1_uv_src[j + 1];
  975|       |
  976|  12.5M|            if((i + 1) < ht)
  ------------------
  |  Branch (976:16): [True: 12.5M, False: 1.57k]
  ------------------
  977|  12.5M|            {
  978|  12.5M|                cb_sum += pu1_uv_src[j + src_uv_strd] + 1;
  979|  12.5M|                cr_sum += pu1_uv_src[j + 1 + src_uv_strd] + 1;
  980|       |
  981|  12.5M|                cb_sum >>= 1;
  982|  12.5M|                cr_sum >>= 1;
  983|  12.5M|            }
  984|  12.5M|            pu1_u_dst[j / 2] = cb_sum;
  985|  12.5M|            pu1_v_dst[j / 2] = cr_sum;
  986|  12.5M|        }
  987|   215k|        pu1_u_dst += dst_uv_strd;
  988|   215k|        pu1_v_dst += dst_uv_strd;
  989|   215k|        pu1_uv_src += (src_uv_strd * 2);
  990|   215k|    }
  991|  9.13k|    return;
  992|  9.13k|}
ihevcd_hbd_fmt_conv_422sp_to_422p:
 1007|  3.71k|{
 1008|  3.71k|    UWORD16 *pu2_src, *pu2_dst;
 1009|  3.71k|    UWORD16 *pu2_u_src, *pu2_v_src;
 1010|  3.71k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
 1011|  3.71k|    WORD32 i, j;
 1012|       |
 1013|  3.71k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (1013:8): [True: 3.70k, False: 2]
  ------------------
 1014|  3.70k|    {
 1015|       |        /* copy luma */
 1016|  3.70k|        pu2_src = (UWORD16 *)pu2_y_src;
 1017|  3.70k|        pu2_dst = (UWORD16 *)pu2_y_dst;
 1018|       |
 1019|  3.70k|        num_rows = ht;
 1020|  3.70k|        num_cols = wd;
 1021|       |
 1022|  3.70k|        src_strd = src_y_strd;
 1023|  3.70k|        dst_strd = dst_y_strd;
 1024|       |
 1025|   129k|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1025:20): [True: 126k, False: 3.70k]
  ------------------
 1026|   126k|        {
 1027|   126k|            memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
 1028|   126k|            pu2_dst += dst_strd;
 1029|   126k|            pu2_src += src_strd;
 1030|   126k|        }
 1031|  3.70k|    }
 1032|       |    /* de-interleave U and V and copy to destination */
 1033|  3.71k|    if(is_u_first)
  ------------------
  |  Branch (1033:8): [True: 3.75k, False: 18.4E]
  ------------------
 1034|  3.75k|    {
 1035|  3.75k|        pu2_u_src = (UWORD16 *)pu2_uv_src;
 1036|  3.75k|        pu2_v_src = (UWORD16 *)pu2_uv_src + 1;
 1037|  3.75k|    }
 1038|  18.4E|    else
 1039|  18.4E|    {
 1040|  18.4E|        pu2_u_src = (UWORD16 *)pu2_uv_src + 1;
 1041|  18.4E|        pu2_v_src = (UWORD16 *)pu2_uv_src;
 1042|  18.4E|    }
 1043|       |
 1044|  3.71k|    num_rows = ht;
 1045|  3.71k|    num_cols = wd >> 1;
 1046|       |
 1047|  3.71k|    src_strd = src_uv_strd;
 1048|  3.71k|    dst_strd = dst_uv_strd;
 1049|       |
 1050|   134k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1050:16): [True: 130k, False: 3.71k]
  ------------------
 1051|   130k|    {
 1052|  13.1M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (1052:20): [True: 12.9M, False: 130k]
  ------------------
 1053|  12.9M|        {
 1054|  12.9M|            pu2_u_dst[j] = pu2_u_src[j * 2];
 1055|  12.9M|            pu2_v_dst[j] = pu2_v_src[j * 2];
 1056|  12.9M|        }
 1057|       |
 1058|   130k|        pu2_u_dst += dst_strd;
 1059|   130k|        pu2_v_dst += dst_strd;
 1060|   130k|        pu2_u_src += src_strd;
 1061|   130k|        pu2_v_src += src_strd;
 1062|   130k|    }
 1063|  3.71k|    return;
 1064|  3.71k|}
ihevcd_hbd_fmt_conv_422sp_to_420p:
 1079|  61.6k|{
 1080|  61.6k|    UWORD16 *pu2_src, *pu2_dst;
 1081|  61.6k|    UWORD16 *pu2_u_src, *pu2_v_src;
 1082|  61.6k|    WORD32 num_rows, num_cols;
 1083|  61.6k|    WORD32 i, j;
 1084|  61.6k|    WORD32 cb_sum, cr_sum;
 1085|       |
 1086|  61.6k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (1086:8): [True: 61.6k, False: 18.4E]
  ------------------
 1087|  61.6k|    {
 1088|       |        /* copy luma */
 1089|  61.6k|        pu2_src = (UWORD16 *)pu2_y_src;
 1090|  61.6k|        pu2_dst = (UWORD16 *)pu2_y_dst;
 1091|       |
 1092|  61.6k|        num_rows = ht;
 1093|  61.6k|        num_cols = wd;
 1094|       |
 1095|  3.26M|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1095:20): [True: 3.20M, False: 61.6k]
  ------------------
 1096|  3.20M|        {
 1097|  3.20M|            memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
 1098|  3.20M|            pu2_dst += dst_y_strd;
 1099|  3.20M|            pu2_src += src_y_strd;
 1100|  3.20M|        }
 1101|  61.6k|    }
 1102|       |
 1103|       |    /* de-interleave U and V, downsample vertically and copy to destination */
 1104|  61.6k|    if(is_u_first)
  ------------------
  |  Branch (1104:8): [True: 62.6k, False: 18.4E]
  ------------------
 1105|  62.6k|    {
 1106|  62.6k|        pu2_u_src = (UWORD16 *)pu2_uv_src;
 1107|  62.6k|        pu2_v_src = (UWORD16 *)pu2_uv_src + 1;
 1108|  62.6k|    }
 1109|  18.4E|    else
 1110|  18.4E|    {
 1111|  18.4E|        pu2_u_src = (UWORD16 *)pu2_uv_src + 1;
 1112|  18.4E|        pu2_v_src = (UWORD16 *)pu2_uv_src;
 1113|  18.4E|    }
 1114|       |
 1115|  61.6k|    num_rows = ht;
 1116|  61.6k|    num_cols = wd >> 1;
 1117|       |
 1118|  1.86M|    for(i = 0; i < num_rows; i += 2)
  ------------------
  |  Branch (1118:16): [True: 1.80M, False: 61.6k]
  ------------------
 1119|  1.80M|    {
 1120|   364M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (1120:20): [True: 362M, False: 1.80M]
  ------------------
 1121|   362M|        {
 1122|   362M|            cb_sum = pu2_u_src[j * 2];
 1123|   362M|            cr_sum = pu2_v_src[j * 2];
 1124|       |
 1125|   362M|            if((i + 1) < num_rows)
  ------------------
  |  Branch (1125:16): [True: 362M, False: 4.26k]
  ------------------
 1126|   362M|            {
 1127|   362M|                cb_sum += pu2_u_src[j * 2 + src_uv_strd] + 1;
 1128|   362M|                cr_sum += pu2_v_src[j * 2 + src_uv_strd] + 1;
 1129|       |
 1130|   362M|                cb_sum >>= 1;
 1131|   362M|                cr_sum >>= 1;
 1132|   362M|            }
 1133|   362M|            pu2_u_dst[j] = cb_sum;
 1134|   362M|            pu2_v_dst[j] = cr_sum;
 1135|   362M|        }
 1136|       |
 1137|  1.80M|        pu2_u_dst += dst_uv_strd;
 1138|  1.80M|        pu2_v_dst += dst_uv_strd;
 1139|  1.80M|        pu2_u_src += (src_uv_strd * 2);
 1140|  1.80M|        pu2_v_src += (src_uv_strd * 2);
 1141|  1.80M|    }
 1142|  61.6k|    return;
 1143|  61.6k|}
ihevcd_hbd_fmt_conv_420sp_to_420p:
 1158|  14.0k|{
 1159|  14.0k|    UWORD16 *pu2_src, *pu2_dst;
 1160|  14.0k|    UWORD16 *pu2_u_src, *pu2_v_src;
 1161|  14.0k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
 1162|  14.0k|    WORD32 i, j;
 1163|       |
 1164|  14.0k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (1164:8): [True: 0, False: 14.0k]
  ------------------
 1165|      0|    {
 1166|       |        /* copy luma */
 1167|      0|        pu2_src = (UWORD16 *)pu2_y_src;
 1168|      0|        pu2_dst = (UWORD16 *)pu2_y_dst;
 1169|       |
 1170|      0|        num_rows = ht;
 1171|      0|        num_cols = wd;
 1172|       |
 1173|      0|        src_strd = src_y_strd;
 1174|      0|        dst_strd = dst_y_strd;
 1175|       |
 1176|      0|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1176:20): [True: 0, False: 0]
  ------------------
 1177|      0|        {
 1178|      0|            memcpy(pu2_dst, pu2_src, num_cols * sizeof(UWORD16));
 1179|      0|            pu2_dst += dst_strd;
 1180|      0|            pu2_src += src_strd;
 1181|      0|        }
 1182|      0|    }
 1183|       |    /* de-interleave U and V and copy to destination */
 1184|  14.0k|    if(is_u_first)
  ------------------
  |  Branch (1184:8): [True: 14.0k, False: 18.4E]
  ------------------
 1185|  14.0k|    {
 1186|  14.0k|        pu2_u_src = (UWORD16 *)pu2_uv_src;
 1187|  14.0k|        pu2_v_src = (UWORD16 *)pu2_uv_src + 1;
 1188|  14.0k|    }
 1189|  18.4E|    else
 1190|  18.4E|    {
 1191|  18.4E|        pu2_u_src = (UWORD16 *)pu2_uv_src + 1;
 1192|  18.4E|        pu2_v_src = (UWORD16 *)pu2_uv_src;
 1193|  18.4E|    }
 1194|       |
 1195|       |
 1196|  14.0k|    num_rows = ht >> 1;
 1197|  14.0k|    num_cols = wd >> 1;
 1198|       |
 1199|  14.0k|    src_strd = src_uv_strd;
 1200|  14.0k|    dst_strd = dst_uv_strd;
 1201|       |
 1202|   338k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1202:16): [True: 324k, False: 14.0k]
  ------------------
 1203|   324k|    {
 1204|  13.4M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (1204:20): [True: 13.1M, False: 324k]
  ------------------
 1205|  13.1M|        {
 1206|  13.1M|            pu2_u_dst[j] = pu2_u_src[j * 2];
 1207|  13.1M|            pu2_v_dst[j] = pu2_v_src[j * 2];
 1208|  13.1M|        }
 1209|       |
 1210|   324k|        pu2_u_dst += dst_strd;
 1211|   324k|        pu2_v_dst += dst_strd;
 1212|   324k|        pu2_u_src += src_strd;
 1213|   324k|        pu2_v_src += src_strd;
 1214|   324k|    }
 1215|  14.0k|    return;
 1216|  14.0k|}
ihevcd_fmt_conv:
 1254|   701k|{
 1255|   701k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1256|   701k|    pic_buf_t *ps_disp_pic;
 1257|   701k|    UWORD8 *pu1_y_src, *pu1_uv_src;
 1258|   701k|    UWORD8 *pu1_y_dst_tmp, *pu1_uv_dst_tmp;
 1259|   701k|    UWORD8 *pu1_u_dst_tmp, *pu1_v_dst_tmp;
 1260|   701k|    WORD32 is_u_first;
 1261|   701k|    UWORD8 *pu1_luma;
 1262|   701k|    UWORD8 *pu1_chroma;
 1263|   701k|    sps_t *ps_sps;
 1264|   701k|    WORD32 disable_luma_copy;
 1265|   701k|    WORD32 crop_unit_x, crop_unit_y;
 1266|   701k|    WORD32 h_samp_factor, v_samp_factor;
 1267|   701k|    WORD32 src_chroma_pixel_strd = 2;
 1268|   701k|    WORD32 src_chroma_row_stride;
 1269|       |
 1270|   701k|    if(0 == num_rows)
  ------------------
  |  Branch (1270:8): [True: 975, False: 700k]
  ------------------
 1271|    975|        return ret;
 1272|       |
 1273|       |    /* In case processing is disabled, then no need to format convert/copy */
 1274|   700k|    PROFILE_DISABLE_FMT_CONV();
  ------------------
  |  |   78|   700k|#define PROFILE_DISABLE_FMT_CONV();
  ------------------
 1275|   700k|    ps_sps = ps_proc->ps_sps;
 1276|       |
 1277|   700k|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (1277:21): [True: 0, False: 700k]
  ------------------
 1278|   700k|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (1278:21): [True: 594k, False: 106k]
  ------------------
 1279|       |
 1280|   700k|    crop_unit_x = 1;
 1281|   700k|    crop_unit_y = 1;
 1282|       |
 1283|   700k|    if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1283:8): [True: 594k, False: 106k]
  ------------------
 1284|   594k|    {
 1285|   594k|        crop_unit_x = 2;
 1286|   594k|        crop_unit_y = 2;
 1287|   594k|    }
 1288|   106k|    else if(CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1288:13): [True: 102k, False: 3.37k]
  ------------------
 1289|   102k|    {
 1290|   102k|        crop_unit_x = 2;
 1291|   102k|        crop_unit_y = 1;
 1292|   102k|    }
 1293|       |
 1294|   700k|    ps_disp_pic = ps_codec->ps_disp_buf;
 1295|   700k|    pu1_luma = ps_disp_pic->pu1_luma;
 1296|   700k|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1296:8): [True: 696k, False: 4.02k]
  ------------------
 1297|   696k|    {
 1298|   696k|        pu1_chroma = ps_disp_pic->pu1_chroma;
 1299|   696k|    }
 1300|       |
 1301|       |
 1302|       |    /* Take care of cropping */
 1303|   700k|    pu1_luma    +=
 1304|   700k|        (ps_codec->i4_strd * ps_sps->i2_pic_crop_top_offset * crop_unit_y + ps_sps->i2_pic_crop_left_offset * crop_unit_x) *
 1305|   700k|        ps_codec->i4_pixel_size_y;
 1306|       |
 1307|   700k|    src_chroma_row_stride = (ps_codec->i4_strd * src_chroma_pixel_strd / h_samp_factor);
 1308|   700k|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1308:8): [True: 696k, False: 4.13k]
  ------------------
 1309|   696k|    {
 1310|   696k|        pu1_chroma += ((ps_sps->i2_pic_crop_top_offset * src_chroma_row_stride)
 1311|   696k|                        + ps_sps->i2_pic_crop_left_offset * src_chroma_pixel_strd) * ps_codec->i4_pixel_size_uv;
 1312|   696k|    }
 1313|   700k|    is_u_first = (IV_YUV_420SP_UV == ps_codec->e_ref_chroma_fmt) ? 1 : 0;
  ------------------
  |  Branch (1313:18): [True: 616k, False: 83.6k]
  ------------------
 1314|       |
 1315|       |    /* In case of 420P output luma copy is disabled for shared mode */
 1316|   700k|    disable_luma_copy = 0;
 1317|   700k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (1317:8): [True: 0, False: 700k]
  ------------------
 1318|      0|    {
 1319|      0|        disable_luma_copy = 1;
 1320|      0|    }
 1321|       |
 1322|       |
 1323|       |
 1324|   700k|    {
 1325|   700k|        pu1_y_src   = pu1_luma + cur_row * ps_codec->i4_strd * ps_codec->i4_pixel_size_y;
 1326|   700k|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1326:12): [True: 696k, False: 4.21k]
  ------------------
 1327|   696k|        {
 1328|   696k|            pu1_uv_src = pu1_chroma + (((cur_row / v_samp_factor) * src_chroma_row_stride) * ps_codec->i4_pixel_size_uv);
 1329|   696k|        }
 1330|       |
 1331|       |        /* In case of shared mode, with 420P output, get chroma destination */
 1332|   700k|        if((1 == ps_codec->i4_share_disp_buf) && (IV_YUV_420P == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (1332:12): [True: 0, False: 700k]
  |  Branch (1332:50): [True: 0, False: 0]
  ------------------
 1333|      0|        {
 1334|      0|            WORD32 i;
 1335|      0|            for(i = 0; i < ps_codec->i4_share_disp_buf_cnt; i++)
  ------------------
  |  Branch (1335:24): [True: 0, False: 0]
  ------------------
 1336|      0|            {
 1337|      0|                WORD32 diff = ps_disp_pic->pu1_luma - ps_codec->s_disp_buffer[i].pu1_bufs[0];
 1338|      0|                if(diff == (ps_codec->i4_strd * PAD_TOP + PAD_LEFT))
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                              if(diff == (ps_codec->i4_strd * PAD_TOP + PAD_LEFT))
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  |  Branch (1338:20): [True: 0, False: 0]
  ------------------
 1339|      0|                {
 1340|      0|                    pu1_u_dst = ps_codec->s_disp_buffer[i].pu1_bufs[1];
 1341|      0|                    pu1_u_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                                  pu1_u_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
 1342|       |
 1343|      0|                    pu1_v_dst = ps_codec->s_disp_buffer[i].pu1_bufs[2];
 1344|      0|                    pu1_v_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                                  pu1_v_dst += (ps_codec->i4_strd * PAD_TOP) / 4 + (PAD_LEFT / 2);
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
 1345|      0|                    break;
 1346|      0|                }
 1347|      0|            }
 1348|      0|        }
 1349|   700k|        pu1_y_dst_tmp  = pu1_y_dst  + cur_row * ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_y;
 1350|   700k|        if(IV_YUV_444P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1350:12): [True: 0, False: 700k]
  ------------------
 1351|      0|        {
 1352|      0|            pu1_u_dst_tmp = pu1_u_dst + cur_row * ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_uv;
 1353|      0|            pu1_v_dst_tmp = pu1_v_dst + cur_row * ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_uv;
 1354|      0|        }
 1355|   700k|        else if(IV_YUV_422P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1355:17): [True: 14.9k, False: 685k]
  ------------------
 1356|  14.9k|        {
 1357|  14.9k|            pu1_u_dst_tmp = pu1_u_dst + cur_row * ((ps_codec->i4_disp_strd + 1) / 2) * ps_codec->i4_pixel_size_uv;
 1358|  14.9k|            pu1_v_dst_tmp = pu1_v_dst + cur_row * ((ps_codec->i4_disp_strd + 1) / 2) * ps_codec->i4_pixel_size_uv;
 1359|  14.9k|        }
 1360|   685k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1360:17): [True: 187k, False: 497k]
  ------------------
 1361|   187k|        {
 1362|   187k|            pu1_u_dst_tmp = pu1_u_dst + ((cur_row + 1) / 2) * ((ps_codec->i4_disp_strd + 1) / 2) * ps_codec->i4_pixel_size_uv;
 1363|   187k|            pu1_v_dst_tmp = pu1_v_dst + ((cur_row + 1) / 2) * ((ps_codec->i4_disp_strd + 1) / 2) * ps_codec->i4_pixel_size_uv;
 1364|   187k|        }
 1365|   497k|        else if(IV_YUV_420SP_UV == ps_codec->e_chroma_fmt
  ------------------
  |  Branch (1365:17): [True: 116k, False: 381k]
  ------------------
 1366|   381k|                        || IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1366:28): [True: 82.8k, False: 299k]
  ------------------
 1367|   197k|        {
 1368|   197k|            pu1_uv_dst_tmp = pu1_u_dst + ((cur_row + 1) / 2) * ALIGN2(ps_codec->i4_disp_strd) * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |   55|   197k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
 1369|   197k|        }
 1370|       |
 1371|       |        /* In case of multi threaded implementation, format conversion might be called
 1372|       |         * before reconstruction is completed. If the frame being converted/copied
 1373|       |         * is same as the frame being reconstructed,
 1374|       |         * Check how many rows can be format converted
 1375|       |         * Convert those many rows and then check for remaining rows and so on
 1376|       |         */
 1377|       |
 1378|   700k|        if((0 == ps_codec->i4_flush_mode) && (ps_codec->i4_disp_buf_id == ps_proc->i4_cur_pic_buf_id) && (1 < ps_codec->i4_num_cores))
  ------------------
  |  Branch (1378:12): [True: 698k, False: 2.04k]
  |  Branch (1378:46): [True: 685k, False: 13.3k]
  |  Branch (1378:106): [True: 664k, False: 20.6k]
  ------------------
 1379|   664k|        {
 1380|   664k|            WORD32 idx;
 1381|   664k|            UWORD8 *pu1_buf;
 1382|   664k|            WORD32 status;
 1383|   664k|            WORD32 last_row = cur_row + num_rows;
 1384|   664k|            WORD32 last_ctb_y;
 1385|   664k|            UWORD32 ctb_in_row;
 1386|       |
 1387|  13.8M|            while(1)
  ------------------
  |  Branch (1387:19): [True: 13.8M, Folded]
  ------------------
 1388|  13.8M|            {
 1389|  13.8M|                last_row = cur_row + MAX(num_rows, (1 << ps_sps->i1_log2_ctb_size)) +
  ------------------
  |  |   42|  13.8M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 13.8M]
  |  |  ------------------
  ------------------
 1390|  13.8M|                                ps_sps->i2_pic_crop_top_offset * crop_unit_y;
 1391|  13.8M|                last_ctb_y = (last_row >> ps_sps->i1_log2_ctb_size) - 1;
 1392|       |                /* Since deblocking works with a shift of -4, -4 ,wait till next CTB row is processed */
 1393|  13.8M|                last_ctb_y++;
 1394|       |                /* In case of a  conformance window, an extra wait of one row might be needed */
 1395|  13.8M|                last_ctb_y++;
 1396|  13.8M|                last_ctb_y = MIN(last_ctb_y, (ps_sps->i2_pic_ht_in_ctb - 1));
  ------------------
  |  |   43|  13.8M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 7.68M, False: 6.19M]
  |  |  ------------------
  ------------------
 1397|       |
 1398|  13.8M|                idx = (last_ctb_y * ps_sps->i2_pic_wd_in_ctb);
 1399|       |
 1400|       |                /*Check if the row below is completely processed before proceeding with format conversion*/
 1401|  13.8M|                status = 1;
 1402|   537M|                for(ctb_in_row = 0; (WORD32)ctb_in_row < ps_sps->i2_pic_wd_in_ctb; ctb_in_row++)
  ------------------
  |  Branch (1402:37): [True: 523M, False: 13.8M]
  ------------------
 1403|   523M|                {
 1404|   523M|                    pu1_buf = (ps_codec->pu1_proc_map + idx + ctb_in_row);
 1405|   523M|                    status &= *pu1_buf;
 1406|   523M|                }
 1407|       |
 1408|  13.8M|                if(status)
  ------------------
  |  Branch (1408:20): [True: 658k, False: 13.2M]
  ------------------
 1409|   658k|                {
 1410|   658k|                    break;
 1411|   658k|                }
 1412|  13.2M|                else
 1413|  13.2M|                {
 1414|  13.2M|                    ithread_yield();
 1415|  13.2M|                }
 1416|  13.8M|            }
 1417|   664k|        }
 1418|       |
 1419|   700k|        if((IV_YUV_420SP_UV == ps_codec->e_chroma_fmt) || (IV_YUV_420SP_VU == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (1419:12): [True: 121k, False: 578k]
  |  Branch (1419:59): [True: 82.1k, False: 496k]
  ------------------
 1420|   196k|        {
 1421|   196k|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1421:16): [True: 196k, False: 18.4E]
  ------------------
 1422|   196k|            {
 1423|   196k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   196k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1423:20): [True: 163k, False: 33.0k]
  ------------------
 1424|   163k|                {
 1425|   163k|                    ihevcd_fmt_conv_420sp_to_420sp_ft *fmt_conv_fptr;
 1426|   163k|                    if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|   163k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (1426:24): [True: 144k, False: 18.9k]
  ------------------
 1427|   144k|                    {
 1428|   144k|                        fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr;
 1429|   144k|                    }
 1430|  18.9k|                    else
 1431|  18.9k|                    {
 1432|  18.9k|                        fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420sp;
 1433|  18.9k|                    }
 1434|   163k|                    fmt_conv_fptr(pu1_y_src, pu1_uv_src,
 1435|   163k|                                  pu1_y_dst_tmp, pu1_uv_dst_tmp,
 1436|   163k|                                  ps_codec->i4_disp_wd, num_rows,
 1437|   163k|                                  ps_codec->i4_strd, ps_codec->i4_strd,
 1438|   163k|                                  ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1439|   163k|                }
 1440|  33.0k|                else
 1441|  33.0k|                {
 1442|  33.0k|                    ihevcd_hbd_fmt_conv_420sp_to_420sp((UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1443|  33.0k|                                                       (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_uv_dst_tmp,
 1444|  33.0k|                                                       ps_codec->i4_disp_wd, num_rows,
 1445|  33.0k|                                                       ps_codec->i4_strd, ps_codec->i4_strd,
 1446|  33.0k|                                                       ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1447|  33.0k|                }
 1448|   196k|            }
 1449|  18.4E|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1449:21): [True: 0, False: 18.4E]
  ------------------
 1450|      0|            {
 1451|      0|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|      0|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1451:20): [True: 0, False: 0]
  ------------------
 1452|      0|                {
 1453|      0|                    ihevcd_fmt_conv_400_to_420sp(pu1_y_src,
 1454|      0|                                                 pu1_y_dst_tmp, pu1_uv_dst_tmp,
 1455|      0|                                                 ps_codec->i4_disp_wd, num_rows,
 1456|      0|                                                 ps_codec->i4_strd,
 1457|      0|                                                 ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1458|      0|                }
 1459|      0|                else
 1460|      0|                {
 1461|      0|                    ihevcd_hbd_fmt_conv_400_to_420sp((UWORD16 *)pu1_y_src,
 1462|      0|                                                     (UWORD16 *)pu1_y_dst_tmp,
 1463|      0|                                                     (UWORD16 *)pu1_uv_dst_tmp,
 1464|      0|                                                     ps_codec->i4_disp_wd, num_rows,
 1465|      0|                                                     ps_codec->i4_strd,
 1466|      0|                                                     ps_codec->i4_disp_strd, ps_codec->i4_disp_strd,
 1467|      0|                                                     ps_sps->i1_bit_depth_luma_minus8 + 8);
 1468|      0|                }
 1469|      0|            }
 1470|   196k|        }
 1471|   504k|        else if(IV_GRAY == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1471:17): [True: 297k, False: 207k]
  ------------------
 1472|   297k|        {
 1473|   297k|            ihevcd_fmt_conv_luma_copy(pu1_y_src,
 1474|   297k|                                      pu1_y_dst_tmp,
 1475|   297k|                                      ps_codec->i4_disp_wd * ps_codec->i4_pixel_size_y,
 1476|   297k|                                      num_rows,
 1477|   297k|                                      ps_codec->i4_strd * ps_codec->i4_pixel_size_y,
 1478|   297k|                                      ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_y);
 1479|   297k|        }
 1480|   207k|        else if(IV_YUV_444P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1480:17): [True: 0, False: 207k]
  ------------------
 1481|      0|        {
 1482|      0|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1482:16): [True: 0, False: 0]
  ------------------
 1483|      0|            {
 1484|      0|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|      0|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1484:20): [True: 0, False: 0]
  ------------------
 1485|      0|                {
 1486|      0|                    ps_codec->s_func_selector.ihevcd_fmt_conv_444sp_to_444p_fptr(
 1487|      0|                                                    pu1_y_src, pu1_uv_src,
 1488|      0|                                                    pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1489|      0|                                                    ps_codec->i4_disp_wd, num_rows,
 1490|      0|                                                    ps_codec->i4_strd, src_chroma_row_stride,
 1491|      0|                                                    ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1492|      0|                }
 1493|      0|                else
 1494|      0|                {
 1495|      0|                    ihevcd_fmt_conv_hbd_444sp_to_444p((UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1496|      0|                                                      (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_u_dst_tmp,
 1497|      0|                                                      (UWORD16 *)pu1_v_dst_tmp, ps_codec->i4_disp_wd, num_rows,
 1498|      0|                                                      ps_codec->i4_strd, src_chroma_row_stride,
 1499|      0|                                                      ps_codec->i4_disp_strd, ps_codec->i4_disp_strd);
 1500|      0|                }
 1501|      0|            }
 1502|      0|        }
 1503|   207k|        else if(IV_YUV_422P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1503:17): [True: 14.6k, False: 192k]
  ------------------
 1504|  14.6k|        {
 1505|  14.6k|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1505:16): [True: 14.6k, False: 18.4E]
  ------------------
 1506|  14.6k|            {
 1507|  14.6k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  14.6k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1507:20): [True: 10.8k, False: 3.79k]
  ------------------
 1508|  10.8k|                {
 1509|  10.8k|                    ihevcd_fmt_conv_422sp_to_422p(pu1_y_src, pu1_uv_src,
 1510|  10.8k|                                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1511|  10.8k|                                                  ps_codec->i4_disp_wd, num_rows,
 1512|  10.8k|                                                  ps_codec->i4_strd, ps_codec->i4_strd,
 1513|  10.8k|                                                  ps_codec->i4_disp_strd,
 1514|  10.8k|                                                  ((ps_codec->i4_disp_strd + 1) / 2));
 1515|  10.8k|                }
 1516|  3.79k|                else
 1517|  3.79k|                {
 1518|  3.79k|                    ihevcd_hbd_fmt_conv_422sp_to_422p((UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1519|  3.79k|                                                      (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_u_dst_tmp,
 1520|  3.79k|                                                      (UWORD16 *)pu1_v_dst_tmp, ps_codec->i4_disp_wd, num_rows,
 1521|  3.79k|                                                      ps_codec->i4_strd, ps_codec->i4_strd,
 1522|  3.79k|                                                      ps_codec->i4_disp_strd, ((ps_codec->i4_disp_strd + 1) / 2),
 1523|  3.79k|                                                      is_u_first, disable_luma_copy);
 1524|  3.79k|                }
 1525|  14.6k|            }
 1526|  14.6k|        }
 1527|   192k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1527:17): [True: 183k, False: 9.06k]
  ------------------
 1528|   183k|        {
 1529|   183k|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1529:16): [True: 2.31k, False: 181k]
  ------------------
 1530|  2.31k|            {
 1531|  2.31k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  2.31k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1531:20): [True: 1.26k, False: 1.05k]
  ------------------
 1532|  1.26k|                {
 1533|  1.26k|                    ihevcd_fmt_conv_400_to_420p(pu1_y_src,
 1534|  1.26k|                                                pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1535|  1.26k|                                                ps_codec->i4_disp_wd, num_rows,
 1536|  1.26k|                                                ps_codec->i4_strd,
 1537|  1.26k|                                                ps_codec->i4_disp_strd,
 1538|  1.26k|                                                ((ps_codec->i4_disp_strd + 1) / 2));
 1539|  1.26k|                }
 1540|  1.05k|                else
 1541|  1.05k|                {
 1542|  1.05k|                    ihevcd_hbd_fmt_conv_400_to_420p((UWORD16 *)pu1_y_src,
 1543|  1.05k|                                                    (UWORD16 *)pu1_y_dst_tmp,
 1544|  1.05k|                                                    (UWORD16 *)pu1_u_dst_tmp,
 1545|  1.05k|                                                    (UWORD16 *)pu1_v_dst_tmp,
 1546|  1.05k|                                                    ps_codec->i4_disp_wd, num_rows,
 1547|  1.05k|                                                    ps_codec->i4_strd,
 1548|  1.05k|                                                    ps_codec->i4_disp_strd,
 1549|  1.05k|                                                    ((ps_codec->i4_disp_strd + 1) / 2),
 1550|  1.05k|                                                    ps_sps->i1_bit_depth_luma_minus8 + 8);
 1551|  1.05k|                }
 1552|  2.31k|            }
 1553|   181k|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1553:21): [True: 109k, False: 71.3k]
  ------------------
 1554|   109k|            {
 1555|   109k|                ihevcd_fmt_conv_420sp_to_420p_ft *fmt_conv_fptr;
 1556|   109k|                if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|   109k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (1556:20): [True: 99.6k, False: 10.3k]
  ------------------
 1557|  99.6k|                {
 1558|  99.6k|                    fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr;
 1559|  99.6k|                }
 1560|  10.3k|                else
 1561|  10.3k|                {
 1562|  10.3k|                    fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420p;
 1563|  10.3k|                }
 1564|       |
 1565|   109k|                if(0 == disable_luma_copy)
  ------------------
  |  Branch (1565:20): [True: 110k, False: 18.4E]
  ------------------
 1566|   110k|                {
 1567|       |                    // copy luma
 1568|   110k|                    WORD32 i;
 1569|   110k|                    WORD32 num_cols = ps_codec->i4_disp_wd * ps_codec->i4_pixel_size_y;
 1570|       |
 1571|  9.19M|                    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (1571:32): [True: 9.08M, False: 110k]
  ------------------
 1572|  9.08M|                    {
 1573|  9.08M|                        memcpy(pu1_y_dst_tmp, pu1_y_src, num_cols);
 1574|  9.08M|                        pu1_y_dst_tmp += ps_codec->i4_disp_strd * ps_codec->i4_pixel_size_y;
 1575|  9.08M|                        pu1_y_src += ps_codec->i4_strd * ps_codec->i4_pixel_size_y;
 1576|  9.08M|                    }
 1577|       |
 1578|   110k|                    disable_luma_copy = 1;
 1579|   110k|                }
 1580|       |
 1581|   109k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   109k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1581:20): [True: 95.6k, False: 14.3k]
  ------------------
 1582|  95.6k|                {
 1583|  95.6k|                    fmt_conv_fptr(pu1_y_src, pu1_uv_src,
 1584|  95.6k|                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1585|  95.6k|                                  ps_codec->i4_disp_wd,
 1586|  95.6k|                                  num_rows,
 1587|  95.6k|                                  ps_codec->i4_strd,
 1588|  95.6k|                                  ps_codec->i4_strd,
 1589|  95.6k|                                  ps_codec->i4_disp_strd,
 1590|  95.6k|                                  (ps_codec->i4_disp_strd / 2),
 1591|  95.6k|                                  is_u_first,
 1592|  95.6k|                                  disable_luma_copy);
 1593|  95.6k|                }
 1594|  14.3k|                else
 1595|  14.3k|                {
 1596|  14.3k|                    ps_codec->s_func_selector.ihevcd_hbd_fmt_conv_420sp_to_420p_fptr(
 1597|  14.3k|                                    (UWORD16 *)pu1_y_src, (UWORD16 *)pu1_uv_src,
 1598|  14.3k|                                    (UWORD16 *)pu1_y_dst_tmp, (UWORD16 *)pu1_u_dst_tmp,
 1599|  14.3k|                                    (UWORD16 *)pu1_v_dst_tmp,
 1600|  14.3k|                                    ps_codec->i4_disp_wd,
 1601|  14.3k|                                    num_rows,
 1602|  14.3k|                                    ps_codec->i4_strd,
 1603|  14.3k|                                    ps_codec->i4_strd,
 1604|  14.3k|                                    ps_codec->i4_disp_strd,
 1605|  14.3k|                                    (ps_codec->i4_disp_strd / 2),
 1606|  14.3k|                                    is_u_first,
 1607|  14.3k|                                    disable_luma_copy);
 1608|  14.3k|                }
 1609|   109k|            }
 1610|  71.3k|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1610:21): [True: 0, False: 71.3k]
  ------------------
 1611|      0|            {
 1612|      0|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|      0|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1612:20): [True: 0, False: 0]
  ------------------
 1613|      0|                {
 1614|      0|                    ihevcd_fmt_conv_444sp_to_420p(pu1_y_src, pu1_uv_src,
 1615|      0|                                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1616|      0|                                                  ps_codec->i4_disp_wd, num_rows,
 1617|      0|                                                  ps_codec->i4_strd, src_chroma_row_stride,
 1618|      0|                                                  ps_codec->i4_disp_strd,
 1619|      0|                                                  ((ps_codec->i4_disp_strd + 1) / 2));
 1620|      0|                }
 1621|      0|                else
 1622|      0|                {
 1623|      0|                    ihevcd_hbd_fmt_conv_444sp_to_420p((UWORD16 *)pu1_y_src,
 1624|      0|                                                      (UWORD16 *)pu1_uv_src,
 1625|      0|                                                      (UWORD16 *)pu1_y_dst_tmp,
 1626|      0|                                                      (UWORD16 *)pu1_u_dst_tmp,
 1627|      0|                                                      (UWORD16 *)pu1_v_dst_tmp,
 1628|      0|                                                      ps_codec->i4_disp_wd, num_rows,
 1629|      0|                                                      ps_codec->i4_strd, src_chroma_row_stride,
 1630|      0|                                                      ps_codec->i4_disp_strd,
 1631|      0|                                                      ((ps_codec->i4_disp_strd + 1) / 2),
 1632|      0|                                                      is_u_first, disable_luma_copy);
 1633|      0|                }
 1634|      0|            }
 1635|  71.3k|            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1635:21): [True: 71.5k, False: 18.4E]
  ------------------
 1636|  71.5k|            {
 1637|  71.5k|                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  71.5k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1637:20): [True: 9.17k, False: 62.4k]
  ------------------
 1638|  9.17k|                {
 1639|  9.17k|                    ihevcd_fmt_conv_422sp_to_420p(pu1_y_src, pu1_uv_src,
 1640|  9.17k|                                                  pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
 1641|  9.17k|                                                  ps_codec->i4_disp_wd, num_rows,
 1642|  9.17k|                                                  ps_codec->i4_strd, src_chroma_row_stride,
 1643|  9.17k|                                                  ps_codec->i4_disp_strd,
 1644|  9.17k|                                                  ((ps_codec->i4_disp_strd + 1) / 2));
 1645|  9.17k|                }
 1646|  62.4k|                else
 1647|  62.4k|                {
 1648|  62.4k|                    ihevcd_hbd_fmt_conv_422sp_to_420p((UWORD16 *)pu1_y_src,
 1649|  62.4k|                                                      (UWORD16 *)pu1_uv_src,
 1650|  62.4k|                                                      (UWORD16 *)pu1_y_dst_tmp,
 1651|  62.4k|                                                      (UWORD16 *)pu1_u_dst_tmp,
 1652|  62.4k|                                                      (UWORD16 *)pu1_v_dst_tmp,
 1653|  62.4k|                                                      ps_codec->i4_disp_wd, num_rows,
 1654|  62.4k|                                                      ps_codec->i4_strd, src_chroma_row_stride,
 1655|  62.4k|                                                      ps_codec->i4_disp_strd,
 1656|  62.4k|                                                      ((ps_codec->i4_disp_strd + 1) / 2),
 1657|  62.4k|                                                      is_u_first, disable_luma_copy);
 1658|  62.4k|                }
 1659|  71.5k|            }
 1660|   183k|        }
 1661|   700k|    }
 1662|   700k|    return (ret);
 1663|   701k|}

ihevcd_init_function_ptr_generic:
   60|  58.1k|{
   61|  58.1k|    ps_func_selector->ihevc_deblk_chroma_horz_fptr                      =  &ihevc_deblk_chroma_horz;
   62|  58.1k|    ps_func_selector->ihevc_deblk_chroma_vert_fptr                      =  &ihevc_deblk_chroma_vert;
   63|  58.1k|    ps_func_selector->ihevc_deblk_luma_vert_fptr                        =  &ihevc_deblk_luma_vert;
   64|  58.1k|    ps_func_selector->ihevc_deblk_luma_horz_fptr                        =  &ihevc_deblk_luma_horz;
   65|  58.1k|    ps_func_selector->ihevc_deblk_422chroma_horz_fptr                   =  &ihevc_deblk_422chroma_horz;
   66|  58.1k|    ps_func_selector->ihevc_deblk_422chroma_vert_fptr                   =  &ihevc_deblk_422chroma_vert;
   67|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_copy_fptr                 =  &ihevc_inter_pred_chroma_copy;
   68|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr          =  &ihevc_inter_pred_chroma_copy_w16out;
   69|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_horz_fptr                 =  &ihevc_inter_pred_chroma_horz;
   70|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr          =  &ihevc_inter_pred_chroma_horz_w16out;
   71|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_fptr                 =  &ihevc_inter_pred_chroma_vert;
   72|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr          =  &ihevc_inter_pred_chroma_vert_w16inp;
   73|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr   =  &ihevc_inter_pred_chroma_vert_w16inp_w16out;
   74|  58.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr          =  &ihevc_inter_pred_chroma_vert_w16out;
   75|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_horz_fptr                   =  &ihevc_inter_pred_luma_horz;
   76|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_fptr                   =  &ihevc_inter_pred_luma_vert;
   77|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr            =  &ihevc_inter_pred_luma_vert_w16out;
   78|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr            =  &ihevc_inter_pred_luma_vert_w16inp;
   79|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_copy_fptr                   =  &ihevc_inter_pred_luma_copy;
   80|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr            =  &ihevc_inter_pred_luma_copy_w16out;
   81|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr            =  &ihevc_inter_pred_luma_horz_w16out;
   82|  58.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr     =  &ihevc_inter_pred_luma_vert_w16inp_w16out;
   83|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr     =  &ihevc_intra_pred_chroma_ref_substitution;
   84|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr       =  &ihevc_intra_pred_luma_ref_substitution;
   85|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr   =  &ihevc_intra_pred_luma_ref_subst_all_avlble;
   86|  58.1k|    ps_func_selector->ihevc_intra_pred_ref_filtering_fptr               =  &ihevc_intra_pred_ref_filtering;
   87|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr        =  &ihevc_intra_pred_chroma_ref_filtering;
   88|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_dc_fptr                   =  &ihevc_intra_pred_chroma_dc;
   89|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_horz_fptr                 =  &ihevc_intra_pred_chroma_horz;
   90|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr                =  &ihevc_intra_pred_chroma_mode2;
   91|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr           =  &ihevc_intra_pred_chroma_mode_18_34;
   92|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr        =  &ihevc_intra_pred_chroma_mode_27_to_33;
   93|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr          =  &ihevc_intra_pred_chroma_mode_3_to_9;
   94|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_planar_fptr               =  &ihevc_intra_pred_chroma_planar;
   95|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_ver_fptr                  =  &ihevc_intra_pred_chroma_ver;
   96|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr        =  &ihevc_intra_pred_chroma_mode_11_to_17;
   97|  58.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr        =  &ihevc_intra_pred_chroma_mode_19_to_25;
   98|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr          =  &ihevc_intra_pred_luma_mode_11_to_17;
   99|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr          =  &ihevc_intra_pred_luma_mode_19_to_25;
  100|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_dc_fptr                     =  &ihevc_intra_pred_luma_dc;
  101|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_horz_fptr                   =  &ihevc_intra_pred_luma_horz;
  102|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_mode2_fptr                  =  &ihevc_intra_pred_luma_mode2;
  103|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr             =  &ihevc_intra_pred_luma_mode_18_34;
  104|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr          =  &ihevc_intra_pred_luma_mode_27_to_33;
  105|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr            =  &ihevc_intra_pred_luma_mode_3_to_9;
  106|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_planar_fptr                 =  &ihevc_intra_pred_luma_planar;
  107|  58.1k|    ps_func_selector->ihevc_intra_pred_luma_ver_fptr                    =  &ihevc_intra_pred_luma_ver;
  108|  58.1k|    ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr                  =  &ihevc_itrans_res_4x4_ttype1;
  109|  58.1k|    ps_func_selector->ihevc_itrans_res_4x4_fptr                         =  &ihevc_itrans_res_4x4;
  110|  58.1k|    ps_func_selector->ihevc_itrans_res_8x8_fptr                         =  &ihevc_itrans_res_8x8;
  111|  58.1k|    ps_func_selector->ihevc_itrans_res_16x16_fptr                       =  &ihevc_itrans_res_16x16;
  112|  58.1k|    ps_func_selector->ihevc_itrans_res_32x32_fptr                       =  &ihevc_itrans_res_32x32;
  113|  58.1k|    ps_func_selector->ihevc_itrans_res_dc_fptr                          =  &ihevc_itrans_res_dc;
  114|  58.1k|    ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr                =  &ihevc_itrans_recon_4x4_ttype1;
  115|  58.1k|    ps_func_selector->ihevc_itrans_recon_4x4_fptr                       =  &ihevc_itrans_recon_4x4;
  116|  58.1k|    ps_func_selector->ihevc_itrans_recon_8x8_fptr                       =  &ihevc_itrans_recon_8x8;
  117|  58.1k|    ps_func_selector->ihevc_itrans_recon_16x16_fptr                     =  &ihevc_itrans_recon_16x16;
  118|  58.1k|    ps_func_selector->ihevc_itrans_recon_32x32_fptr                     =  &ihevc_itrans_recon_32x32;
  119|  58.1k|    ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr                =  &ihevc_chroma_itrans_recon_4x4;
  120|  58.1k|    ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr                =  &ihevc_chroma_itrans_recon_8x8;
  121|  58.1k|    ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr              =  &ihevc_chroma_itrans_recon_16x16;
  122|  58.1k|    ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr              =  &ihevc_chroma_itrans_recon_32x32;
  123|  58.1k|    ps_func_selector->ihevc_recon_4x4_ttype1_fptr                       =  &ihevc_recon_4x4_ttype1;
  124|  58.1k|    ps_func_selector->ihevc_recon_4x4_fptr                              =  &ihevc_recon_4x4;
  125|  58.1k|    ps_func_selector->ihevc_recon_8x8_fptr                              =  &ihevc_recon_8x8;
  126|  58.1k|    ps_func_selector->ihevc_recon_16x16_fptr                            =  &ihevc_recon_16x16;
  127|  58.1k|    ps_func_selector->ihevc_recon_32x32_fptr                            =  &ihevc_recon_32x32;
  128|  58.1k|    ps_func_selector->ihevc_chroma_recon_4x4_fptr                       =  &ihevc_chroma_recon_4x4;
  129|  58.1k|    ps_func_selector->ihevc_chroma_recon_8x8_fptr                       =  &ihevc_chroma_recon_8x8;
  130|  58.1k|    ps_func_selector->ihevc_chroma_recon_16x16_fptr                     =  &ihevc_chroma_recon_16x16;
  131|  58.1k|    ps_func_selector->ihevc_chroma_recon_32x32_fptr                     =  &ihevc_chroma_recon_32x32;
  132|  58.1k|    ps_func_selector->ihevc_memset_16bit_fptr                           =  &ihevc_memset_16bit;
  133|  58.1k|    ps_func_selector->ihevc_pad_left_luma_fptr                          =  &ihevc_pad_left_luma;
  134|  58.1k|    ps_func_selector->ihevc_pad_left_chroma_fptr                        =  &ihevc_pad_left_chroma;
  135|  58.1k|    ps_func_selector->ihevc_pad_right_luma_fptr                         =  &ihevc_pad_right_luma;
  136|  58.1k|    ps_func_selector->ihevc_pad_right_chroma_fptr                       =  &ihevc_pad_right_chroma;
  137|  58.1k|    ps_func_selector->ihevc_weighted_pred_bi_fptr                       =  &ihevc_weighted_pred_bi;
  138|  58.1k|    ps_func_selector->ihevc_weighted_pred_bi_default_fptr               =  &ihevc_weighted_pred_bi_default;
  139|  58.1k|    ps_func_selector->ihevc_weighted_pred_uni_fptr                      =  &ihevc_weighted_pred_uni;
  140|  58.1k|    ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr                =  &ihevc_weighted_pred_chroma_bi;
  141|  58.1k|    ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr               =  &ihevc_weighted_pred_chroma_uni;
  142|  58.1k|    ps_func_selector->ihevc_sao_band_offset_luma_fptr                   =  &ihevc_sao_band_offset_luma;
  143|  58.1k|    ps_func_selector->ihevc_sao_band_offset_chroma_fptr                 =  &ihevc_sao_band_offset_chroma;
  144|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class0_fptr                 =  &ihevc_sao_edge_offset_class0;
  145|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr          =  &ihevc_sao_edge_offset_class0_chroma;
  146|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class1_fptr                 =  &ihevc_sao_edge_offset_class1;
  147|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr          =  &ihevc_sao_edge_offset_class1_chroma;
  148|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class2_fptr                 =  &ihevc_sao_edge_offset_class2;
  149|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr          =  &ihevc_sao_edge_offset_class2_chroma;
  150|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class3_fptr                 =  &ihevc_sao_edge_offset_class3;
  151|  58.1k|    ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr          =  &ihevc_sao_edge_offset_class3_chroma;
  152|  58.1k|    ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr               =  &ihevcd_fmt_conv_420sp_to_420sp;
  153|  58.1k|    ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr                =  &ihevcd_fmt_conv_420sp_to_420p;
  154|  58.1k|    ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr                =  &ihevcd_fmt_conv_444sp_to_444p;
  155|  58.1k|    ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr                  =  &ihevcd_itrans_recon_dc_luma;
  156|  58.1k|    ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr                =  &ihevcd_itrans_recon_dc_chroma;
  157|       |
  158|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_ref_substitution_fptr   = &ihevc_hbd_intra_pred_luma_ref_substitution;
  159|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_ref_filtering_fptr           = &ihevc_hbd_intra_pred_ref_filtering;
  160|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_ref_substitution_fptr = &ihevc_hbd_intra_pred_chroma_ref_substitution;
  161|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_ref_filtering_fptr    = &ihevc_hbd_intra_pred_chroma_ref_filtering;
  162|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_planar_fptr             = &ihevc_hbd_intra_pred_luma_planar;
  163|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_dc_fptr                 = &ihevc_hbd_intra_pred_luma_dc;
  164|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_mode2_fptr              = &ihevc_hbd_intra_pred_luma_mode2;
  165|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_mode_3_to_9_fptr        = &ihevc_hbd_intra_pred_luma_mode_3_to_9;
  166|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_horz_fptr               = &ihevc_hbd_intra_pred_luma_horz;
  167|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_mode_11_to_17_fptr      = &ihevc_hbd_intra_pred_luma_mode_11_to_17;
  168|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_mode_18_34_fptr         = &ihevc_hbd_intra_pred_luma_mode_18_34;
  169|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_mode_19_to_25_fptr      = &ihevc_hbd_intra_pred_luma_mode_19_to_25;
  170|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_ver_fptr                = &ihevc_hbd_intra_pred_luma_ver;
  171|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_luma_mode_27_to_33_fptr      = &ihevc_hbd_intra_pred_luma_mode_27_to_33;
  172|       |
  173|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_planar_fptr           = &ihevc_hbd_intra_pred_chroma_planar;
  174|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_dc_fptr               = &ihevc_hbd_intra_pred_chroma_dc;
  175|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_mode2_fptr            = &ihevc_hbd_intra_pred_chroma_mode2;
  176|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_mode_3_to_9_fptr      = &ihevc_hbd_intra_pred_chroma_mode_3_to_9;
  177|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_horz_fptr             = &ihevc_hbd_intra_pred_chroma_horz;
  178|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_mode_11_to_17_fptr    = &ihevc_hbd_intra_pred_chroma_mode_11_to_17;
  179|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_mode_18_34_fptr       = &ihevc_hbd_intra_pred_chroma_mode_18_34;
  180|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_mode_19_to_25_fptr    = &ihevc_hbd_intra_pred_chroma_mode_19_to_25;
  181|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_ver_fptr              = &ihevc_hbd_intra_pred_chroma_ver;
  182|  58.1k|    ps_func_selector->ihevc_hbd_intra_pred_chroma_mode_27_to_33_fptr    = &ihevc_hbd_intra_pred_chroma_mode_27_to_33;
  183|       |
  184|  58.1k|    ps_func_selector->ihevc_hbd_itrans_recon_4x4_ttype1_fptr            = &ihevc_hbd_itrans_recon_4x4_ttype1;
  185|  58.1k|    ps_func_selector->ihevc_hbd_itrans_recon_4x4_fptr                   = &ihevc_hbd_itrans_recon_4x4;
  186|  58.1k|    ps_func_selector->ihevc_hbd_itrans_recon_8x8_fptr                   = &ihevc_hbd_itrans_recon_8x8;
  187|  58.1k|    ps_func_selector->ihevc_hbd_itrans_recon_16x16_fptr                 = &ihevc_hbd_itrans_recon_16x16;
  188|  58.1k|    ps_func_selector->ihevc_hbd_itrans_recon_32x32_fptr                 = &ihevc_hbd_itrans_recon_32x32;
  189|  58.1k|    ps_func_selector->ihevc_hbd_chroma_itrans_recon_4x4_fptr            = &ihevc_hbd_chroma_itrans_recon_4x4;
  190|  58.1k|    ps_func_selector->ihevc_hbd_chroma_itrans_recon_8x8_fptr            = &ihevc_hbd_chroma_itrans_recon_8x8;
  191|  58.1k|    ps_func_selector->ihevc_hbd_chroma_itrans_recon_16x16_fptr          = &ihevc_hbd_chroma_itrans_recon_16x16;
  192|  58.1k|    ps_func_selector->ihevc_hbd_chroma_itrans_recon_32x32_fptr          = &ihevc_hbd_chroma_itrans_recon_32x32;
  193|       |
  194|  58.1k|    ps_func_selector->ihevc_hbd_recon_4x4_ttype1_fptr                   = &ihevc_hbd_recon_4x4_ttype1;
  195|  58.1k|    ps_func_selector->ihevc_hbd_recon_4x4_fptr                          = &ihevc_hbd_recon_4x4;
  196|  58.1k|    ps_func_selector->ihevc_hbd_recon_8x8_fptr                          = &ihevc_hbd_recon_8x8;
  197|  58.1k|    ps_func_selector->ihevc_hbd_recon_16x16_fptr                        = &ihevc_hbd_recon_16x16;
  198|  58.1k|    ps_func_selector->ihevc_hbd_recon_32x32_fptr                        = &ihevc_hbd_recon_32x32;
  199|  58.1k|    ps_func_selector->ihevc_hbd_chroma_recon_4x4_fptr                   = &ihevc_hbd_chroma_recon_4x4;
  200|  58.1k|    ps_func_selector->ihevc_hbd_chroma_recon_8x8_fptr                   = &ihevc_hbd_chroma_recon_8x8;
  201|  58.1k|    ps_func_selector->ihevc_hbd_chroma_recon_16x16_fptr                 = &ihevc_hbd_chroma_recon_16x16;
  202|  58.1k|    ps_func_selector->ihevc_hbd_chroma_recon_32x32_fptr                 = &ihevc_hbd_chroma_recon_32x32;
  203|       |
  204|  58.1k|    ps_func_selector->ihevc_hbd_deblk_luma_vert_fptr                    = &ihevc_hbd_deblk_luma_vert;
  205|  58.1k|    ps_func_selector->ihevc_hbd_deblk_luma_horz_fptr                    = &ihevc_hbd_deblk_luma_horz;
  206|  58.1k|    ps_func_selector->ihevc_hbd_deblk_chroma_vert_fptr                  = &ihevc_hbd_deblk_chroma_vert;
  207|  58.1k|    ps_func_selector->ihevc_hbd_deblk_chroma_horz_fptr                  = &ihevc_hbd_deblk_chroma_horz;
  208|  58.1k|    ps_func_selector->ihevc_hbd_sao_band_offset_luma_fptr               = &ihevc_hbd_sao_band_offset_luma;
  209|  58.1k|    ps_func_selector->ihevc_hbd_sao_band_offset_chroma_fptr             = &ihevc_hbd_sao_band_offset_chroma;
  210|       |
  211|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class0_fptr             = &ihevc_hbd_sao_edge_offset_class0;
  212|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class1_fptr             = &ihevc_hbd_sao_edge_offset_class1;
  213|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class2_fptr             = &ihevc_hbd_sao_edge_offset_class2;
  214|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class3_fptr             = &ihevc_hbd_sao_edge_offset_class3;
  215|       |
  216|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class0_chroma_fptr      = &ihevc_hbd_sao_edge_offset_class0_chroma;
  217|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class1_chroma_fptr      = &ihevc_hbd_sao_edge_offset_class1_chroma;
  218|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class2_chroma_fptr      = &ihevc_hbd_sao_edge_offset_class2_chroma;
  219|  58.1k|    ps_func_selector->ihevc_hbd_sao_edge_offset_class3_chroma_fptr      = &ihevc_hbd_sao_edge_offset_class3_chroma;
  220|       |
  221|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_copy_fptr               = &ihevc_hbd_inter_pred_luma_copy;
  222|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_vert_fptr               = &ihevc_hbd_inter_pred_luma_vert;
  223|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_horz_fptr               = &ihevc_hbd_inter_pred_luma_horz;
  224|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_horz_w16out_fptr        = &ihevc_hbd_inter_pred_luma_horz_w16out;
  225|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_copy_w16out_fptr        = &ihevc_hbd_inter_pred_luma_copy_w16out;
  226|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_vert_w16out_fptr        = &ihevc_hbd_inter_pred_luma_vert_w16out;
  227|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_vert_w16inp_fptr        = &ihevc_hbd_inter_pred_luma_vert_w16inp;
  228|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_hbd_inter_pred_luma_vert_w16inp_w16out;
  229|       |
  230|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_copy_fptr             = &ihevc_hbd_inter_pred_chroma_copy;
  231|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_vert_fptr             = &ihevc_hbd_inter_pred_chroma_vert;
  232|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_horz_fptr             = &ihevc_hbd_inter_pred_chroma_horz;
  233|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_horz_w16out_fptr      = &ihevc_hbd_inter_pred_chroma_horz_w16out;
  234|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_copy_w16out_fptr      = &ihevc_hbd_inter_pred_chroma_copy_w16out;
  235|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_vert_w16out_fptr      = &ihevc_hbd_inter_pred_chroma_vert_w16out;
  236|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_vert_w16inp_fptr      = &ihevc_hbd_inter_pred_chroma_vert_w16inp;
  237|  58.1k|    ps_func_selector->ihevc_hbd_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_hbd_inter_pred_chroma_vert_w16inp_w16out;
  238|  58.1k|    ps_func_selector->ihevc_hbd_weighted_pred_uni_fptr                  = &ihevc_hbd_weighted_pred_uni;
  239|  58.1k|    ps_func_selector->ihevc_hbd_weighted_pred_bi_fptr                   = &ihevc_hbd_weighted_pred_bi;
  240|  58.1k|    ps_func_selector->ihevc_hbd_weighted_pred_bi_default_fptr           = &ihevc_hbd_weighted_pred_bi_default;
  241|  58.1k|    ps_func_selector->ihevc_hbd_weighted_pred_chroma_uni_fptr           = &ihevc_hbd_weighted_pred_chroma_uni;
  242|  58.1k|    ps_func_selector->ihevc_hbd_weighted_pred_chroma_bi_fptr            = &ihevc_hbd_weighted_pred_chroma_bi;
  243|  58.1k|    ps_func_selector->ihevc_hbd_pad_left_luma_fptr                      = &ihevc_hbd_pad_left_luma;
  244|  58.1k|    ps_func_selector->ihevc_hbd_pad_right_luma_fptr                     = &ihevc_hbd_pad_right_luma;
  245|  58.1k|    ps_func_selector->ihevc_hbd_pad_left_chroma_fptr                    = &ihevc_hbd_pad_left_chroma;
  246|       |
  247|  58.1k|    ps_func_selector->ihevcd_hbd_fmt_conv_420sp_to_420p_fptr            = &ihevcd_hbd_fmt_conv_420sp_to_420p;
  248|  58.1k|    ps_func_selector->ihevcd_hbd_itrans_recon_dc_luma_fptr              = &ihevcd_hbd_itrans_recon_dc_luma;
  249|  58.1k|    ps_func_selector->ihevcd_hbd_itrans_recon_dc_chroma_fptr            = &ihevcd_hbd_itrans_recon_dc_chroma;
  250|  58.1k|}

ihevcd_get_mv_ctb:
  108|  4.20M|{
  109|       |
  110|  4.20M|    WORD32 i;
  111|  4.20M|    sps_t *ps_sps;
  112|  4.20M|    pps_t *ps_pps;
  113|  4.20M|    pu_t *ps_pu;
  114|  4.20M|    tile_t *ps_tile;
  115|  4.20M|    UWORD8 *pu1_pic_pu_map_ctb;
  116|  4.20M|    WORD32 num_minpu_in_ctb;
  117|  4.20M|    WORD32 ctb_start_pu_idx;
  118|  4.20M|    UWORD32 *pu4_top_pu_idx, *pu4_left_pu_idx, *pu4_top_left_pu_idx;
  119|  4.20M|    WORD32 pu_x_in_4x4, pu_y_in_4x4;
  120|  4.20M|    WORD32 pu_x_in_4x4_single_mcl, pu_y_in_4x4_single_mcl;
  121|  4.20M|    pu_mv_t s_pred_mv;
  122|  4.20M|    WORD32 ctb_size, ctb_size_in_min_pu;
  123|  4.20M|    WORD32 num_pu_per_ctb, pu_wd, pu_ht, pu_cnt;
  124|  4.20M|    WORD32  pu_wd_single_mcl, pu_ht_single_mcl;
  125|  4.20M|    UWORD32 au4_nbr_avail[MAX_CTB_SIZE / MIN_PU_SIZE
  126|  4.20M|                    + 2 /* Top nbr + bot nbr */];
  127|  4.20M|    UWORD32 *pu4_nbr_pu_idx/* (Left + ctb_size + right ) * (top + ctb_size + bottom) */;
  128|  4.20M|    WORD32 top_avail_bits;
  129|  4.20M|    UWORD8 u1_lb_avail, u1_l_avail, u1_t_avail, u1_tr_avail, u1_tl_avail;
  130|  4.20M|    WORD32 nbr_pu_idx_strd;
  131|  4.20M|    WORD32 cb_size;
  132|  4.20M|    WORD32 single_mcl_flag;
  133|       |
  134|  4.20M|    PROFILE_DISABLE_MV_PREDICTION();
  ------------------
  |  |   90|  4.20M|#define PROFILE_DISABLE_MV_PREDICTION() ;
  ------------------
  135|  4.20M|    ps_sps = ps_mv_ctxt->ps_sps;
  136|  4.20M|    ps_pps = ps_mv_ctxt->ps_pps;
  137|  4.20M|    ps_pu = ps_mv_ctxt->ps_pu;
  138|  4.20M|    ps_tile = ps_mv_ctxt->ps_tile;
  139|       |
  140|  4.20M|    pu4_nbr_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx_map;
  141|       |
  142|  4.20M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  143|       |
  144|  4.20M|    ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  4.20M|#define MIN_PU_SIZE         4
  ------------------
  145|       |
  146|  4.20M|    num_minpu_in_ctb = ctb_size_in_min_pu * ctb_size_in_min_pu;
  147|  4.20M|    pu1_pic_pu_map_ctb = ps_mv_ctxt->pu1_pic_pu_map + (ps_mv_ctxt->i4_ctb_x + ps_mv_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb) * num_minpu_in_ctb;
  148|       |
  149|  4.20M|    num_pu_per_ctb = ps_mv_ctxt->i4_ctb_pu_cnt;
  150|  4.20M|    ctb_start_pu_idx = ps_mv_ctxt->i4_ctb_start_pu_idx;
  151|  4.20M|    nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  4.20M|#define MAX_CTB_SIZE        64
  ------------------
                  nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  4.20M|#define MIN_PU_SIZE         4
  ------------------
  152|       |
  153|  4.20M|    {
  154|       |        /* Updating the initial availability map */
  155|  4.20M|        WORD32 i;
  156|  4.20M|        UWORD32 u4_left_ctb_avail, u4_top_lt_ctb_avail, u4_top_rt_ctb_avail,
  157|  4.20M|                        u4_top_ctb_avail;
  158|       |
  159|  4.20M|        u4_left_ctb_avail = ps_mv_ctxt->u1_left_ctb_avail;
  160|  4.20M|        u4_top_lt_ctb_avail = ps_mv_ctxt->u1_top_lt_ctb_avail;
  161|  4.20M|        u4_top_ctb_avail = ps_mv_ctxt->u1_top_ctb_avail;
  162|  4.20M|        u4_top_rt_ctb_avail = ps_mv_ctxt->u1_top_rt_ctb_avail;
  163|       |
  164|       |        /* Initializing the availability array */
  165|  4.20M|        memset(au4_nbr_avail, 0,
  166|  4.20M|               (MAX_CTB_SIZE / MIN_PU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  351|  4.20M|#define MAX_CTB_SIZE        64
  ------------------
                             (MAX_CTB_SIZE / MIN_PU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  367|  4.20M|#define MIN_PU_SIZE         4
  ------------------
  167|       |        /* Initializing the availability array with CTB level availability flags */
  168|  4.20M|        {
  169|  4.20M|            WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  170|  4.20M|                            - (ps_mv_ctxt->i4_ctb_y << ps_sps->i1_log2_ctb_size);
  171|  4.20M|            WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  4.20M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 4.06M, False: 144k]
  |  |  ------------------
  ------------------
  172|  38.9M|            for(i = 0; i < ctb_size_left / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|  38.9M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (172:24): [True: 34.7M, False: 4.20M]
  ------------------
  173|  34.7M|            {
  174|  34.7M|                au4_nbr_avail[i + 1] = (u4_left_ctb_avail << 31);
  175|  34.7M|            }
  176|  4.20M|        }
  177|  4.20M|        au4_nbr_avail[0] |= ((u4_top_rt_ctb_avail << 31)
  178|  4.20M|                        >> (1 + ctb_size_in_min_pu)); /* 1+ctb_size/4 position bit pos from msb */
  179|       |
  180|  4.20M|        au4_nbr_avail[0] |= (u4_top_lt_ctb_avail << 31);
  181|  4.20M|        {
  182|  4.20M|            WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples
  183|  4.20M|                            - (ps_mv_ctxt->i4_ctb_x << ps_sps->i1_log2_ctb_size);
  184|  4.20M|            WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  4.20M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.84M, False: 357k]
  |  |  ------------------
  ------------------
  185|  4.20M|            WORD32 shift = (31 - (ctb_size / MIN_TU_SIZE));
  ------------------
  |  |  358|  4.20M|#define MIN_TU_SIZE         4
  ------------------
  186|       |
  187|       |            /* ctb_size_top gives number of valid pixels remaining in the current row */
  188|       |            /* Since we need pattern of 1's starting from the MSB, an additional shift */
  189|       |            /* is needed */
  190|  4.20M|            shift += ((ctb_size - ctb_size_top) / MIN_TU_SIZE);
  ------------------
  |  |  358|  4.20M|#define MIN_TU_SIZE         4
  ------------------
  191|       |
  192|  4.20M|            top_avail_bits = ((1 << (ctb_size_top / MIN_PU_SIZE)) - 1) << shift;
  ------------------
  |  |  367|  4.20M|#define MIN_PU_SIZE         4
  ------------------
  193|  4.20M|        }
  194|       |
  195|  4.20M|        au4_nbr_avail[0] |= ((u4_top_ctb_avail == 1) ? top_avail_bits : 0x0);
  ------------------
  |  Branch (195:30): [True: 3.93M, False: 272k]
  ------------------
  196|       |        /* Starting from msb 2nd bit to (1+ctb_size/4) bit, set 1 if top avail,or 0 */
  197|       |
  198|  4.20M|    }
  199|       |
  200|  4.20M|    {
  201|       |        /* In case of a  tile boundary, left and top arrays must change*/
  202|       |        /*Left*/
  203|       |        /* If start of tile row*/
  204|  4.20M|        if(((ps_tile->u1_pos_x) == (ps_mv_ctxt->i4_ctb_x)) && (ps_mv_ctxt->i4_ctb_x != 0))
  ------------------
  |  Branch (204:12): [True: 472k, False: 3.73M]
  |  Branch (204:63): [True: 65.6k, False: 407k]
  ------------------
  205|  65.6k|        {
  206|  65.6k|            WORD32 index_pic_map;
  207|  65.6k|            WORD32 ctb_pu_idx;
  208|  65.6k|            UWORD8 *pu1_pic_pu_map;
  209|       |
  210|       |            /* Goto the left ctb which belongs to another tile */
  211|  65.6k|            index_pic_map = ((ps_mv_ctxt->i4_ctb_x - 1) + ps_mv_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  212|  65.6k|            ctb_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx[index_pic_map];
  213|  65.6k|            index_pic_map *= num_minpu_in_ctb;
  214|       |
  215|       |            /*Replicate the PUs of the last column of the left ctb*/
  216|  65.6k|            pu1_pic_pu_map = ps_mv_ctxt->pu1_pic_pu_map + index_pic_map + ctb_size_in_min_pu - 1;
  217|   621k|            for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (217:24): [True: 556k, False: 65.6k]
  ------------------
  218|   556k|            {
  219|       |                /* Left neighbors change*/
  220|   556k|                pu4_ctb_left_pu_idx[i] = ctb_pu_idx + (WORD32)*pu1_pic_pu_map;
  221|   556k|                pu1_pic_pu_map = pu1_pic_pu_map + ctb_size_in_min_pu;
  222|   556k|            }
  223|       |
  224|       |
  225|       |            /* Top left ctb is a valid neighbor only when a row above exists */
  226|  65.6k|            if(ps_mv_ctxt->i4_ctb_y != 0)
  ------------------
  |  Branch (226:16): [True: 63.0k, False: 2.64k]
  ------------------
  227|  63.0k|            {
  228|  63.0k|                index_pic_map = ((ps_mv_ctxt->i4_ctb_x - 1) + (ps_mv_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  229|  63.0k|                ctb_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx[index_pic_map];
  230|  63.0k|                index_pic_map *= num_minpu_in_ctb;
  231|  63.0k|                index_pic_map += (num_minpu_in_ctb - 1);
  232|  63.0k|                pu4_ctb_top_left_pu_idx[0] = ctb_pu_idx + ps_mv_ctxt->pu1_pic_pu_map[index_pic_map];
  233|  63.0k|            }
  234|  65.6k|        }
  235|       |        /*Top*/
  236|       |        /* If start of tile column*/
  237|  4.20M|        if(((ps_tile->u1_pos_y) == (ps_mv_ctxt->i4_ctb_y)) && (ps_mv_ctxt->i4_ctb_y != 0))
  ------------------
  |  Branch (237:12): [True: 282k, False: 3.92M]
  |  Branch (237:63): [True: 116k, False: 165k]
  ------------------
  238|   116k|        {
  239|   116k|            WORD32 index_pic_map;
  240|   116k|            WORD32 ctb_pu_idx;
  241|   116k|            UWORD8 *pu1_pic_pu_map;
  242|       |
  243|       |            /* Goto the top ctb which belongs to another tile */
  244|   116k|            index_pic_map =  (ps_mv_ctxt->i4_ctb_x) + ((ps_mv_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  245|   116k|            ctb_pu_idx = ps_mv_ctxt->pu4_pic_pu_idx[index_pic_map];
  246|   116k|            index_pic_map *= num_minpu_in_ctb;
  247|       |
  248|       |            /*Replicate the PUs of the last row of the top ctb*/
  249|   116k|            pu1_pic_pu_map = ps_mv_ctxt->pu1_pic_pu_map + index_pic_map + (ctb_size_in_min_pu * (ctb_size_in_min_pu - 1));
  250|  1.20M|            for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (250:24): [True: 1.09M, False: 116k]
  ------------------
  251|  1.09M|            {
  252|       |                /* Top neighbors change*/
  253|  1.09M|                pu4_ctb_top_pu_idx[i] = ctb_pu_idx + (WORD32)*pu1_pic_pu_map;
  254|  1.09M|                pu1_pic_pu_map++;
  255|  1.09M|            }
  256|   116k|        }
  257|       |
  258|       |        /* Updating the initial neighbor pu idx map */
  259|       |        /* Initializing the availability array with CTB level availability flags */
  260|       |        /* 16x16 array for holding pu info of the ctb, wrt the frame pu count*/
  261|  39.8M|        for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (261:20): [True: 35.6M, False: 4.20M]
  ------------------
  262|  35.6M|        {
  263|       |            /* Left */
  264|  35.6M|            pu4_nbr_pu_idx[(i + 1) * nbr_pu_idx_strd] = pu4_ctb_left_pu_idx[i];
  265|       |            /* Top */
  266|  35.6M|            pu4_nbr_pu_idx[i + 1] = pu4_ctb_top_pu_idx[i];
  267|  35.6M|        }
  268|       |        /* Top right */
  269|  4.20M|        pu4_nbr_pu_idx[1 + ctb_size_in_min_pu] = pu4_ctb_top_pu_idx[ctb_size_in_min_pu];
  270|       |
  271|       |        /* Top left */
  272|  4.20M|        pu4_nbr_pu_idx[0] = pu4_ctb_top_left_pu_idx[0];
  273|       |
  274|  4.20M|    }
  275|       |
  276|       |    /* CTB level MV pred */
  277|  76.8M|    for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (277:21): [True: 72.6M, False: 4.20M]
  ------------------
  278|  72.6M|    {
  279|  72.6M|        pu_ht = (ps_pu->b4_ht + 1) << 2;
  280|  72.6M|        pu_wd = (ps_pu->b4_wd + 1) << 2;
  281|       |
  282|  72.6M|        pu_ht_single_mcl = pu_ht;
  283|  72.6M|        pu_wd_single_mcl = pu_wd;
  284|       |
  285|  72.6M|        pu_x_in_4x4 = ps_pu->b4_pos_x;
  286|  72.6M|        pu_y_in_4x4 = ps_pu->b4_pos_y;
  287|       |
  288|  72.6M|        pu_x_in_4x4_single_mcl = pu_x_in_4x4;
  289|  72.6M|        pu_y_in_4x4_single_mcl = pu_y_in_4x4;
  290|       |
  291|       |        /*******************************************/
  292|       |        /* Neighbor location: Graphical indication */
  293|       |        /*                                         */
  294|       |        /*          B2 _____________B1 B0          */
  295|       |        /*            |               |            */
  296|       |        /*            |               |            */
  297|       |        /*            |               |            */
  298|       |        /*            |      PU     ht|            */
  299|       |        /*            |               |            */
  300|       |        /*            |               |            */
  301|       |        /*          A1|______wd_______|            */
  302|       |        /*          A0                             */
  303|       |        /*                                         */
  304|       |        /*******************************************/
  305|       |        /* Below code is for merge mode, where if single_mcl_flag == 1,
  306|       |         * all the prediction units of the current coding unit share a
  307|       |         * single merge candidate list, which is identical to the
  308|       |         * merge candidate list of the 2Nx2N prediction unit.
  309|       |         */
  310|  72.6M|        single_mcl_flag = 0;
  311|  72.6M|        if(1 == ps_pu->b1_merge_flag)
  ------------------
  |  Branch (311:12): [True: 71.9M, False: 718k]
  ------------------
  312|  71.9M|        {
  313|  71.9M|            cb_size = MAX(pu_wd_single_mcl, pu_ht_single_mcl);
  ------------------
  |  |   42|  71.9M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 177k, False: 71.7M]
  |  |  ------------------
  ------------------
  314|  71.9M|            cb_size = MAX(cb_size,
  ------------------
  |  |   42|  71.9M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 578k, False: 71.3M]
  |  |  ------------------
  ------------------
  315|  71.9M|                          (1 << ps_sps->i1_log2_min_coding_block_size));
  316|  71.9M|            if((ps_pps->i1_log2_parallel_merge_level > 2) && cb_size == 8 && (pu_wd_single_mcl != pu_ht_single_mcl))
  ------------------
  |  Branch (316:16): [True: 15.2M, False: 56.7M]
  |  Branch (316:62): [True: 14.0M, False: 1.21M]
  |  Branch (316:78): [True: 28.1k, False: 13.9M]
  ------------------
  317|  28.1k|            {
  318|  28.1k|                single_mcl_flag = 1;
  319|  28.1k|                if((PART_Nx2N == ps_pu->b3_part_mode) && (1 == ps_pu->b2_part_idx))
  ------------------
  |  Branch (319:20): [True: 13.2k, False: 14.8k]
  |  Branch (319:58): [True: 6.49k, False: 6.73k]
  ------------------
  320|  6.49k|                {
  321|  6.49k|                    pu_x_in_4x4_single_mcl = pu_x_in_4x4_single_mcl - 1;
  322|  6.49k|                }
  323|  21.6k|                else if((PART_2NxN == ps_pu->b3_part_mode) && (1 == ps_pu->b2_part_idx))
  ------------------
  |  Branch (323:25): [True: 14.8k, False: 6.73k]
  |  Branch (323:63): [True: 7.48k, False: 7.41k]
  ------------------
  324|  7.48k|                {
  325|  7.48k|                    pu_y_in_4x4_single_mcl = pu_y_in_4x4_single_mcl - 1;
  326|  7.48k|                }
  327|  28.1k|                pu_ht_single_mcl = 8;
  328|  28.1k|                pu_wd_single_mcl = 8;
  329|  28.1k|            }
  330|  71.9M|        }
  331|  72.6M|        pu4_top_pu_idx = &pu4_nbr_pu_idx[(1 + pu_x_in_4x4_single_mcl)
  332|  72.6M|                        + (1 + pu_y_in_4x4_single_mcl - 1) * nbr_pu_idx_strd];
  333|  72.6M|        pu4_top_left_pu_idx = pu4_top_pu_idx - 1;
  334|  72.6M|        pu4_left_pu_idx = pu4_top_pu_idx - 1 + nbr_pu_idx_strd;
  335|       |
  336|       |        /* Get neibhbor availability */
  337|  72.6M|        {
  338|  72.6M|            u1_lb_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl + pu_ht_single_mcl / MIN_PU_SIZE]
  ------------------
  |  |  367|  72.6M|#define MIN_PU_SIZE         4
  ------------------
  339|  72.6M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl - 1))) & 1;
  340|  72.6M|            u1_l_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl]
  341|  72.6M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl - 1))) & 1;
  342|  72.6M|            u1_t_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl - 1]
  343|  72.6M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl))) & 1;
  344|  72.6M|            u1_tr_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl - 1]
  345|  72.6M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl + pu_wd_single_mcl / MIN_PU_SIZE)))
  ------------------
  |  |  367|  72.6M|#define MIN_PU_SIZE         4
  ------------------
  346|  72.6M|                            & 1;
  347|  72.6M|            u1_tl_avail = (au4_nbr_avail[1 + pu_y_in_4x4_single_mcl - 1]
  348|  72.6M|                            >> (31 - (1 + pu_x_in_4x4_single_mcl - 1))) & 1;
  349|  72.6M|        }
  350|  72.6M|        if(ps_pu->b1_intra_flag == 0)
  ------------------
  |  Branch (350:12): [True: 72.4M, False: 216k]
  ------------------
  351|  72.4M|        {
  352|  72.4M|            if(ps_pu->b1_merge_flag == 0)
  ------------------
  |  Branch (352:16): [True: 702k, False: 71.7M]
  ------------------
  353|   702k|            {
  354|   702k|                WORD32 pred_flag_l0, pred_flag_l1;
  355|   702k|                WORD32 tmp_x, tmp_y, mvd_x, mvd_y, mvp_x, mvp_y;
  356|   702k|                WORD32 two_pow_16, two_pow_15;
  357|       |
  358|   702k|                ihevcd_mv_pred(ps_mv_ctxt, pu4_top_pu_idx, pu4_left_pu_idx,
  359|   702k|                               pu4_top_left_pu_idx, nbr_pu_idx_strd,
  360|   702k|                               ps_pu, u1_lb_avail, u1_l_avail,
  361|   702k|                               u1_tr_avail, u1_t_avail, u1_tl_avail,
  362|   702k|                               &s_pred_mv);
  363|       |
  364|   702k|                pred_flag_l0 = (ps_pu->b2_pred_mode != PRED_L1);
  365|   702k|                pred_flag_l1 = (ps_pu->b2_pred_mode != PRED_L0);
  366|       |
  367|   702k|                two_pow_16 = (1 << 16);
  368|   702k|                two_pow_15 = (1 << 15);
  369|       |
  370|       |                /* L0 MV */
  371|   702k|                if(pred_flag_l0)
  ------------------
  |  Branch (371:20): [True: 574k, False: 127k]
  ------------------
  372|   574k|                {
  373|   574k|                    mvp_x = s_pred_mv.s_l0_mv.i2_mvx;
  374|   574k|                    mvp_y = s_pred_mv.s_l0_mv.i2_mvy;
  375|   574k|                    mvd_x = ps_pu->mv.s_l0_mv.i2_mvx;
  376|   574k|                    mvd_y = ps_pu->mv.s_l0_mv.i2_mvy;
  377|       |
  378|   574k|                    tmp_x = (mvp_x + mvd_x + two_pow_16) & (two_pow_16 - 1);
  379|   574k|                    tmp_x = tmp_x >= two_pow_15 ?
  ------------------
  |  Branch (379:29): [True: 195k, False: 378k]
  ------------------
  380|   378k|                                    (tmp_x - two_pow_16) : tmp_x;
  381|   574k|                    ps_pu->mv.s_l0_mv.i2_mvx = tmp_x;
  382|   574k|                    tmp_y = (mvp_y + mvd_y + two_pow_16) & (two_pow_16 - 1);
  383|   574k|                    tmp_y = tmp_y >= two_pow_15 ?
  ------------------
  |  Branch (383:29): [True: 193k, False: 380k]
  ------------------
  384|   380k|                                    (tmp_y - two_pow_16) : tmp_y;
  385|   574k|                    ps_pu->mv.s_l0_mv.i2_mvy = tmp_y;
  386|   574k|                }
  387|       |                /* L1 MV */
  388|   702k|                if(pred_flag_l1)
  ------------------
  |  Branch (388:20): [True: 238k, False: 463k]
  ------------------
  389|   238k|                {
  390|   238k|                    mvp_x = s_pred_mv.s_l1_mv.i2_mvx;
  391|   238k|                    mvp_y = s_pred_mv.s_l1_mv.i2_mvy;
  392|   238k|                    mvd_x = ps_pu->mv.s_l1_mv.i2_mvx;
  393|   238k|                    mvd_y = ps_pu->mv.s_l1_mv.i2_mvy;
  394|       |
  395|   238k|                    tmp_x = (mvp_x + mvd_x + two_pow_16) & (two_pow_16 - 1);
  396|   238k|                    tmp_x = tmp_x >= two_pow_15 ?
  ------------------
  |  Branch (396:29): [True: 76.2k, False: 161k]
  ------------------
  397|   161k|                                    (tmp_x - two_pow_16) : tmp_x;
  398|   238k|                    ps_pu->mv.s_l1_mv.i2_mvx = tmp_x;
  399|   238k|                    tmp_y = (mvp_y + mvd_y + two_pow_16) & (two_pow_16 - 1);
  400|   238k|                    tmp_y = tmp_y >= two_pow_15 ?
  ------------------
  |  Branch (400:29): [True: 72.2k, False: 165k]
  ------------------
  401|   165k|                                    (tmp_y - two_pow_16) : tmp_y;
  402|   238k|                    ps_pu->mv.s_l1_mv.i2_mvy = tmp_y;
  403|   238k|                }
  404|   702k|            }
  405|  71.7M|            else
  406|  71.7M|            {
  407|  71.7M|                WORD32 part_mode;
  408|  71.7M|                WORD32 part_idx;
  409|  71.7M|                part_mode = ps_pu->b3_part_mode;
  410|       |                //TODO: Get part_idx
  411|  71.7M|                part_idx = ps_pu->b2_part_idx;
  412|       |
  413|  71.7M|                ihevcd_mv_merge(ps_mv_ctxt, pu4_top_pu_idx, pu4_left_pu_idx,
  414|  71.7M|                                nbr_pu_idx_strd, ps_pu, part_mode,
  415|  71.7M|                                part_idx, pu_wd_single_mcl, pu_ht_single_mcl,
  416|  71.7M|                                pu_x_in_4x4_single_mcl << 2, pu_y_in_4x4_single_mcl << 2,
  417|  71.7M|                                single_mcl_flag, u1_lb_avail, u1_l_avail, u1_tr_avail,
  418|  71.7M|                                u1_t_avail, u1_tl_avail);
  419|       |
  420|  71.7M|                if(PRED_BI == ps_pu->b2_pred_mode)
  ------------------
  |  Branch (420:20): [True: 63.2M, False: 8.46M]
  ------------------
  421|  63.2M|                {
  422|  63.2M|                    if(((ps_pu->b3_part_mode == PART_2NxN) && (pu_wd == 8))
  ------------------
  |  Branch (422:25): [True: 78.7k, False: 63.2M]
  |  Branch (422:63): [True: 59.5k, False: 19.2k]
  ------------------
  423|  63.2M|                                    || ((ps_pu->b3_part_mode == PART_Nx2N)
  ------------------
  |  Branch (423:41): [True: 80.1k, False: 63.1M]
  ------------------
  424|  80.1k|                                                    && (pu_ht == 8)))
  ------------------
  |  Branch (424:56): [True: 55.4k, False: 24.6k]
  ------------------
  425|   114k|                    {
  426|   114k|                        ps_pu->b2_pred_mode = PRED_L0;
  427|   114k|                    }
  428|  63.2M|                }
  429|  71.7M|            }
  430|  72.4M|        }
  431|       |
  432|  72.6M|        {
  433|  72.6M|            slice_header_t *ps_slice_hdr;
  434|  72.6M|            pic_buf_t *ps_pic_buf_l0, *ps_pic_buf_l1;
  435|  72.6M|            ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  436|  72.6M|            ps_pic_buf_l0 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list0[ps_pu->mv.i1_l0_ref_idx].pv_pic_buf));
  437|  72.6M|            ps_pic_buf_l1 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list1[ps_pu->mv.i1_l1_ref_idx].pv_pic_buf));
  438|  72.6M|            ps_pu->mv.i1_l0_ref_pic_buf_id = ps_pic_buf_l0->u1_buf_id;
  439|  72.6M|            if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (439:16): [True: 72.3M, False: 314k]
  ------------------
  440|  72.3M|            {
  441|  72.3M|                ps_pu->mv.i1_l1_ref_pic_buf_id = ps_pic_buf_l1->u1_buf_id;
  442|  72.3M|            }
  443|  72.6M|        }
  444|       |
  445|       |        /* Neighbor availability inside CTB */
  446|       |        /* 1bit per 4x4. Indicates whether that 4x4 block has been reconstructed(avialable) */
  447|       |        /* Used for neighbor availability in intra pred */
  448|  72.6M|        {
  449|  72.6M|            WORD32 trans_in_min_tu;
  450|  72.6M|            UWORD32 cur_tu_in_bits;
  451|  72.6M|            UWORD32 cur_tu_avail_flag;
  452|       |
  453|  72.6M|            trans_in_min_tu = pu_wd / MIN_PU_SIZE;
  ------------------
  |  |  367|  72.6M|#define MIN_PU_SIZE         4
  ------------------
  454|  72.6M|            cur_tu_in_bits = (1 << trans_in_min_tu) - 1;
  455|  72.6M|            cur_tu_in_bits = cur_tu_in_bits << (32 - trans_in_min_tu);
  456|       |
  457|  72.6M|            cur_tu_avail_flag = cur_tu_in_bits >> (pu_x_in_4x4 + 1);
  458|       |
  459|   221M|            for(i = 0; i < pu_ht / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|   221M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (459:24): [True: 148M, False: 72.6M]
  ------------------
  460|   148M|                au4_nbr_avail[1 + pu_y_in_4x4 + i] |= cur_tu_avail_flag;
  461|  72.6M|        }
  462|       |
  463|       |        /* Neighbor PU idx update inside CTB */
  464|       |        /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */
  465|       |
  466|  72.6M|        {
  467|  72.6M|            WORD32 row, col;
  468|  72.6M|            UWORD32 cur_pu_idx;
  469|  72.6M|            WORD32 offset;
  470|  72.6M|            cur_pu_idx = ctb_start_pu_idx + pu_cnt;
  471|       |
  472|  72.6M|            offset = (1 + pu_x_in_4x4 + 0) + (1 + pu_y_in_4x4 + 0) * nbr_pu_idx_strd;
  473|       |
  474|   221M|            for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  367|   221M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (474:26): [True: 148M, False: 72.6M]
  ------------------
  475|   148M|            {
  476|   479M|                for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  367|   479M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (476:30): [True: 330M, False: 148M]
  ------------------
  477|   330M|                {
  478|   330M|                    pu4_nbr_pu_idx[offset + col] = cur_pu_idx;
  479|   330M|                }
  480|   148M|                offset += nbr_pu_idx_strd;
  481|   148M|            }
  482|  72.6M|        }
  483|       |
  484|  72.6M|    }
  485|       |
  486|       |    /* Updating Top and Left pointers */
  487|  4.20M|    {
  488|  4.20M|        WORD32 offset_top, offset_left;
  489|       |
  490|  4.20M|        offset_left = ctb_size_in_min_pu + (0 + 1) * nbr_pu_idx_strd;
  491|  4.20M|        offset_top = ctb_size_in_min_pu * nbr_pu_idx_strd + 0 + 1;
  492|       |
  493|       |        /* Top Left */
  494|       |        /* saving top left before updating top ptr, as updating top ptr will overwrite the top left for the next ctb */
  495|  4.20M|        pu4_ctb_top_left_pu_idx[0] = pu4_ctb_top_pu_idx[ctb_size_in_min_pu - 1];
  496|       |
  497|  39.8M|        for(i = 0; i < ctb_size_in_min_pu; i++)
  ------------------
  |  Branch (497:20): [True: 35.6M, False: 4.20M]
  ------------------
  498|  35.6M|        {
  499|       |            /* Left */
  500|       |            /* Last column of au4_nbr_pu_idx */
  501|  35.6M|            pu4_ctb_left_pu_idx[i] = pu4_nbr_pu_idx[offset_left];
  502|       |            /* Top */
  503|       |            /* Last row of au4_nbr_pu_idx */
  504|  35.6M|            pu4_ctb_top_pu_idx[i] = pu4_nbr_pu_idx[offset_top];
  505|       |
  506|  35.6M|            offset_left += nbr_pu_idx_strd;
  507|  35.6M|            offset_top += 1;
  508|  35.6M|        }
  509|  4.20M|    }
  510|       |
  511|       |    /* Updating the CTB level PU idx (Used for collocated MV pred)*/
  512|  4.20M|    {
  513|  4.20M|        WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
  514|  4.20M|        WORD32 first_pu_of_ctb;
  515|  4.20M|        first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
  516|  4.20M|        UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  4.20M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 132k, False: 4.07M]
  |  |  ------------------
  ------------------
  517|  4.20M|                    - (ps_mv_ctxt->i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  518|  4.20M|        UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  4.20M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 336k, False: 3.86M]
  |  |  ------------------
  ------------------
  519|  4.20M|                    - (ps_mv_ctxt->i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  520|       |
  521|  4.20M|        index_pic_map = 0 * ctb_size_in_min_pu + 0;
  522|  4.20M|        index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
  523|       |
  524|  38.7M|        for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (524:26): [True: 34.5M, False: 4.20M]
  ------------------
  525|  34.5M|        {
  526|   374M|            for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (526:30): [True: 339M, False: 34.5M]
  ------------------
  527|   339M|            {
  528|   339M|                pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
  529|   339M|                                - first_pu_of_ctb;
  530|   339M|            }
  531|  34.5M|            index_pic_map += ctb_size_in_min_pu;
  532|  34.5M|            index_nbr_map += nbr_pu_idx_strd;
  533|  34.5M|        }
  534|  4.20M|    }
  535|  4.20M|    return num_pu_per_ctb;
  536|  4.20M|}

ihevcd_inter_pred_ctb:
   95|  4.21M|{
   96|  4.21M|    UWORD8 *ref_pic_luma_l0, *ref_pic_chroma_l0;
   97|  4.21M|    UWORD8 *ref_pic_luma_l1, *ref_pic_chroma_l1;
   98|       |
   99|  4.21M|    UWORD8 *ref_pic_l0 = NULL, *ref_pic_l1 = NULL;
  100|       |
  101|  4.21M|    slice_header_t *ps_slice_hdr;
  102|  4.21M|    sps_t *ps_sps;
  103|  4.21M|    pps_t *ps_pps;
  104|  4.21M|    pu_t *ps_pu;
  105|  4.21M|    codec_t *ps_codec;
  106|  4.21M|    pred_wt_ofst_t *ps_wt_ofst;
  107|  4.21M|    WORD32 pu_indx;
  108|  4.21M|    WORD32 pu_x, pu_y;
  109|  4.21M|    WORD32 pu_wd, pu_ht;
  110|  4.21M|    WORD32 i4_pu_cnt;
  111|  4.21M|    WORD32 cur_ctb_idx;
  112|       |
  113|  4.21M|    WORD32 clr_indx;
  114|  4.21M|    WORD32 ntaps;
  115|       |
  116|       |
  117|       |
  118|  4.21M|    WORD32 ai2_xint[2] = { 0, 0 }, ai2_yint[2] = { 0, 0 };
  119|  4.21M|    WORD32 ai2_xfrac[2] = { 0, 0 }, ai2_yfrac[2] = { 0, 0 };
  120|       |
  121|  4.21M|    WORD32 weighted_pred, bi_pred;
  122|       |
  123|  4.21M|    WORD32 ref_strd;
  124|  4.21M|    UWORD8 *pu1_dst_luma, *pu1_dst_chroma;
  125|       |
  126|  4.21M|    UWORD8 *pu1_dst;
  127|       |
  128|  4.21M|    WORD16 *pi2_tmp1, *pi2_tmp2;
  129|       |
  130|  4.21M|    WORD32 luma_weight_l0, luma_weight_l1;
  131|  4.21M|    WORD32 chroma_weight_l0_cb, chroma_weight_l1_cb, chroma_weight_l0_cr, chroma_weight_l1_cr;
  132|  4.21M|    WORD32 luma_offset_l0, luma_offset_l1;
  133|  4.21M|    WORD32 chroma_offset_l0_cb, chroma_offset_l1_cb, chroma_offset_l0_cr, chroma_offset_l1_cr;
  134|  4.21M|    WORD32 shift, lvl_shift1, lvl_shift2;
  135|       |
  136|  4.21M|    pf_inter_pred func_ptr1, func_ptr2, func_ptr3, func_ptr4;
  137|  4.21M|    pf_hbd_inter_pred hbd_func_ptr1, hbd_func_ptr2, hbd_func_ptr3, hbd_func_ptr4;
  138|  4.21M|    WORD32 func_indx1, func_indx2, func_indx3, func_indx4;
  139|  4.21M|    void *func_src;
  140|  4.21M|    void *func_dst;
  141|  4.21M|    WORD32 func_src_strd;
  142|  4.21M|    WORD32 func_dst_strd;
  143|  4.21M|    WORD8 *func_coeff;
  144|  4.21M|    WORD32 func_wd;
  145|  4.21M|    WORD32 func_ht;
  146|  4.21M|    WORD32 next_ctb_idx;
  147|  4.21M|    WORD8(*coeff)[8];
  148|  4.21M|    WORD32  chroma_yuv420sp_vu;
  149|  4.21M|    WORD32 num_comp;
  150|  4.21M|    WORD32 h_samp_factor, v_samp_factor;
  151|  4.21M|    WORD32 chroma_pixel_strd = 2;
  152|  4.21M|    WORD32 is_yuv420, is_yuv422, is_yuv444;
  153|  4.21M|    WORD32 pixel_size_y, pixel_size_uv;
  154|  4.21M|    WORD32 bit_depth_luma, bit_depth_chroma;
  155|  4.21M|    WORD32 wp_ofst_bd_shift_luma, wp_ofst_bd_shift_chroma;
  156|       |
  157|  4.21M|    PROFILE_DISABLE_INTER_PRED();
  ------------------
  |  |   69|  4.21M|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
  158|  4.21M|    ps_codec = ps_proc->ps_codec;
  159|  4.21M|    pixel_size_y     = ps_codec->i4_pixel_size_y;
  160|  4.21M|    pixel_size_uv    = ps_codec->i4_pixel_size_uv;
  161|  4.21M|    bit_depth_luma   = ps_codec->i4_bit_depth_luma;
  162|  4.21M|    bit_depth_chroma = ps_codec->i4_bit_depth_chroma;
  163|  4.21M|    ps_slice_hdr = ps_proc->ps_slice_hdr;
  164|  4.21M|    ps_wt_ofst = &ps_slice_hdr->s_wt_ofst;
  165|  4.21M|    ps_pps = ps_proc->ps_pps;
  166|  4.21M|    ps_sps = ps_proc->ps_sps;
  167|  4.21M|    cur_ctb_idx = ps_proc->i4_ctb_x
  168|  4.21M|                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  169|       |    /*
  170|       |     * In case of tiles, the next ctb belonging to the same tile must be used to get the PU index
  171|       |     */
  172|       |
  173|  4.21M|    next_ctb_idx = ps_proc->i4_next_pu_ctb_cnt;
  174|  4.21M|    i4_pu_cnt = ps_proc->pu4_pic_pu_idx[next_ctb_idx] - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  175|       |
  176|  4.21M|    ps_pu = ps_proc->ps_pu;
  177|  4.21M|    ref_strd = ps_codec->i4_strd;
  178|  4.21M|    pi2_tmp1 = ps_proc->pi2_inter_pred_tmp_buf1;
  179|  4.21M|    pi2_tmp2 = ps_proc->pi2_inter_pred_tmp_buf2;
  180|  4.21M|    pu1_dst_luma = ps_proc->pu1_cur_pic_luma;
  181|  4.21M|    pu1_dst_chroma = ps_proc->pu1_cur_pic_chroma;
  182|       |
  183|  4.21M|    chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
  184|       |
  185|  4.21M|    ASSERT(PSLICE == ps_slice_hdr->i1_slice_type || BSLICE == ps_slice_hdr->i1_slice_type);
  ------------------
  |  |   55|  4.21M|#define ASSERT(x) {}
  ------------------
  186|       |
  187|  4.21M|    ref_pic_luma_l0 = NULL;
  188|  4.21M|    ref_pic_chroma_l0 = NULL;
  189|       |
  190|  4.21M|    luma_weight_l0 = 0;
  191|  4.21M|    chroma_weight_l0_cb = 0;
  192|  4.21M|    chroma_weight_l0_cr = 0;
  193|       |
  194|  4.21M|    luma_offset_l0 = 0;
  195|  4.21M|    chroma_offset_l0_cb = 0;
  196|  4.21M|    chroma_offset_l0_cr = 0;
  197|       |
  198|  4.21M|    ref_pic_luma_l1 = NULL;
  199|  4.21M|    ref_pic_chroma_l1 = NULL;
  200|       |
  201|  4.21M|    luma_weight_l1 = 0;
  202|  4.21M|    chroma_weight_l1_cb = 0;
  203|  4.21M|    chroma_weight_l1_cr = 0;
  204|       |
  205|  4.21M|    luma_offset_l1 = 0;
  206|  4.21M|    chroma_offset_l1_cb = 0;
  207|  4.21M|    chroma_offset_l1_cr = 0;
  208|       |
  209|  4.21M|    num_comp = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME ? 1 : 2;
  ------------------
  |  Branch (209:16): [True: 3.26k, False: 4.21M]
  ------------------
  210|  4.21M|    is_yuv420 = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 1 : 0;
  ------------------
  |  Branch (210:17): [True: 4.21M, False: 5.24k]
  ------------------
  211|  4.21M|    is_yuv422 = (CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc) ? 1 : 0;
  ------------------
  |  Branch (211:17): [True: 23.3k, False: 4.19M]
  ------------------
  212|  4.21M|    is_yuv444 = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 0;
  ------------------
  |  Branch (212:17): [True: 0, False: 4.21M]
  ------------------
  213|  4.21M|    h_samp_factor = is_yuv444 ? 1 : 2;
  ------------------
  |  Branch (213:21): [True: 0, False: 4.21M]
  ------------------
  214|  18.4E|    v_samp_factor = is_yuv420 ? 2 : 1;
  ------------------
  |  Branch (214:21): [True: 4.22M, False: 18.4E]
  ------------------
  215|       |
  216|  4.21M|    wp_ofst_bd_shift_luma = ps_sps->i1_use_high_precision_pred_wt ? 0 : (bit_depth_luma - 8);
  ------------------
  |  Branch (216:29): [True: 2.73k, False: 4.21M]
  ------------------
  217|  4.21M|    wp_ofst_bd_shift_chroma = ps_sps->i1_use_high_precision_pred_wt ? 0 : (bit_depth_chroma - 8);
  ------------------
  |  Branch (217:31): [True: 2.71k, False: 4.21M]
  ------------------
  218|       |
  219|  76.0M|    for(pu_indx = 0; pu_indx < i4_pu_cnt; pu_indx++, ps_pu++)
  ------------------
  |  Branch (219:22): [True: 71.7M, False: 4.21M]
  ------------------
  220|  71.7M|    {
  221|       |        /* If the PU is intra then proceed to the next */
  222|  71.7M|        if(1 == ps_pu->b1_intra_flag)
  ------------------
  |  Branch (222:12): [True: 85.4k, False: 71.7M]
  ------------------
  223|  85.4k|            continue;
  224|  71.7M|        pu_x = (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size) + (ps_pu->b4_pos_x << 2);
  225|  71.7M|        pu_y = (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size) + (ps_pu->b4_pos_y << 2);
  226|       |
  227|  71.7M|        pu_wd = (ps_pu->b4_wd + 1) << 2;
  228|  71.7M|        pu_ht = (ps_pu->b4_ht + 1) << 2;
  229|       |
  230|  71.7M|        weighted_pred = (ps_slice_hdr->i1_slice_type == PSLICE) ? ps_pps->i1_weighted_pred_flag :
  ------------------
  |  Branch (230:25): [True: 364k, False: 71.3M]
  ------------------
  231|  71.7M|                        ps_pps->i1_weighted_bipred_flag;
  232|  71.7M|        bi_pred = (ps_pu->b2_pred_mode == PRED_BI);
  233|       |
  234|  71.7M|        if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (234:12): [True: 69.8M, False: 1.88M]
  ------------------
  235|  69.8M|        {
  236|  69.8M|            pic_buf_t *ps_pic_buf_l0;
  237|       |
  238|  69.8M|            ps_pic_buf_l0 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list0[ps_pu->mv.i1_l0_ref_idx].pv_pic_buf));
  239|       |
  240|  69.8M|            ref_pic_luma_l0 = ps_pic_buf_l0->pu1_luma;
  241|       |
  242|  69.8M|            luma_weight_l0 = ps_wt_ofst->i2_luma_weight_l0[ps_pu->mv.i1_l0_ref_idx];
  243|  69.8M|            luma_offset_l0 = ps_wt_ofst->i2_luma_offset_l0[ps_pu->mv.i1_l0_ref_idx] << wp_ofst_bd_shift_luma;
  244|       |
  245|  69.8M|            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (245:16): [True: 69.8M, False: 18.4E]
  ------------------
  246|  69.8M|            {
  247|  69.8M|                ref_pic_chroma_l0 = ps_pic_buf_l0->pu1_chroma;
  248|  69.8M|                chroma_weight_l0_cb = ps_wt_ofst->i2_chroma_weight_l0_cb[ps_pu->mv.i1_l0_ref_idx];
  249|  69.8M|                chroma_weight_l0_cr = ps_wt_ofst->i2_chroma_weight_l0_cr[ps_pu->mv.i1_l0_ref_idx];
  250|       |
  251|  69.8M|                chroma_offset_l0_cb = ps_wt_ofst->i2_chroma_offset_l0_cb[ps_pu->mv.i1_l0_ref_idx] << wp_ofst_bd_shift_chroma;
  252|  69.8M|                chroma_offset_l0_cr = ps_wt_ofst->i2_chroma_offset_l0_cr[ps_pu->mv.i1_l0_ref_idx] << wp_ofst_bd_shift_chroma;
  253|  69.8M|            }
  254|  69.8M|        }
  255|       |
  256|  71.7M|        if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (256:12): [True: 65.7M, False: 5.92M]
  ------------------
  257|  65.7M|        {
  258|  65.7M|            pic_buf_t *ps_pic_buf_l1;
  259|  65.7M|            ps_pic_buf_l1 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list1[ps_pu->mv.i1_l1_ref_idx].pv_pic_buf));
  260|  65.7M|            ref_pic_luma_l1 = ps_pic_buf_l1->pu1_luma;
  261|       |
  262|  65.7M|            luma_weight_l1 = ps_wt_ofst->i2_luma_weight_l1[ps_pu->mv.i1_l1_ref_idx];
  263|  65.7M|            luma_offset_l1 = ps_wt_ofst->i2_luma_offset_l1[ps_pu->mv.i1_l1_ref_idx] << wp_ofst_bd_shift_luma;
  264|       |
  265|  65.7M|            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (265:16): [True: 65.8M, False: 18.4E]
  ------------------
  266|  65.8M|            {
  267|  65.8M|                ref_pic_chroma_l1 = ps_pic_buf_l1->pu1_chroma;
  268|  65.8M|                chroma_weight_l1_cb = ps_wt_ofst->i2_chroma_weight_l1_cb[ps_pu->mv.i1_l1_ref_idx];
  269|  65.8M|                chroma_weight_l1_cr = ps_wt_ofst->i2_chroma_weight_l1_cr[ps_pu->mv.i1_l1_ref_idx];
  270|       |
  271|  65.8M|                chroma_offset_l1_cb = ps_wt_ofst->i2_chroma_offset_l1_cb[ps_pu->mv.i1_l1_ref_idx] << wp_ofst_bd_shift_chroma;
  272|  65.8M|                chroma_offset_l1_cr = ps_wt_ofst->i2_chroma_offset_l1_cr[ps_pu->mv.i1_l1_ref_idx] << wp_ofst_bd_shift_chroma;
  273|  65.8M|            }
  274|  65.7M|        }
  275|       |
  276|       |        /*luma and chroma components*/
  277|   211M|        for(clr_indx = 0; clr_indx < num_comp; clr_indx++)
  ------------------
  |  Branch (277:27): [True: 139M, False: 71.7M]
  ------------------
  278|   139M|        {
  279|   139M|            WORD32 pixel_size;
  280|   139M|            UWORD8 u1_bit_depth;
  281|       |
  282|   139M|            PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx);
  ------------------
  |  |   98|   139M|#define PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx) ;
  ------------------
  283|   139M|            PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx);
  ------------------
  |  |   99|   139M|#define PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx) ;
  ------------------
  284|       |
  285|   139M|            if(clr_indx == 0)
  ------------------
  |  Branch (285:16): [True: 73.2M, False: 66.2M]
  ------------------
  286|  73.2M|            {
  287|  73.2M|                WORD32 mv;
  288|  73.2M|                pixel_size = pixel_size_y;
  289|  73.2M|                u1_bit_depth  = (UWORD8)bit_depth_luma;
  290|       |
  291|  73.2M|                if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (291:20): [True: 71.2M, False: 1.99M]
  ------------------
  292|  71.2M|                {
  293|  71.2M|                    mv = CLIP3(ps_pu->mv.s_l0_mv.i2_mvx, (-((MAX_CTB_SIZE + pu_x + 7) << 2)), ((ps_sps->i2_pic_width_in_luma_samples - pu_x + 7) << 2));
  ------------------
  |  |   40|  71.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.29M, False: 69.9M]
  |  |  |  Branch (40:53): [True: 808k, False: 69.1M]
  |  |  ------------------
  ------------------
  294|  71.2M|                    ai2_xint[0] = pu_x + (mv >> 2);
  295|  71.2M|                    ai2_xfrac[0] = mv & 3;
  296|       |
  297|  71.2M|                    mv = CLIP3(ps_pu->mv.s_l0_mv.i2_mvy, (-((MAX_CTB_SIZE + pu_y + 7) << 2)), ((ps_sps->i2_pic_height_in_luma_samples - pu_y + 7) << 2));
  ------------------
  |  |   40|  71.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 779k, False: 70.4M]
  |  |  |  Branch (40:53): [True: 728k, False: 69.7M]
  |  |  ------------------
  ------------------
  298|  71.2M|                    ai2_yint[0] = pu_y + (mv >> 2);
  299|  71.2M|                    ai2_yfrac[0] = mv & 3;
  300|       |
  301|  71.2M|                    ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask;
  302|  71.2M|                    ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask;
  303|       |
  304|       |
  305|  71.2M|                    ref_pic_l0 = ref_pic_luma_l0 + (ai2_yint[0] * ref_strd
  306|  71.2M|                                    + ai2_xint[0]) * pixel_size_y;
  307|  71.2M|                }
  308|       |
  309|  73.2M|                if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (309:20): [True: 66.1M, False: 7.11M]
  ------------------
  310|  66.1M|                {
  311|       |
  312|  66.1M|                    mv = CLIP3(ps_pu->mv.s_l1_mv.i2_mvx, (-((MAX_CTB_SIZE + pu_x + 7) << 2)), ((ps_sps->i2_pic_width_in_luma_samples - pu_x + 7) << 2));
  ------------------
  |  |   40|  66.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.08M, False: 65.0M]
  |  |  |  Branch (40:53): [True: 771k, False: 64.2M]
  |  |  ------------------
  ------------------
  313|  66.1M|                    ai2_xint[1] = pu_x + (mv >> 2);
  314|  66.1M|                    ai2_xfrac[1] = mv & 3;
  315|       |
  316|  66.1M|                    mv = CLIP3(ps_pu->mv.s_l1_mv.i2_mvy, (-((MAX_CTB_SIZE + pu_y + 7) << 2)), ((ps_sps->i2_pic_height_in_luma_samples - pu_y + 7) << 2));
  ------------------
  |  |   40|  66.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 640k, False: 65.4M]
  |  |  |  Branch (40:53): [True: 584k, False: 64.8M]
  |  |  ------------------
  ------------------
  317|  66.1M|                    ai2_yint[1] = pu_y + (mv >> 2);
  318|  66.1M|                    ai2_yfrac[1] = mv & 3;
  319|       |
  320|  66.1M|                    ref_pic_l1 = ref_pic_luma_l1 + (ai2_yint[1] * ref_strd
  321|  66.1M|                                    + ai2_xint[1]) * pixel_size_y;
  322|  66.1M|                    ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask;
  323|  66.1M|                    ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask;
  324|       |
  325|  66.1M|                }
  326|       |
  327|  73.2M|                pu1_dst = pu1_dst_luma + (pu_y * ref_strd + pu_x) * pixel_size_y;
  328|       |
  329|  73.2M|                ntaps = NTAPS_LUMA;
  ------------------
  |  |   39|  73.2M|#define NTAPS_LUMA 8
  ------------------
  330|  73.2M|                coeff = gai1_ihevc_luma_filter;
  331|  73.2M|            }
  332|       |
  333|  66.2M|            else
  334|  66.2M|            {
  335|  66.2M|                WORD32 mv;
  336|  66.2M|                pixel_size = pixel_size_uv;
  337|  66.2M|                u1_bit_depth  = (UWORD8)bit_depth_chroma;
  338|       |
  339|       |                /* xint is upshifted by 1 because the chroma components are  */
  340|       |                /* interleaved which is not the assumption made by standard  */
  341|  66.2M|                if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (341:20): [True: 69.7M, False: 18.4E]
  ------------------
  342|  69.7M|                {
  343|  69.7M|                    mv = CLIP3(ps_pu->mv.s_l0_mv.i2_mvx, (-((MAX_CTB_SIZE + pu_x + 7) << 2)), ((ps_sps->i2_pic_width_in_luma_samples - pu_x + 7) << 2));
  ------------------
  |  |   40|  69.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.28M, False: 68.4M]
  |  |  |  Branch (40:53): [True: 795k, False: 67.6M]
  |  |  ------------------
  ------------------
  344|  69.7M|                    ai2_xint[0] = (pu_x *  chroma_pixel_strd / h_samp_factor) + (mv >> (2 + h_samp_factor - 1)) * chroma_pixel_strd;
  345|  69.7M|                    ai2_xfrac[0] = mv & (is_yuv444 ? 3 : 7);
  ------------------
  |  Branch (345:42): [True: 0, False: 69.7M]
  ------------------
  346|       |
  347|  69.7M|                    mv = CLIP3(ps_pu->mv.s_l0_mv.i2_mvy, (-((MAX_CTB_SIZE + pu_y + 7) << 2)), ((ps_sps->i2_pic_height_in_luma_samples - pu_y + 7) << 2));
  ------------------
  |  |   40|  69.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 776k, False: 68.9M]
  |  |  |  Branch (40:53): [True: 720k, False: 68.2M]
  |  |  ------------------
  ------------------
  348|  69.7M|                    ai2_yint[0] = ((pu_y / v_samp_factor) + (mv >> (2 + v_samp_factor - 1)));
  349|  69.7M|                    ai2_yfrac[0] = mv & (is_yuv420 ? 7 : 3);
  ------------------
  |  Branch (349:42): [True: 69.6M, False: 155k]
  ------------------
  350|       |
  351|  69.7M|                    ref_pic_l0 = ref_pic_chroma_l0 + (ai2_yint[0] * (ref_strd * chroma_pixel_strd / h_samp_factor) + ai2_xint[0]) * pixel_size_uv;
  352|       |
  353|  69.7M|                    ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask;
  354|  69.7M|                    ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask;
  355|       |
  356|  69.7M|                }
  357|       |
  358|  66.2M|                if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (358:20): [True: 64.5M, False: 1.63M]
  ------------------
  359|  64.5M|                {
  360|  64.5M|                    mv = CLIP3(ps_pu->mv.s_l1_mv.i2_mvx, (-((MAX_CTB_SIZE + pu_x + 7) << 2)), ((ps_sps->i2_pic_width_in_luma_samples - pu_x + 7) << 2));
  ------------------
  |  |   40|  64.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.07M, False: 63.5M]
  |  |  |  Branch (40:53): [True: 760k, False: 62.7M]
  |  |  ------------------
  ------------------
  361|  64.5M|                    ai2_xint[1] = (pu_x *  chroma_pixel_strd / h_samp_factor) + (mv >> (2 + h_samp_factor - 1)) * chroma_pixel_strd;
  362|  64.5M|                    ai2_xfrac[1] = mv & (is_yuv444 ? 3 : 7);
  ------------------
  |  Branch (362:42): [True: 0, False: 64.5M]
  ------------------
  363|       |
  364|  64.5M|                    mv = CLIP3(ps_pu->mv.s_l1_mv.i2_mvy, (-((MAX_CTB_SIZE + pu_y + 7) << 2)), ((ps_sps->i2_pic_height_in_luma_samples - pu_y + 7) << 2));
  ------------------
  |  |   40|  64.5M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 634k, False: 63.9M]
  |  |  |  Branch (40:53): [True: 579k, False: 63.3M]
  |  |  ------------------
  ------------------
  365|  64.5M|                    ai2_yint[1] = ((pu_y / v_samp_factor) + (mv >> (2 + v_samp_factor - 1)));
  366|  64.5M|                    ai2_yfrac[1] = mv & (is_yuv420 ? 7 : 3);
  ------------------
  |  Branch (366:42): [True: 64.4M, False: 158k]
  ------------------
  367|       |
  368|  64.5M|                    ref_pic_l1 = ref_pic_chroma_l1 + (ai2_yint[1] * (ref_strd * chroma_pixel_strd / h_samp_factor) + ai2_xint[1]) * pixel_size_uv;
  369|       |
  370|  64.5M|                    ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask;
  371|  64.5M|                    ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask;
  372|       |
  373|  64.5M|                }
  374|       |
  375|  66.2M|                pu1_dst = pu1_dst_chroma + ((pu_y / v_samp_factor) * (ref_strd * chroma_pixel_strd / h_samp_factor) +
  376|  66.2M|                                (pu_x * chroma_pixel_strd / h_samp_factor)) * pixel_size_uv;
  377|       |
  378|  66.2M|                ntaps = NTAPS_CHROMA;
  ------------------
  |  |   40|  66.2M|#define NTAPS_CHROMA 4
  ------------------
  379|  66.2M|                coeff = gai1_ihevc_chroma_filter;
  380|  66.2M|            }
  381|       |
  382|   139M|            if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (382:16): [True: 134M, False: 5.09M]
  ------------------
  383|   134M|            {
  384|   134M|                func_indx1 = 4 * (weighted_pred || bi_pred) + 1 + 11 * clr_indx;
  ------------------
  |  Branch (384:35): [True: 44.7M, False: 89.6M]
  |  Branch (384:52): [True: 76.9M, False: 12.7M]
  ------------------
  385|   134M|                func_indx1 += ai2_xfrac[0] ? 2 : 0;
  ------------------
  |  Branch (385:31): [True: 22.1M, False: 112M]
  ------------------
  386|   134M|                func_indx1 += ai2_yfrac[0] ? 1 : 0;
  ------------------
  |  Branch (386:31): [True: 22.8M, False: 111M]
  ------------------
  387|       |
  388|   134M|                func_indx2 = (ai2_xfrac[0] && ai2_yfrac[0])
  ------------------
  |  Branch (388:31): [True: 22.3M, False: 111M]
  |  Branch (388:47): [True: 13.0M, False: 9.37M]
  ------------------
  389|   134M|                                * (9 + (weighted_pred || bi_pred)) + 11 * clr_indx;
  ------------------
  |  Branch (389:41): [True: 44.4M, False: 89.8M]
  |  Branch (389:58): [True: 77.1M, False: 12.7M]
  ------------------
  390|       |
  391|   134M|                func_ptr1 = ps_codec->apf_inter_pred[func_indx1];
  392|   134M|                func_ptr2 = ps_codec->apf_inter_pred[func_indx2];
  393|   134M|                hbd_func_ptr1 = ps_codec->apf_hbd_inter_pred[func_indx1];
  394|   134M|                hbd_func_ptr2 = ps_codec->apf_hbd_inter_pred[func_indx2];
  395|   134M|            }
  396|  5.09M|            else
  397|  5.09M|            {
  398|  5.09M|                func_ptr1 = NULL;
  399|  5.09M|                func_ptr2 = NULL;
  400|  5.09M|                hbd_func_ptr1 = NULL;
  401|  5.09M|                hbd_func_ptr2 = NULL;
  402|  5.09M|            }
  403|   139M|            if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (403:16): [True: 125M, False: 14.0M]
  ------------------
  404|   125M|            {
  405|   125M|                func_indx3 = 4 * (weighted_pred || bi_pred) + 1 + 11 * clr_indx;
  ------------------
  |  Branch (405:35): [True: 44.2M, False: 81.1M]
  |  Branch (405:52): [True: 77.5M, False: 3.61M]
  ------------------
  406|   125M|                func_indx3 += ai2_xfrac[1] ? 2 : 0;
  ------------------
  |  Branch (406:31): [True: 12.8M, False: 112M]
  ------------------
  407|   125M|                func_indx3 += ai2_yfrac[1] ? 1 : 0;
  ------------------
  |  Branch (407:31): [True: 14.6M, False: 110M]
  ------------------
  408|       |
  409|   125M|                func_indx4 = (ai2_xfrac[1] && ai2_yfrac[1])
  ------------------
  |  Branch (409:31): [True: 12.9M, False: 112M]
  |  Branch (409:47): [True: 6.73M, False: 6.19M]
  ------------------
  410|   125M|                                * (9 + (weighted_pred || bi_pred)) + 11 * clr_indx;
  ------------------
  |  Branch (410:41): [True: 44.6M, False: 80.7M]
  |  Branch (410:58): [True: 77.1M, False: 3.61M]
  ------------------
  411|       |
  412|   125M|                func_ptr3 = ps_codec->apf_inter_pred[func_indx3];
  413|   125M|                func_ptr4 = ps_codec->apf_inter_pred[func_indx4];
  414|   125M|                hbd_func_ptr3 = ps_codec->apf_hbd_inter_pred[func_indx3];
  415|   125M|                hbd_func_ptr4 = ps_codec->apf_hbd_inter_pred[func_indx4];
  416|   125M|            }
  417|  14.0M|            else
  418|  14.0M|            {
  419|  14.0M|                func_ptr3 = NULL;
  420|  14.0M|                func_ptr4 = NULL;
  421|  14.0M|                hbd_func_ptr3 = NULL;
  422|  14.0M|                hbd_func_ptr4 = NULL;
  423|  14.0M|            }
  424|       |
  425|       |            /*Function 1*/
  426|   139M|            if(func_ptr1 != NULL)
  ------------------
  |  Branch (426:16): [True: 134M, False: 4.83M]
  ------------------
  427|   134M|            {
  428|   134M|                func_src_strd = ref_strd;
  429|   134M|                if (clr_indx != 0)
  ------------------
  |  Branch (429:21): [True: 69.8M, False: 64.7M]
  ------------------
  430|  69.8M|                {
  431|  69.8M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  432|  69.8M|                }
  433|   134M|                func_src = (ai2_xfrac[0] && ai2_yfrac[0]) ?
  ------------------
  |  Branch (433:29): [True: 22.3M, False: 112M]
  |  Branch (433:45): [True: 12.9M, False: 9.40M]
  ------------------
  434|  12.9M|                                ref_pic_l0 - (ntaps / 2 - 1) * func_src_strd * pixel_size :
  435|   134M|                                ref_pic_l0;
  436|   134M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (436:29): [True: 45.1M, False: 89.4M]
  |  Branch (436:46): [True: 76.6M, False: 12.8M]
  ------------------
  437|   121M|                                (void *)pi2_tmp1 : (void *)pu1_dst;
  438|   134M|                if(ai2_xfrac[0] && ai2_yfrac[0])
  ------------------
  |  Branch (438:20): [True: 22.2M, False: 112M]
  |  Branch (438:36): [True: 12.8M, False: 9.37M]
  ------------------
  439|  12.8M|                {
  440|  12.8M|                    func_dst = pi2_tmp1;
  441|  12.8M|                }
  442|       |
  443|   134M|                func_dst_strd = (weighted_pred || bi_pred
  ------------------
  |  Branch (443:34): [True: 45.3M, False: 89.2M]
  |  Branch (443:51): [True: 76.4M, False: 12.7M]
  ------------------
  444|  12.7M|                                || (ai2_xfrac[0] && ai2_yfrac[0])) ?
  ------------------
  |  Branch (444:37): [True: 7.14M, False: 5.62M]
  |  Branch (444:53): [True: 4.72M, False: 2.41M]
  ------------------
  445|   125M|                                pu_wd : ref_strd;
  446|   134M|                if (clr_indx != 0)
  ------------------
  |  Branch (446:21): [True: 69.2M, False: 65.3M]
  ------------------
  447|  69.2M|                {
  448|  69.2M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  449|  69.2M|                }
  450|   134M|                func_coeff = ai2_xfrac[0] ? coeff[ai2_xfrac[0] << (is_yuv444 ? clr_indx : 0)]
  ------------------
  |  Branch (450:30): [True: 21.9M, False: 112M]
  |  Branch (450:68): [True: 0, False: 21.9M]
  ------------------
  451|   134M|                                : coeff[ai2_yfrac[0] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (451:58): [True: 111M, False: 1.52M]
  ------------------
  452|   134M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (452:37): [True: 0, False: 134M]
  ------------------
  453|   134M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (453:37): [True: 132M, False: 2.10M]
  ------------------
  454|   134M|                func_ht += (ai2_xfrac[0] && ai2_yfrac[0]) ? ntaps - 1 : 0;
  ------------------
  |  Branch (454:29): [True: 21.9M, False: 112M]
  |  Branch (454:45): [True: 12.6M, False: 9.25M]
  ------------------
  455|       |
  456|   134M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|   134M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (456:21): [True: 132M, False: 2.38M]
  ------------------
  457|   132M|                {
  458|   132M|                    func_ptr1(func_src, func_dst, func_src_strd, func_dst_strd,
  459|   132M|                              func_coeff, func_ht, func_wd);
  460|   132M|                }
  461|  2.38M|                else
  462|  2.38M|                {
  463|  2.38M|                    hbd_func_ptr1(func_src, func_dst,  func_src_strd, func_dst_strd,
  464|  2.38M|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  465|  2.38M|                }
  466|   134M|            }
  467|       |
  468|       |            /*Function 2*/
  469|   139M|            if(func_ptr2 != NULL)
  ------------------
  |  Branch (469:16): [True: 12.5M, False: 126M]
  ------------------
  470|  12.5M|            {
  471|  12.5M|                func_src_strd = pu_wd;
  472|  12.5M|                if (clr_indx != 0)
  ------------------
  |  Branch (472:21): [True: 7.44M, False: 5.13M]
  ------------------
  473|  7.44M|                {
  474|  7.44M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  475|  7.44M|                }
  476|  12.5M|                func_src = pi2_tmp1 + (ntaps / 2 - 1) * func_src_strd;
  477|  12.5M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (477:29): [True: 825k, False: 11.7M]
  |  Branch (477:46): [True: 7.15M, False: 4.60M]
  ------------------
  478|  7.99M|                                (void *)pi2_tmp1 : (void *)pu1_dst;
  479|       |
  480|  12.5M|                func_dst_strd = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (480:34): [True: 799k, False: 11.7M]
  |  Branch (480:51): [True: 7.17M, False: 4.61M]
  ------------------
  481|  8.00M|                                pu_wd : ref_strd;
  482|  12.5M|                if (clr_indx != 0)
  ------------------
  |  Branch (482:21): [True: 7.45M, False: 5.13M]
  ------------------
  483|  7.45M|                {
  484|  7.45M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  485|  7.45M|                }
  486|  12.5M|                func_coeff = coeff[ai2_yfrac[0] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (486:53): [True: 12.5M, False: 46.1k]
  ------------------
  487|  12.5M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (487:37): [True: 0, False: 12.5M]
  ------------------
  488|  12.5M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (488:37): [True: 12.5M, False: 38.3k]
  ------------------
  489|       |
  490|  12.5M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  12.5M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (490:21): [True: 12.4M, False: 109k]
  ------------------
  491|  12.4M|                {
  492|  12.4M|                    func_ptr2(func_src, func_dst, func_src_strd, func_dst_strd,
  493|  12.4M|                              func_coeff, func_ht, func_wd);
  494|  12.4M|                }
  495|   109k|                else
  496|   109k|                {
  497|   109k|                    hbd_func_ptr2(func_src, func_dst, func_src_strd, func_dst_strd,
  498|   109k|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  499|   109k|                }
  500|  12.5M|            }
  501|       |
  502|   139M|            if(func_ptr3 != NULL)
  ------------------
  |  Branch (502:16): [True: 123M, False: 16.0M]
  ------------------
  503|   123M|            {
  504|   123M|                func_src_strd = ref_strd;
  505|   123M|                if (clr_indx != 0)
  ------------------
  |  Branch (505:21): [True: 64.1M, False: 59.2M]
  ------------------
  506|  64.1M|                {
  507|  64.1M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  508|  64.1M|                }
  509|   123M|                func_src = (ai2_xfrac[1] && ai2_yfrac[1]) ?
  ------------------
  |  Branch (509:29): [True: 12.7M, False: 110M]
  |  Branch (509:45): [True: 6.67M, False: 6.04M]
  ------------------
  510|  6.66M|                                ref_pic_l1 - (ntaps / 2 - 1) * func_src_strd * pixel_size :
  511|   123M|                                ref_pic_l1;
  512|       |
  513|   123M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (513:29): [True: 44.9M, False: 78.4M]
  |  Branch (513:46): [True: 74.8M, False: 3.59M]
  ------------------
  514|   119M|                                (void *)pi2_tmp2 : (void *)pu1_dst;
  515|   123M|                if(ai2_xfrac[1] && ai2_yfrac[1])
  ------------------
  |  Branch (515:20): [True: 12.7M, False: 110M]
  |  Branch (515:36): [True: 6.65M, False: 6.04M]
  ------------------
  516|  6.65M|                {
  517|  6.65M|                    func_dst = pi2_tmp2;
  518|  6.65M|                }
  519|   123M|                func_dst_strd = (weighted_pred || bi_pred
  ------------------
  |  Branch (519:34): [True: 44.9M, False: 78.4M]
  |  Branch (519:51): [True: 74.8M, False: 3.59M]
  ------------------
  520|  3.59M|                                || (ai2_xfrac[1] && ai2_yfrac[1])) ?
  ------------------
  |  Branch (520:37): [True: 1.83M, False: 1.75M]
  |  Branch (520:53): [True: 1.35M, False: 489k]
  ------------------
  521|   120M|                                pu_wd : ref_strd;
  522|   123M|                if (clr_indx != 0)
  ------------------
  |  Branch (522:21): [True: 63.9M, False: 59.4M]
  ------------------
  523|  63.9M|                {
  524|  63.9M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  525|  63.9M|                }
  526|   123M|                func_coeff = ai2_xfrac[1] ? coeff[ai2_xfrac[1] << (is_yuv444 ? clr_indx : 0)]
  ------------------
  |  Branch (526:30): [True: 12.6M, False: 110M]
  |  Branch (526:68): [True: 0, False: 12.6M]
  ------------------
  527|   123M|                                : coeff[ai2_yfrac[1] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (527:58): [True: 110M, False: 660k]
  ------------------
  528|   123M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (528:37): [True: 0, False: 123M]
  ------------------
  529|   123M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (529:37): [True: 122M, False: 1.00M]
  ------------------
  530|       |
  531|   123M|                func_ht += (ai2_xfrac[1] && ai2_yfrac[1]) ? ntaps - 1 : 0;
  ------------------
  |  Branch (531:29): [True: 12.6M, False: 110M]
  |  Branch (531:45): [True: 6.62M, False: 6.02M]
  ------------------
  532|       |
  533|   123M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|   123M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (533:21): [True: 122M, False: 1.12M]
  ------------------
  534|   122M|                {
  535|   122M|                    func_ptr3(func_src, func_dst, func_src_strd, func_dst_strd,
  536|   122M|                              func_coeff, func_ht, func_wd);
  537|   122M|                }
  538|  1.12M|                else
  539|  1.12M|                {
  540|  1.12M|                    hbd_func_ptr3(func_src, func_dst, func_src_strd, func_dst_strd,
  541|  1.12M|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  542|  1.12M|                }
  543|       |
  544|       |
  545|   123M|            }
  546|       |
  547|   139M|            if(func_ptr4 != NULL)
  ------------------
  |  Branch (547:16): [True: 6.62M, False: 132M]
  ------------------
  548|  6.62M|            {
  549|  6.62M|                func_src_strd = pu_wd;
  550|  6.62M|                if (clr_indx != 0)
  ------------------
  |  Branch (550:21): [True: 4.14M, False: 2.47M]
  ------------------
  551|  4.14M|                {
  552|  4.14M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  553|  4.14M|                }
  554|  6.62M|                func_src = pi2_tmp2 + (ntaps / 2 - 1) * func_src_strd;
  555|       |
  556|  6.62M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (556:29): [True: 460k, False: 6.16M]
  |  Branch (556:46): [True: 4.82M, False: 1.33M]
  ------------------
  557|  5.28M|                                (void *)pi2_tmp2 : (void *)pu1_dst;
  558|  6.62M|                func_dst_strd = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (558:34): [True: 456k, False: 6.16M]
  |  Branch (558:51): [True: 4.82M, False: 1.34M]
  ------------------
  559|  5.29M|                                pu_wd : ref_strd;
  560|  6.62M|                if (clr_indx != 0)
  ------------------
  |  Branch (560:21): [True: 4.15M, False: 2.47M]
  ------------------
  561|  4.15M|                {
  562|  4.15M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  563|  4.15M|                }
  564|  6.62M|                func_coeff = coeff[ai2_yfrac[1] << (is_yuv420 ? 0 : clr_indx)];
  ------------------
  |  Branch (564:53): [True: 6.61M, False: 8.43k]
  ------------------
  565|  6.62M|                func_wd = pu_wd >> (is_yuv444 ? 0 : clr_indx);
  ------------------
  |  Branch (565:37): [True: 0, False: 6.62M]
  ------------------
  566|  6.62M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (566:37): [True: 6.61M, False: 5.44k]
  ------------------
  567|       |
  568|  6.62M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  6.62M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (568:21): [True: 6.60M, False: 16.4k]
  ------------------
  569|  6.60M|                {
  570|  6.60M|                    func_ptr4(func_src, func_dst, func_src_strd, func_dst_strd,
  571|  6.60M|                              func_coeff, func_ht, func_wd);
  572|  6.60M|                }
  573|  16.4k|                else
  574|  16.4k|                {
  575|  16.4k|                    hbd_func_ptr4(func_src, func_dst, func_src_strd, func_dst_strd,
  576|  16.4k|                                  func_coeff, func_ht, func_wd, u1_bit_depth);
  577|  16.4k|                }
  578|       |
  579|  6.62M|            }
  580|       |
  581|   139M|            PROFILE_DISABLE_INTER_PRED_LUMA_AVERAGING(clr_indx);
  ------------------
  |  |  100|   139M|#define PROFILE_DISABLE_INTER_PRED_LUMA_AVERAGING(clr_indx) ;
  ------------------
  582|   139M|            PROFILE_DISABLE_INTER_PRED_CHROMA_AVERAGING(clr_indx);
  ------------------
  |  |  101|   139M|#define PROFILE_DISABLE_INTER_PRED_CHROMA_AVERAGING(clr_indx) ;
  ------------------
  583|       |
  584|       |
  585|   139M|            if((weighted_pred != 0) && (bi_pred != 0))
  ------------------
  |  Branch (585:16): [True: 45.3M, False: 94.1M]
  |  Branch (585:40): [True: 43.8M, False: 1.50M]
  ------------------
  586|  43.8M|            {
  587|  43.8M|                lvl_shift1 = 0;
  588|  43.8M|                lvl_shift2 = 0;
  589|  43.8M|                if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (589:20): [True: 23.0M, False: 20.8M]
  |  Branch (589:40): [True: 309k, False: 22.7M]
  |  Branch (589:56): [True: 212k, False: 96.9k]
  ------------------
  590|   212k|                    lvl_shift1 = (1 << 13);
  591|       |
  592|  43.8M|                if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (592:20): [True: 23.0M, False: 20.8M]
  |  Branch (592:40): [True: 202k, False: 22.8M]
  |  Branch (592:56): [True: 162k, False: 39.5k]
  ------------------
  593|   162k|                    lvl_shift2 = (1 << 13);
  594|       |
  595|       |
  596|  43.8M|                if(0 == clr_indx)
  ------------------
  |  Branch (596:20): [True: 23.0M, False: 20.8M]
  ------------------
  597|  23.0M|                {
  598|  23.0M|                    shift = ps_wt_ofst->i1_luma_log2_weight_denom
  599|  23.0M|                                + 14 - bit_depth_luma + 1;
  600|       |
  601|  23.0M|                    if (PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  23.0M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (601:25): [True: 22.9M, False: 155k]
  ------------------
  602|  22.9M|                    {
  603|  22.9M|                        ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr(pi2_tmp1,
  604|  22.9M|                                                                            pi2_tmp2,
  605|  22.9M|                                                                            pu1_dst,
  606|  22.9M|                                                                            pu_wd,
  607|  22.9M|                                                                            pu_wd,
  608|  22.9M|                                                                            ref_strd,
  609|  22.9M|                                                                            luma_weight_l0,
  610|  22.9M|                                                                            luma_offset_l0,
  611|  22.9M|                                                                            luma_weight_l1,
  612|  22.9M|                                                                            luma_offset_l1,
  613|  22.9M|                                                                            shift,
  614|  22.9M|                                                                            lvl_shift1,
  615|  22.9M|                                                                            lvl_shift2,
  616|  22.9M|                                                                            pu_ht,
  617|  22.9M|                                                                            pu_wd);
  618|  22.9M|                    }
  619|   155k|                    else
  620|   155k|                    {
  621|   155k|                        ps_codec->s_func_selector.ihevc_hbd_weighted_pred_bi_fptr(pi2_tmp1,
  622|   155k|                                                                                  pi2_tmp2,
  623|   155k|                                                                                  (UWORD16 *)pu1_dst,
  624|   155k|                                                                                  pu_wd,
  625|   155k|                                                                                  pu_wd,
  626|   155k|                                                                                  ref_strd,
  627|   155k|                                                                                  luma_weight_l0,
  628|   155k|                                                                                  luma_offset_l0,
  629|   155k|                                                                                  luma_weight_l1,
  630|   155k|                                                                                  luma_offset_l1,
  631|   155k|                                                                                  shift,
  632|   155k|                                                                                  lvl_shift1,
  633|   155k|                                                                                  lvl_shift2,
  634|   155k|                                                                                  pu_ht,
  635|   155k|                                                                                  pu_wd,
  636|   155k|                                                                                  bit_depth_luma);
  637|   155k|                    }
  638|  23.0M|                }
  639|  20.8M|                else
  640|  20.8M|                {
  641|  20.8M|                    shift = ps_wt_ofst->i1_chroma_log2_weight_denom
  642|  20.8M|                                    + 14 - bit_depth_chroma + 1;
  643|  20.8M|                    func_src_strd = pu_wd * (chroma_pixel_strd / h_samp_factor);
  644|  20.8M|                    func_dst_strd = ref_strd * (chroma_pixel_strd / h_samp_factor);
  645|       |
  646|  20.8M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (646:24): [True: 1.55M, False: 19.2M]
  ------------------
  647|  1.55M|                    {
  648|  1.55M|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  1.55M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (648:29): [True: 1.53M, False: 19.7k]
  ------------------
  649|  1.53M|                        {
  650|  1.53M|                            ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  651|  1.53M|                                                                                         pi2_tmp2,
  652|  1.53M|                                                                                         pu1_dst,
  653|  1.53M|                                                                                         func_src_strd,
  654|  1.53M|                                                                                         func_src_strd,
  655|  1.53M|                                                                                         func_dst_strd,
  656|  1.53M|                                                                                         chroma_weight_l0_cr,
  657|  1.53M|                                                                                         chroma_weight_l0_cb,
  658|  1.53M|                                                                                         chroma_offset_l0_cr,
  659|  1.53M|                                                                                         chroma_offset_l0_cb,
  660|  1.53M|                                                                                         chroma_weight_l1_cr,
  661|  1.53M|                                                                                         chroma_weight_l1_cb,
  662|  1.53M|                                                                                         chroma_offset_l1_cr,
  663|  1.53M|                                                                                         chroma_offset_l1_cb,
  664|  1.53M|                                                                                         shift,
  665|  1.53M|                                                                                         lvl_shift1,
  666|  1.53M|                                                                                         lvl_shift2,
  667|  18.4E|                                                                                         pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (667:100): [True: 1.53M, False: 18.4E]
  ------------------
  668|  1.53M|                                                                                         pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (668:100): [True: 0, False: 1.53M]
  ------------------
  669|  1.53M|                        }
  670|  19.7k|                        else
  671|  19.7k|                        {
  672|  19.7k|                            ps_codec->s_func_selector.ihevc_hbd_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  673|  19.7k|                                                                                             pi2_tmp2,
  674|  19.7k|                                                                                             (UWORD16 *)pu1_dst,
  675|  19.7k|                                                                                             func_src_strd,
  676|  19.7k|                                                                                             func_src_strd,
  677|  19.7k|                                                                                             func_dst_strd,
  678|  19.7k|                                                                                             chroma_weight_l0_cr,
  679|  19.7k|                                                                                             chroma_weight_l0_cb,
  680|  19.7k|                                                                                             chroma_offset_l0_cr,
  681|  19.7k|                                                                                             chroma_offset_l0_cb,
  682|  19.7k|                                                                                             chroma_weight_l1_cr,
  683|  19.7k|                                                                                             chroma_weight_l1_cb,
  684|  19.7k|                                                                                             chroma_offset_l1_cr,
  685|  19.7k|                                                                                             chroma_offset_l1_cb,
  686|  19.7k|                                                                                             shift,
  687|  19.7k|                                                                                             lvl_shift1,
  688|  19.7k|                                                                                             lvl_shift2,
  689|  18.4E|                                                                                             pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (689:104): [True: 20.0k, False: 18.4E]
  ------------------
  690|  19.7k|                                                                                             pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (690:104): [True: 0, False: 19.7k]
  ------------------
  691|  19.7k|                                                                                             (UWORD8)bit_depth_chroma);
  692|  19.7k|                        }
  693|  1.55M|                    }
  694|  19.2M|                    else
  695|  19.2M|                    {
  696|  19.2M|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  19.2M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (696:29): [True: 21.2M, False: 18.4E]
  ------------------
  697|  21.2M|                        {
  698|  21.2M|                            ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  699|  21.2M|                                                                                         pi2_tmp2,
  700|  21.2M|                                                                                         pu1_dst,
  701|  21.2M|                                                                                         func_src_strd,
  702|  21.2M|                                                                                         func_src_strd,
  703|  21.2M|                                                                                         func_dst_strd,
  704|  21.2M|                                                                                         chroma_weight_l0_cb,
  705|  21.2M|                                                                                         chroma_weight_l0_cr,
  706|  21.2M|                                                                                         chroma_offset_l0_cb,
  707|  21.2M|                                                                                         chroma_offset_l0_cr,
  708|  21.2M|                                                                                         chroma_weight_l1_cb,
  709|  21.2M|                                                                                         chroma_weight_l1_cr,
  710|  21.2M|                                                                                         chroma_offset_l1_cb,
  711|  21.2M|                                                                                         chroma_offset_l1_cr,
  712|  21.2M|                                                                                         shift,
  713|  21.2M|                                                                                         lvl_shift1,
  714|  21.2M|                                                                                         lvl_shift2,
  715|  21.2M|                                                                                         pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (715:100): [True: 21.1M, False: 50.8k]
  ------------------
  716|  21.2M|                                                                                         pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (716:100): [True: 0, False: 21.2M]
  ------------------
  717|  21.2M|                        }
  718|  18.4E|                        else
  719|  18.4E|                        {
  720|  18.4E|                            ps_codec->s_func_selector.ihevc_hbd_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  721|  18.4E|                                                                                             pi2_tmp2,
  722|  18.4E|                                                                                             (UWORD16 *)pu1_dst,
  723|  18.4E|                                                                                             func_src_strd,
  724|  18.4E|                                                                                             func_src_strd,
  725|  18.4E|                                                                                             func_dst_strd,
  726|  18.4E|                                                                                             chroma_weight_l0_cb,
  727|  18.4E|                                                                                             chroma_weight_l0_cr,
  728|  18.4E|                                                                                             chroma_offset_l0_cb,
  729|  18.4E|                                                                                             chroma_offset_l0_cr,
  730|  18.4E|                                                                                             chroma_weight_l1_cb,
  731|  18.4E|                                                                                             chroma_weight_l1_cr,
  732|  18.4E|                                                                                             chroma_offset_l1_cb,
  733|  18.4E|                                                                                             chroma_offset_l1_cr,
  734|  18.4E|                                                                                             shift,
  735|  18.4E|                                                                                             lvl_shift1,
  736|  18.4E|                                                                                             lvl_shift2,
  737|  18.4E|                                                                                             pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (737:104): [True: 57.6k, False: 18.4E]
  ------------------
  738|  18.4E|                                                                                             pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (738:104): [True: 0, False: 18.4E]
  ------------------
  739|  18.4E|                                                                                             (UWORD8)bit_depth_chroma);
  740|  18.4E|                        }
  741|  19.2M|                    }
  742|  20.8M|                }
  743|  43.8M|            }
  744|       |
  745|  95.5M|            else if((weighted_pred != 0) && (bi_pred == 0))
  ------------------
  |  Branch (745:21): [True: 1.60M, False: 93.9M]
  |  Branch (745:45): [True: 1.60M, False: 18.4E]
  ------------------
  746|  1.60M|            {
  747|  1.60M|                lvl_shift1 = 0;
  748|  1.60M|                if(ps_pu->b2_pred_mode == PRED_L0)
  ------------------
  |  Branch (748:20): [True: 1.28M, False: 321k]
  ------------------
  749|  1.28M|                {
  750|  1.28M|                    if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (750:24): [True: 667k, False: 613k]
  |  Branch (750:44): [True: 205k, False: 462k]
  |  Branch (750:60): [True: 131k, False: 73.4k]
  ------------------
  751|   131k|                        lvl_shift1 = (1 << 13);
  752|  1.28M|                }
  753|   321k|                else
  754|   321k|                {
  755|   321k|                    if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (755:24): [True: 164k, False: 156k]
  |  Branch (755:44): [True: 69.5k, False: 95.0k]
  |  Branch (755:60): [True: 61.3k, False: 8.22k]
  ------------------
  756|  61.3k|                        lvl_shift1 = (1 << 13);
  757|   321k|                }
  758|       |
  759|  1.60M|                if(0 == clr_indx)
  ------------------
  |  Branch (759:20): [True: 832k, False: 770k]
  ------------------
  760|   832k|                {
  761|   832k|                    shift = ps_wt_ofst->i1_luma_log2_weight_denom
  762|   832k|                                    + 14 - bit_depth_luma;
  763|       |
  764|   832k|                    if (PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   832k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (764:25): [True: 779k, False: 52.9k]
  ------------------
  765|   779k|                    {
  766|   779k|                        ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (766:80): [True: 618k, False: 160k]
  ------------------
  767|   779k|                                                                               pu1_dst,
  768|   779k|                                                                               pu_wd,
  769|   779k|                                                                               ref_strd,
  770|   779k|                                                                               ps_pu->b2_pred_mode == PRED_L0 ? luma_weight_l0 : luma_weight_l1,
  ------------------
  |  Branch (770:80): [True: 618k, False: 160k]
  ------------------
  771|   779k|                                                                               ps_pu->b2_pred_mode == PRED_L0 ? luma_offset_l0 : luma_offset_l1,
  ------------------
  |  Branch (771:80): [True: 619k, False: 160k]
  ------------------
  772|   779k|                                                                               shift,
  773|   779k|                                                                               lvl_shift1,
  774|   779k|                                                                               pu_ht,
  775|   779k|                                                                               pu_wd);
  776|   779k|                    }
  777|  52.9k|                    else
  778|  52.9k|                    {
  779|  52.9k|                        ps_codec->s_func_selector.ihevc_hbd_weighted_pred_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (779:84): [True: 49.3k, False: 3.53k]
  ------------------
  780|  52.9k|                                                                                   (UWORD16 *)pu1_dst,
  781|  52.9k|                                                                                   pu_wd,
  782|  52.9k|                                                                                   ref_strd,
  783|  52.9k|                                                                                   ps_pu->b2_pred_mode == PRED_L0 ? luma_weight_l0 : luma_weight_l1,
  ------------------
  |  Branch (783:84): [True: 49.3k, False: 3.53k]
  ------------------
  784|  52.9k|                                                                                   ps_pu->b2_pred_mode == PRED_L0 ? luma_offset_l0 : luma_offset_l1,
  ------------------
  |  Branch (784:84): [True: 49.3k, False: 3.53k]
  ------------------
  785|  52.9k|                                                                                   shift,
  786|  52.9k|                                                                                   lvl_shift1,
  787|  52.9k|                                                                                   pu_ht,
  788|  52.9k|                                                                                   pu_wd,
  789|  52.9k|                                                                                   (UWORD8)bit_depth_luma);
  790|  52.9k|                    }
  791|   832k|                }
  792|   770k|                else
  793|   770k|                {
  794|   770k|                    shift = ps_wt_ofst->i1_chroma_log2_weight_denom
  795|   770k|                                    + 14 - bit_depth_chroma;
  796|   770k|                    func_src_strd = pu_wd * (chroma_pixel_strd / h_samp_factor);
  797|   770k|                    func_dst_strd = ref_strd * (chroma_pixel_strd / h_samp_factor);
  798|       |
  799|   770k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (799:24): [True: 165k, False: 604k]
  ------------------
  800|   165k|                    {
  801|   165k|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   165k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (801:29): [True: 157k, False: 8.05k]
  ------------------
  802|   157k|                        {
  803|   157k|                            ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (803:91): [True: 137k, False: 20.1k]
  ------------------
  804|   157k|                                                                                          pu1_dst,
  805|   157k|                                                                                          func_src_strd,
  806|   157k|                                                                                          func_dst_strd,
  807|   157k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (807:91): [True: 137k, False: 20.1k]
  ------------------
  808|   157k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (808:91): [True: 137k, False: 20.1k]
  ------------------
  809|   157k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (809:91): [True: 137k, False: 20.1k]
  ------------------
  810|   157k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (810:91): [True: 137k, False: 20.0k]
  ------------------
  811|   157k|                                                                                          shift,
  812|   157k|                                                                                          lvl_shift1,
  813|  18.4E|                                                                                          pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (813:101): [True: 157k, False: 18.4E]
  ------------------
  814|   157k|                                                                                          pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (814:101): [True: 0, False: 157k]
  ------------------
  815|   157k|                        }
  816|  8.05k|                        else
  817|  8.05k|                        {
  818|  8.05k|                            ps_codec->s_func_selector.ihevc_hbd_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (818:95): [True: 7.09k, False: 959]
  ------------------
  819|  8.05k|                                                                                             (UWORD16 *)pu1_dst,
  820|  8.05k|                                                                                             func_src_strd,
  821|  8.05k|                                                                                             func_dst_strd,
  822|  8.05k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (822:94): [True: 7.09k, False: 959]
  ------------------
  823|  8.05k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (823:94): [True: 7.09k, False: 958]
  ------------------
  824|  8.05k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (824:94): [True: 7.09k, False: 958]
  ------------------
  825|  8.05k|                                                                                             ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (825:94): [True: 7.09k, False: 958]
  ------------------
  826|  8.05k|                                                                                             shift,
  827|  8.05k|                                                                                             lvl_shift1,
  828|  18.4E|                                                                                             pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (828:104): [True: 8.08k, False: 18.4E]
  ------------------
  829|  8.05k|                                                                                             pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (829:104): [True: 0, False: 8.05k]
  ------------------
  830|  8.05k|                                                                                             (UWORD8)bit_depth_chroma);
  831|  8.05k|                        }
  832|   165k|                    }
  833|   604k|                    else
  834|   604k|                    {
  835|   604k|                        if (PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   604k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (835:29): [True: 597k, False: 7.03k]
  ------------------
  836|   597k|                        {
  837|   597k|                            ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (837:91): [True: 456k, False: 141k]
  ------------------
  838|   597k|                                                                                          pu1_dst,
  839|   597k|                                                                                          func_src_strd,
  840|   597k|                                                                                          func_dst_strd,
  841|   597k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (841:91): [True: 456k, False: 141k]
  ------------------
  842|   597k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (842:91): [True: 456k, False: 141k]
  ------------------
  843|   597k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (843:91): [True: 456k, False: 141k]
  ------------------
  844|   597k|                                                                                          ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (844:91): [True: 456k, False: 141k]
  ------------------
  845|   597k|                                                                                          shift,
  846|   597k|                                                                                          lvl_shift1,
  847|   597k|                                                                                          pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (847:101): [True: 588k, False: 9.44k]
  ------------------
  848|   597k|                                                                                          pu_wd >> (is_yuv444 ? 0 : clr_indx));
  ------------------
  |  Branch (848:101): [True: 0, False: 597k]
  ------------------
  849|   597k|                        }
  850|  7.03k|                        else
  851|  7.03k|                        {
  852|  18.4E|                            ps_codec->s_func_selector.ihevc_hbd_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (852:95): [True: 42.2k, False: 18.4E]
  ------------------
  853|  7.03k|                                                                                              (UWORD16 *)pu1_dst,
  854|  7.03k|                                                                                              func_src_strd,
  855|  7.03k|                                                                                              func_dst_strd,
  856|  18.4E|                                                                                              ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (856:95): [True: 42.2k, False: 18.4E]
  ------------------
  857|  18.4E|                                                                                              ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (857:95): [True: 42.2k, False: 18.4E]
  ------------------
  858|  18.4E|                                                                                              ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (858:95): [True: 42.2k, False: 18.4E]
  ------------------
  859|  18.4E|                                                                                              ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (859:95): [True: 42.2k, False: 18.4E]
  ------------------
  860|  7.03k|                                                                                              shift,
  861|  7.03k|                                                                                              lvl_shift1,
  862|  18.4E|                                                                                              pu_ht >> (is_yuv420 ? clr_indx : 0),
  ------------------
  |  Branch (862:105): [True: 19.7k, False: 18.4E]
  ------------------
  863|  7.03k|                                                                                              pu_wd >> (is_yuv444 ? 0 : clr_indx),
  ------------------
  |  Branch (863:105): [True: 0, False: 7.03k]
  ------------------
  864|  7.03k|                                                                                              (UWORD8)bit_depth_chroma);
  865|  7.03k|                        }
  866|   604k|                    }
  867|   770k|                }
  868|  1.60M|            }
  869|       |
  870|  93.9M|            else if((weighted_pred == 0) && (bi_pred != 0))
  ------------------
  |  Branch (870:21): [True: 90.1M, False: 3.86M]
  |  Branch (870:45): [True: 74.1M, False: 15.9M]
  ------------------
  871|  74.1M|            {
  872|  74.1M|                lvl_shift1 = 0;
  873|  74.1M|                lvl_shift2 = 0;
  874|       |
  875|  74.1M|                if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (875:20): [True: 39.1M, False: 35.0M]
  |  Branch (875:40): [True: 6.08M, False: 33.0M]
  |  Branch (875:56): [True: 3.29M, False: 2.79M]
  ------------------
  876|  3.29M|                    lvl_shift1 = (1 << 13);
  877|       |
  878|  74.1M|                if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (878:20): [True: 39.1M, False: 34.9M]
  |  Branch (878:40): [True: 4.26M, False: 34.9M]
  |  Branch (878:56): [True: 1.80M, False: 2.45M]
  ------------------
  879|  1.80M|                    lvl_shift2 = (1 << 13);
  880|       |
  881|  74.1M|                func_src_strd = pu_wd;
  882|  74.1M|                func_dst_strd = ref_strd;
  883|  74.1M|                if (clr_indx != 0)
  ------------------
  |  Branch (883:21): [True: 38.4M, False: 35.7M]
  ------------------
  884|  38.4M|                {
  885|  38.4M|                    func_src_strd *= (chroma_pixel_strd / h_samp_factor);
  886|  38.4M|                    func_dst_strd *= (chroma_pixel_strd / h_samp_factor);
  887|  38.4M|                }
  888|  74.1M|                func_ht = pu_ht >> (is_yuv420 ? clr_indx : 0);
  ------------------
  |  Branch (888:37): [True: 73.8M, False: 308k]
  ------------------
  889|  74.1M|                func_wd = pu_wd << (is_yuv444 ? clr_indx : 0);
  ------------------
  |  Branch (889:37): [True: 0, False: 74.1M]
  ------------------
  890|       |
  891|  74.1M|                if (PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  74.1M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (891:21): [True: 73.7M, False: 364k]
  ------------------
  892|  73.7M|                {
  893|  73.7M|                    ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr(pi2_tmp1,
  894|  73.7M|                                                                                  pi2_tmp2,
  895|  73.7M|                                                                                  pu1_dst,
  896|  73.7M|                                                                                  func_src_strd,
  897|  73.7M|                                                                                  func_src_strd,
  898|  73.7M|                                                                                  func_dst_strd,
  899|  73.7M|                                                                                  lvl_shift1,
  900|  73.7M|                                                                                  lvl_shift2,
  901|  73.7M|                                                                                  func_ht,
  902|  73.7M|                                                                                  func_wd);
  903|  73.7M|                }
  904|   364k|                else
  905|   364k|                {
  906|   364k|                    ps_codec->s_func_selector.ihevc_hbd_weighted_pred_bi_default_fptr(pi2_tmp1,
  907|   364k|                                                                                      pi2_tmp2,
  908|   364k|                                                                                      (UWORD16 *)pu1_dst,
  909|   364k|                                                                                      func_src_strd,
  910|   364k|                                                                                      func_src_strd,
  911|   364k|                                                                                      func_dst_strd,
  912|   364k|                                                                                      lvl_shift1,
  913|   364k|                                                                                      lvl_shift2,
  914|   364k|                                                                                      func_ht,
  915|   364k|                                                                                      func_wd,
  916|   364k|                                                                                      u1_bit_depth);
  917|   364k|                }
  918|  74.1M|            }
  919|   139M|        }
  920|  71.7M|    }
  921|  4.21M|}

ihevcd_intra_pred_mode_prediction:
  109|  3.15M|{
  110|  3.15M|    WORD32 i, j, num_pred_blocks;
  111|  3.15M|    WORD32 available_l, available_t;
  112|  3.15M|    WORD32 cand_intra_pred_mode_l, cand_intra_pred_mode_t;
  113|  3.15M|    WORD32 cand_mode_list[3];
  114|  3.15M|    WORD32 cb_size, block_offset_in_min_pu;
  115|  3.15M|    UWORD8 *pu1_luma_intra_pred_mode_top;
  116|  3.15M|    UWORD8 *pu1_luma_intra_pred_mode_left;
  117|       |
  118|  3.15M|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
  119|  3.15M|    parse_cu_t *ps_cu = &ps_codec->s_parse.s_cu;
  120|  3.15M|    sps_t *ps_sps = ps_parse->ps_sps;
  121|       |
  122|       |
  123|  3.15M|    available_t = 1;
  124|  3.15M|    available_l = 1;
  125|       |    /* i4_pos_x and i4_pos_y are in minCu units (8x8), convert them to 4x4 units by multiplying by 2 */
  126|  3.15M|    pu1_luma_intra_pred_mode_top = ps_parse->pu1_luma_intra_pred_mode_top
  127|  3.15M|                    + (ps_cu->i4_pos_x * 2);
  128|       |
  129|  3.15M|    pu1_luma_intra_pred_mode_left = ps_parse->pu1_luma_intra_pred_mode_left
  130|  3.15M|                    + (ps_cu->i4_pos_y * 2);
  131|       |
  132|       |/*
  133|       |    if(0 == ps_cu->i4_pos_y)
  134|       |    {
  135|       |        memset(pu1_luma_intra_pred_mode_top, INTRA_DC, 16);
  136|       |    }
  137|       |
  138|       |    if(0 == ps_cu->i4_pos_x)
  139|       |    {
  140|       |        memset(pu1_luma_intra_pred_mode_left, INTRA_DC, 16);
  141|       |    }
  142|       |*/
  143|  3.15M|    if(ps_cu->i4_pos_y)
  ------------------
  |  Branch (143:8): [True: 2.09M, False: 1.05M]
  ------------------
  144|  2.09M|    {
  145|  2.09M|        UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
  146|  2.09M|        WORD32 top_intra_flag;
  147|       |
  148|  2.09M|        WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  149|  2.09M|        pu1_pic_intra_flag += ((y0 - 8) / 8) * numbytes_row;
  150|  2.09M|        pu1_pic_intra_flag += (x0 / 64);
  151|  2.09M|        top_intra_flag = *pu1_pic_intra_flag;
  152|  2.09M|        top_intra_flag &= (1 << ((x0 / 8) % 8));
  153|       |
  154|  2.09M|        if(0 == top_intra_flag)
  ------------------
  |  Branch (154:12): [True: 28.9k, False: 2.06M]
  ------------------
  155|  28.9k|        {
  156|  28.9k|            available_t = 0;
  157|  28.9k|        }
  158|  2.09M|    }
  159|  1.05M|    else
  160|  1.05M|        available_t = 0;
  161|       |
  162|       |
  163|  3.15M|    if((0 == ps_cu->i4_pos_x) && (((0 == ps_codec->s_parse.i4_ctb_slice_x) && (0 == ps_codec->s_parse.i4_ctb_slice_y)) ||
  ------------------
  |  Branch (163:8): [True: 1.12M, False: 2.03M]
  |  Branch (163:36): [True: 202k, False: 920k]
  |  Branch (163:79): [True: 122k, False: 80.2k]
  ------------------
  164|  1.00M|                                  (0 == ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (164:35): [True: 81.3k, False: 918k]
  ------------------
  165|   204k|    {
  166|   204k|        available_l = 0;
  167|   204k|    }
  168|       |
  169|  3.15M|    if(available_l)
  ------------------
  |  Branch (169:8): [True: 2.95M, False: 204k]
  ------------------
  170|  2.95M|    {
  171|  2.95M|        UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
  172|  2.95M|        WORD32 left_intra_flag;
  173|  2.95M|        WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  174|  2.95M|        pu1_pic_intra_flag += (y0 / 8) * numbytes_row;
  175|  2.95M|        pu1_pic_intra_flag += ((x0 - 8) / 64);
  176|  2.95M|        left_intra_flag = *pu1_pic_intra_flag;
  177|  2.95M|        left_intra_flag &= (1 << (((x0 - 8) / 8) % 8));
  178|       |
  179|  2.95M|        if(0 == left_intra_flag)
  ------------------
  |  Branch (179:12): [True: 44.8k, False: 2.90M]
  ------------------
  180|  44.8k|        {
  181|  44.8k|            available_l = 0;
  182|  44.8k|        }
  183|  2.95M|    }
  184|       |
  185|  3.15M|    cb_size = (1 << log2_cb_size);
  186|       |
  187|  3.15M|    block_offset_in_min_pu = (cb_size / 2) / MIN_PU_SIZE;
  ------------------
  |  |  367|  3.15M|#define MIN_PU_SIZE         4
  ------------------
  188|       |
  189|  3.15M|    num_pred_blocks = (ps_cu->i4_part_mode == PART_NxN) ? 2 : 1;
  ------------------
  |  Branch (189:23): [True: 615k, False: 2.53M]
  ------------------
  190|       |
  191|  6.92M|    for(i = 0; i < num_pred_blocks; i++)
  ------------------
  |  Branch (191:16): [True: 3.77M, False: 3.15M]
  ------------------
  192|  3.77M|    {
  193|  3.77M|        WORD32 available_l_tmp;
  194|  3.77M|        available_l_tmp = available_l;
  195|  8.77M|        for(j = 0; j < num_pred_blocks; j++)
  ------------------
  |  Branch (195:20): [True: 5.00M, False: 3.77M]
  ------------------
  196|  5.00M|        {
  197|       |            /* Computing Candidate intra pred mode left */
  198|  5.00M|            {
  199|  5.00M|                WORD32 block_offset;
  200|       |
  201|  5.00M|                block_offset = i * block_offset_in_min_pu;
  202|  5.00M|                cand_intra_pred_mode_l = INTRA_DC;
  ------------------
  |  |  514|  5.00M|#define INTRA_DC                 1
  ------------------
  203|  5.00M|                if(available_l_tmp)
  ------------------
  |  Branch (203:20): [True: 4.68M, False: 314k]
  ------------------
  204|  4.68M|                {
  205|  4.68M|                    cand_intra_pred_mode_l =
  206|  4.68M|                                    pu1_luma_intra_pred_mode_left[block_offset];
  207|  4.68M|                }
  208|       |
  209|  5.00M|            }
  210|       |
  211|  5.00M|            {
  212|  5.00M|                WORD32 block_offset;
  213|  5.00M|                block_offset = j * block_offset_in_min_pu;
  214|  5.00M|                cand_intra_pred_mode_t = INTRA_DC;
  ------------------
  |  |  514|  5.00M|#define INTRA_DC                 1
  ------------------
  215|  5.00M|                if(available_t)
  ------------------
  |  Branch (215:20): [True: 3.80M, False: 1.19M]
  ------------------
  216|  3.80M|                {
  217|  3.80M|                    cand_intra_pred_mode_t =
  218|  3.80M|                                    pu1_luma_intra_pred_mode_top[block_offset];
  219|  3.80M|                }
  220|  5.00M|            }
  221|       |
  222|       |            /* Computing Candidate mode list */
  223|  5.00M|            if(cand_intra_pred_mode_l == cand_intra_pred_mode_t)
  ------------------
  |  Branch (223:16): [True: 1.33M, False: 3.66M]
  ------------------
  224|  1.33M|            {
  225|  1.33M|                if(cand_intra_pred_mode_l < 2)
  ------------------
  |  Branch (225:20): [True: 773k, False: 566k]
  ------------------
  226|   773k|                {
  227|   773k|                    cand_mode_list[0] = INTRA_PLANAR;
  ------------------
  |  |  511|   773k|#define INTRA_PLANAR             0
  ------------------
  228|   773k|                    cand_mode_list[1] = INTRA_DC;
  ------------------
  |  |  514|   773k|#define INTRA_DC                 1
  ------------------
  229|   773k|                    cand_mode_list[2] = INTRA_ANGULAR(26); /* angular 26 = Vertical */
  ------------------
  |  |  517|   773k|#define INTRA_ANGULAR(x) (x)
  ------------------
  230|   773k|                }
  231|   566k|                else
  232|   566k|                {
  233|   566k|                    cand_mode_list[0] = cand_intra_pred_mode_l;
  234|   566k|                    cand_mode_list[1] = 2
  235|   566k|                                    + ((cand_intra_pred_mode_l + 29) % 32);
  236|   566k|                    cand_mode_list[2] = 2
  237|   566k|                                    + ((cand_intra_pred_mode_l - 2 + 1) % 32);
  238|   566k|                }
  239|  1.33M|            }
  240|  3.66M|            else
  241|  3.66M|            {
  242|  3.66M|                cand_mode_list[0] = cand_intra_pred_mode_l;
  243|  3.66M|                cand_mode_list[1] = cand_intra_pred_mode_t;
  244|       |
  245|  3.66M|                if((cand_intra_pred_mode_l != INTRA_PLANAR)
  ------------------
  |  |  511|  3.66M|#define INTRA_PLANAR             0
  ------------------
  |  Branch (245:20): [True: 2.83M, False: 824k]
  ------------------
  246|  2.83M|                                && (cand_intra_pred_mode_t != INTRA_PLANAR))
  ------------------
  |  |  511|  2.83M|#define INTRA_PLANAR             0
  ------------------
  |  Branch (246:36): [True: 2.23M, False: 599k]
  ------------------
  247|  2.23M|                {
  248|  2.23M|                    cand_mode_list[2] = INTRA_PLANAR;
  ------------------
  |  |  511|  2.23M|#define INTRA_PLANAR             0
  ------------------
  249|  2.23M|                }
  250|  1.42M|                else if((cand_intra_pred_mode_l != INTRA_DC)
  ------------------
  |  |  514|  1.42M|#define INTRA_DC                 1
  ------------------
  |  Branch (250:25): [True: 1.11M, False: 305k]
  ------------------
  251|  1.11M|                                && (cand_intra_pred_mode_t != INTRA_DC))
  ------------------
  |  |  514|  1.11M|#define INTRA_DC                 1
  ------------------
  |  Branch (251:36): [True: 575k, False: 543k]
  ------------------
  252|   575k|                {
  253|   575k|                    cand_mode_list[2] = INTRA_DC;
  ------------------
  |  |  514|   575k|#define INTRA_DC                 1
  ------------------
  254|   575k|                }
  255|   848k|                else
  256|   848k|                {
  257|   848k|                    cand_mode_list[2] = INTRA_ANGULAR(26);
  ------------------
  |  |  517|   848k|#define INTRA_ANGULAR(x) (x)
  ------------------
  258|   848k|                }
  259|  3.66M|            }
  260|       |
  261|       |            /* Computing Intra pred mode */
  262|  5.00M|            if(ps_cu->ai4_prev_intra_luma_pred_flag[2 * i + j] == 1)
  ------------------
  |  Branch (262:16): [True: 2.80M, False: 2.19M]
  ------------------
  263|  2.80M|            {
  264|  2.80M|                ps_cu->ai4_intra_luma_pred_mode[2 * i + j] =
  265|  2.80M|                                cand_mode_list[ps_cu->ai4_mpm_idx[2 * i + j]];
  266|  2.80M|            }
  267|  2.19M|            else
  268|  2.19M|            {
  269|  2.19M|                WORD32 intra_pred_mode;
  270|       |                /* Arranging cand_mode_list in increasing order */
  271|  2.19M|                if(cand_mode_list[0] > cand_mode_list[1])
  ------------------
  |  Branch (271:20): [True: 965k, False: 1.23M]
  ------------------
  272|   965k|                {
  273|   965k|                    SWAP(cand_mode_list[0], cand_mode_list[1]);
  ------------------
  |  |   87|   965k|#define SWAP(X,Y)                   \
  |  |   88|   965k|{                                   \
  |  |   89|   965k|    (X) = (X) ^ (Y);                \
  |  |   90|   965k|    (Y) = (X) ^ (Y);                \
  |  |   91|   965k|    (X) = (X) ^ (Y);                \
  |  |   92|   965k|}
  ------------------
  274|   965k|                }
  275|  2.19M|                if(cand_mode_list[0] > cand_mode_list[2])
  ------------------
  |  Branch (275:20): [True: 1.26M, False: 929k]
  ------------------
  276|  1.26M|                {
  277|  1.26M|                    SWAP(cand_mode_list[0], cand_mode_list[2]);
  ------------------
  |  |   87|  1.26M|#define SWAP(X,Y)                   \
  |  |   88|  1.26M|{                                   \
  |  |   89|  1.26M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.26M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.26M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.26M|}
  ------------------
  278|  1.26M|                }
  279|  2.19M|                if(cand_mode_list[1] > cand_mode_list[2])
  ------------------
  |  Branch (279:20): [True: 1.72M, False: 474k]
  ------------------
  280|  1.72M|                {
  281|  1.72M|                    SWAP(cand_mode_list[1], cand_mode_list[2]);
  ------------------
  |  |   87|  1.72M|#define SWAP(X,Y)                   \
  |  |   88|  1.72M|{                                   \
  |  |   89|  1.72M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.72M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.72M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.72M|}
  ------------------
  282|  1.72M|                }
  283|       |
  284|  2.19M|                intra_pred_mode = ps_cu->ai4_rem_intra_luma_pred_mode[2 * i + j];
  285|       |
  286|  2.19M|                if(intra_pred_mode >= cand_mode_list[0])
  ------------------
  |  Branch (286:20): [True: 1.88M, False: 318k]
  ------------------
  287|  1.88M|                    intra_pred_mode++;
  288|       |
  289|  2.19M|                if(intra_pred_mode >= cand_mode_list[1])
  ------------------
  |  Branch (289:20): [True: 1.58M, False: 614k]
  ------------------
  290|  1.58M|                    intra_pred_mode++;
  291|       |
  292|  2.19M|                if(intra_pred_mode >= cand_mode_list[2])
  ------------------
  |  Branch (292:20): [True: 606k, False: 1.59M]
  ------------------
  293|   606k|                    intra_pred_mode++;
  294|       |
  295|  2.19M|                ps_cu->ai4_intra_luma_pred_mode[2 * i + j] = intra_pred_mode;
  296|  2.19M|            }
  297|       |            /* Update Top and Left intra pred mode */
  298|  5.00M|            {
  299|  5.00M|                WORD32 intra_pred_mode;
  300|       |
  301|  5.00M|                intra_pred_mode = ps_cu->ai4_intra_luma_pred_mode[2 * i + j];
  302|       |
  303|  5.00M|                memset(pu1_luma_intra_pred_mode_left + i * block_offset_in_min_pu, intra_pred_mode, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.00M|#define MIN_PU_SIZE         4
  ------------------
  304|  5.00M|                memset(pu1_luma_intra_pred_mode_top + j * block_offset_in_min_pu, intra_pred_mode, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.00M|#define MIN_PU_SIZE         4
  ------------------
  305|       |
  306|  5.00M|            }
  307|       |            /* If partition is PART_NxN, then left is available for second column always */
  308|  5.00M|            available_l_tmp = 1;
  309|       |
  310|  5.00M|        }
  311|       |        /* If partition is PART_NxN, then top is available for bottom row always */
  312|  3.77M|        available_t = 1;
  313|  3.77M|    }
  314|       |
  315|       |    /* In case it is PART_2Nx2N partition, replicate intra pred mode in other three entries */
  316|  3.15M|    if(ps_cu->i4_part_mode == PART_2Nx2N)
  ------------------
  |  Branch (316:8): [True: 2.53M, False: 615k]
  ------------------
  317|  2.53M|    {
  318|  2.53M|        ps_cu->ai4_intra_luma_pred_mode[1] = ps_cu->ai4_intra_luma_pred_mode[0];
  319|  2.53M|        ps_cu->ai4_intra_luma_pred_mode[2] = ps_cu->ai4_intra_luma_pred_mode[0];
  320|  2.53M|        ps_cu->ai4_intra_luma_pred_mode[3] = ps_cu->ai4_intra_luma_pred_mode[0];
  321|  2.53M|    }
  322|  3.15M|}

ihevcd_unpack_coeffs:
  234|  8.13M|{
  235|       |    /* Generating coeffs from coeff-map */
  236|  8.13M|    WORD32 i;
  237|  8.13M|    WORD16 *pi2_sblk_ptr;
  238|  8.13M|    WORD32 subblk_pos_x, subblk_pos_y;
  239|  8.13M|    WORD32 sblk_scan_idx, coeff_raster_idx;
  240|  8.13M|    WORD32 sblk_non_zero_coeff_idx;
  241|  8.13M|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  242|  8.13M|    UWORD8 u1_num_coded_sblks, u1_scan_type;
  243|  8.13M|    UWORD8 *pu1_new_tu_coeff_data;
  244|  8.13M|    WORD32 trans_size;
  245|  8.13M|    WORD32 xs, ys;
  246|  8.13M|    WORD32 trans_skip;
  247|  8.13M|    WORD16 iquant_out;
  248|  8.13M|    WORD32 shift_iq;
  249|       |
  250|  8.13M|    shift_iq = bit_depth + log2_trans_size - 5;
  251|  8.13M|    trans_size = (1 << log2_trans_size);
  252|       |
  253|       |    /* First byte points to number of coded blocks */
  254|  8.13M|    u1_num_coded_sblks = *pu1_tu_coeff_data++;
  255|       |
  256|       |    /* Next byte points to scan type */
  257|  8.13M|    u1_scan_type = *pu1_tu_coeff_data++;
  258|       |    /* 0th bit has trans_skip */
  259|  8.13M|    trans_skip = u1_scan_type & 1;
  260|  8.13M|#ifdef ENABLE_MAIN_REXT_PROFILE
  261|  8.13M|    u1_scan_type = (u1_scan_type & 0xF) >> 1;
  262|       |#else
  263|       |    u1_scan_type >>= 1;
  264|       |#endif
  265|       |
  266|  8.13M|    pi2_sblk_ptr = pi2_tu_coeff;
  267|       |
  268|       |    /* Initially all columns are assumed to be zero */
  269|  8.13M|    *pu4_zero_cols = 0xFFFFFFFF;
  270|       |    /* Initially all rows are assumed to be zero */
  271|  8.13M|    *pu4_zero_rows = 0xFFFFFFFF;
  272|       |
  273|  8.13M|    ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)(pu1_tu_coeff_data);
  274|       |
  275|  8.13M|    if(trans_skip)
  ------------------
  |  Branch (275:8): [True: 1.18M, False: 6.94M]
  ------------------
  276|  1.18M|        memset(pi2_tu_coeff, 0, trans_size * trans_size * sizeof(WORD16));
  277|       |
  278|  8.13M|    STATS_INIT_SBLK_AND_COEFF_POS();
  ------------------
  |  |  141|  8.13M|#define STATS_INIT_SBLK_AND_COEFF_POS() ;
  ------------------
  279|       |
  280|       |    /* DC only case */
  281|  8.13M|    if((e_trans_type != DST_4x4) && (1 == u1_num_coded_sblks)
  ------------------
  |  Branch (281:8): [True: 5.82M, False: 2.30M]
  |  Branch (281:37): [True: 4.48M, False: 1.33M]
  ------------------
  282|  4.48M|                    && (0 == ps_tu_sblk_coeff_data->u2_subblk_pos)
  ------------------
  |  Branch (282:24): [True: 4.24M, False: 245k]
  ------------------
  283|  4.24M|                    && (1 == ps_tu_sblk_coeff_data->u2_sig_coeff_map))
  ------------------
  |  Branch (283:24): [True: 2.51M, False: 1.72M]
  ------------------
  284|  2.51M|    {
  285|  2.51M|        *pu4_coeff_type = 1;
  286|       |
  287|  2.51M|        if(!trans_quant_bypass)
  ------------------
  |  Branch (287:12): [True: 2.39M, False: 119k]
  ------------------
  288|  2.39M|        {
  289|  2.39M|            WORD32 dequant_coeff = (trans_skip && (trans_size > 4)) ? 16 : pi2_dequant_matrix[0];
  ------------------
  |  Branch (289:37): [True: 313k, False: 2.08M]
  |  Branch (289:51): [True: 622, False: 312k]
  ------------------
  290|  2.39M|            if(4 == trans_size)
  ------------------
  |  Branch (290:16): [True: 912k, False: 1.48M]
  ------------------
  291|   912k|            {
  292|   912k|                IQUANT_4x4(iquant_out,
  ------------------
  |  |  158|   912k|#define IQUANT_4x4(res, coeff /*pi2_src[index*src_strd]*/, dequant_coeff /*pi2_dequant_coeff[index*trans_size] * g_ihevc_iquant_scales[qp_rem] */, shift_iq, qp_div)   \
  |  |  159|   912k|{                                                                                                                                              \
  |  |  160|   912k|    WORD32 clip_coeff, tmp;                                                                                                                    \
  |  |  161|   912k|    WORD32 coeff_min,coeff_max;                                                                                                                \
  |  |  162|   912k|    WORD32 coeff_bit_range;                                                                                                                    \
  |  |  163|   912k|    WORD32 add_iq;                                                                                                                             \
  |  |  164|   912k|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|   912k|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 272k, False: 640k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|   912k|                                                                                                                                               \
  |  |  166|   912k|    coeff_bit_range = 16;                                                                                                                      \
  |  |  167|   912k|    if(qp_div > shift_iq)                                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 188k, False: 724k]
  |  |  ------------------
  |  |  168|   912k|        coeff_bit_range = 10;                                                                                                                  \
  |  |  169|   912k|                                                                                                                                               \
  |  |  170|   912k|    coeff_min = -(1<<(coeff_bit_range-1));                                                                                                     \
  |  |  171|   912k|    coeff_max = (1<<(coeff_bit_range-1)) - 1;                                                                                                  \
  |  |  172|   912k|                                                                                                                                               \
  |  |  173|   912k|    clip_coeff = CLIP3(coeff,coeff_min,coeff_max);                                                                                             \
  |  |  ------------------
  |  |  |  |   40|   912k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 68, False: 912k]
  |  |  |  |  |  Branch (40:53): [True: 71, False: 912k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|   912k|                                                                                                                                               \
  |  |  175|   912k|    tmp = clip_coeff * dequant_coeff ;                                                                                                         \
  |  |  176|   912k|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  177|   912k|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|   912k|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 640k, False: 272k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|   912k|                                                                                                                                               \
  |  |  179|   912k|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|   912k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|   912k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 4.24k, False: 908k]
  |  |  |  |  |  |  |  Branch (40:53): [True: 3.48k, False: 904k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|   912k|}
  ------------------
  293|   912k|                           ps_tu_sblk_coeff_data->ai2_level[0],
  294|   912k|                           dequant_coeff
  295|   912k|                                           * g_ihevc_iquant_scales[qp_rem],
  296|   912k|                           shift_iq, qp_div);
  297|   912k|            }
  298|  1.48M|            else
  299|  1.48M|            {
  300|  1.48M|                IQUANT(iquant_out, ps_tu_sblk_coeff_data->ai2_level[0],
  ------------------
  |  |  140|  1.48M|#define IQUANT(res, coeff /*pi2_src[index*src_strd]*/, dequant_coeff /*pi2_dequant_coeff[index*trans_size] * g_ihevc_iquant_scales[qp_rem] */, shift_iq, qp_div)       \
  |  |  141|  1.48M|{                                                                                                                                              \
  |  |  142|  1.48M|    WORD32 tmp, add_iq;                                                                                                                        \
  |  |  143|  1.48M|                                                                                                                                               \
  |  |  144|  1.48M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  1.48M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 1.21M, False: 274k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.48M|                                                                                                                                               \
  |  |  146|  1.48M|    tmp = coeff * dequant_coeff ;                                                                                                              \
  |  |  147|  1.48M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  148|  1.48M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  1.48M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 278k, False: 1.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|  1.48M|                                                                                                                                               \
  |  |  150|  1.48M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  1.48M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.48M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 2.86k, False: 1.48M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 2.33k, False: 1.48M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  1.48M|}
  ------------------
  301|  1.48M|                       dequant_coeff * g_ihevc_iquant_scales[qp_rem],
  302|  1.48M|                       shift_iq, qp_div);
  303|  1.48M|            }
  304|  2.39M|            if(trans_skip)
  ------------------
  |  Branch (304:16): [True: 313k, False: 2.08M]
  ------------------
  305|   313k|            {
  306|   313k|                WORD32 shift_ts = MAX_TR_DYNAMIC_RANGE - bit_depth - log2_trans_size;
  ------------------
  |  |  441|   313k|#define MAX_TR_DYNAMIC_RANGE  15
  ------------------
  307|   313k|                if(shift_ts > 0)
  ------------------
  |  Branch (307:20): [True: 313k, False: 89]
  ------------------
  308|   313k|                {
  309|   313k|                    iquant_out = (iquant_out + (1 << (shift_ts - 1))) >> shift_ts;
  310|   313k|                }
  311|     89|                else if(shift_ts < 0)
  ------------------
  |  Branch (311:25): [True: 0, False: 89]
  ------------------
  312|      0|                {
  313|      0|                    iquant_out = iquant_out << (-shift_ts);
  314|      0|                }
  315|   313k|            }
  316|  2.39M|        }
  317|   119k|        else
  318|   119k|        {
  319|       |            /* setting the column to zero */
  320|  1.20M|            for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (320:24): [True: 1.08M, False: 119k]
  ------------------
  321|  1.08M|                *(pi2_tu_coeff + i * trans_size) = 0;
  322|       |
  323|   119k|            iquant_out = ps_tu_sblk_coeff_data->ai2_level[0];
  324|   119k|        }
  325|  2.51M|        *pi2_coeff_value = iquant_out;
  326|  2.51M|        *pi2_tu_coeff = iquant_out;
  327|  2.51M|        *pu4_zero_cols &= ~0x1;
  328|  2.51M|        *pu4_zero_rows &= ~0x1;
  329|  2.51M|        ps_tu_sblk_coeff_data =
  330|  2.51M|                        (tu_sblk_coeff_data_t *)&ps_tu_sblk_coeff_data->ai2_level[1];
  331|       |
  332|  2.51M|        STATS_UPDATE_COEFF_COUNT();
  ------------------
  |  |  144|  2.51M|#define STATS_UPDATE_COEFF_COUNT() ;
  ------------------
  333|  2.51M|        STATS_LAST_SBLK_POS_UPDATE(e_trans_type, (trans_skip || trans_quant_bypass),  0, 0);
  ------------------
  |  |  142|  2.51M|#define STATS_LAST_SBLK_POS_UPDATE(e_trans_type, t_skip_or_tq_bypass, sblk_x, sblk_y) ;
  ------------------
  334|  2.51M|        STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, (trans_quant_bypass || trans_skip));
  ------------------
  |  |  143|  2.51M|#define STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, t_skip_or_tq_bypass) ;
  ------------------
  335|  2.51M|        return ((UWORD8 *)ps_tu_sblk_coeff_data);
  336|  2.51M|    }
  337|  5.61M|    else
  338|  5.61M|    {
  339|  5.61M|        *pu4_coeff_type = 0;
  340|       |        /* In case of trans skip, memset has already happened */
  341|  5.61M|        if(!trans_skip)
  ------------------
  |  Branch (341:12): [True: 4.78M, False: 828k]
  ------------------
  342|  4.78M|            memset(pi2_tu_coeff, 0, trans_size * trans_size * sizeof(WORD16));
  343|  5.61M|    }
  344|       |
  345|  14.7M|    for(i = 0; i < u1_num_coded_sblks; i++)
  ------------------
  |  Branch (345:16): [True: 9.09M, False: 5.61M]
  ------------------
  346|  9.09M|    {
  347|  9.09M|        UWORD32 u4_sig_coeff_map;
  348|  9.09M|        subblk_pos_x = ps_tu_sblk_coeff_data->u2_subblk_pos & 0x00FF;
  349|  9.09M|        subblk_pos_y = (ps_tu_sblk_coeff_data->u2_subblk_pos & 0xFF00) >> 8;
  350|       |
  351|  9.09M|        STATS_LAST_SBLK_POS_UPDATE(e_trans_type, (trans_skip || trans_quant_bypass), subblk_pos_x, subblk_pos_y);
  ------------------
  |  |  142|  9.09M|#define STATS_LAST_SBLK_POS_UPDATE(e_trans_type, t_skip_or_tq_bypass, sblk_x, sblk_y) ;
  ------------------
  352|       |
  353|  9.09M|        subblk_pos_x = subblk_pos_x * MIN_TU_SIZE;
  ------------------
  |  |  358|  9.09M|#define MIN_TU_SIZE         4
  ------------------
  354|  9.09M|        subblk_pos_y = subblk_pos_y * MIN_TU_SIZE;
  ------------------
  |  |  358|  9.09M|#define MIN_TU_SIZE         4
  ------------------
  355|       |
  356|  9.09M|        pi2_sblk_ptr = pi2_tu_coeff + subblk_pos_y * trans_size
  357|  9.09M|                        + subblk_pos_x;
  358|       |
  359|       |        //*pu4_zero_cols &= ~(0xF << subblk_pos_x);
  360|       |
  361|  9.09M|        sblk_non_zero_coeff_idx = 0;
  362|  9.09M|        u4_sig_coeff_map = ps_tu_sblk_coeff_data->u2_sig_coeff_map;
  363|       |        //for(sblk_scan_idx = (31 - CLZ(u4_sig_coeff_map)); sblk_scan_idx >= 0; sblk_scan_idx--)
  364|  9.09M|        sblk_scan_idx = 31;
  365|  9.09M|        do
  366|  49.2M|        {
  367|  49.2M|            WORD32 clz = CLZ(u4_sig_coeff_map);
  368|       |
  369|  49.2M|            sblk_scan_idx -= clz;
  370|       |            /* when clz is 31, u4_sig_coeff_map << (clz+1) might result in unknown behaviour in some cases */
  371|       |            /* Hence either use SHL which takes care of handling these issues based on platform or shift in two stages */
  372|  49.2M|            u4_sig_coeff_map = u4_sig_coeff_map << clz;
  373|       |            /* Copying coeffs and storing in reverse order */
  374|  49.2M|            {
  375|  49.2M|                STATS_UPDATE_COEFF_COUNT();
  ------------------
  |  |  144|  49.2M|#define STATS_UPDATE_COEFF_COUNT() ;
  ------------------
  376|  49.2M|                coeff_raster_idx =
  377|  49.2M|                                gau1_ihevc_invscan4x4[u1_scan_type][sblk_scan_idx];
  378|       |
  379|  49.2M|                xs = coeff_raster_idx & 0x3;
  380|  49.2M|                ys = coeff_raster_idx >> 2;
  381|       |
  382|  49.2M|                if(!trans_quant_bypass)
  ------------------
  |  Branch (382:20): [True: 44.7M, False: 4.52M]
  ------------------
  383|  44.7M|                {
  384|  44.7M|                    WORD32 dequant_coeff = (trans_skip && (trans_size > 4)) ? 16 : pi2_dequant_matrix[(subblk_pos_x + xs) + (subblk_pos_y + ys) * trans_size];
  ------------------
  |  Branch (384:45): [True: 5.69M, False: 39.0M]
  |  Branch (384:59): [True: 51.6k, False: 5.63M]
  ------------------
  385|  44.7M|                    if(4 == trans_size)
  ------------------
  |  Branch (385:24): [True: 17.3M, False: 27.3M]
  ------------------
  386|  17.3M|                    {
  387|  17.3M|                        IQUANT_4x4(iquant_out,
  ------------------
  |  |  158|  17.3M|#define IQUANT_4x4(res, coeff /*pi2_src[index*src_strd]*/, dequant_coeff /*pi2_dequant_coeff[index*trans_size] * g_ihevc_iquant_scales[qp_rem] */, shift_iq, qp_div)   \
  |  |  159|  17.3M|{                                                                                                                                              \
  |  |  160|  17.3M|    WORD32 clip_coeff, tmp;                                                                                                                    \
  |  |  161|  17.3M|    WORD32 coeff_min,coeff_max;                                                                                                                \
  |  |  162|  17.3M|    WORD32 coeff_bit_range;                                                                                                                    \
  |  |  163|  17.3M|    WORD32 add_iq;                                                                                                                             \
  |  |  164|  17.3M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  17.3M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 6.12M, False: 11.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  17.3M|                                                                                                                                               \
  |  |  166|  17.3M|    coeff_bit_range = 16;                                                                                                                      \
  |  |  167|  17.3M|    if(qp_div > shift_iq)                                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 3.55M, False: 13.8M]
  |  |  ------------------
  |  |  168|  17.3M|        coeff_bit_range = 10;                                                                                                                  \
  |  |  169|  17.3M|                                                                                                                                               \
  |  |  170|  17.3M|    coeff_min = -(1<<(coeff_bit_range-1));                                                                                                     \
  |  |  171|  17.3M|    coeff_max = (1<<(coeff_bit_range-1)) - 1;                                                                                                  \
  |  |  172|  17.3M|                                                                                                                                               \
  |  |  173|  17.3M|    clip_coeff = CLIP3(coeff,coeff_min,coeff_max);                                                                                             \
  |  |  ------------------
  |  |  |  |   40|  17.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 317, False: 17.3M]
  |  |  |  |  |  Branch (40:53): [True: 266, False: 17.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|  17.3M|                                                                                                                                               \
  |  |  175|  17.3M|    tmp = clip_coeff * dequant_coeff ;                                                                                                         \
  |  |  176|  17.3M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  177|  17.3M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  17.3M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 11.2M, False: 6.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|  17.3M|                                                                                                                                               \
  |  |  179|  17.3M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  17.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  17.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 425k, False: 16.9M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 287k, False: 16.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|  17.3M|}
  ------------------
  388|  17.3M|                                   ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx],
  389|  17.3M|                                   dequant_coeff
  390|  17.3M|                                   * g_ihevc_iquant_scales[qp_rem],
  391|  17.3M|                                   shift_iq, qp_div);
  392|  17.3M|                        sblk_non_zero_coeff_idx++;
  393|  17.3M|                    }
  394|  27.3M|                    else
  395|  27.3M|                    {
  396|  27.3M|                        IQUANT(iquant_out,
  ------------------
  |  |  140|  27.3M|#define IQUANT(res, coeff /*pi2_src[index*src_strd]*/, dequant_coeff /*pi2_dequant_coeff[index*trans_size] * g_ihevc_iquant_scales[qp_rem] */, shift_iq, qp_div)       \
  |  |  141|  27.3M|{                                                                                                                                              \
  |  |  142|  27.3M|    WORD32 tmp, add_iq;                                                                                                                        \
  |  |  143|  27.3M|                                                                                                                                               \
  |  |  144|  27.3M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  27.3M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 11.1M, False: 16.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  27.3M|                                                                                                                                               \
  |  |  146|  27.3M|    tmp = coeff * dequant_coeff ;                                                                                                              \
  |  |  147|  27.3M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  148|  27.3M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  27.3M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 16.2M, False: 11.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|  27.3M|                                                                                                                                               \
  |  |  150|  27.3M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  27.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  27.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 226k, False: 27.1M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 193k, False: 26.9M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  27.3M|}
  ------------------
  397|  27.3M|                               ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx],
  398|  27.3M|                               dequant_coeff * g_ihevc_iquant_scales[qp_rem],
  399|  27.3M|                               shift_iq, qp_div);
  400|  27.3M|                        sblk_non_zero_coeff_idx++;
  401|  27.3M|                    }
  402|       |
  403|  44.7M|                    if(trans_skip)
  ------------------
  |  Branch (403:24): [True: 5.69M, False: 39.0M]
  ------------------
  404|  5.69M|                    {
  405|  5.69M|                        WORD32 shift_ts = MAX_TR_DYNAMIC_RANGE - bit_depth - log2_trans_size;
  ------------------
  |  |  441|  5.69M|#define MAX_TR_DYNAMIC_RANGE  15
  ------------------
  406|  5.69M|                        if(shift_ts > 0)
  ------------------
  |  Branch (406:28): [True: 5.65M, False: 33.2k]
  ------------------
  407|  5.65M|                        {
  408|  5.65M|                            iquant_out = (iquant_out + (1 << (shift_ts - 1))) >> shift_ts;
  409|  5.65M|                        }
  410|  33.2k|                        else if(shift_ts < 0)
  ------------------
  |  Branch (410:33): [True: 0, False: 33.2k]
  ------------------
  411|      0|                        {
  412|      0|                            iquant_out = iquant_out << (-shift_ts);
  413|      0|                        }
  414|  5.69M|                    }
  415|  44.7M|                }
  416|  4.52M|                else
  417|  4.52M|                {
  418|  4.52M|                    iquant_out = ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx++];
  419|  4.52M|                }
  420|  49.2M|                *pu4_zero_cols &= ~(0x1U << (subblk_pos_x + xs));
  421|  49.2M|                *pu4_zero_rows &= ~(0x1U << (subblk_pos_y + ys));
  422|  49.2M|                *(pi2_sblk_ptr + xs + ys * trans_size) = iquant_out;
  423|  49.2M|            }
  424|  49.2M|            sblk_scan_idx--;
  425|  49.2M|            u4_sig_coeff_map <<= 1;
  426|       |
  427|  49.2M|        }while(u4_sig_coeff_map);
  ------------------
  |  Branch (427:16): [True: 40.1M, False: 9.09M]
  ------------------
  428|       |        /* Updating the sblk pointer */
  429|  9.09M|        ps_tu_sblk_coeff_data =
  430|  9.09M|                        (tu_sblk_coeff_data_t *)&ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx];
  431|  9.09M|    }
  432|       |
  433|  5.61M|    STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, (trans_quant_bypass || trans_skip));
  ------------------
  |  |  143|  5.61M|#define STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, t_skip_or_tq_bypass) ;
  ------------------
  434|       |
  435|  5.61M|    pu1_new_tu_coeff_data = (UWORD8 *)ps_tu_sblk_coeff_data;
  436|       |
  437|  5.61M|    return pu1_new_tu_coeff_data;
  438|  8.13M|}
ihevcd_get_intra_nbr_flag:
  447|  7.23M|{
  448|  7.23M|    sps_t *ps_sps;
  449|  7.23M|    UWORD8 u1_bot_lt_avail, u1_left_avail, u1_top_avail, u1_top_rt_avail,
  450|  7.23M|                    u1_top_lt_avail;
  451|  7.23M|    WORD32 x_cur, y_cur, x_nbr, y_nbr;
  452|  7.23M|    UWORD8 *pu1_nbr_intra_flag;
  453|  7.23M|    UWORD8 *pu1_pic_intra_flag;
  454|  7.23M|    UWORD8 top_right, top, top_left, left, bot_left;
  455|  7.23M|    WORD32 intra_pos;
  456|  7.23M|    WORD32 num_8_blks, num_8_blks_in_bits;
  457|  7.23M|    WORD32 numbytes_row = (i2_pic_width_in_luma_samples + 63) / 64;
  458|  7.23M|    WORD32 cur_x, cur_y;
  459|  7.23M|    WORD32 i;
  460|  7.23M|    WORD32 nbr_flags;
  461|       |
  462|  7.23M|    ps_sps = ps_proc->ps_sps;
  463|  7.23M|    cur_x = ps_tu->b4_pos_x;
  464|  7.23M|    cur_y = ps_tu->b4_pos_y;
  465|       |
  466|  7.23M|    u1_bot_lt_avail = (pu4_intra_nbr_avail[1 + cur_y + trans_size / MIN_TU_SIZE]
  ------------------
  |  |  358|  7.23M|#define MIN_TU_SIZE         4
  ------------------
  467|  7.23M|                    >> (31 - (1 + cur_x - 1))) & 1;
  468|  7.23M|    u1_left_avail = (pu4_intra_nbr_avail[1 + cur_y] >> (31 - (1 + cur_x - 1)))
  469|  7.23M|                    & 1;
  470|  7.23M|    u1_top_avail = (pu4_intra_nbr_avail[1 + cur_y - 1] >> (31 - (1 + cur_x)))
  471|  7.23M|                    & 1;
  472|  7.23M|    u1_top_rt_avail = (pu4_intra_nbr_avail[1 + cur_y - 1]
  473|  7.23M|                    >> (31 - (1 + cur_x + trans_size / MIN_TU_SIZE))) & 1;
  ------------------
  |  |  358|  7.23M|#define MIN_TU_SIZE         4
  ------------------
  474|  7.23M|    u1_top_lt_avail = (pu4_intra_nbr_avail[1 + cur_y - 1]
  475|  7.23M|                    >> (31 - (1 + cur_x - 1))) & 1;
  476|       |
  477|  7.23M|    x_cur = ps_proc->i4_ctb_x * ctb_size + cur_x * MIN_TU_SIZE;
  ------------------
  |  |  358|  7.23M|#define MIN_TU_SIZE         4
  ------------------
  478|  7.23M|    y_cur = ps_proc->i4_ctb_y * ctb_size + cur_y * MIN_TU_SIZE;
  ------------------
  |  |  358|  7.23M|#define MIN_TU_SIZE         4
  ------------------
  479|       |
  480|  7.23M|    pu1_pic_intra_flag = ps_proc->pu1_pic_intra_flag;
  481|       |
  482|       |    /* WORD32 nbr_flags as below  MSB --> LSB */
  483|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  484|       |     *       1         4         4     4         4
  485|       |     */
  486|  7.23M|    bot_left = 0;
  487|  7.23M|    left = 0;
  488|  7.23M|    top_right = 0;
  489|  7.23M|    top = 0;
  490|  7.23M|    top_left = 0;
  491|       |
  492|  7.23M|    num_8_blks = trans_size > 4 ? trans_size / 8 : 1;
  ------------------
  |  Branch (492:18): [True: 3.97M, False: 3.25M]
  ------------------
  493|  7.23M|    num_8_blks_in_bits = ((1 << num_8_blks) - 1);
  494|       |
  495|  7.23M|    if(i1_constrained_intra_pred_flag)
  ------------------
  |  Branch (495:8): [True: 4.57M, False: 2.65M]
  ------------------
  496|  4.57M|    {
  497|       |        /* TODO: constrained intra pred not tested */
  498|  4.57M|        if(u1_bot_lt_avail)
  ------------------
  |  Branch (498:12): [True: 1.21M, False: 3.35M]
  ------------------
  499|  1.21M|        {
  500|  1.21M|            x_nbr = x_cur - 1;
  501|  1.21M|            y_nbr = y_cur + trans_size;
  502|       |
  503|  1.21M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  504|  1.21M|                            + x_nbr / 64;
  505|  1.21M|            intra_pos = ((x_nbr / 8) % 8);
  506|  3.52M|            for(i = 0; i < num_8_blks; i++)
  ------------------
  |  Branch (506:24): [True: 2.31M, False: 1.21M]
  ------------------
  507|  2.31M|            {
  508|  2.31M|                bot_left |= ((*(pu1_nbr_intra_flag + i * numbytes_row)
  509|  2.31M|                                >> intra_pos) & 1) << i;
  510|  2.31M|            }
  511|  1.21M|            bot_left &= num_8_blks_in_bits;
  512|  1.21M|        }
  513|  4.57M|        if(u1_left_avail)
  ------------------
  |  Branch (513:12): [True: 4.30M, False: 267k]
  ------------------
  514|  4.30M|        {
  515|  4.30M|            x_nbr = x_cur - 1;
  516|  4.30M|            y_nbr = y_cur;
  517|       |
  518|  4.30M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  519|  4.30M|                            + x_nbr / 64;
  520|  4.30M|            intra_pos = ((x_nbr / 8) % 8);
  521|       |
  522|  12.9M|            for(i = 0; i < num_8_blks; i++)
  ------------------
  |  Branch (522:24): [True: 8.67M, False: 4.30M]
  ------------------
  523|  8.67M|            {
  524|  8.67M|                left |= ((*(pu1_nbr_intra_flag + i * numbytes_row) >> intra_pos)
  525|  8.67M|                                & 1) << i;
  526|  8.67M|            }
  527|  4.30M|            left &= num_8_blks_in_bits;
  528|  4.30M|        }
  529|  4.57M|        if(u1_top_avail)
  ------------------
  |  Branch (529:12): [True: 4.13M, False: 441k]
  ------------------
  530|  4.13M|        {
  531|  4.13M|            x_nbr = x_cur;
  532|  4.13M|            y_nbr = y_cur - 1;
  533|       |
  534|  4.13M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  535|  4.13M|                            + x_nbr / 64;
  536|  4.13M|            intra_pos = ((x_nbr / 8) % 8);
  537|       |
  538|  4.13M|            top = (*pu1_nbr_intra_flag >> intra_pos);
  539|  4.13M|            top &= num_8_blks_in_bits;
  540|       |            /*
  541|       |             for(i=0;i<num_8_blks;i++)
  542|       |             {
  543|       |             top |= ( (*pu1_nbr_intra_flag >> (intra_pos+i)) & 1) << i;
  544|       |             }
  545|       |             */
  546|  4.13M|        }
  547|  4.57M|        if(u1_top_rt_avail)
  ------------------
  |  Branch (547:12): [True: 2.70M, False: 1.87M]
  ------------------
  548|  2.70M|        {
  549|  2.70M|            x_nbr = x_cur + trans_size;
  550|  2.70M|            y_nbr = y_cur - 1;
  551|       |
  552|  2.70M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  553|  2.70M|                            + x_nbr / 64;
  554|  2.70M|            intra_pos = ((x_nbr / 8) % 8);
  555|       |
  556|  2.70M|            top_right = (*pu1_nbr_intra_flag >> intra_pos);
  557|  2.70M|            top_right &= num_8_blks_in_bits;
  558|       |            /*
  559|       |             for(i=0;i<num_8_blks;i++)
  560|       |             {
  561|       |             top_right |= ( (*pu1_nbr_intra_flag >> (intra_pos+i)) & 1) << i;
  562|       |             }
  563|       |             */
  564|  2.70M|        }
  565|  4.57M|        if(u1_top_lt_avail)
  ------------------
  |  Branch (565:12): [True: 3.90M, False: 666k]
  ------------------
  566|  3.90M|        {
  567|  3.90M|            x_nbr = x_cur - 1;
  568|  3.90M|            y_nbr = y_cur - 1;
  569|       |
  570|  3.90M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  571|  3.90M|                            + x_nbr / 64;
  572|  3.90M|            intra_pos = ((x_nbr / 8) % 8);
  573|       |
  574|  3.90M|            top_left = (*pu1_nbr_intra_flag >> intra_pos) & 1;
  575|  3.90M|        }
  576|  4.57M|    }
  577|  2.65M|    else
  578|  2.65M|    {
  579|  2.65M|        if(u1_top_avail)
  ------------------
  |  Branch (579:12): [True: 2.48M, False: 171k]
  ------------------
  580|  2.48M|            top = 0xF;
  581|  2.65M|        if(u1_top_rt_avail)
  ------------------
  |  Branch (581:12): [True: 1.64M, False: 1.01M]
  ------------------
  582|  1.64M|            top_right = 0xF;
  583|  2.65M|        if(u1_bot_lt_avail)
  ------------------
  |  Branch (583:12): [True: 778k, False: 1.87M]
  ------------------
  584|   778k|            bot_left = 0xF;
  585|  2.65M|        if(u1_left_avail)
  ------------------
  |  Branch (585:12): [True: 2.56M, False: 93.0k]
  ------------------
  586|  2.56M|            left = 0xF;
  587|  2.65M|        if(u1_top_lt_avail)
  ------------------
  |  Branch (587:12): [True: 2.40M, False: 253k]
  ------------------
  588|  2.40M|            top_left = 0x1;
  589|  2.65M|    }
  590|       |
  591|       |    /* Handling incomplete CTBs */
  592|  7.23M|    {
  593|  7.23M|        WORD32 pu_size_limit = MIN(trans_size, 8);
  ------------------
  |  |   43|  7.23M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.26M, False: 3.96M]
  |  |  ------------------
  ------------------
  594|  7.23M|        WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples
  595|  7.23M|                        - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size)
  596|  7.23M|                        - (ps_tu->b4_pos_x * MIN_TU_SIZE)
  ------------------
  |  |  358|  7.23M|#define MIN_TU_SIZE         4
  ------------------
  597|  7.23M|                        - (1 << (ps_tu->b3_size + 2));
  598|       |        /* ctb_size_top gives number of valid pixels remaining in the current row */
  599|  7.23M|        WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  7.23M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 4.77M, False: 2.45M]
  |  |  ------------------
  ------------------
  600|  7.23M|        WORD32 ctb_size_top_bits = (1 << (ctb_size_top / pu_size_limit)) - 1;
  601|       |
  602|  7.23M|        WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  603|  7.23M|                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size)
  604|  7.23M|                        - (ps_tu->b4_pos_y * MIN_TU_SIZE)
  ------------------
  |  |  358|  7.23M|#define MIN_TU_SIZE         4
  ------------------
  605|  7.23M|                        - (1 << (ps_tu->b3_size + 2));
  606|       |        /* ctb_size_bot gives number of valid pixels remaining in the current column */
  607|  7.23M|        WORD32 ctb_size_bot = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  7.23M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 6.67M, False: 553k]
  |  |  ------------------
  ------------------
  608|  7.23M|        WORD32 ctb_size_bot_bits = (1 << (ctb_size_bot / pu_size_limit)) - 1;
  609|       |
  610|  7.23M|        top_right &= ctb_size_top_bits;
  611|  7.23M|        bot_left &= ctb_size_bot_bits;
  612|  7.23M|    }
  613|       |
  614|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  615|       |     *      1         4         4     4         4
  616|       |     */
  617|       |
  618|       |    /*
  619|       |     nbr_flags = (top_left << 16) | (gau4_ihevcd_4_bit_reverse[top_right] << 12) | (gau4_ihevcd_4_bit_reverse[top] << 8) | (gau4_ihevcd_4_bit_reverse[left] << 4)
  620|       |     | gau4_ihevcd_4_bit_reverse[bot_left];
  621|       |     */
  622|  7.23M|    nbr_flags = (top_left << 16) | (top_right << 12) | (top << 8) | (gau4_ihevcd_4_bit_reverse[left] << 4)
  623|  7.23M|                    | gau4_ihevcd_4_bit_reverse[bot_left];
  624|       |
  625|       |
  626|  7.23M|    return nbr_flags;
  627|       |
  628|  7.23M|}
get_iqitrec_func:
  864|   282M|{
  865|   282M|    sps_t *ps_sps = ps_proc->ps_sps;
  866|   282M|    pps_t *ps_pps = ps_proc->ps_pps;
  867|   282M|    WORD8 trans_size = 1 << log2_trans_size;
  868|       |
  869|   282M|    if(1 == ps_pl_tu_ctxt->cbf
  ------------------
  |  Branch (869:8): [True: 8.13M, False: 274M]
  ------------------
  870|  8.13M|                    && (ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag))
  ------------------
  |  Branch (870:25): [True: 582k, False: 7.55M]
  |  Branch (870:56): [True: 1.17M, False: 6.38M]
  ------------------
  871|  1.76M|    {
  872|  1.76M|        if(ps_sps->i1_transform_skip_rotation_enabled_flag && trans_size == 4 && intra_flag)
  ------------------
  |  Branch (872:12): [True: 70.0k, False: 1.69M]
  |  Branch (872:63): [True: 64.6k, False: 5.42k]
  |  Branch (872:82): [True: 60.6k, False: 3.97k]
  ------------------
  873|  60.6k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  874|  1.70M|        if(ps_sps->i1_implicit_rdpcm_enabled_flag && intra_flag
  ------------------
  |  Branch (874:12): [True: 31.7k, False: 1.67M]
  |  Branch (874:54): [True: 28.0k, False: 3.67k]
  ------------------
  875|  28.0k|                        && (intra_pred_mode == 10 || intra_pred_mode == 26))
  ------------------
  |  Branch (875:29): [True: 3.19k, False: 24.8k]
  |  Branch (875:54): [True: 3.69k, False: 21.1k]
  ------------------
  876|  6.89k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  877|  1.69M|        if(ps_pl_tu_ctxt->explicit_rdpcm_flag)
  ------------------
  |  Branch (877:12): [True: 2.19k, False: 1.69M]
  ------------------
  878|  2.19k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  879|  1.69M|    }
  880|   282M|    if(ps_pps->i1_cross_component_prediction_enabled_flag)
  ------------------
  |  Branch (880:8): [True: 4.19M, False: 278M]
  ------------------
  881|  4.19M|    {
  882|  4.19M|        if((chroma_plane == NULL_PLANE
  ------------------
  |  Branch (882:13): [True: 3.72M, False: 466k]
  ------------------
  883|  3.72M|                        && (ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0
  ------------------
  |  Branch (883:29): [True: 74.0k, False: 3.65M]
  ------------------
  884|  3.65M|                                        || ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0))
  ------------------
  |  Branch (884:44): [True: 26.3k, False: 3.62M]
  ------------------
  885|  4.09M|                        || (chroma_plane == V_PLANE && ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0)
  ------------------
  |  Branch (885:29): [True: 235k, False: 3.85M]
  |  Branch (885:56): [True: 101k, False: 134k]
  ------------------
  886|  3.99M|                        || (chroma_plane == U_PLANE && ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0))
  ------------------
  |  Branch (886:29): [True: 235k, False: 3.75M]
  |  Branch (886:56): [True: 111k, False: 124k]
  ------------------
  887|   311k|            return ihevcd_iquant_itrans_resi_recon_tu_plane;
  888|  4.19M|    }
  889|   282M|    return ihevcd_iquant_itrans_recon_tu_plane;
  890|   282M|}
ihevcd_iquant_itrans_recon_ctb:
  894|  19.2M|{
  895|  19.2M|    WORD16 *pi2_scaling_mat;
  896|  19.2M|    UWORD8 *pu1_y_dst_ctb;
  897|  19.2M|    UWORD8 *pu1_uv_dst_ctb;
  898|  19.2M|    WORD32 ctb_size;
  899|  19.2M|    codec_t *ps_codec;
  900|  19.2M|    slice_header_t *ps_slice_hdr;
  901|  19.2M|    tu_t *ps_tu;
  902|  19.2M|    WORD16 *pi2_ctb_coeff;
  903|  19.2M|    WORD32 tu_cnt;
  904|  19.2M|    WORD16 *pi2_tu_coeff;
  905|  19.2M|    WORD32 pic_strd;
  906|  19.2M|    WORD32 luma_nbr_flags;
  907|  19.2M|    WORD32 luma_nbr_flags_4x4[4] = { 0 };
  908|  19.2M|    WORD32 chroma_nbr_flags = 0;
  909|  19.2M|    WORD32 chroma_nbr_flags_subtu = 0;
  910|  19.2M|    WORD32 disable_boundary_filter = 0;
  911|       |
  912|  19.2M|    UWORD8 u1_luma_pred_mode_first_tu = 0;
  913|       |    /* Pointers for generating 2d coeffs from coeff-map */
  914|  19.2M|    UWORD8 *pu1_tu_coeff_data;
  915|       |    /* nbr avail map for CTB */
  916|       |    /* 1st bit points to neighbor (left/top_left/bot_left) */
  917|       |    /* 1Tb starts at 2nd bit from msb of 2nd value in array, followed by number of min_tu's in that ctb */
  918|  19.2M|    UWORD32 au4_intra_nbr_avail[MAX_CTB_SIZE / MIN_TU_SIZE + 2 /* Top nbr + bot nbr */];
  919|  19.2M|    UWORD32 top_avail_bits;
  920|  19.2M|    sps_t *ps_sps;
  921|  19.2M|    pps_t *ps_pps;
  922|  19.2M|    WORD32 pixel_size_y, pixel_size_uv;
  923|  19.2M|    WORD32 bit_depth_luma, bit_depth_chroma;
  924|  19.2M|    WORD32 intra_flag;
  925|  19.2M|    UWORD8 *pu1_pic_intra_flag;
  926|  19.2M|    WORD32 h_samp_factor, v_samp_factor;
  927|  19.2M|    WORD32 chroma_pixel_strd = 2;
  928|  19.2M|    PF_IQITRECON_PLANE iqitrecon_fptr = ihevcd_iquant_itrans_recon_tu_plane;
  929|       |
  930|       |    /*************************************************************************/
  931|       |    /* Contanis scaling matrix offset in the following order in a 1D buffer  */
  932|       |    /* Entries that are listed as UNUSED are invalid combinations where      */
  933|       |    /* scaling matrix is not used. eg: 64x64 SKIP CU, 64x64 PCM CU           */
  934|       |    /* Intra 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
  935|       |    /* Inter 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
  936|       |    /* Intra 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
  937|       |    /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
  938|       |    /* Intra 16x16 Y, 16x16 U, 16x16 V                                       */
  939|       |    /* Inter 16x16 Y, 16x16 U, 16x16 V                                       */
  940|       |    /* Intra 32x32 Y, 32x32 U, 32x32 V                                       */
  941|       |    /* Inter 32x32 Y, 32x32 U, 32x32 V                                       */
  942|       |    /* UNUSED,        UNUSED,  UNUSED                                        */
  943|       |    /* UNUSED,        UNUSED,  UNUSED                                        */
  944|       |    /*************************************************************************/
  945|  19.2M|    static const WORD32 scaling_mat_offset[] =
  946|  19.2M|      { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992,
  947|  19.2M|        1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136, 0, 0, 0, 0, 0, 0};
  948|       |
  949|  19.2M|    PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED();
  ------------------
  |  |   63|  19.2M|#define PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED() ;
  ------------------
  950|       |
  951|  19.2M|    ps_sps = ps_proc->ps_sps;
  952|  19.2M|    ps_pps = ps_proc->ps_pps;
  953|  19.2M|    ps_slice_hdr = ps_proc->ps_slice_hdr;
  954|  19.2M|    ps_codec = ps_proc->ps_codec;
  955|       |
  956|  19.2M|    pu1_y_dst_ctb = ps_proc->pu1_cur_ctb_luma;
  957|  19.2M|    pu1_uv_dst_ctb = ps_proc->pu1_cur_ctb_chroma;
  958|       |
  959|  19.2M|    pi2_ctb_coeff = ps_proc->pi2_invscan_out;
  960|       |
  961|  19.2M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  962|  19.2M|    pu1_tu_coeff_data = (UWORD8 *)ps_proc->pv_tu_coeff_data;
  963|       |
  964|  19.2M|    pic_strd = ps_codec->i4_strd;
  965|       |
  966|  19.2M|    pixel_size_y     = ps_codec->i4_pixel_size_y;
  967|  19.2M|    pixel_size_uv    = ps_codec->i4_pixel_size_uv;
  968|  19.2M|    bit_depth_luma   = ps_codec->i4_bit_depth_luma;
  969|  19.2M|    bit_depth_chroma = ps_codec->i4_bit_depth_chroma;
  970|  19.2M|    pi2_tu_coeff = pi2_ctb_coeff;
  971|       |
  972|  19.2M|    ps_tu = ps_proc->ps_tu;
  973|       |
  974|  19.2M|    if((1 == ps_sps->i1_scaling_list_enable_flag) && (1 == ps_pps->i1_pps_scaling_list_data_present_flag))
  ------------------
  |  Branch (974:8): [True: 16.5M, False: 2.70M]
  |  Branch (974:54): [True: 780k, False: 15.7M]
  ------------------
  975|   780k|    {
  976|   780k|        pi2_scaling_mat = ps_pps->pi2_scaling_mat;
  977|   780k|    }
  978|  18.4M|    else
  979|  18.4M|    {
  980|  18.4M|        pi2_scaling_mat = ps_sps->pi2_scaling_mat;
  981|  18.4M|    }
  982|       |
  983|  19.2M|    {
  984|       |        /* Updating the initial availability map */
  985|  19.2M|        WORD32 i;
  986|  19.2M|        UWORD8 u1_left_ctb_avail, u1_top_lt_ctb_avail, u1_top_rt_ctb_avail,
  987|  19.2M|                        u1_top_ctb_avail;
  988|       |
  989|  19.2M|        u1_left_ctb_avail = ps_proc->u1_left_ctb_avail;
  990|  19.2M|        u1_top_lt_ctb_avail = ps_proc->u1_top_lt_ctb_avail;
  991|  19.2M|        u1_top_ctb_avail = ps_proc->u1_top_ctb_avail;
  992|  19.2M|        u1_top_rt_ctb_avail = ps_proc->u1_top_rt_ctb_avail;
  993|       |
  994|       |        /* Initializing the availability array */
  995|  19.2M|        memset(au4_intra_nbr_avail, 0,
  996|  19.2M|               (MAX_CTB_SIZE / MIN_TU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  351|  19.2M|#define MAX_CTB_SIZE        64
  ------------------
                             (MAX_CTB_SIZE / MIN_TU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  358|  19.2M|#define MIN_TU_SIZE         4
  ------------------
  997|       |        /* Initializing the availability array with CTB level availability flags */
  998|  19.2M|        {
  999|  19.2M|            WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size);
 1000|  19.2M|            WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  19.2M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 18.4M, False: 754k]
  |  |  ------------------
  ------------------
 1001|   154M|            for(i = 0; i < ctb_size_left / MIN_TU_SIZE; i++)
  ------------------
  |  |  358|   154M|#define MIN_TU_SIZE         4
  ------------------
  |  Branch (1001:24): [True: 134M, False: 19.2M]
  ------------------
 1002|   134M|            {
 1003|   134M|                au4_intra_nbr_avail[i + 1] = ((UWORD32)u1_left_ctb_avail << 31);
 1004|   134M|            }
 1005|  19.2M|        }
 1006|  19.2M|        au4_intra_nbr_avail[0] |= (((UWORD32)u1_top_rt_ctb_avail << 31)
 1007|  19.2M|                        >> (1 + ctb_size / MIN_TU_SIZE)); /* 1+ctb_size/4 position bit pos from msb */
  ------------------
  |  |  358|  19.2M|#define MIN_TU_SIZE         4
  ------------------
 1008|       |
 1009|  19.2M|        au4_intra_nbr_avail[0] |= ((UWORD32)u1_top_lt_ctb_avail << 31);
 1010|       |
 1011|  19.2M|        {
 1012|  19.2M|            WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size);
 1013|  19.2M|            WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  19.2M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 18.2M, False: 1.00M]
  |  |  ------------------
  ------------------
 1014|  19.2M|            WORD32 shift = (31 - (ctb_size / MIN_TU_SIZE));
  ------------------
  |  |  358|  19.2M|#define MIN_TU_SIZE         4
  ------------------
 1015|       |
 1016|       |            /* ctb_size_top gives number of valid pixels remaining in the current row */
 1017|       |            /* Since we need pattern of 1's starting from the MSB, an additional shift */
 1018|       |            /* is needed */
 1019|  19.2M|            shift += ((ctb_size - ctb_size_top) / MIN_TU_SIZE);
  ------------------
  |  |  358|  19.2M|#define MIN_TU_SIZE         4
  ------------------
 1020|       |
 1021|  19.2M|            top_avail_bits = ((1 << (ctb_size_top / MIN_TU_SIZE)) - 1)
  ------------------
  |  |  358|  19.2M|#define MIN_TU_SIZE         4
  ------------------
 1022|  19.2M|                            << shift;
 1023|  19.2M|        }
 1024|  19.2M|        au4_intra_nbr_avail[0] |= (
 1025|  19.2M|                        (u1_top_ctb_avail == 1) ? top_avail_bits : 0x0);
  ------------------
  |  Branch (1025:25): [True: 18.1M, False: 1.11M]
  ------------------
 1026|       |        /* Starting from msb 2nd bit to (1+ctb_size/4) bit, set 1 if top avail,or 0 */
 1027|       |
 1028|  19.2M|    }
 1029|       |
 1030|  19.2M|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (1030:21): [True: 0, False: 19.2M]
  ------------------
 1031|  19.2M|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (1031:21): [True: 18.5M, False: 712k]
  ------------------
 1032|       |
 1033|       |    /* Applying Inverse transform on all the TU's in CTB */
 1034|   277M|    for(tu_cnt = 0; tu_cnt < ps_proc->i4_ctb_tu_cnt; tu_cnt++, ps_tu++)
  ------------------
  |  Branch (1034:21): [True: 257M, False: 19.2M]
  ------------------
 1035|   257M|    {
 1036|       |        /* Reset boundary filter flag for each transform unit (TU) iteration */
 1037|   257M|        disable_boundary_filter = 0;
 1038|   257M|        tu_plane_iq_it_recon_ctxt_t y_cb_tu = { 0 };
 1039|   257M|        tu_plane_iq_it_recon_ctxt_t cr_tu = { 0 };
 1040|   257M|        tu_plane_iq_it_recon_ctxt_t *ps_cb_tu = &y_cb_tu;
 1041|   257M|        tu_plane_iq_it_recon_ctxt_t *ps_cr_tu = &cr_tu;
 1042|   257M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1043|   257M|        tu_plane_iq_it_recon_ctxt_t cb_sub_tu = { 0 };
 1044|   257M|        tu_plane_iq_it_recon_ctxt_t cr_sub_tu = { 0 };
 1045|   257M|#endif
 1046|       |
 1047|   257M|        WORD32 num_comp, c_idx, func_idx;
 1048|       |
 1049|   257M|        WORD32 qp_div = 0, qp_rem = 0;
 1050|   257M|        WORD32 qp_div_v = 0, qp_rem_v = 0;
 1051|   257M|        WORD32 chroma_qp_idx;
 1052|   257M|        WORD8 i1_chroma_pic_qp_offset, i1_chroma_slice_qp_offset;
 1053|   257M|        WORD16 *pi2_dequant_matrix = NULL, *pi2_dequant_matrix_v = NULL;
 1054|       |
 1055|   257M|        WORD32 trans_size = 0;
 1056|   257M|        TRANSFORM_TYPE e_trans_type;
 1057|   257M|        WORD32 log2_y_trans_size_minus_2, log2_uv_trans_size_minus_2;
 1058|   257M|        WORD32 log2_trans_size;
 1059|       |
 1060|   257M|        WORD32 tu_x, tu_y;
 1061|   257M|        WORD32 tu_y_offset, tu_uv_offset;
 1062|   257M|        UWORD8 u1_luma_pred_mode, u1_chroma_pred_mode;
 1063|   257M|        WORD32 offset;
 1064|   257M|        WORD32 pcm_flag;
 1065|   257M|        WORD32 chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
 1066|       |        /* If 420SP_VU is chroma format, pred and dst pointer   */
 1067|       |        /* will be added +1 to point to U                       */
 1068|   257M|        WORD32 chroma_yuv420sp_vu_u_offset = 1 * chroma_yuv420sp_vu;
 1069|       |        /* If 420SP_VU is chroma format, pred and dst pointer   */
 1070|       |        /* will be added U offset of +1 and subtracted 2        */
 1071|       |        /* to point to V                                        */
 1072|   257M|        WORD32 chroma_yuv420sp_vu_v_offset = -2 * chroma_yuv420sp_vu;
 1073|       |
 1074|   257M|        tu_x = ps_tu->b4_pos_x * 4; /* Converting minTU unit to pixel unit */
 1075|   257M|        tu_y = ps_tu->b4_pos_y * 4; /* Converting minTU unit to pixel unit */
 1076|   257M|        {
 1077|   257M|            WORD32 tu_abs_x = (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size) + (tu_x);
 1078|   257M|            WORD32 tu_abs_y = (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size) + (tu_y);
 1079|       |
 1080|   257M|            WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1081|       |
 1082|   257M|            pu1_pic_intra_flag = ps_proc->pu1_pic_intra_flag;
 1083|   257M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
 1084|   257M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
 1085|       |
 1086|   257M|            intra_flag = *pu1_pic_intra_flag;
 1087|   257M|            intra_flag &= (1 << ((tu_abs_x >> 3) % 8));
 1088|   257M|        }
 1089|       |
 1090|   257M|        u1_luma_pred_mode = ps_tu->b6_luma_intra_mode;
 1091|   257M|        u1_chroma_pred_mode = ps_tu->b3_chroma_intra_mode_idx;
 1092|       |
 1093|   257M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && u1_chroma_pred_mode != 7)
  ------------------
  |  Branch (1093:12): [True: 255M, False: 2.70M]
  |  Branch (1093:73): [True: 5.22M, False: 249M]
  ------------------
 1094|  5.21M|            num_comp = 2; /* Y and UV */
 1095|   252M|        else
 1096|   252M|            num_comp = 1; /* Y */
 1097|       |
 1098|   257M|        pcm_flag = 0;
 1099|       |
 1100|   257M|        if((intra_flag) && (u1_luma_pred_mode == INTRA_PRED_NONE))
  ------------------
  |  |  521|  7.19M|#define INTRA_PRED_NONE  63
  ------------------
  |  Branch (1100:12): [True: 7.19M, False: 250M]
  |  Branch (1100:28): [True: 2.56k, False: 7.18M]
  ------------------
 1101|  2.56k|        {
 1102|  2.56k|            UWORD8 *pu1_buf;
 1103|  2.56k|            UWORD8 *pu1_y_dst = pu1_y_dst_ctb;
 1104|  2.56k|            UWORD8 *pu1_uv_dst = pu1_uv_dst_ctb;
 1105|  2.56k|            WORD32 i, j;
 1106|  2.56k|            tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
 1107|  2.56k|            WORD32 cb_size = 1 << (ps_tu->b3_size + 2);
 1108|       |
 1109|       |            /* trans_size is used to update availability after reconstruction */
 1110|  2.56k|            trans_size = cb_size;
 1111|       |
 1112|  2.56k|            pcm_flag = 1;
 1113|       |
 1114|  2.56k|            tu_y_offset = tu_x + tu_y * pic_strd;
 1115|  2.56k|            pu1_y_dst += (tu_x + tu_y * pic_strd) * pixel_size_y;
 1116|       |
 1117|       |            /* First byte points to number of coded blocks */
 1118|  2.56k|            pu1_tu_coeff_data++;
 1119|       |
 1120|       |            /* Next byte points to scan type */
 1121|  2.56k|            pu1_tu_coeff_data++;
 1122|       |
 1123|  2.56k|            ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)pu1_tu_coeff_data;
 1124|       |
 1125|  2.56k|            pu1_buf = (UWORD8 *)&ps_tu_sblk_coeff_data->ai2_level[0];
 1126|  2.56k|            {
 1127|       |
 1128|  32.4k|                for(i = 0; i < cb_size; i++)
  ------------------
  |  Branch (1128:28): [True: 29.8k, False: 2.56k]
  ------------------
 1129|  29.8k|                {
 1130|  29.8k|                    memcpy(&pu1_y_dst[i * pic_strd * pixel_size_y], pu1_buf, (cb_size * pixel_size_y));
 1131|  29.8k|                    pu1_buf += cb_size * pixel_size_y;
 1132|  29.8k|                }
 1133|       |
 1134|  2.56k|                if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1134:20): [True: 2.49k, False: 72]
  ------------------
 1135|  2.49k|                {
 1136|  2.49k|                    WORD32 chroma_strd = (pic_strd * chroma_pixel_strd) / h_samp_factor;
 1137|       |
 1138|  2.49k|                    pu1_uv_dst += ((tu_x * chroma_pixel_strd / h_samp_factor)
 1139|  2.49k|                                    + (tu_y * chroma_pixel_strd * pic_strd / (h_samp_factor * v_samp_factor))) * pixel_size_uv;
 1140|  2.49k|                    pu1_uv_dst = pu1_uv_dst + chroma_yuv420sp_vu_u_offset * pixel_size_uv;
 1141|       |
 1142|       |                    /* U */
 1143|  17.3k|                    for(i = 0; i < cb_size / v_samp_factor; i++)
  ------------------
  |  Branch (1143:32): [True: 14.9k, False: 2.49k]
  ------------------
 1144|  14.9k|                    {
 1145|   112k|                        for(j = 0; j < cb_size / h_samp_factor; j++)
  ------------------
  |  Branch (1145:36): [True: 98.0k, False: 14.9k]
  ------------------
 1146|  98.0k|                        {
 1147|  98.0k|                            if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  98.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1147:32): [True: 94.8k, False: 3.15k]
  ------------------
 1148|  94.8k|                            {
 1149|  94.8k|                                pu1_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *pu1_buf++;
 1150|  94.8k|                            }
 1151|  3.15k|                            else
 1152|  3.15k|                            {
 1153|  3.15k|                                UWORD16 *pu2_uv_dst = (UWORD16 *)pu1_uv_dst;
 1154|  3.15k|                                pu2_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *(UWORD16 *)pu1_buf;
 1155|  3.15k|                                pu1_buf += 2;
 1156|  3.15k|                            }
 1157|  98.0k|                        }
 1158|  14.9k|                    }
 1159|       |
 1160|  2.49k|                    pu1_uv_dst = pu1_uv_dst + (1 + chroma_yuv420sp_vu_v_offset) * pixel_size_uv;
 1161|       |
 1162|       |                    /* V */
 1163|  17.3k|                    for(i = 0; i < cb_size / v_samp_factor; i++)
  ------------------
  |  Branch (1163:32): [True: 14.9k, False: 2.49k]
  ------------------
 1164|  14.9k|                    {
 1165|   112k|                        for(j = 0; j < cb_size / h_samp_factor; j++)
  ------------------
  |  Branch (1165:36): [True: 98.0k, False: 14.9k]
  ------------------
 1166|  98.0k|                        {
 1167|  98.0k|                            if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  98.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1167:32): [True: 94.8k, False: 3.15k]
  ------------------
 1168|  94.8k|                            {
 1169|  94.8k|                                pu1_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *pu1_buf++;
 1170|  94.8k|                            }
 1171|  3.15k|                            else
 1172|  3.15k|                            {
 1173|  3.15k|                                UWORD16 *pu2_uv_dst = (UWORD16 *)pu1_uv_dst;
 1174|  3.15k|                                pu2_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *(UWORD16 *)pu1_buf;
 1175|  3.15k|                                pu1_buf += 2;
 1176|  3.15k|                            }
 1177|  98.0k|                        }
 1178|  14.9k|                    }
 1179|  2.49k|                }
 1180|  2.56k|            }
 1181|       |
 1182|  2.56k|            pu1_tu_coeff_data = pu1_buf;
 1183|       |
 1184|  2.56k|        }
 1185|       |
 1186|       |
 1187|       |
 1188|       |
 1189|       |
 1190|   524M|        for(c_idx = 0; c_idx < num_comp; c_idx++)
  ------------------
  |  Branch (1190:24): [True: 266M, False: 257M]
  ------------------
 1191|   266M|        {
 1192|   266M|            if(0 == pcm_flag)
  ------------------
  |  Branch (1192:16): [True: 266M, False: 18.4E]
  ------------------
 1193|   266M|            {
 1194|       |
 1195|   266M|                if(c_idx == 0) /* Y */
  ------------------
  |  Branch (1195:20): [True: 261M, False: 5.79M]
  ------------------
 1196|   261M|                {
 1197|   261M|                    WORD32 qp_bd_offset_y = ps_codec->i4_qp_bd_offset_y;
 1198|       |
 1199|   261M|                    log2_y_trans_size_minus_2 = ps_tu->b3_size;
 1200|   261M|                    trans_size = 1 << (log2_y_trans_size_minus_2 + 2);
 1201|   261M|                    log2_trans_size = log2_y_trans_size_minus_2 + 2;
 1202|       |
 1203|   261M|                    tu_y_offset = tu_x + tu_y * pic_strd;
 1204|       |
 1205|       |                    /* Calculating scaling matrix offset */
 1206|   261M|                    offset = log2_y_trans_size_minus_2 * 6 + (!intra_flag) * 3 + c_idx;
 1207|   261M|                    pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset];
 1208|       |
 1209|       |                    /* 4x4 transform Luma in INTRA mode is DST */
 1210|   261M|                    if(log2_y_trans_size_minus_2 == 0 && intra_flag)
  ------------------
  |  Branch (1210:24): [True: 4.26M, False: 256M]
  |  Branch (1210:58): [True: 3.25M, False: 1.00M]
  ------------------
 1211|  3.25M|                    {
 1212|  3.25M|                        func_idx = log2_y_trans_size_minus_2;
 1213|  3.25M|                        e_trans_type = DST_4x4;
 1214|  3.25M|                    }
 1215|   257M|                    else
 1216|   257M|                    {
 1217|   257M|                        func_idx = log2_y_trans_size_minus_2 + 1;
 1218|   257M|                        e_trans_type = (TRANSFORM_TYPE)(log2_y_trans_size_minus_2 + 1);
 1219|   257M|                    }
 1220|       |
 1221|   261M|                    qp_div = (ps_tu->b7_qp + qp_bd_offset_y) / 6;
 1222|   261M|                    qp_rem = (ps_tu->b7_qp + qp_bd_offset_y) % 6;
 1223|       |
 1224|   261M|                    y_cb_tu.pi2_tu_coeff = pi2_tu_coeff;
 1225|   261M|                    y_cb_tu.pu1_pred = pu1_y_dst_ctb + tu_y_offset * pixel_size_y;
 1226|   261M|                    y_cb_tu.pu1_dst = pu1_y_dst_ctb + tu_y_offset * pixel_size_y;
 1227|   261M|                    y_cb_tu.tu_coeff_stride = trans_size;
 1228|   261M|                    y_cb_tu.pred_strd = pic_strd;
 1229|   261M|                    y_cb_tu.dst_strd = pic_strd;
 1230|   261M|                    y_cb_tu.cbf = ps_tu->b1_y_cbf;
 1231|   261M|                    y_cb_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1232|   261M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1233|   261M|                    y_cb_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1234|   261M|                    y_cb_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1235|   261M|#endif
 1236|       |                    /* Unpacking coeffs */
 1237|   261M|                    if(1 == y_cb_tu.cbf)
  ------------------
  |  Branch (1237:24): [True: 4.89M, False: 256M]
  ------------------
 1238|  4.89M|                    {
 1239|  4.89M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1240|  4.89M|                                        y_cb_tu.pi2_tu_coeff, log2_y_trans_size_minus_2 + 2,
 1241|  4.89M|                                        pu1_tu_coeff_data, pi2_dequant_matrix,
 1242|  4.89M|                                        qp_rem, qp_div, e_trans_type,
 1243|  4.89M|                                        ps_tu->b1_transquant_bypass, &y_cb_tu.zero_cols,
 1244|  4.89M|                                        &y_cb_tu.zero_rows, &y_cb_tu.coeff_type,
 1245|  4.89M|                                        &y_cb_tu.coeff_value, bit_depth_luma);
 1246|  4.89M|                    }
 1247|   261M|                }
 1248|  5.79M|                else /* UV interleaved */
 1249|  5.79M|                {
 1250|       |                    /* Initializing variables */
 1251|  5.79M|                    const WORD16 *pi2_ihevcd_chroma_qp =
 1252|  5.79M|                                    CHROMA_FMT_IDC_YUV420 != ps_sps->i1_chroma_format_idc ?
  ------------------
  |  Branch (1252:37): [True: 1.12M, False: 4.67M]
  ------------------
 1253|  1.12M|                                                    gai2_ihevcd_chroma_qp_clip :
 1254|  5.79M|                                                    gai2_ihevcd_chroma_qp_420;
 1255|  5.79M|                    WORD32  qp_bd_offset_uv = ps_codec->i4_qp_bd_offset_uv;
 1256|  5.79M|                    WORD32  qp_u, qp_v;
 1257|       |
 1258|       |                    /* Chroma :If Transform size is 4x4, keep 4x4 else do transform on (trans_size/2 x trans_size/2) */
 1259|  5.79M|                    if(ps_tu->b3_size == 0)
  ------------------
  |  Branch (1259:24): [True: 1.04M, False: 4.75M]
  ------------------
 1260|  1.04M|                    {
 1261|  1.04M|                        log2_uv_trans_size_minus_2 = ps_tu->b3_size;
 1262|  1.04M|                        if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1262:28): [True: 0, False: 1.04M]
  ------------------
 1263|      0|                        {
 1264|      0|                            tu_uv_offset = (tu_x * chroma_pixel_strd)
 1265|      0|                                            + (tu_y * chroma_pixel_strd * pic_strd);
 1266|      0|                        }
 1267|  1.04M|                        else
 1268|  1.04M|                        {
 1269|       |                            /* Chroma 4x4 is present with 4th luma 4x4 block. For this case chroma postion has to be (luma pos x - 4, luma pos y - 4) */
 1270|  1.04M|                            tu_uv_offset = (tu_x - 4) + ((tu_y - 4) / v_samp_factor) * pic_strd;
 1271|  1.04M|                        }
 1272|  1.04M|                    }
 1273|  4.75M|                    else
 1274|  4.75M|                    {
 1275|  4.75M|                        if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1275:28): [True: 0, False: 4.75M]
  ------------------
 1276|      0|                        {
 1277|      0|                            log2_uv_trans_size_minus_2 = ps_tu->b3_size;
 1278|      0|                        }
 1279|  4.75M|                        else
 1280|  4.75M|                        {
 1281|  4.75M|                            log2_uv_trans_size_minus_2 = ps_tu->b3_size - 1;
 1282|  4.75M|                        }
 1283|  4.75M|                        tu_uv_offset = (tu_x * chroma_pixel_strd / h_samp_factor)
 1284|  4.75M|                                        + (tu_y * chroma_pixel_strd * pic_strd / (h_samp_factor * v_samp_factor));
 1285|  4.75M|                    }
 1286|  5.79M|                    trans_size = 1 << (log2_uv_trans_size_minus_2 + 2);
 1287|  5.79M|                    log2_trans_size = log2_uv_trans_size_minus_2 + 2;
 1288|       |
 1289|       |                    /*TODO: Add support for choosing different tables for U and V,
 1290|       |                     * change this to a single array to handle flat/default/custom, intra/inter, luma/chroma and various sizes
 1291|       |                     */
 1292|       |                    /* Calculating scaling matrix offset */
 1293|       |                    /* ((log2_uv_trans_size_minus_2 == 3) ? 1:3) condition check is not needed, since
 1294|       |                     * max uv trans size is 16x16
 1295|       |                     */
 1296|  5.79M|                    offset = log2_uv_trans_size_minus_2 * 6 + (!intra_flag) * 3 + c_idx;
 1297|  5.79M|                    pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset];
 1298|  5.79M|                    pi2_dequant_matrix_v = pi2_scaling_mat + scaling_mat_offset[offset + 1];
 1299|       |
 1300|  5.79M|                    func_idx = 1 + 4 + log2_uv_trans_size_minus_2; /* DST func + Y funcs + cur func index*/
 1301|       |
 1302|       |                    /* Handle error cases where 64x64 TU is signalled which results in 32x32 chroma.
 1303|       |                     * Limit func_idx based on allowed max chroma tu size */
 1304|  5.79M|                    func_idx = MIN(func_idx, (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 8 : 7);
  ------------------
  |  |   43|  11.5M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.65M, False: 2.14M]
  |  |  |  Branch (43:30): [True: 0, False: 5.79M]
  |  |  |  Branch (43:42): [True: 0, False: 2.14M]
  |  |  ------------------
  ------------------
 1305|       |
 1306|  5.79M|                    e_trans_type = (TRANSFORM_TYPE)(log2_uv_trans_size_minus_2 + 1);
 1307|       |                    /* QP for U */
 1308|  5.79M|                    i1_chroma_pic_qp_offset = ps_pps->i1_pic_cb_qp_offset;
 1309|  5.79M|                    i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cb_qp_offset;
 1310|       |
 1311|  5.79M|                    chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + i1_chroma_slice_qp_offset;
 1312|  5.79M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1313|  5.79M|                    if(ps_tu->b1_cu_chroma_qp_offset_flag)
  ------------------
  |  Branch (1313:24): [True: 12.4k, False: 5.78M]
  ------------------
 1314|  12.4k|                    {
 1315|  12.4k|                        chroma_qp_idx += ps_pps->i4_cb_qp_offset_list[ps_tu->b3_cu_chroma_qp_offset_idx];
 1316|  12.4k|                    }
 1317|  5.79M|#endif
 1318|  5.79M|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  5.79M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1318:24): [True: 3.74M, False: 2.05M]
  ------------------
 1319|  3.74M|                    {
 1320|  3.74M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57);
  ------------------
  |  |   40|  3.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 5.22k, False: 3.73M]
  |  |  |  Branch (40:53): [True: 11.0k, False: 3.72M]
  |  |  ------------------
  ------------------
 1321|  3.74M|                        qp_div = pi2_ihevcd_chroma_qp[chroma_qp_idx] / 6;
 1322|  3.74M|                        qp_rem = pi2_ihevcd_chroma_qp[chroma_qp_idx] % 6;
 1323|  3.74M|                    }
 1324|  2.05M|                    else
 1325|  2.05M|                    {
 1326|  2.05M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, (-qp_bd_offset_uv), 57);
  ------------------
  |  |   40|  2.05M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 8.82k, False: 2.05M]
  |  |  |  Branch (40:53): [True: 1.24k, False: 2.04M]
  |  |  ------------------
  ------------------
 1327|  2.05M|                        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1327:28): [True: 453k, False: 1.60M]
  ------------------
 1328|   453k|                        {
 1329|   453k|                            if (chroma_qp_idx < 30)
  ------------------
  |  Branch (1329:33): [True: 62.8k, False: 390k]
  ------------------
 1330|  62.8k|                            {
 1331|  62.8k|                                qp_u = chroma_qp_idx;
 1332|  62.8k|                            }
 1333|   390k|                            else if (chroma_qp_idx > 43)
  ------------------
  |  Branch (1333:38): [True: 369k, False: 21.2k]
  ------------------
 1334|   369k|                            {
 1335|   369k|                                qp_u = chroma_qp_idx - 6;
 1336|   369k|                            }
 1337|  21.2k|                            else
 1338|  21.2k|                            {
 1339|  21.2k|                                qp_u = gai2_ihevcd_chroma_qp_420[chroma_qp_idx];
 1340|  21.2k|                            }
 1341|   453k|                        }
 1342|  1.60M|                        else
 1343|  1.60M|                        {
 1344|  1.60M|                            qp_u = MIN(chroma_qp_idx, 51);
  ------------------
  |  |   43|  1.60M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 579k, False: 1.02M]
  |  |  ------------------
  ------------------
 1345|  1.60M|                        }
 1346|  2.05M|                        qp_u += qp_bd_offset_uv;
 1347|  2.05M|                        qp_div = qp_u / 6;
 1348|  2.05M|                        qp_rem = qp_u % 6;
 1349|  2.05M|                    }
 1350|       |
 1351|       |                    /* QP for V */
 1352|  5.79M|                    i1_chroma_pic_qp_offset = ps_pps->i1_pic_cr_qp_offset;
 1353|  5.79M|                    i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cr_qp_offset;
 1354|       |
 1355|  5.79M|                    chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + i1_chroma_slice_qp_offset;
 1356|  5.79M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1357|  5.79M|                    if(ps_tu->b1_cu_chroma_qp_offset_flag)
  ------------------
  |  Branch (1357:24): [True: 12.4k, False: 5.78M]
  ------------------
 1358|  12.4k|                    {
 1359|  12.4k|                        chroma_qp_idx += ps_pps->i4_cr_qp_offset_list[ps_tu->b3_cu_chroma_qp_offset_idx];
 1360|  12.4k|                    }
 1361|  5.79M|#endif
 1362|  5.79M|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  5.79M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1362:24): [True: 3.73M, False: 2.06M]
  ------------------
 1363|  3.73M|                    {
 1364|  3.73M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57);
  ------------------
  |  |   40|  3.73M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.75k, False: 3.73M]
  |  |  |  Branch (40:53): [True: 24.6k, False: 3.70M]
  |  |  ------------------
  ------------------
 1365|  3.73M|                        qp_div_v = pi2_ihevcd_chroma_qp[chroma_qp_idx] / 6;
 1366|  3.73M|                        qp_rem_v = pi2_ihevcd_chroma_qp[chroma_qp_idx] % 6;
 1367|  3.73M|                    }
 1368|  2.06M|                    else
 1369|  2.06M|                    {
 1370|  2.06M|                        chroma_qp_idx = CLIP3(chroma_qp_idx, (-qp_bd_offset_uv), 57);
  ------------------
  |  |   40|  2.06M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 877, False: 2.06M]
  |  |  |  Branch (40:53): [True: 1.34k, False: 2.06M]
  |  |  ------------------
  ------------------
 1371|  2.06M|                        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1371:28): [True: 453k, False: 1.60M]
  ------------------
 1372|   453k|                        {
 1373|   453k|                            if (chroma_qp_idx < 30)
  ------------------
  |  Branch (1373:33): [True: 73.5k, False: 379k]
  ------------------
 1374|  73.5k|                            {
 1375|  73.5k|                                qp_v = chroma_qp_idx;
 1376|  73.5k|                            }
 1377|   379k|                            else if (chroma_qp_idx > 43)
  ------------------
  |  Branch (1377:38): [True: 363k, False: 16.2k]
  ------------------
 1378|   363k|                            {
 1379|   363k|                                qp_v = chroma_qp_idx - 6;
 1380|   363k|                            }
 1381|  16.2k|                            else
 1382|  16.2k|                            {
 1383|  16.2k|                                qp_v = gai2_ihevcd_chroma_qp_420[chroma_qp_idx];
 1384|  16.2k|                            }
 1385|   453k|                        }
 1386|  1.60M|                        else
 1387|  1.60M|                        {
 1388|  1.60M|                            qp_v = MIN(chroma_qp_idx, 51);
  ------------------
  |  |   43|  1.60M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 674k, False: 935k]
  |  |  ------------------
  ------------------
 1389|  1.60M|                        }
 1390|  2.06M|                        qp_v += qp_bd_offset_uv;
 1391|  2.06M|                        qp_div_v = qp_v / 6;
 1392|  2.06M|                        qp_rem_v = qp_v % 6;
 1393|  2.06M|                    }
 1394|       |
 1395|  5.79M|                    y_cb_tu.pi2_tu_coeff = pi2_tu_coeff;
 1396|  5.79M|                    y_cb_tu.pu1_pred = pu1_uv_dst_ctb + (tu_uv_offset + chroma_yuv420sp_vu_u_offset) * pixel_size_uv; /* Pointing to start byte of U*/
 1397|  5.79M|                    y_cb_tu.pu1_dst = pu1_uv_dst_ctb + (tu_uv_offset + chroma_yuv420sp_vu_u_offset) * pixel_size_uv; /* Pointing to start byte of U*/
 1398|  5.79M|                    y_cb_tu.tu_coeff_stride = trans_size;
 1399|  5.79M|                    y_cb_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1400|  5.79M|                    y_cb_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1401|  5.79M|                    y_cb_tu.cbf = ps_tu->b1_cb_cbf;
 1402|       |
 1403|  5.79M|                    cr_tu.pi2_tu_coeff = pi2_tu_coeff + trans_size * trans_size;
 1404|  5.79M|                    cr_tu.pu1_pred = y_cb_tu.pu1_pred + (1 + chroma_yuv420sp_vu_v_offset) * pixel_size_uv; /* Pointing to start byte of V*/
 1405|  5.79M|                    cr_tu.pu1_dst = y_cb_tu.pu1_dst + (1 + chroma_yuv420sp_vu_v_offset) * pixel_size_uv; /* Pointing to start byte of V*/
 1406|  5.79M|                    cr_tu.tu_coeff_stride = trans_size;
 1407|  5.79M|                    cr_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1408|  5.79M|                    cr_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1409|  5.79M|                    cr_tu.cbf = ps_tu->b1_cr_cbf;
 1410|       |
 1411|       |                    /* Unpacking coeffs */
 1412|  5.79M|                    y_cb_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1413|  5.79M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1414|  5.79M|                    y_cb_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1415|  5.79M|                    y_cb_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1416|  5.79M|#endif
 1417|  5.79M|                    if(1 == y_cb_tu.cbf)
  ------------------
  |  Branch (1417:24): [True: 1.34M, False: 4.45M]
  ------------------
 1418|  1.34M|                    {
 1419|  1.34M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1420|  1.34M|                                        y_cb_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1421|  1.34M|                                        pu1_tu_coeff_data, pi2_dequant_matrix,
 1422|  1.34M|                                        qp_rem, qp_div, e_trans_type,
 1423|  1.34M|                                        ps_tu->b1_transquant_bypass, &y_cb_tu.zero_cols,
 1424|  1.34M|                                        &y_cb_tu.zero_rows, &y_cb_tu.coeff_type,
 1425|  1.34M|                                        &y_cb_tu.coeff_value, bit_depth_chroma);
 1426|  1.34M|                    }
 1427|  5.79M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1428|  5.79M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1428:24): [True: 1.12M, False: 4.67M]
  ------------------
 1429|  1.12M|                    {
 1430|  1.12M|                        cb_sub_tu.pi2_tu_coeff = ps_proc->pi2_invscan_out_subtu;
 1431|  1.12M|                        cb_sub_tu.pu1_pred = y_cb_tu.pu1_pred + trans_size * y_cb_tu.pred_strd * pixel_size_uv;
 1432|  1.12M|                        cb_sub_tu.pu1_dst = y_cb_tu.pu1_dst + trans_size * y_cb_tu.dst_strd * pixel_size_uv;
 1433|  1.12M|                        cb_sub_tu.tu_coeff_stride = trans_size;
 1434|  1.12M|                        cb_sub_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1435|  1.12M|                        cb_sub_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1436|  1.12M|                        cb_sub_tu.cbf = ps_tu->b1_cb_cbf_subtu1;
 1437|  1.12M|                        cb_sub_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1438|  1.12M|                        cb_sub_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1439|  1.12M|                        cb_sub_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1440|  1.12M|                        if(1 == cb_sub_tu.cbf)
  ------------------
  |  Branch (1440:28): [True: 281k, False: 843k]
  ------------------
 1441|   281k|                        {
 1442|   281k|                            pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1443|   281k|                                            cb_sub_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1444|   281k|                                            pu1_tu_coeff_data, pi2_dequant_matrix,
 1445|   281k|                                            qp_rem, qp_div, e_trans_type,
 1446|   281k|                                            ps_tu->b1_transquant_bypass, &cb_sub_tu.zero_cols,
 1447|   281k|                                            &cb_sub_tu.zero_rows, &cb_sub_tu.coeff_type,
 1448|   281k|                                            &cb_sub_tu.coeff_value, bit_depth_chroma);
 1449|   281k|                        }
 1450|  1.12M|                    }
 1451|  5.79M|#endif
 1452|       |
 1453|  5.79M|                    cr_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1454|  5.79M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1455|  5.79M|                    cr_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1456|  5.79M|                    cr_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1457|  5.79M|#endif
 1458|  5.79M|                    if(1 == cr_tu.cbf)
  ------------------
  |  Branch (1458:24): [True: 1.37M, False: 4.42M]
  ------------------
 1459|  1.37M|                    {
 1460|  1.37M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1461|  1.37M|                                        cr_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1462|  1.37M|                                        pu1_tu_coeff_data, pi2_dequant_matrix_v,
 1463|  1.37M|                                        qp_rem_v, qp_div_v, e_trans_type,
 1464|  1.37M|                                        ps_tu->b1_transquant_bypass, &cr_tu.zero_cols,
 1465|  1.37M|                                        &cr_tu.zero_rows, &cr_tu.coeff_type,
 1466|  1.37M|                                        &cr_tu.coeff_value, bit_depth_chroma);
 1467|  1.37M|                    }
 1468|  5.79M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1469|  5.79M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1469:24): [True: 1.12M, False: 4.67M]
  ------------------
 1470|  1.12M|                    {
 1471|  1.12M|                        cr_sub_tu.pi2_tu_coeff = ps_proc->pi2_invscan_out_subtu + trans_size * trans_size;
 1472|  1.12M|                        cr_sub_tu.pu1_pred = cr_tu.pu1_pred + trans_size * cr_tu.pred_strd * pixel_size_uv;
 1473|  1.12M|                        cr_sub_tu.pu1_dst = cr_tu.pu1_dst + trans_size * cr_tu.dst_strd * pixel_size_uv;
 1474|  1.12M|                        cr_sub_tu.tu_coeff_stride = trans_size;
 1475|  1.12M|                        cr_sub_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1476|  1.12M|                        cr_sub_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor;
 1477|  1.12M|                        cr_sub_tu.cbf = ps_tu->b1_cr_cbf_subtu1;
 1478|  1.12M|                        cr_sub_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1;
 1479|  1.12M|                        cr_sub_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1;
 1480|  1.12M|                        cr_sub_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1;
 1481|  1.12M|                        if(1 == cr_sub_tu.cbf)
  ------------------
  |  Branch (1481:28): [True: 285k, False: 840k]
  ------------------
 1482|   285k|                        {
 1483|   285k|                            pu1_tu_coeff_data = ihevcd_unpack_coeffs(
 1484|   285k|                                            cr_sub_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2,
 1485|   285k|                                            pu1_tu_coeff_data, pi2_dequant_matrix_v,
 1486|   285k|                                            qp_rem_v, qp_div_v, e_trans_type,
 1487|   285k|                                            ps_tu->b1_transquant_bypass, &cr_sub_tu.zero_cols,
 1488|   285k|                                            &cr_sub_tu.zero_rows, &cr_sub_tu.coeff_type,
 1489|   285k|                                            &cr_sub_tu.coeff_value, bit_depth_chroma);
 1490|   285k|                        }
 1491|  1.12M|                    }
 1492|  5.79M|#endif
 1493|  5.79M|                }
 1494|   266M|                WORD8 subtu_idx = 0;
 1495|   266M|                do
 1496|   268M|                {
 1497|   268M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1498|   268M|                    if(subtu_idx != 0 && c_idx != 0)
  ------------------
  |  Branch (1498:24): [True: 1.12M, False: 266M]
  |  Branch (1498:42): [True: 1.12M, False: 4]
  ------------------
 1499|  1.12M|                    {
 1500|  1.12M|                        ps_cb_tu = &cb_sub_tu;
 1501|  1.12M|                        ps_cr_tu = &cr_sub_tu;
 1502|  1.12M|                        chroma_nbr_flags = chroma_nbr_flags_subtu;
 1503|  1.12M|                    }
 1504|   268M|#endif
 1505|       |                    /***************************************************************/
 1506|       |                    /******************  Intra Prediction **************************/
 1507|       |                    /***************************************************************/
 1508|   268M|                    if(intra_flag) /* Intra */
  ------------------
  |  Branch (1508:24): [True: 12.9M, False: 255M]
  ------------------
 1509|  12.9M|                    {
 1510|  12.9M|                        WORD32 pixel_size = (c_idx == 0) ? pixel_size_y : pixel_size_uv;
  ------------------
  |  Branch (1510:45): [True: 7.21M, False: 5.69M]
  ------------------
 1511|       |                        /* While (MAX_TU_SIZE * 2 * 2) + 1 is the actaul size needed,
 1512|       |                        au1_ref_sub_out size is kept as multiple of 8,
 1513|       |                        so that SIMD functions can load 64 bits. Also some SIMD
 1514|       |                        modules read few bytes before the start of the array, so
 1515|       |                        allocate 16 extra bytes at the start.
 1516|       |                        Multiplied by pixel_size to allocate for HBD. */
 1517|  12.9M|                        UWORD8 au1_ref_sub_out[(16 + (MAX_TU_SIZE * 2 * 2 * 2) + 8) * 2];
 1518|  12.9M|                        memset(au1_ref_sub_out, 0, (16 + (MAX_TU_SIZE * 2 * 2 * 2) + 8) * pixel_size);
  ------------------
  |  |  357|  12.9M|#define MAX_TU_SIZE         32
  ------------------
 1519|  12.9M|                        UWORD8 *pu1_ref_sub_out = &au1_ref_sub_out[16 * pixel_size];
 1520|  12.9M|                        UWORD8 *pu1_top_left, *pu1_top, *pu1_left;
 1521|  12.9M|                        WORD32 luma_pred_func_idx, chroma_pred_func_idx;
 1522|       |
 1523|       |                        /* Get the neighbour availability flags */
 1524|       |                        /* Done for only Y */
 1525|  12.9M|                        if(c_idx == 0)
  ------------------
  |  Branch (1525:28): [True: 7.23M, False: 5.66M]
  ------------------
 1526|  7.23M|                        {
 1527|       |                            /* Get neighbor availability for Y only */
 1528|  7.23M|                            luma_nbr_flags = ihevcd_get_intra_nbr_flag(ps_proc,
 1529|  7.23M|                                                                    ps_tu,
 1530|  7.23M|                                                                    au4_intra_nbr_avail,
 1531|  7.23M|                                                                    ps_sps->i2_pic_width_in_luma_samples,
 1532|  7.23M|                                                                    ps_pps->i1_constrained_intra_pred_flag,
 1533|  7.23M|                                                                    trans_size,
 1534|  7.23M|                                                                    ctb_size);
 1535|       |
 1536|  7.23M|                            if(trans_size == 4)
  ------------------
  |  Branch (1536:32): [True: 3.26M, False: 3.97M]
  ------------------
 1537|  3.26M|                                luma_nbr_flags_4x4[(ps_tu->b4_pos_x % 2) + (ps_tu->b4_pos_y % 2) * 2] = luma_nbr_flags;
 1538|       |
 1539|  7.23M|                            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1539:32): [True: 0, False: 7.23M]
  ------------------
 1540|      0|                            {
 1541|      0|                                chroma_nbr_flags = luma_nbr_flags;
 1542|      0|                            }
 1543|  7.23M|                            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1543:37): [True: 1.77M, False: 5.46M]
  ------------------
 1544|  1.77M|                            {
 1545|       |                                /*
 1546|       |                                * Neighbor Bitfield Layout in libhevc (17 bits):
 1547|       |                                *   Bit 16: Top-Left (TL)
 1548|       |                                *   Bits 15..12: Top-Right (TR) - 4 chunks of 8px (Bits 12, 13, 14, 15)
 1549|       |                                *   Bits 11..8:  Top (T)       - 4 chunks of 8px (Bits 8, 9, 10, 11)
 1550|       |                                *   Bits 7..4:   Left (L)      - 4 chunks of 8px (Bits 7, 6, 5, 4)
 1551|       |                                *   Bits 3..0:   Bottom-Left (BL) - 4 chunks of 8px (Bits 3, 2, 1, 0)
 1552|       |                                *
 1553|       |                                * Mapping Rules for 4:2:2:
 1554|       |                                * 1. Sub-TU 0 (Upper (trans_size/2) x (trans_size/2)):
 1555|       |                                *    - Left: Upper half of parent Luma Left boundary.
 1556|       |                                *    - Bottom-Left: Lower half of parent Luma Left boundary.
 1557|       |                                * 2. Sub-TU 1 (Lower (trans_size/2) x (trans_size/2)):
 1558|       |                                *    - Top-Left: Bottom pixel of Sub-TU 0 Left boundary.
 1559|       |                                *    - Top: Always available from reconstructed bottom row of Sub-TU 0.
 1560|       |                                *    - Top-Right: 0 (not yet decoded in Z-scan order; padded by substitution).
 1561|       |                                *    - Left: Lower half of parent Luma Left boundary.
 1562|       |                                *    - Bottom-Left: Parent Luma Bottom-Left boundary.
 1563|       |                                */
 1564|  1.77M|                                WORD32 tp_left = (luma_nbr_flags & 0x10000);
 1565|       |
 1566|  1.77M|                                switch (trans_size)
 1567|  1.77M|                                {
 1568|   381k|                                case 8:
  ------------------
  |  Branch (1568:33): [True: 381k, False: 1.38M]
  ------------------
 1569|   381k|                                    {
 1570|       |                                        /* Luma 8x8 -> Two 4x4 Chroma Sub-TUs (1 chunk of 4/8px per edge) */
 1571|   381k|                                        WORD32 chroma_Left = (luma_nbr_flags & 0x80);
 1572|   381k|                                        WORD32 chroma_BL = (luma_nbr_flags & 0x80) ? 0x8 : 0;
  ------------------
  |  Branch (1572:60): [True: 362k, False: 18.3k]
  ------------------
 1573|   381k|                                        chroma_nbr_flags = tp_left | (luma_nbr_flags & 0x1000) | (luma_nbr_flags & 0x100) | chroma_Left | chroma_BL;
 1574|       |
 1575|   381k|                                        WORD32 tp_left_subtu1 = (luma_nbr_flags & 0x80) ? 0x10000 : 0;
  ------------------
  |  Branch (1575:65): [True: 362k, False: 18.4k]
  ------------------
 1576|   381k|                                        WORD32 chroma_Left_subtu = (luma_nbr_flags & 0x80);
 1577|   381k|                                        WORD32 chroma_BL_subtu = (luma_nbr_flags & 0x8);
 1578|       |                                        /* Top of Sub-TU 1 is 1 chunk (Bit 8 = 0x100) from reconstructed Sub-TU 0 */
 1579|   381k|                                        chroma_nbr_flags_subtu = tp_left_subtu1 | 0x100 | chroma_Left_subtu | chroma_BL_subtu;
 1580|   381k|                                    }
 1581|   381k|                                    break;
 1582|   197k|                                case 16:
  ------------------
  |  Branch (1582:33): [True: 197k, False: 1.57M]
  ------------------
 1583|   197k|                                    {
 1584|       |                                        /* Luma 16x16 -> Two 8x8 Chroma Sub-TUs (1 chunk of 8px per edge) */
 1585|   197k|                                        WORD32 chroma_Left = (luma_nbr_flags & 0x80) ? 0xC0 : 0;
  ------------------
  |  Branch (1585:62): [True: 166k, False: 30.4k]
  ------------------
 1586|   197k|                                        WORD32 chroma_BL = (luma_nbr_flags & 0x40) ? 0xC : 0;
  ------------------
  |  Branch (1586:60): [True: 166k, False: 30.4k]
  ------------------
 1587|   197k|                                        chroma_nbr_flags = tp_left | (luma_nbr_flags & 0x3000) | (luma_nbr_flags & 0x300) | chroma_Left | chroma_BL;
 1588|       |
 1589|   197k|                                        WORD32 tp_left_subtu1 = (luma_nbr_flags & 0x80) ? 0x10000 : 0;
  ------------------
  |  Branch (1589:65): [True: 166k, False: 30.4k]
  ------------------
 1590|   197k|                                        WORD32 chroma_Left_subtu = (luma_nbr_flags & 0x40) ? 0xC0 : 0;
  ------------------
  |  Branch (1590:68): [True: 166k, False: 30.4k]
  ------------------
 1591|   197k|                                        WORD32 chroma_BL_subtu = (luma_nbr_flags & 0x8) ? 0xC : 0;
  ------------------
  |  Branch (1591:66): [True: 41.6k, False: 155k]
  ------------------
 1592|       |                                        /* Top of Sub-TU 1 is 2 chunks (Bits 8,9 = 0x300) from reconstructed Sub-TU 0 */
 1593|   197k|                                        chroma_nbr_flags_subtu = tp_left_subtu1 | 0x300 | chroma_Left_subtu | chroma_BL_subtu;
 1594|   197k|                                    }
 1595|   197k|                                    break;
 1596|   322k|                                case 32:
  ------------------
  |  Branch (1596:33): [True: 322k, False: 1.44M]
  ------------------
 1597|   322k|                                    {
 1598|       |                                        /* Luma 32x32 -> Two 16x16 Chroma Sub-TUs (2 chunks of 8px per edge) */
 1599|   322k|                                        WORD32 chroma_Left = ((luma_nbr_flags & 0x80) ? 0xC0 : 0) | ((luma_nbr_flags & 0x40) ? 0x30 : 0);
  ------------------
  |  Branch (1599:63): [True: 300k, False: 22.6k]
  |  Branch (1599:102): [True: 300k, False: 22.6k]
  ------------------
 1600|   322k|                                        WORD32 chroma_BL = ((luma_nbr_flags & 0x20) ? 0xC : 0) | ((luma_nbr_flags & 0x10) ? 0x3 : 0);
  ------------------
  |  Branch (1600:61): [True: 300k, False: 22.6k]
  |  Branch (1600:99): [True: 300k, False: 22.6k]
  ------------------
 1601|   322k|                                        chroma_nbr_flags = tp_left | (luma_nbr_flags & 0xF000) | (luma_nbr_flags & 0xF00) | chroma_Left | chroma_BL;
 1602|       |
 1603|   322k|                                        WORD32 tp_left_subtu1 = (luma_nbr_flags & 0x40) ? 0x10000 : 0;
  ------------------
  |  Branch (1603:65): [True: 300k, False: 22.6k]
  ------------------
 1604|   322k|                                        WORD32 chroma_Left_subtu = ((luma_nbr_flags & 0x20) ? 0xC0 : 0) | ((luma_nbr_flags & 0x10) ? 0x30 : 0);
  ------------------
  |  Branch (1604:69): [True: 300k, False: 22.6k]
  |  Branch (1604:108): [True: 300k, False: 22.6k]
  ------------------
 1605|   322k|                                        WORD32 chroma_BL_subtu = ((luma_nbr_flags & 0x8) ? 0xC : 0) | ((luma_nbr_flags & 0x4) ? 0x3 : 0);
  ------------------
  |  Branch (1605:67): [True: 71.3k, False: 251k]
  |  Branch (1605:104): [True: 71.3k, False: 251k]
  ------------------
 1606|       |                                        /* Top of Sub-TU 1 is 4 chunks (Bits 8..11 = 0xF00) from reconstructed Sub-TU 0 */
 1607|   322k|                                        chroma_nbr_flags_subtu = tp_left_subtu1 | 0xF00 | chroma_Left_subtu | chroma_BL_subtu;
 1608|   322k|                                    }
 1609|   322k|                                    break;
 1610|   870k|                                default:
  ------------------
  |  Branch (1610:33): [True: 870k, False: 899k]
  ------------------
 1611|   870k|                                    chroma_nbr_flags = (luma_nbr_flags & 0x1ff00) | (luma_nbr_flags & 0xf0) | ((luma_nbr_flags & 0xf0) >> 4);
 1612|   870k|                                    chroma_nbr_flags_subtu = (((luma_nbr_flags & 0xf0) != 0 ? 1 : 0) << 16) | (0xf << 8) | (luma_nbr_flags & 0xff);
  ------------------
  |  Branch (1612:64): [True: 827k, False: 42.4k]
  ------------------
 1613|   870k|                                    break;
 1614|  1.77M|                                }
 1615|  1.77M|                            }
 1616|  5.46M|                            else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1616:37): [True: 5.33M, False: 131k]
  ------------------
 1617|  5.33M|                            {
 1618|  5.33M|                                if(((ps_tu->b4_pos_x % 2 == 0) && (ps_tu->b4_pos_y % 2 == 0)))
  ------------------
  |  Branch (1618:37): [True: 4.20M, False: 1.12M]
  |  Branch (1618:67): [True: 3.64M, False: 566k]
  ------------------
 1619|  3.63M|                                    chroma_nbr_flags = luma_nbr_flags;
 1620|  5.33M|                            }
 1621|       |
 1622|       |                            /* Initializing nbr pointers */
 1623|  7.23M|                            pu1_top = y_cb_tu.pu1_pred - pic_strd * pixel_size_y;
 1624|  7.23M|                            pu1_left = y_cb_tu.pu1_pred - pixel_size_y;
 1625|  7.23M|                            pu1_top_left = y_cb_tu.pu1_pred - (pic_strd + 1) * pixel_size_y;
 1626|       |
 1627|       |                            /* call reference array substitution */
 1628|  7.23M|                            if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  7.23M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1628:32): [True: 4.95M, False: 2.27M]
  ------------------
 1629|  4.95M|                            {
 1630|  4.95M|                                if(luma_nbr_flags == 0x1ffff)
  ------------------
  |  Branch (1630:36): [True: 720k, False: 4.23M]
  ------------------
 1631|   720k|                                {
 1632|   720k|                                    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr(
 1633|   720k|                                                    pu1_top_left,
 1634|   720k|                                                    pu1_top, pu1_left, y_cb_tu.pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1);
 1635|   720k|                                }
 1636|  4.23M|                                else
 1637|  4.23M|                                {
 1638|  4.23M|                                    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr(
 1639|  4.23M|                                                    pu1_top_left,
 1640|  4.23M|                                                    pu1_top, pu1_left, y_cb_tu.pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1);
 1641|  4.23M|                                }
 1642|       |
 1643|       |                                /* call reference filtering */
 1644|  4.95M|                                ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr(
 1645|  4.95M|                                                pu1_ref_sub_out,
 1646|  4.95M|                                                trans_size,
 1647|  4.95M|                                                pu1_ref_sub_out,
 1648|  4.95M|                                                u1_luma_pred_mode,
 1649|  4.95M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1650|  4.95M|                                                (ps_sps->i1_intra_smoothing_disabled_flag << 3
 1651|  4.95M|                                                                | ps_sps->i1_strong_intra_smoothing_enable_flag)
 1652|       |#else
 1653|       |                                                ps_sps->i1_strong_intra_smoothing_enable_flag
 1654|       |#endif
 1655|  4.95M|                                                );
 1656|  4.95M|                            }
 1657|  2.27M|                            else
 1658|  2.27M|                            {
 1659|  2.27M|                                ps_codec->s_func_selector.ihevc_hbd_intra_pred_luma_ref_substitution_fptr(
 1660|  2.27M|                                                (UWORD16 *)pu1_top_left, (UWORD16 *)pu1_top, (UWORD16 *)pu1_left,
 1661|  2.27M|                                                y_cb_tu.pred_strd, trans_size, luma_nbr_flags,
 1662|  2.27M|                                                (UWORD16 *)pu1_ref_sub_out, 1, bit_depth_luma);
 1663|       |
 1664|       |                                /* call reference filtering */
 1665|  2.27M|                                ps_codec->s_func_selector.ihevc_hbd_intra_pred_ref_filtering_fptr(
 1666|  2.27M|                                                (UWORD16 *)pu1_ref_sub_out, trans_size,
 1667|  2.27M|                                                (UWORD16 *)pu1_ref_sub_out, u1_luma_pred_mode,
 1668|  2.27M|                                                (ps_sps->i1_intra_smoothing_disabled_flag << 3
 1669|  2.27M|                                                                | ps_sps->i1_strong_intra_smoothing_enable_flag),
 1670|  2.27M|                                                (UWORD8)bit_depth_luma);
 1671|  2.27M|                            }
 1672|       |
 1673|       |                            /* use the look up to get the function idx */
 1674|  7.23M|                            luma_pred_func_idx = g_i4_ip_funcs[u1_luma_pred_mode];
 1675|       |
 1676|  7.23M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1677|  7.23M|                            if(ps_sps->i1_implicit_rdpcm_enabled_flag && ps_tu->b1_transquant_bypass
  ------------------
  |  Branch (1677:32): [True: 102k, False: 7.13M]
  |  Branch (1677:74): [True: 36.9k, False: 66.0k]
  ------------------
 1678|  36.9k|                                            && (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26))
  ------------------
  |  Branch (1678:49): [True: 6.40k, False: 30.5k]
  |  Branch (1678:76): [True: 5.56k, False: 24.9k]
  ------------------
 1679|  11.9k|                                disable_boundary_filter = 1;
 1680|  7.23M|#endif
 1681|       |                            /* call the intra prediction function */
 1682|  7.23M|                            if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  7.23M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1682:32): [True: 4.98M, False: 2.25M]
  ------------------
 1683|  4.98M|                            {
 1684|  4.98M|                                ps_codec->apf_intra_pred_luma[luma_pred_func_idx](
 1685|  4.98M|                                                pu1_ref_sub_out, 1,
 1686|  4.98M|                                                y_cb_tu.pu1_pred,
 1687|  4.98M|                                                y_cb_tu.pred_strd,
 1688|  4.98M|                                                trans_size,
 1689|  4.98M|                                                (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26) ?
  ------------------
  |  Branch (1689:50): [True: 90.0k, False: 4.89M]
  |  Branch (1689:77): [True: 439k, False: 4.45M]
  ------------------
 1690|   541k|                                                                disable_boundary_filter :
 1691|  4.98M|                                                                u1_luma_pred_mode
 1692|  4.98M|                                                );
 1693|  4.98M|                            }
 1694|  2.25M|                            else
 1695|  2.25M|                            {
 1696|  2.25M|                                ps_codec->apf_hbd_intra_pred_luma[luma_pred_func_idx](
 1697|  2.25M|                                                (UWORD16 *)pu1_ref_sub_out, 1,
 1698|  2.25M|                                                (UWORD16 *)y_cb_tu.pu1_pred,
 1699|  2.25M|                                                y_cb_tu.pred_strd,
 1700|  2.25M|                                                trans_size,
 1701|  2.25M|                                                (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26) ?
  ------------------
  |  Branch (1701:50): [True: 18.4E, False: 2.25M]
  |  Branch (1701:77): [True: 286k, False: 1.96M]
  ------------------
 1702|   308k|                                                                disable_boundary_filter :
 1703|  2.25M|                                                                u1_luma_pred_mode,
 1704|  2.25M|                                                (UWORD8)bit_depth_luma);
 1705|  2.25M|                            }
 1706|  7.23M|                        }
 1707|  5.66M|                        else
 1708|  5.66M|                        {
 1709|       |                            /* In case of yuv420sp_vu, prediction happens as usual.         */
 1710|       |                            /* So point the pu1_pred pointer to original prediction pointer */
 1711|  5.66M|                            UWORD8 *pu1_pred_orig = ps_cb_tu->pu1_pred - chroma_yuv420sp_vu_u_offset;
 1712|       |
 1713|       |                            /*    Top-Left | Top-Right | Top | Left | Bottom-Left
 1714|       |                            *      1         4         4     4         4
 1715|       |                            *
 1716|       |                            * Generating chroma_nbr_flags depending upon the transform size */
 1717|  5.66M|                            if(ps_tu->b3_size == 0)
  ------------------
  |  Branch (1717:32): [True: 1.00M, False: 4.65M]
  ------------------
 1718|  1.00M|                            {
 1719|  1.00M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1719:36): [True: 572k, False: 436k]
  ------------------
 1720|   572k|                                {
 1721|       |                                    /* Take TL,T,L flags of First luma 4x4 block */
 1722|   572k|                                    chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0);
 1723|       |                                    /* Take TR flags of Second luma 4x4 block */
 1724|   572k|                                    chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000);
 1725|       |                                    /* Take BL flags of Third luma 4x4 block */
 1726|   572k|                                    chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F);
 1727|   572k|                                }
 1728|   436k|                                else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1728:41): [True: 436k, False: 18.4E]
  ------------------
 1729|   436k|                                {
 1730|   436k|                                    if(subtu_idx == 0)
  ------------------
  |  Branch (1730:40): [True: 218k, False: 217k]
  ------------------
 1731|   218k|                                    {
 1732|       |                                        /* Take TL,T,L flags of First luma 4x4 block */
 1733|   218k|                                        chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0);
 1734|       |                                        /* Take TR flags of Second luma 4x4 block */
 1735|   218k|                                        chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000);
 1736|       |                                        /* Take BL flags of first luma 4x4 block */
 1737|   218k|                                        chroma_nbr_flags |= (luma_nbr_flags_4x4[0] & 0x0000F);
 1738|   218k|                                    }
 1739|   217k|                                    else
 1740|   217k|                                    {
 1741|       |                                        /* Take TL,T,L flags of Third luma 4x4 block */
 1742|   217k|                                        chroma_nbr_flags = (luma_nbr_flags_4x4[2] & 0x10FF0);
 1743|       |                                        /* Take BL flags of Third luma 4x4 block */
 1744|   217k|                                        chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F);
 1745|   217k|                                    }
 1746|   436k|                                }
 1747|  1.00M|                            }
 1748|       |
 1749|       |                            /* Initializing nbr pointers */
 1750|  5.66M|                            pu1_top = pu1_pred_orig - (pic_strd * chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
 1751|  5.66M|                            pu1_left = pu1_pred_orig - 2 * pixel_size_uv;
 1752|  5.66M|                            pu1_top_left = pu1_pred_orig - (pic_strd * chroma_pixel_strd / h_samp_factor + 2) * pixel_size_uv;
 1753|       |
 1754|  5.66M|                            if(subtu_idx == 0)
  ------------------
  |  Branch (1754:32): [True: 4.74M, False: 923k]
  ------------------
 1755|  4.74M|                            {
 1756|       |                                /* Chroma pred  mode derivation from luma pred mode */
 1757|  4.74M|                                {
 1758|  4.74M|                                    tu_t *ps_tu_tmp = ps_tu;
 1759|  4.74M|                                    if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1759:40): [True: 4.74M, False: 18.4E]
  ------------------
 1760|  4.74M|                                    {
 1761|  23.0M|                                        while(!ps_tu_tmp->b1_first_tu_in_cu)
  ------------------
  |  Branch (1761:47): [True: 18.2M, False: 4.74M]
  ------------------
 1762|  18.2M|                                        {
 1763|  18.2M|                                            ps_tu_tmp--;
 1764|  18.2M|                                        }
 1765|  4.74M|                                    }
 1766|  4.74M|                                    u1_luma_pred_mode_first_tu = ps_tu_tmp->b6_luma_intra_mode;
 1767|  4.74M|                                }
 1768|  4.74M|                                if(4 == u1_chroma_pred_mode)
  ------------------
  |  Branch (1768:36): [True: 4.22M, False: 521k]
  ------------------
 1769|  4.22M|                                    u1_chroma_pred_mode = u1_luma_pred_mode_first_tu;
 1770|   521k|                                else
 1771|   521k|                                {
 1772|   521k|                                    u1_chroma_pred_mode = gau1_intra_pred_chroma_modes[u1_chroma_pred_mode];
 1773|       |
 1774|   521k|                                    if(u1_chroma_pred_mode == u1_luma_pred_mode_first_tu)
  ------------------
  |  Branch (1774:40): [True: 77.0k, False: 444k]
  ------------------
 1775|  77.0k|                                    {
 1776|  77.0k|                                        u1_chroma_pred_mode = INTRA_ANGULAR(34);
  ------------------
  |  |  517|  77.0k|#define INTRA_ANGULAR(x) (x)
  ------------------
 1777|  77.0k|                                    }
 1778|   521k|                                }
 1779|  4.74M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (1779:36): [True: 1.11M, False: 3.62M]
  ------------------
 1780|  1.11M|                                {
 1781|  1.11M|                                    u1_chroma_pred_mode = gau1_intra_pred_chroma_modes_422[u1_chroma_pred_mode];
 1782|  1.11M|                                }
 1783|  4.74M|                            }
 1784|       |
 1785|       |                            /* call the chroma reference array substitution */
 1786|  5.66M|                            if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  5.66M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1786:32): [True: 3.38M, False: 2.28M]
  ------------------
 1787|  3.38M|                            {
 1788|  3.38M|                                ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr(
 1789|  3.38M|                                                pu1_top_left,
 1790|  3.38M|                                                pu1_top, pu1_left,
 1791|  3.38M|                                                ps_cb_tu->pred_strd,
 1792|  3.38M|                                                trans_size, chroma_nbr_flags, pu1_ref_sub_out, 1,
 1793|  3.38M|                                                ps_sps->i1_chroma_format_idc);
 1794|       |
 1795|  3.38M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1796|       |                                /* call reference filtering */
 1797|  3.38M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1797:36): [True: 0, False: 3.38M]
  ------------------
 1798|      0|                                {
 1799|      0|                                    ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_filtering_fptr(
 1800|      0|                                                    pu1_ref_sub_out,
 1801|      0|                                                    trans_size,
 1802|      0|                                                    pu1_ref_sub_out,
 1803|      0|                                                    u1_chroma_pred_mode,
 1804|      0|                                                    (ps_sps->i1_intra_smoothing_disabled_flag << 3
 1805|      0|                                                                    | ps_sps->i1_strong_intra_smoothing_enable_flag));
 1806|      0|                                }
 1807|  3.38M|#endif
 1808|       |
 1809|       |                                /* use the look up to get the function idx */
 1810|  3.38M|                                chroma_pred_func_idx = g_i4_ip_funcs[u1_chroma_pred_mode];
 1811|       |
 1812|       |                                /* call the intra prediction function */
 1813|  3.38M|                                ps_codec->apf_intra_pred_chroma[chroma_pred_func_idx](pu1_ref_sub_out, 1, pu1_pred_orig, ps_cb_tu->pred_strd, trans_size, u1_chroma_pred_mode);
 1814|  3.38M|                            }
 1815|  2.28M|                            else
 1816|  2.28M|                            {
 1817|  2.28M|                                ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_ref_substitution_fptr((UWORD16 *)pu1_top_left,
 1818|  2.28M|                                                (UWORD16 *)pu1_top, (UWORD16 *)pu1_left, ps_cb_tu->pred_strd, trans_size,
 1819|  2.28M|                                                chroma_nbr_flags, (UWORD16 *)pu1_ref_sub_out, 1, ps_sps->i1_chroma_format_idc,
 1820|  2.28M|                                                (UWORD8) bit_depth_chroma);
 1821|       |
 1822|  2.28M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1823|       |                                /* call reference filtering */
 1824|  2.28M|                                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1824:36): [True: 0, False: 2.28M]
  ------------------
 1825|      0|                                {
 1826|      0|                                    ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_ref_filtering_fptr(
 1827|      0|                                                    (UWORD16 *)pu1_ref_sub_out,
 1828|      0|                                                    trans_size,
 1829|      0|                                                    (UWORD16 *)pu1_ref_sub_out,
 1830|      0|                                                    u1_chroma_pred_mode,
 1831|      0|                                                    (ps_sps->i1_intra_smoothing_disabled_flag << 3
 1832|      0|                                                                    | ps_sps->i1_strong_intra_smoothing_enable_flag));
 1833|      0|                                }
 1834|  2.28M|#endif
 1835|       |
 1836|       |                                /* use the look up to get the function idx */
 1837|  2.28M|                                chroma_pred_func_idx = g_i4_ip_funcs[u1_chroma_pred_mode];
 1838|       |
 1839|       |                                /* call the intra prediction function */
 1840|  2.28M|                                ps_codec->apf_hbd_intra_pred_chroma[chroma_pred_func_idx]((UWORD16 *)pu1_ref_sub_out,
 1841|  2.28M|                                            1, (UWORD16 *)pu1_pred_orig, ps_cb_tu->pred_strd, trans_size, u1_chroma_pred_mode);
 1842|  2.28M|                            }
 1843|  5.66M|                        }
 1844|  12.9M|                    }
 1845|       |
 1846|       |                    /* Updating number of transform types */
 1847|   268M|                    STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx);
  ------------------
  |  |  138|   268M|#define STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx) ;
  ------------------
 1848|       |
 1849|   268M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1850|   268M|                    iqitrecon_fptr = get_iqitrec_func(
 1851|   268M|                                    ps_proc, ps_tu, ps_cb_tu, log2_trans_size,
 1852|   268M|                                    c_idx != 0 ? U_PLANE : NULL_PLANE, intra_flag,
  ------------------
  |  Branch (1852:37): [True: 6.17M, False: 261M]
  ------------------
 1853|  18.4E|                                    c_idx == 0 ? u1_luma_pred_mode : u1_chroma_pred_mode);
  ------------------
  |  Branch (1853:37): [True: 272M, False: 18.4E]
  ------------------
 1854|   268M|#endif
 1855|       |                    /* IQ, IT and Recon for Y if c_idx == 0, and U if c_idx !=0 */
 1856|   268M|                    iqitrecon_fptr(ps_proc, ps_tu, ps_cb_tu, func_idx, log2_trans_size,
 1857|   268M|                                c_idx != 0 ? U_PLANE : NULL_PLANE, intra_flag,
  ------------------
  |  Branch (1857:33): [True: 6.10M, False: 261M]
  ------------------
 1858|   268M|                                c_idx == 0 ? u1_luma_pred_mode : u1_chroma_pred_mode);
  ------------------
  |  Branch (1858:33): [True: 263M, False: 4.24M]
  ------------------
 1859|       |                    /* IQ, IT and Recon for V */
 1860|   268M|                    if(c_idx != 0)
  ------------------
  |  Branch (1860:24): [True: 6.34M, False: 261M]
  ------------------
 1861|  6.34M|                    {
 1862|  6.34M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1863|  6.34M|                        iqitrecon_fptr = get_iqitrec_func(ps_proc, ps_tu, ps_cr_tu, log2_trans_size,
 1864|  6.34M|                                                        V_PLANE, intra_flag, u1_chroma_pred_mode);
 1865|  6.34M|#endif
 1866|  6.34M|                        iqitrecon_fptr(ps_proc, ps_tu, ps_cr_tu, func_idx, log2_trans_size, V_PLANE,
 1867|  6.34M|                                    intra_flag, u1_chroma_pred_mode);
 1868|  6.34M|                    }
 1869|   268M|                }
 1870|   268M|                while(c_idx != 0 && ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422
  ------------------
  |  Branch (1870:23): [True: 6.33M, False: 261M]
  |  Branch (1870:37): [True: 2.23M, False: 4.09M]
  ------------------
 1871|  2.23M|                                && ++subtu_idx < 2);
  ------------------
  |  Branch (1871:36): [True: 1.12M, False: 1.11M]
  ------------------
 1872|   266M|            }
 1873|       |
 1874|       |            /* Neighbor availability inside CTB */
 1875|       |            /* 1bit per 4x4. Indicates whether that 4x4 block has been reconstructed(avialable) */
 1876|       |            /* Used for neighbor availability in intra pred */
 1877|   266M|            if(c_idx == 0)
  ------------------
  |  Branch (1877:16): [True: 258M, False: 7.94M]
  ------------------
 1878|   258M|            {
 1879|   258M|                WORD32 i;
 1880|   258M|                WORD32 trans_in_min_tu;
 1881|   258M|                UWORD32 cur_tu_in_bits;
 1882|   258M|                UWORD32 cur_tu_avail_flag;
 1883|       |
 1884|   258M|                trans_in_min_tu = trans_size / MIN_TU_SIZE;
  ------------------
  |  |  358|   258M|#define MIN_TU_SIZE         4
  ------------------
 1885|   258M|                cur_tu_in_bits = (1 << trans_in_min_tu) - 1;
 1886|   258M|                cur_tu_in_bits = cur_tu_in_bits << (32 - trans_in_min_tu);
 1887|       |
 1888|   258M|                cur_tu_avail_flag = cur_tu_in_bits >> (ps_tu->b4_pos_x + 1);
 1889|       |
 1890|   787M|                for(i = 0; i < trans_in_min_tu; i++)
  ------------------
  |  Branch (1890:28): [True: 528M, False: 258M]
  ------------------
 1891|   528M|                    au4_intra_nbr_avail[1 + ps_tu->b4_pos_y + i] |=
 1892|   528M|                                    cur_tu_avail_flag;
 1893|   258M|            }
 1894|   266M|        }
 1895|   257M|    }
 1896|  19.2M|    ps_proc->pv_tu_coeff_data = pu1_tu_coeff_data;
 1897|       |
 1898|  19.2M|    return ps_proc->i4_ctb_tu_cnt;
 1899|  19.2M|}
ihevcd_iquant_itrans_recon_ctb.c:ihevcd_iquant_itrans_resi_recon_tu_plane:
  727|   380k|{
  728|   380k|    sps_t *ps_sps = ps_proc->ps_sps;
  729|   380k|    pps_t *ps_pps = ps_proc->ps_pps;
  730|   380k|    codec_t *ps_codec = ps_proc->ps_codec;
  731|   380k|    WORD8 trans_size = 1 << log2_trans_size;
  732|   380k|    WORD16 *pi2_res = ps_proc->pi2_res_luma_buf;
  733|   380k|    WORD16 *pi2_res_uv = ps_proc->pi2_res_chroma_buf;
  734|   380k|    WORD32 alpha = 0;
  735|   380k|    WORD16 *residue_out_base = chroma_plane == NULL_PLANE ? pi2_res : pi2_res_uv;
  ------------------
  |  Branch (735:32): [True: 153k, False: 227k]
  ------------------
  736|   380k|    WORD16 *residue_out = residue_out_base;
  737|       |    // if both rdpcm and rotate are to be applied, share the output residue buffer between the
  738|       |    // two transforms
  739|   380k|    WORD16 *residue_out_intrmdt = residue_out_base + (TRANS_SIZE_4 * TRANS_SIZE_4);
  ------------------
  |  |  429|   380k|#define TRANS_SIZE_4   4
  ------------------
                  WORD16 *residue_out_intrmdt = residue_out_base + (TRANS_SIZE_4 * TRANS_SIZE_4);
  ------------------
  |  |  429|   380k|#define TRANS_SIZE_4   4
  ------------------
  740|       |
  741|   380k|    WORD32 bit_depth = chroma_plane == NULL_PLANE ? ps_codec->i4_bit_depth_luma : ps_codec->i4_bit_depth_chroma;
  ------------------
  |  Branch (741:24): [True: 153k, False: 227k]
  ------------------
  742|   380k|    if(chroma_plane == U_PLANE && ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0)
  ------------------
  |  Branch (742:8): [True: 119k, False: 260k]
  |  Branch (742:35): [True: 111k, False: 8.70k]
  ------------------
  743|   111k|    {
  744|   111k|        alpha = (1 << (ps_tu->b3_cb_log2_res_scale_abs_plus1 - 1))
  745|   111k|                        * (1 - 2 * ps_tu->b1_cb_log2_res_sign);
  746|   111k|    }
  747|   269k|    else if(chroma_plane == V_PLANE && ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0)
  ------------------
  |  Branch (747:13): [True: 109k, False: 159k]
  |  Branch (747:40): [True: 101k, False: 8.46k]
  ------------------
  748|   101k|    {
  749|   101k|        alpha = (1 << (ps_tu->b3_cr_log2_res_scale_abs_plus1 - 1))
  750|   101k|                        * (1 - 2 * ps_tu->b1_cr_log2_res_sign);
  751|   101k|    }
  752|   380k|    if(1 == ps_pl_tu_ctxt->cbf)
  ------------------
  |  Branch (752:8): [True: 198k, False: 181k]
  ------------------
  753|   198k|    {
  754|   198k|        if(ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag)
  ------------------
  |  Branch (754:12): [True: 34.0k, False: 164k]
  |  Branch (754:43): [True: 39.5k, False: 125k]
  ------------------
  755|  73.6k|        {
  756|  73.6k|            WORD8 rotate = ps_sps->i1_transform_skip_rotation_enabled_flag && trans_size == 4
  ------------------
  |  Branch (756:28): [True: 64.0k, False: 9.62k]
  |  Branch (756:79): [True: 62.5k, False: 1.46k]
  ------------------
  757|  62.5k|                            && intra_flag;
  ------------------
  |  Branch (757:32): [True: 60.5k, False: 1.93k]
  ------------------
  758|  73.6k|            WORD8 rdpcm = (ps_sps->i1_implicit_rdpcm_enabled_flag && intra_flag
  ------------------
  |  Branch (758:28): [True: 40.3k, False: 33.3k]
  |  Branch (758:70): [True: 38.1k, False: 2.19k]
  ------------------
  759|  38.1k|                            && (intra_pred_mode == 10 || intra_pred_mode == 26))
  ------------------
  |  Branch (759:33): [True: 7.19k, False: 30.9k]
  |  Branch (759:58): [True: 5.96k, False: 24.9k]
  ------------------
  760|  60.4k|                            || ps_pl_tu_ctxt->explicit_rdpcm_flag;
  ------------------
  |  Branch (760:32): [True: 2.19k, False: 58.2k]
  ------------------
  761|  73.6k|            WORD16 *src_residue = ps_pl_tu_ctxt->pi2_tu_coeff;
  762|  73.6k|            WORD16 src_residue_strd = ps_pl_tu_ctxt->tu_coeff_stride;
  763|       |
  764|  73.6k|            if(rotate)
  ------------------
  |  Branch (764:16): [True: 60.5k, False: 13.0k]
  ------------------
  765|  60.5k|            {
  766|  60.5k|                ihevc_res_4x4_rotate(src_residue, rdpcm ? residue_out_intrmdt : residue_out,
  ------------------
  |  Branch (766:51): [True: 6.27k, False: 54.3k]
  ------------------
  767|  60.5k|                                     src_residue_strd, trans_size, ps_pl_tu_ctxt->zero_cols);
  768|  60.5k|                ps_pl_tu_ctxt->zero_cols =
  769|  60.5k|                                gau4_ihevcd_4_bit_reverse[ps_pl_tu_ctxt->zero_cols & 0xF];
  770|  60.5k|                src_residue = residue_out_intrmdt;
  771|  60.5k|                src_residue_strd = trans_size;
  772|  60.5k|            }
  773|       |
  774|  73.6k|            if(rdpcm)
  ------------------
  |  Branch (774:16): [True: 15.3k, False: 58.2k]
  ------------------
  775|  15.3k|            {
  776|  15.3k|                WORD8 rdpcm_dir =
  777|  15.3k|                                ps_pl_tu_ctxt->explicit_rdpcm_flag ?
  ------------------
  |  Branch (777:33): [True: 2.19k, False: 13.1k]
  ------------------
  778|  2.19k|                                                ps_pl_tu_ctxt->explicit_rdpcm_dir :
  779|  15.3k|                                                intra_pred_mode != 10;
  780|  15.3k|                if(rdpcm_dir == 0)
  ------------------
  |  Branch (780:20): [True: 8.07k, False: 7.29k]
  ------------------
  781|  8.07k|                {
  782|  8.07k|                    ihevc_res_nxn_rdpcm_horz(src_residue, residue_out, src_residue_strd, trans_size,
  783|  8.07k|                                             trans_size, ps_pl_tu_ctxt->zero_cols);
  784|  8.07k|                    ps_pl_tu_ctxt->zero_cols = (1 << CTZ(~ps_pl_tu_ctxt->zero_cols)) - 1;
  785|  8.07k|                }
  786|  7.29k|                else
  787|  7.29k|                {
  788|  7.29k|                    ihevc_res_nxn_rdpcm_vert(src_residue, residue_out, src_residue_strd, trans_size,
  789|  7.29k|                                             trans_size, ps_pl_tu_ctxt->zero_cols);
  790|  7.29k|                }
  791|  15.3k|            }
  792|       |
  793|  73.6k|            if(!rdpcm && !rotate)
  ------------------
  |  Branch (793:16): [True: 58.1k, False: 15.4k]
  |  Branch (793:26): [True: 3.91k, False: 54.2k]
  ------------------
  794|  3.91k|            {
  795|  3.91k|                ihevc_res_nxn_copy(src_residue, residue_out, src_residue_strd, trans_size,
  796|  3.91k|                                   trans_size, ps_pl_tu_ctxt->zero_cols);
  797|  3.91k|            }
  798|  73.6k|        }
  799|   125k|        else
  800|   125k|        {
  801|       |            /* iQuant, iTrans */
  802|   125k|            if(0 == ps_pl_tu_ctxt->coeff_type)
  ------------------
  |  Branch (802:16): [True: 101k, False: 23.3k]
  ------------------
  803|   101k|            {
  804|   101k|                WORD32 func_tmp_idx = chroma_plane != NULL_PLANE ? func_idx - 4 : func_idx;
  ------------------
  |  Branch (804:39): [True: 8.53k, False: 93.4k]
  ------------------
  805|   101k|                ps_codec->apf_itrans_res[func_tmp_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
  806|   101k|                                                       ps_proc->pi2_itrans_intrmd_buf, residue_out,
  807|   101k|                                                       ps_pl_tu_ctxt->tu_coeff_stride, trans_size,
  808|   101k|                                                       ps_pl_tu_ctxt->zero_cols,
  809|   101k|                                                       ps_pl_tu_ctxt->zero_rows, (UWORD8)bit_depth);
  810|   101k|            }
  811|  23.3k|            else /* DC only */
  812|  23.3k|            {
  813|  23.3k|                ps_codec->apf_itrans_res_dc(residue_out, trans_size, log2_trans_size,
  814|  23.3k|                                            ps_pl_tu_ctxt->coeff_value, (UWORD8)bit_depth);
  815|  23.3k|            }
  816|   125k|            ps_pl_tu_ctxt->zero_cols = 0;
  817|   125k|        }
  818|   198k|        if(!alpha)
  ------------------
  |  Branch (818:12): [True: 170k, False: 28.6k]
  ------------------
  819|   170k|        {
  820|   170k|            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|   170k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (820:16): [True: 125k, False: 44.8k]
  ------------------
  821|   125k|            {
  822|   125k|                ps_codec->apf_recon[func_idx](residue_out, ps_pl_tu_ctxt->pu1_pred,
  823|   125k|                                              ps_pl_tu_ctxt->pu1_dst, trans_size,
  824|   125k|                                              ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  825|   125k|                                              ps_pl_tu_ctxt->zero_cols);
  826|   125k|            }
  827|  44.8k|            else
  828|  44.8k|            {
  829|  44.8k|                ps_codec->apf_hbd_recon[func_idx](residue_out, (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  830|  44.8k|                                                  (UWORD16 *)ps_pl_tu_ctxt->pu1_dst, trans_size,
  831|  44.8k|                                                  ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  832|  44.8k|                                                  ps_pl_tu_ctxt->zero_cols, (UWORD8)bit_depth);
  833|  44.8k|            }
  834|   170k|        }
  835|   198k|    }
  836|   380k|    if(alpha)
  ------------------
  |  Branch (836:8): [True: 211k, False: 168k]
  ------------------
  837|   211k|    {
  838|   211k|        if(0 == ps_pl_tu_ctxt->cbf)
  ------------------
  |  Branch (838:12): [True: 183k, False: 28.6k]
  ------------------
  839|   183k|        {
  840|   183k|            memset(residue_out, 0, trans_size * trans_size * sizeof(WORD16));
  841|   183k|        }
  842|   211k|        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|   211k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (842:12): [True: 184k, False: 27.3k]
  ------------------
  843|   184k|        {
  844|   184k|            ihevc_chroma_recon_nxn_ccp(pi2_res, pi2_res_uv, ps_pl_tu_ctxt->pu1_pred,
  845|   184k|                                       ps_pl_tu_ctxt->pu1_dst, alpha, trans_size, trans_size,
  846|   184k|                                       trans_size, ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd);
  847|   184k|        }
  848|  27.3k|        else
  849|  27.3k|        {
  850|  27.3k|            ihevc_hbd_chroma_recon_nxn_ccp(pi2_res, pi2_res_uv, (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  851|  27.3k|                                           (UWORD16 *)ps_pl_tu_ctxt->pu1_dst, alpha, trans_size, trans_size,
  852|  27.3k|                                           trans_size, ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, (UWORD8)bit_depth);
  853|  27.3k|        }
  854|   211k|    }
  855|   380k|}
ihevcd_iquant_itrans_recon_ctb.c:ihevcd_iquant_itrans_recon_tu_plane:
  638|   274M|{
  639|   274M|    sps_t *ps_sps = ps_proc->ps_sps;
  640|   274M|    pps_t *ps_pps = ps_proc->ps_pps;
  641|   274M|    codec_t *ps_codec = ps_proc->ps_codec;
  642|   274M|    WORD32 is_chroma = (chroma_plane != NULL_PLANE);
  643|   274M|    WORD32 pixel_size = is_chroma ? ps_codec->i4_pixel_size_uv : ps_codec->i4_pixel_size_y;
  ------------------
  |  Branch (643:25): [True: 12.3M, False: 261M]
  ------------------
  644|   274M|    WORD32 bit_depth = is_chroma ? ps_codec->i4_bit_depth_chroma : ps_codec->i4_bit_depth_luma;
  ------------------
  |  Branch (644:24): [True: 12.3M, False: 261M]
  ------------------
  645|       |
  646|   274M|    if(1 == ps_pl_tu_ctxt->cbf)
  ------------------
  |  Branch (646:8): [True: 7.92M, False: 266M]
  ------------------
  647|  7.92M|    {
  648|  7.92M|        if(ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag)
  ------------------
  |  Branch (648:12): [True: 547k, False: 7.37M]
  |  Branch (648:43): [True: 1.13M, False: 6.24M]
  ------------------
  649|  1.69M|        {
  650|       |            /* Recon */
  651|  1.69M|            if(PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  1.69M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (651:16): [True: 972k, False: 718k]
  ------------------
  652|   972k|            {
  653|   972k|                ps_codec->apf_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff, ps_pl_tu_ctxt->pu1_pred,
  654|   972k|                                              ps_pl_tu_ctxt->pu1_dst, ps_pl_tu_ctxt->tu_coeff_stride,
  655|   972k|                                              ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  656|   972k|                                              ps_pl_tu_ctxt->zero_cols);
  657|   972k|            }
  658|   718k|            else
  659|   718k|            {
  660|   718k|                ps_codec->apf_hbd_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff, (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  661|   718k|                                                  (UWORD16 *)ps_pl_tu_ctxt->pu1_dst, ps_pl_tu_ctxt->tu_coeff_stride,
  662|   718k|                                                  ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd,
  663|   718k|                                                  ps_pl_tu_ctxt->zero_cols, (UWORD8)bit_depth);
  664|   718k|            }
  665|  1.69M|        }
  666|  6.23M|        else
  667|  6.23M|        {
  668|       |            /* iQuant , iTrans and Recon */
  669|  6.23M|            if((0 == ps_pl_tu_ctxt->coeff_type))
  ------------------
  |  Branch (669:16): [True: 4.21M, False: 2.01M]
  ------------------
  670|  4.21M|            {
  671|  4.21M|                if(PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  4.21M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (671:20): [True: 3.07M, False: 1.14M]
  ------------------
  672|  3.07M|                {
  673|  3.07M|                    ps_codec->apf_itrans_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
  674|  3.07M|                                                        ps_proc->pi2_itrans_intrmd_buf,
  675|  3.07M|                                                        ps_pl_tu_ctxt->pu1_pred,
  676|  3.07M|                                                        ps_pl_tu_ctxt->pu1_dst,
  677|  3.07M|                                                        ps_pl_tu_ctxt->tu_coeff_stride,
  678|  3.07M|                                                        ps_pl_tu_ctxt->pred_strd,
  679|  3.07M|                                                        ps_pl_tu_ctxt->dst_strd,
  680|  3.07M|                                                        ps_pl_tu_ctxt->zero_cols,
  681|  3.07M|                                                        ps_pl_tu_ctxt->zero_rows);
  682|  3.07M|                }
  683|  1.14M|                else
  684|  1.14M|                {
  685|  1.14M|                    ps_codec->apf_hbd_itrans_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
  686|  1.14M|                                                           ps_proc->pi2_itrans_intrmd_buf,
  687|  1.14M|                                                           (UWORD16 *)ps_pl_tu_ctxt->pu1_pred,
  688|  1.14M|                                                           (UWORD16 *)ps_pl_tu_ctxt->pu1_dst,
  689|  1.14M|                                                           ps_pl_tu_ctxt->tu_coeff_stride,
  690|  1.14M|                                                           ps_pl_tu_ctxt->pred_strd,
  691|  1.14M|                                                           ps_pl_tu_ctxt->dst_strd,
  692|  1.14M|                                                           ps_pl_tu_ctxt->zero_cols,
  693|  1.14M|                                                           ps_pl_tu_ctxt->zero_rows,
  694|  1.14M|                                                           (UWORD8)bit_depth);
  695|  1.14M|                }
  696|  4.21M|            }
  697|  2.01M|            else /* DC only */
  698|  2.01M|            {
  699|  2.01M|                if(PIXEL_SIZE_1BYTE == pixel_size)
  ------------------
  |  |  279|  2.01M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (699:20): [True: 1.34M, False: 672k]
  ------------------
  700|  1.34M|                {
  701|  1.34M|                    ps_codec->apf_itrans_recon_dc[is_chroma](
  702|  1.34M|                                ps_pl_tu_ctxt->pu1_pred, ps_pl_tu_ctxt->pu1_dst,
  703|  1.34M|                                ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, log2_trans_size,
  704|  1.34M|                                ps_pl_tu_ctxt->coeff_value);
  705|  1.34M|                }
  706|   672k|                else
  707|   672k|                {
  708|   672k|                    ps_codec->apf_hbd_itrans_recon_dc[is_chroma](
  709|   672k|                                (UWORD16 *)ps_pl_tu_ctxt->pu1_pred, (UWORD16 *)ps_pl_tu_ctxt->pu1_dst,
  710|   672k|                                ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, log2_trans_size,
  711|   672k|                                ps_pl_tu_ctxt->coeff_value, bit_depth);
  712|   672k|                }
  713|  2.01M|            }
  714|  6.23M|        }
  715|  7.92M|    }
  716|   274M|}

ihevcd_itrans_recon_dc_luma:
   92|   140k|{
   93|   140k|    WORD32 row, col;
   94|   140k|    WORD32 add, shift;
   95|   140k|    WORD32 dc_value, quant_out;
   96|   140k|    WORD32 trans_size;
   97|       |
   98|   140k|    trans_size = (1 << log2_trans_size);
   99|       |
  100|   140k|    quant_out = i2_coeff_value;
  101|       |
  102|   140k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   140k|#define IT_SHIFT_STAGE_1 7
  ------------------
  103|   140k|    add = 1 << (shift - 1);
  104|   140k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   140k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   140k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 140k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 140k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|   140k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   140k|#define IT_SHIFT_STAGE_2 12
  ------------------
  106|   140k|    add = 1 << (shift - 1);
  107|   140k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   140k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   140k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 140k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 140k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|       |
  109|  2.30M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (109:18): [True: 2.16M, False: 140k]
  ------------------
  110|  43.2M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (110:22): [True: 41.1M, False: 2.16M]
  ------------------
  111|  41.1M|            pu1_dst[row * dst_strd + col] = CLIP_U8((pu1_pred[row * pred_strd + col] + dc_value));
  ------------------
  |  |   40|  41.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  41.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.5M, False: 29.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.00M, False: 28.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|       |
  113|   140k|}
ihevcd_hbd_itrans_recon_dc_luma:
  122|   189k|{
  123|   189k|    WORD32 row, col;
  124|   189k|    WORD32 add, shift;
  125|   189k|    WORD32 dc_value, quant_out;
  126|   189k|    WORD32 trans_size;
  127|       |
  128|   189k|    trans_size = (1 << log2_trans_size);
  129|       |
  130|   189k|    quant_out = i2_coeff_value;
  131|       |
  132|   189k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   189k|#define IT_SHIFT_STAGE_1 7
  ------------------
  133|   189k|    add = 1 << (shift - 1);
  134|   189k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   189k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   189k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 189k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 189k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|   189k|    shift = 20 - bit_depth;
  136|   189k|    add = 1 << (shift - 1);
  137|   189k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   189k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   189k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 189k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 189k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|       |
  139|  3.02M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (139:18): [True: 2.83M, False: 189k]
  ------------------
  140|  60.7M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (140:22): [True: 57.9M, False: 2.83M]
  ------------------
  141|  57.9M|            pu2_dst[row * dst_strd + col] = CLIP3((pu2_pred[row * pred_strd + col] + dc_value),
  ------------------
  |  |   40|  57.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.48M, False: 54.4M]
  |  |  |  Branch (40:53): [True: 127k, False: 54.2M]
  |  |  ------------------
  ------------------
  142|   189k|                                                  0, ((1 << bit_depth) - 1));
  143|       |
  144|   189k|}
ihevcd_itrans_recon_dc_chroma:
  152|  90.4k|{
  153|  90.4k|    WORD32 row, col;
  154|  90.4k|    WORD32 add, shift;
  155|  90.4k|    WORD32 dc_value, quant_out;
  156|  90.4k|    WORD32 trans_size;
  157|       |
  158|       |
  159|  90.4k|    trans_size = (1 << log2_trans_size);
  160|       |
  161|  90.4k|    quant_out = i2_coeff_value;
  162|       |
  163|  90.4k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  90.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  164|  90.4k|    add = 1 << (shift - 1);
  165|  90.4k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|  90.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  90.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 90.4k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 90.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  90.4k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  90.4k|#define IT_SHIFT_STAGE_2 12
  ------------------
  167|  90.4k|    add = 1 << (shift - 1);
  168|  90.4k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|  90.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  90.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 90.4k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 90.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|       |
  170|   765k|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (170:18): [True: 675k, False: 90.4k]
  ------------------
  171|  7.55M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (171:22): [True: 6.88M, False: 675k]
  ------------------
  172|  6.88M|            pu1_dst[row * dst_strd + (col << 1)] = CLIP_U8((pu1_pred[row * pred_strd + (col << 1)] + dc_value));
  ------------------
  |  |   40|  6.88M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.88M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 389k, False: 6.49M]
  |  |  |  |  |  Branch (40:53): [True: 242k, False: 6.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|       |
  174|  90.4k|}
ihevcd_hbd_itrans_recon_dc_chroma:
  183|   527k|{
  184|   527k|    WORD32 row, col;
  185|   527k|    WORD32 add, shift;
  186|   527k|    WORD32 dc_value, quant_out;
  187|   527k|    WORD32 trans_size;
  188|       |
  189|   527k|    trans_size = (1 << log2_trans_size);
  190|       |
  191|   527k|    quant_out = i2_coeff_value;
  192|       |
  193|   527k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   527k|#define IT_SHIFT_STAGE_1 7
  ------------------
  194|   527k|    add = 1 << (shift - 1);
  195|   527k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   527k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   527k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 527k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 527k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|   527k|    shift = 20 - bit_depth;
  197|   527k|    add = 1 << (shift - 1);
  198|   527k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   527k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   527k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 527k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 527k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|       |
  200|  3.57M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (200:18): [True: 3.04M, False: 527k]
  ------------------
  201|  26.5M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (201:22): [True: 23.4M, False: 3.04M]
  ------------------
  202|  23.4M|            pu2_dst[row * dst_strd + (col << 1)] = CLIP3((pu2_pred[row * pred_strd + (col << 1)] + dc_value),
  ------------------
  |  |   40|  23.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 730k, False: 22.7M]
  |  |  |  Branch (40:53): [True: 496k, False: 22.2M]
  |  |  ------------------
  ------------------
  203|   527k|                                                         0, ((1 << bit_depth) - 1));
  204|       |
  205|   527k|}

ihevcd_jobq_ctxt_size:
   74|  24.8k|{
   75|  24.8k|    WORD32 size;
   76|  24.8k|    size = sizeof(jobq_t);
   77|  24.8k|    size += ithread_get_mutex_lock_size();
   78|  24.8k|    return size;
   79|  24.8k|}
ihevcd_jobq_lock:
  100|  5.40M|{
  101|  5.40M|    WORD32 retval;
  102|  5.40M|    retval = ithread_mutex_lock(ps_jobq->pv_mutex);
  103|  5.40M|    if(retval)
  ------------------
  |  Branch (103:8): [True: 0, False: 5.40M]
  ------------------
  104|      0|    {
  105|      0|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
  106|      0|    }
  107|  5.40M|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  108|  5.40M|}
ihevcd_jobq_unlock:
  130|  5.44M|{
  131|  5.44M|    WORD32 retval;
  132|  5.44M|    retval = ithread_mutex_unlock(ps_jobq->pv_mutex);
  133|  5.44M|    if(retval)
  ------------------
  |  Branch (133:8): [True: 0, False: 5.44M]
  ------------------
  134|      0|    {
  135|      0|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
  136|      0|    }
  137|  5.44M|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  138|       |
  139|  5.44M|}
ihevcd_jobq_yield:
  163|  2.00M|{
  164|       |
  165|  2.00M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  166|       |
  167|  2.00M|    IHEVCD_ERROR_T rettmp;
  168|  2.00M|    rettmp = ihevcd_jobq_unlock(ps_jobq);
  169|  2.00M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  2.00M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.00M]
  |  |  ------------------
  ------------------
  170|       |
  171|       |    //NOP(1024 * 8);
  172|  2.00M|    ithread_yield();
  173|       |
  174|  2.00M|    rettmp = ihevcd_jobq_lock(ps_jobq);
  175|  2.00M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  2.00M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 2.00M]
  |  |  ------------------
  ------------------
  176|  2.00M|    return ret;
  177|  2.00M|}
ihevcd_jobq_init:
  232|  24.8k|{
  233|  24.8k|    jobq_t *ps_jobq;
  234|  24.8k|    UWORD8 *pu1_buf;
  235|  24.8k|    pu1_buf = (UWORD8 *)pv_buf;
  236|       |
  237|  24.8k|    ps_jobq = (jobq_t *)pu1_buf;
  238|  24.8k|    pu1_buf += sizeof(jobq_t);
  239|  24.8k|    buf_size -= sizeof(jobq_t);
  240|       |
  241|  24.8k|    ps_jobq->pv_mutex = pu1_buf;
  242|  24.8k|    pu1_buf += ithread_get_mutex_lock_size();
  243|  24.8k|    buf_size -= ithread_get_mutex_lock_size();
  244|       |
  245|  24.8k|    if(buf_size <= 0)
  ------------------
  |  Branch (245:8): [True: 0, False: 24.8k]
  ------------------
  246|      0|        return NULL;
  247|       |
  248|  24.8k|    ithread_mutex_init(ps_jobq->pv_mutex);
  249|       |
  250|  24.8k|    ps_jobq->pv_buf_base = pu1_buf;
  251|  24.8k|    ps_jobq->pv_buf_wr = pu1_buf;
  252|  24.8k|    ps_jobq->pv_buf_rd = pu1_buf;
  253|  24.8k|    ps_jobq->pv_buf_end = pu1_buf + buf_size;
  254|  24.8k|    ps_jobq->i4_terminate = 0;
  255|       |
  256|       |
  257|  24.8k|    return ps_jobq;
  258|  24.8k|}
ihevcd_jobq_reset:
  278|  94.7k|{
  279|  94.7k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  280|  94.7k|    ret = ihevcd_jobq_lock(ps_jobq);
  281|  94.7k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  94.7k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 94.7k]
  |  |  ------------------
  ------------------
  282|       |
  283|  94.7k|    ps_jobq->pv_buf_wr      = ps_jobq->pv_buf_base;
  284|  94.7k|    ps_jobq->pv_buf_rd      = ps_jobq->pv_buf_base;
  285|  94.7k|    ps_jobq->i4_terminate   = 0;
  286|  94.7k|    ret = ihevcd_jobq_unlock(ps_jobq);
  287|  94.7k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  94.7k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 94.7k]
  |  |  ------------------
  ------------------
  288|       |
  289|  94.7k|    return ret;
  290|  94.7k|}
ihevcd_jobq_deinit:
  312|  24.8k|{
  313|  24.8k|    WORD32 retval;
  314|  24.8k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  315|       |
  316|  24.8k|    ret = ihevcd_jobq_reset(ps_jobq);
  317|  24.8k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  24.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
  318|       |
  319|  24.8k|    retval = ithread_mutex_destroy(ps_jobq->pv_mutex);
  320|  24.8k|    if(retval)
  ------------------
  |  Branch (320:8): [True: 0, False: 24.8k]
  ------------------
  321|      0|    {
  322|      0|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
  323|      0|    }
  324|       |
  325|  24.8k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  326|  24.8k|}
ihevcd_jobq_terminate:
  349|  48.1k|{
  350|  48.1k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  351|  48.1k|    ret = ihevcd_jobq_lock(ps_jobq);
  352|  48.1k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  48.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 48.1k]
  |  |  ------------------
  ------------------
  353|       |
  354|  48.1k|    ps_jobq->i4_terminate = 1;
  355|       |
  356|  48.1k|    ret = ihevcd_jobq_unlock(ps_jobq);
  357|  48.1k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  48.1k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 48.1k]
  |  |  ------------------
  ------------------
  358|  48.1k|    return ret;
  359|  48.1k|}
ihevcd_jobq_queue:
  393|  1.58M|{
  394|  1.58M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  395|  1.58M|    IHEVCD_ERROR_T rettmp;
  396|  1.58M|    UWORD8 *pu1_buf;
  397|  1.58M|    UNUSED(blocking);
  ------------------
  |  |   38|  1.58M|#define UNUSED(x) ((void)(x))
  ------------------
  398|       |
  399|  1.58M|    rettmp = ihevcd_jobq_lock(ps_jobq);
  400|  1.58M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  1.58M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.58M]
  |  |  ------------------
  ------------------
  401|       |
  402|  1.58M|    pu1_buf = (UWORD8 *)ps_jobq->pv_buf_wr;
  403|  1.58M|    if((UWORD8 *)ps_jobq->pv_buf_end >= (pu1_buf + job_size))
  ------------------
  |  Branch (403:8): [True: 1.58M, False: 0]
  ------------------
  404|  1.58M|    {
  405|  1.58M|        memcpy(ps_jobq->pv_buf_wr, pv_job, job_size);
  406|  1.58M|        ps_jobq->pv_buf_wr = (UWORD8 *)ps_jobq->pv_buf_wr + job_size;
  407|  1.58M|        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  408|  1.58M|    }
  409|      0|    else
  410|      0|    {
  411|       |        /* Handle wrap around case */
  412|       |        /* Wait for pv_buf_rd to consume first job_size number of bytes
  413|       |         * from the beginning of job queue
  414|       |         */
  415|      0|        ret = (IHEVCD_ERROR_T)IHEVCD_FAIL;
  416|      0|    }
  417|       |
  418|  1.58M|    ps_jobq->i4_terminate = 0;
  419|       |
  420|  1.58M|    rettmp = ihevcd_jobq_unlock(ps_jobq);
  421|  1.58M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  1.58M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.58M]
  |  |  ------------------
  ------------------
  422|       |
  423|  1.58M|    return ret;
  424|  1.58M|}
ihevcd_jobq_dequeue:
  458|  1.69M|{
  459|  1.69M|    IHEVCD_ERROR_T ret;
  460|  1.69M|    IHEVCD_ERROR_T rettmp;
  461|  1.69M|    volatile UWORD8 *pu1_buf;
  462|       |
  463|  1.69M|    rettmp = ihevcd_jobq_lock(ps_jobq);
  464|  1.69M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  1.69M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.69M]
  |  |  ------------------
  ------------------
  465|  1.69M|    pu1_buf = (UWORD8 *)ps_jobq->pv_buf_rd;
  466|       |
  467|       |
  468|  1.69M|    if((UWORD8 *)ps_jobq->pv_buf_end >= (pu1_buf + job_size))
  ------------------
  |  Branch (468:8): [True: 1.71M, False: 18.4E]
  ------------------
  469|  1.71M|    {
  470|  3.71M|        while(1)
  ------------------
  |  Branch (470:15): [True: 3.71M, Folded]
  ------------------
  471|  3.71M|        {
  472|  3.71M|            pu1_buf = (UWORD8 *)ps_jobq->pv_buf_rd;
  473|  3.71M|            if((UWORD8 *)ps_jobq->pv_buf_wr >= (pu1_buf + job_size))
  ------------------
  |  Branch (473:16): [True: 1.58M, False: 2.13M]
  ------------------
  474|  1.58M|            {
  475|  1.58M|                memcpy(pv_job, ps_jobq->pv_buf_rd, job_size);
  476|  1.58M|                ps_jobq->pv_buf_rd = (UWORD8 *)ps_jobq->pv_buf_rd + job_size;
  477|  1.58M|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  478|  1.58M|                break;
  479|  1.58M|            }
  480|  2.13M|            else
  481|  2.13M|            {
  482|       |                /* If all the entries have been dequeued, then break and return */
  483|  2.13M|                if(1 == ps_jobq->i4_terminate)
  ------------------
  |  Branch (483:20): [True: 136k, False: 2.00M]
  ------------------
  484|   136k|                {
  485|   136k|                    ret = (IHEVCD_ERROR_T)IHEVCD_FAIL;
  486|   136k|                    break;
  487|   136k|                }
  488|       |
  489|  2.00M|                if(1 == blocking)
  ------------------
  |  Branch (489:20): [True: 2.00M, False: 0]
  ------------------
  490|  2.00M|                {
  491|  2.00M|                    ihevcd_jobq_yield(ps_jobq);
  492|       |
  493|  2.00M|                }
  494|      0|                else
  495|      0|                {
  496|       |                    /* If there is no job available,
  497|       |                     * and this is non blocking call then return fail */
  498|      0|                    ret = (IHEVCD_ERROR_T)IHEVCD_FAIL;
  499|      0|                }
  500|  2.00M|            }
  501|  3.71M|        }
  502|  1.71M|    }
  503|  18.4E|    else
  504|  18.4E|    {
  505|       |        /* Handle wrap around case */
  506|       |        /* Wait for pv_buf_rd to consume first job_size number of bytes
  507|       |         * from the beginning of job queue
  508|       |         */
  509|  18.4E|        ret = (IHEVCD_ERROR_T)IHEVCD_FAIL;
  510|  18.4E|    }
  511|  1.69M|    rettmp = ihevcd_jobq_unlock(ps_jobq);
  512|  1.69M|    RETURN_IF((rettmp != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), rettmp);
  ------------------
  |  |   37|  1.69M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.69M]
  |  |  ------------------
  ------------------
  513|       |
  514|  1.69M|    return ret;
  515|  1.69M|}

ihevcd_compare_pu_t:
   95|   972k|{
   96|   972k|    WORD32 l0_match = 0, l1_match = 0;
   97|   972k|    pu_mv_t *ps_mv_1, *ps_mv_2;
   98|   972k|    WORD32 pred_mode_1, pred_mode_2;
   99|       |
  100|   972k|    ps_mv_1 = &ps_pu_1->mv;
  101|   972k|    ps_mv_2 = &ps_pu_2->mv;
  102|       |
  103|   972k|    pred_mode_1 = ps_pu_1->b2_pred_mode;
  104|   972k|    pred_mode_2 = ps_pu_2->b2_pred_mode;
  105|       |
  106|   972k|    if(pred_mode_1 == pred_mode_2)
  ------------------
  |  Branch (106:8): [True: 686k, False: 286k]
  ------------------
  107|   686k|    {
  108|   686k|        if(pred_mode_1 != PRED_L1)
  ------------------
  |  Branch (108:12): [True: 642k, False: 43.9k]
  ------------------
  109|   642k|        {
  110|   642k|            if(ps_mv_1->i1_l0_ref_idx == ps_mv_2->i1_l0_ref_idx)
  ------------------
  |  Branch (110:16): [True: 553k, False: 88.4k]
  ------------------
  111|   553k|            {
  112|   553k|                if(0 == memcmp(&ps_mv_1->s_l0_mv, &ps_mv_2->s_l0_mv, sizeof(mv_t)))
  ------------------
  |  Branch (112:20): [True: 405k, False: 147k]
  ------------------
  113|   405k|                {
  114|   405k|                    l0_match = 1;
  115|   405k|                }
  116|   553k|            }
  117|   642k|        }
  118|   686k|        if(pred_mode_1 != PRED_L0)
  ------------------
  |  Branch (118:12): [True: 430k, False: 255k]
  ------------------
  119|   430k|        {
  120|   430k|            if(ps_mv_1->i1_l1_ref_idx == ps_mv_2->i1_l1_ref_idx)
  ------------------
  |  Branch (120:16): [True: 374k, False: 55.9k]
  ------------------
  121|   374k|            {
  122|   374k|                if(0 == memcmp(&ps_mv_1->s_l1_mv, &ps_mv_2->s_l1_mv, sizeof(mv_t)))
  ------------------
  |  Branch (122:20): [True: 314k, False: 60.2k]
  ------------------
  123|   314k|                {
  124|   314k|                    l1_match = 1;
  125|   314k|                }
  126|   374k|            }
  127|   430k|        }
  128|   686k|        if(pred_mode_1 == PRED_BI)
  ------------------
  |  Branch (128:12): [True: 386k, False: 299k]
  ------------------
  129|   386k|            return (l1_match && l0_match);
  ------------------
  |  Branch (129:21): [True: 283k, False: 102k]
  |  Branch (129:33): [True: 245k, False: 38.7k]
  ------------------
  130|   299k|        else if(pred_mode_1 == PRED_L0)
  ------------------
  |  Branch (130:17): [True: 260k, False: 38.8k]
  ------------------
  131|   260k|            return l0_match;
  132|  38.8k|        else
  133|  38.8k|            return l1_match;
  134|   686k|    }
  135|       |
  136|   286k|    return 0;
  137|   972k|}
ihevcd_collocated_mvp:
  146|  5.41M|{
  147|  5.41M|    sps_t *ps_sps = ps_mv_ctxt->ps_sps;
  148|  5.41M|    slice_header_t *ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  149|  5.41M|    ref_list_t *ps_ref_list[2];
  150|  5.41M|    mv_buf_t *ps_mv_buf_col;
  151|  5.41M|    WORD32 xp_col, yp_col;
  152|  5.41M|    WORD32 col_ctb_x, col_ctb_y;
  153|  5.41M|    mv_t as_mv_col[2];
  154|  5.41M|    WORD32 log2_ctb_size;
  155|  5.41M|    WORD32 ctb_size;
  156|  5.41M|    WORD32 avail_col;
  157|  5.41M|    WORD32 col_ctb_idx, pu_cnt;
  158|  5.41M|    WORD32 au4_list_col[2];
  159|  5.41M|    WORD32 num_minpu_in_ctb;
  160|  5.41M|    UWORD8 *pu1_pic_pu_map_ctb;
  161|  5.41M|    pu_t *ps_col_pu;
  162|  5.41M|    WORD32 part_pos_y;
  163|       |
  164|       |
  165|  5.41M|    part_pos_y = ps_pu->b4_pos_y << 2;
  166|       |
  167|  5.41M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  168|  5.41M|    ctb_size = (1 << log2_ctb_size);
  169|       |
  170|  5.41M|    avail_col = 1;
  171|       |
  172|       |    /* Initializing reference list */
  173|  5.41M|    ps_ref_list[0] = ps_slice_hdr->as_ref_pic_list0;
  174|  5.41M|    ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list1;
  175|  5.41M|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (175:8): [True: 110k, False: 5.30M]
  ------------------
  176|   110k|        ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list0;
  177|       |
  178|  5.41M|    if((ps_slice_hdr->i1_slice_type == BSLICE) && (ps_slice_hdr->i1_collocated_from_l0_flag == 0))
  ------------------
  |  Branch (178:8): [True: 5.30M, False: 110k]
  |  Branch (178:51): [True: 843k, False: 4.45M]
  ------------------
  179|   843k|    {
  180|       |        /* L1 */
  181|   843k|        ps_mv_buf_col = (mv_buf_t *)ps_ref_list[1][ps_slice_hdr->i1_collocated_ref_idx].pv_mv_buf;
  182|       |
  183|   843k|    }
  184|  4.57M|    else
  185|  4.57M|    {
  186|       |        /* L0 */
  187|  4.57M|        ps_mv_buf_col = (mv_buf_t *)ps_ref_list[0][ps_slice_hdr->i1_collocated_ref_idx].pv_mv_buf;
  188|       |
  189|  4.57M|    }
  190|  5.41M|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.41M|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.41M|#define MIN_PU_SIZE         4
  ------------------
  191|       |
  192|  5.41M|    if(((part_pos_y >> log2_ctb_size) == (y_col >> log2_ctb_size))
  ------------------
  |  Branch (192:8): [True: 4.20M, False: 1.21M]
  ------------------
  193|  4.20M|                    && ((x_col + (ps_mv_ctxt->i4_ctb_x << log2_ctb_size)) < ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (193:24): [True: 4.16M, False: 42.2k]
  ------------------
  194|  4.15M|                    && (((y_col + (ps_mv_ctxt->i4_ctb_y << log2_ctb_size))
  ------------------
  |  Branch (194:24): [True: 4.11M, False: 37.7k]
  ------------------
  195|  4.15M|                                    < ps_sps->i2_pic_height_in_luma_samples)))
  196|  4.11M|    {
  197|  4.11M|        xp_col = ((x_col >> 4) << 4);
  198|  4.11M|        yp_col = ((y_col >> 4) << 4);
  199|  4.11M|        col_ctb_x = ps_mv_ctxt->i4_ctb_x + (xp_col >> log2_ctb_size);
  200|  4.11M|        col_ctb_y = ps_mv_ctxt->i4_ctb_y + (yp_col >> log2_ctb_size);
  201|  4.11M|        col_ctb_idx = col_ctb_x + (col_ctb_y)*(ps_sps->i2_pic_wd_in_ctb);
  202|  4.11M|        pu_cnt = ps_mv_buf_col->pu4_pic_pu_idx[col_ctb_idx];
  203|  4.11M|        pu1_pic_pu_map_ctb = ps_mv_buf_col->pu1_pic_pu_map
  204|  4.11M|                        + col_ctb_idx * num_minpu_in_ctb;
  205|  4.11M|        if(xp_col == ctb_size)
  ------------------
  |  Branch (205:12): [True: 899k, False: 3.21M]
  ------------------
  206|   899k|            xp_col = 0;
  207|  4.11M|        pu_cnt += pu1_pic_pu_map_ctb[(yp_col >> 2)
  208|  4.11M|                        * (ctb_size / MIN_PU_SIZE) + (xp_col >> 2)];
  ------------------
  |  |  367|  4.11M|#define MIN_PU_SIZE         4
  ------------------
  209|  4.11M|        ps_col_pu = &ps_mv_buf_col->ps_pic_pu[pu_cnt];
  210|  4.11M|    }
  211|  1.29M|    else
  212|  1.29M|        avail_col = 0;
  213|       |
  214|  5.41M|    if((avail_col == 0) || (ps_col_pu->b1_intra_flag == 1)
  ------------------
  |  Branch (214:8): [True: 1.29M, False: 4.11M]
  |  Branch (214:28): [True: 142k, False: 3.97M]
  ------------------
  215|  3.97M|                    || (ps_slice_hdr->i1_slice_temporal_mvp_enable_flag == 0))
  ------------------
  |  Branch (215:24): [True: 2.51M, False: 1.45M]
  ------------------
  216|  3.94M|    {
  217|  3.94M|        pu4_avail_col_flag[0] = 0;
  218|  3.94M|        pu4_avail_col_flag[1] = 0;
  219|  3.94M|        ps_mv_col[0].i2_mvx = 0;
  220|  3.94M|        ps_mv_col[0].i2_mvy = 0;
  221|  3.94M|        ps_mv_col[1].i2_mvx = 0;
  222|  3.94M|        ps_mv_col[1].i2_mvy = 0;
  223|  3.94M|    }
  224|  1.46M|    else
  225|  1.46M|    {
  226|  1.46M|        WORD32 au4_ref_idx_col[2];
  227|  1.46M|        WORD32 pred_flag_l0, pred_flag_l1;
  228|  1.46M|        pred_flag_l0 = (ps_col_pu->b2_pred_mode != PRED_L1);
  229|  1.46M|        pred_flag_l1 = (ps_col_pu->b2_pred_mode != PRED_L0);
  230|       |
  231|  1.46M|        if(pred_flag_l0 == 0)
  ------------------
  |  Branch (231:12): [True: 19.5k, False: 1.44M]
  ------------------
  232|  19.5k|        {
  233|  19.5k|            as_mv_col[0] = ps_col_pu->mv.s_l1_mv;
  234|  19.5k|            au4_ref_idx_col[0] = ps_col_pu->mv.i1_l1_ref_idx;
  235|  19.5k|            au4_list_col[0] = 1; /* L1 */
  236|       |
  237|  19.5k|            as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  238|  19.5k|            au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  239|  19.5k|            au4_list_col[1] = 1; /* L1 */
  240|  19.5k|        }
  241|  1.44M|        else
  242|  1.44M|        {
  243|  1.44M|            if(pred_flag_l1 == 0)
  ------------------
  |  Branch (243:16): [True: 292k, False: 1.15M]
  ------------------
  244|   292k|            {
  245|   292k|                as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  246|   292k|                au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  247|   292k|                au4_list_col[0] = 0; /* L1 */
  248|       |
  249|   292k|                as_mv_col[1] = ps_col_pu->mv.s_l0_mv;
  250|   292k|                au4_ref_idx_col[1] = ps_col_pu->mv.i1_l0_ref_idx;
  251|   292k|                au4_list_col[1] = 0; /* L1 */
  252|   292k|            }
  253|  1.15M|            else
  254|  1.15M|            {
  255|  1.15M|                if(1 == ps_slice_hdr->i1_low_delay_flag)
  ------------------
  |  Branch (255:20): [True: 690k, False: 464k]
  ------------------
  256|   690k|                {
  257|   690k|                    as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  258|   690k|                    au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  259|   690k|                    au4_list_col[0] = 0; /* L0 */
  260|       |
  261|   690k|                    as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  262|   690k|                    au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  263|   690k|                    au4_list_col[1] = 1; /* L1 */
  264|   690k|                }
  265|   464k|                else
  266|   464k|                {
  267|   464k|                    if(0 == ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (267:24): [True: 50.6k, False: 413k]
  ------------------
  268|  50.6k|                    {
  269|  50.6k|                        as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  270|  50.6k|                        au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  271|       |
  272|  50.6k|                        as_mv_col[1] = ps_col_pu->mv.s_l0_mv;
  273|  50.6k|                        au4_ref_idx_col[1] = ps_col_pu->mv.i1_l0_ref_idx;
  274|  50.6k|                    }
  275|   413k|                    else
  276|   413k|                    {
  277|   413k|                        as_mv_col[0] = ps_col_pu->mv.s_l1_mv;
  278|   413k|                        au4_ref_idx_col[0] = ps_col_pu->mv.i1_l1_ref_idx;
  279|       |
  280|   413k|                        as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  281|   413k|                        au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  282|   413k|                    }
  283|       |
  284|   464k|                    au4_list_col[0] = ps_slice_hdr->i1_collocated_from_l0_flag; /* L"collocated_from_l0_flag" */
  285|   464k|                    au4_list_col[1] = ps_slice_hdr->i1_collocated_from_l0_flag; /* L"collocated_from_l0_flag" */
  286|   464k|                }
  287|  1.15M|            }
  288|  1.44M|        }
  289|  1.46M|        avail_col = 1;
  290|  1.46M|        {
  291|  1.46M|            WORD32 cur_poc, col_poc, col_ref_poc_l0, cur_ref_poc;
  292|  1.46M|            WORD32 col_ref_poc_l0_lt, cur_ref_poc_lt;
  293|  1.46M|            WORD32 ref_idx_l0, ref_idx_l1;
  294|  1.46M|            WORD32 slice_idx;
  295|  1.46M|            pic_buf_t *ps_pic_buf;
  296|       |
  297|  1.46M|            if(use_pu_ref_idx)
  ------------------
  |  Branch (297:16): [True: 169k, False: 1.29M]
  ------------------
  298|   169k|            {
  299|   169k|                ref_idx_l0 = ps_pu->mv.i1_l0_ref_idx;
  300|   169k|                ref_idx_l1 = ps_pu->mv.i1_l1_ref_idx;
  301|   169k|            }
  302|  1.29M|            else
  303|  1.29M|            {
  304|  1.29M|                ref_idx_l0 = 0;
  305|  1.29M|                ref_idx_l1 = 0;
  306|  1.29M|            }
  307|       |
  308|  1.46M|            col_poc = ps_mv_buf_col->i4_abs_poc;
  309|  1.46M|            cur_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
  310|       |
  311|  1.46M|            slice_idx = *(ps_mv_buf_col->pu1_pic_slice_map + col_ctb_x + col_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  312|  1.46M|            slice_idx &= (MAX_SLICE_HDR_CNT - 1);
  ------------------
  |  |  153|  1.46M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.46M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  313|  1.46M|            if(au4_list_col[0] == 0)
  ------------------
  |  Branch (313:16): [True: 1.03M, False: 436k]
  ------------------
  314|  1.03M|            {
  315|  1.03M|                col_ref_poc_l0 =
  316|  1.03M|                                ps_mv_buf_col->ai4_l0_collocated_poc[slice_idx][au4_ref_idx_col[0]];
  317|  1.03M|                col_ref_poc_l0_lt =
  318|  1.03M|                                (ps_mv_buf_col->ai1_l0_collocated_poc_lt[slice_idx][au4_ref_idx_col[0]] == LONG_TERM_REF);
  319|  1.03M|            }
  320|   436k|            else
  321|   436k|            {
  322|   436k|                col_ref_poc_l0 =
  323|   436k|                                ps_mv_buf_col->ai4_l1_collocated_poc[slice_idx][au4_ref_idx_col[0]];
  324|   436k|                col_ref_poc_l0_lt =
  325|   436k|                                (ps_mv_buf_col->ai1_l1_collocated_poc_lt[slice_idx][au4_ref_idx_col[0]] == LONG_TERM_REF);
  326|   436k|            }
  327|       |            /* L0 collocated mv */
  328|  1.46M|            ps_pic_buf = (pic_buf_t *)((ps_ref_list[0][ref_idx_l0].pv_pic_buf));
  329|  1.46M|            cur_ref_poc = ps_pic_buf->i4_abs_poc;
  330|  1.46M|            cur_ref_poc_lt = (ps_pic_buf->u1_used_as_ref == LONG_TERM_REF);
  331|       |
  332|  1.46M|            if(cur_ref_poc_lt == col_ref_poc_l0_lt)
  ------------------
  |  Branch (332:16): [True: 1.43M, False: 33.4k]
  ------------------
  333|  1.43M|            {
  334|  1.43M|                pu4_avail_col_flag[0] = 1;
  335|       |
  336|  1.43M|                if(cur_ref_poc_lt || ((col_poc - col_ref_poc_l0) == (cur_poc - cur_ref_poc)))
  ------------------
  |  Branch (336:20): [True: 1.80k, False: 1.43M]
  |  Branch (336:38): [True: 443k, False: 988k]
  ------------------
  337|   444k|                {
  338|   444k|                    ps_mv_col[0] = as_mv_col[0];
  339|   444k|                }
  340|   989k|                else
  341|   989k|                {
  342|   989k|                    ps_mv_col[0] = as_mv_col[0];
  343|   989k|                    if(col_ref_poc_l0 != col_poc)
  ------------------
  |  Branch (343:24): [True: 506k, False: 482k]
  ------------------
  344|   506k|                        ihevcd_scale_collocated_mv((mv_t *)(&ps_mv_col[0]), cur_ref_poc,
  345|   506k|                                                   col_ref_poc_l0, col_poc, cur_poc);
  346|   989k|                }
  347|  1.43M|            }
  348|  33.4k|            else
  349|  33.4k|            {
  350|  33.4k|                pu4_avail_col_flag[0] = 0;
  351|  33.4k|                ps_mv_col[0].i2_mvx = 0;
  352|  33.4k|                ps_mv_col[0].i2_mvy = 0;
  353|  33.4k|            }
  354|  1.46M|            if((BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (354:16): [True: 1.44M, False: 18.7k]
  ------------------
  355|  1.44M|            {
  356|  1.44M|                WORD32 col_ref_poc_l1_lt, col_ref_poc_l1;
  357|       |
  358|  1.44M|                if(au4_list_col[1] == 0)
  ------------------
  |  Branch (358:20): [True: 333k, False: 1.11M]
  ------------------
  359|   333k|                {
  360|   333k|                    col_ref_poc_l1 =
  361|   333k|                                    ps_mv_buf_col->ai4_l0_collocated_poc[slice_idx][au4_ref_idx_col[1]];
  362|   333k|                    col_ref_poc_l1_lt =
  363|   333k|                                    (ps_mv_buf_col->ai1_l0_collocated_poc_lt[slice_idx][au4_ref_idx_col[1]] == LONG_TERM_REF);
  364|   333k|                }
  365|  1.11M|                else
  366|  1.11M|                {
  367|  1.11M|                    col_ref_poc_l1 =
  368|  1.11M|                                    ps_mv_buf_col->ai4_l1_collocated_poc[slice_idx][au4_ref_idx_col[1]];
  369|  1.11M|                    col_ref_poc_l1_lt =
  370|  1.11M|                                    (ps_mv_buf_col->ai1_l1_collocated_poc_lt[slice_idx][au4_ref_idx_col[1]] == LONG_TERM_REF);
  371|  1.11M|                }
  372|       |
  373|       |                /* L1 collocated mv */
  374|  1.44M|                ps_pic_buf = (pic_buf_t *)((ps_ref_list[1][ref_idx_l1].pv_pic_buf));
  375|  1.44M|                cur_ref_poc = ps_pic_buf->i4_abs_poc;
  376|  1.44M|                cur_ref_poc_lt = (ps_pic_buf->u1_used_as_ref == LONG_TERM_REF);
  377|       |
  378|  1.44M|                if(cur_ref_poc_lt == col_ref_poc_l1_lt)
  ------------------
  |  Branch (378:20): [True: 1.42M, False: 20.1k]
  ------------------
  379|  1.42M|                {
  380|  1.42M|                    pu4_avail_col_flag[1] = 1;
  381|       |
  382|  1.42M|                    if(cur_ref_poc_lt || ((col_poc - col_ref_poc_l1) == (cur_poc - cur_ref_poc)))
  ------------------
  |  Branch (382:24): [True: 2.67k, False: 1.42M]
  |  Branch (382:42): [True: 538k, False: 887k]
  ------------------
  383|   540k|                    {
  384|   540k|                        ps_mv_col[1] = as_mv_col[1];
  385|   540k|                    }
  386|   887k|                    else
  387|   887k|                    {
  388|   887k|                        ps_mv_col[1] = as_mv_col[1];
  389|   887k|                        if(col_ref_poc_l1 != col_poc)
  ------------------
  |  Branch (389:28): [True: 504k, False: 383k]
  ------------------
  390|   504k|                            ihevcd_scale_collocated_mv((mv_t *)&ps_mv_col[1], cur_ref_poc,
  391|   504k|                                                       col_ref_poc_l1, col_poc, cur_poc);
  392|   887k|                    }
  393|  1.42M|                }
  394|  20.1k|                else
  395|  20.1k|                {
  396|  20.1k|                    pu4_avail_col_flag[1] = 0;
  397|  20.1k|                    ps_mv_col[1].i2_mvx = 0;
  398|  20.1k|                    ps_mv_col[1].i2_mvy = 0;
  399|  20.1k|                }
  400|  1.44M|            }
  401|  18.7k|            else
  402|  18.7k|            {
  403|  18.7k|                pu4_avail_col_flag[1] = 0;
  404|  18.7k|            }
  405|  1.46M|        }
  406|  1.46M|    }
  407|  5.41M|}
ihevcd_mv_merge:
  479|  71.7M|{
  480|       |    /******************************************************/
  481|       |    /*      Spatial Merge Candidates                      */
  482|       |    /******************************************************/
  483|  71.7M|    slice_header_t *ps_slice_hdr;
  484|  71.7M|    pu_t as_pu_merge_list[MAX_NUM_MERGE_CAND];
  485|  71.7M|    pps_t *ps_pps;
  486|  71.7M|    ref_list_t *ps_ref_list[2];
  487|  71.7M|    WORD32 sum_avail_a0_a1_b0_b1 = 0; /*Sum of availability of A0, A1, B0, B1*/
  488|  71.7M|    WORD32 nbr_x, nbr_y;
  489|  71.7M|    WORD32 nbr_avail[MAX_NUM_MV_NBR];
  490|  71.7M|    WORD32 merge_shift;
  491|  71.7M|    WORD32 nbr_pu_idx;
  492|  71.7M|    pu_t *ps_nbr_pu[MAX_NUM_MV_NBR];
  493|  71.7M|    WORD32 max_num_merge_cand;
  494|  71.7M|    WORD32 candidate_cnt;
  495|  71.7M|    WORD32 pos_x_merge_shift, pos_y_merge_shift;
  496|       |
  497|  71.7M|    ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  498|  71.7M|    ps_pps = ps_mv_ctxt->ps_pps;
  499|       |    /* Initializing reference list */
  500|  71.7M|    ps_ref_list[0] = ps_slice_hdr->as_ref_pic_list0;
  501|  71.7M|    ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list1;
  502|  71.7M|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (502:8): [True: 355k, False: 71.4M]
  ------------------
  503|   355k|        ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list0;
  504|       |
  505|  71.7M|    candidate_cnt = 0;
  506|       |    /*******************************************/
  507|       |    /* Neighbor location: Graphical indication */
  508|       |    /*                                         */
  509|       |    /*          B2 _____________B1 B0          */
  510|       |    /*            |               |            */
  511|       |    /*            |               |            */
  512|       |    /*            |               |            */
  513|       |    /*            |      PU     ht|            */
  514|       |    /*            |               |            */
  515|       |    /*            |               |            */
  516|       |    /*          A1|______wd_______|            */
  517|       |    /*          A0                             */
  518|       |    /*                                         */
  519|       |    /*******************************************/
  520|       |
  521|  71.7M|    merge_shift = ps_pps->i1_log2_parallel_merge_level;
  522|       |
  523|       |    /* Availability check */
  524|       |    /* A1 */
  525|  71.7M|    nbr_x = part_pos_x - 1;
  526|  71.7M|    nbr_y = part_pos_y + part_ht - 1; /* A1 */
  527|       |
  528|  71.7M|    nbr_pu_idx = *(pu4_left_pu_idx + ((nbr_y - part_pos_y) >> 2) * left_nbr_4x4_strd);
  529|  71.7M|    ps_nbr_pu[NBR_A1] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  530|       |
  531|  71.7M|    nbr_avail[NBR_A1] = l_avail
  ------------------
  |  Branch (531:25): [True: 70.5M, False: 1.27M]
  ------------------
  532|  70.5M|                    && (!ps_nbr_pu[NBR_A1]->b1_intra_flag); /* A1 */
  ------------------
  |  Branch (532:24): [True: 70.7M, False: 18.4E]
  ------------------
  533|       |
  534|  71.7M|    pos_x_merge_shift = (part_pos_x >> merge_shift);
  535|  71.7M|    pos_y_merge_shift = (part_pos_y >> merge_shift);
  536|  71.7M|    max_num_merge_cand = ps_pu->b3_merge_idx + 1;
  537|       |
  538|  71.7M|    {
  539|  71.7M|        if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (539:12): [True: 70.7M, False: 986k]
  ------------------
  540|  70.7M|        {
  541|       |            /* if at same merge level */
  542|  70.7M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (542:16): [True: 7.18M, False: 63.6M]
  ------------------
  543|  7.18M|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (543:16): [True: 7.17M, False: 8.55k]
  ------------------
  544|  7.17M|            {
  545|  7.17M|                nbr_avail[NBR_A1] = 0;
  546|  7.17M|            }
  547|       |
  548|       |            /* SPEC JCTVC-K1003_v9 version has a different way using not available       */
  549|       |            /* candidates compared to software. for non square part and seconf part case */
  550|       |            /* ideally nothing from the 1st partition should be used as per spec but     */
  551|       |            /* HM 8.2 dev verison does not adhere to this. currenlty code fllows HM      */
  552|       |
  553|       |            /* if single MCL is 0 , second part of 2 part in CU */
  554|  63.7M|            else if((single_mcl_flag == 0) && (part_idx == 1) &&
  ------------------
  |  Branch (554:21): [True: 63.7M, False: 18.4E]
  |  Branch (554:47): [True: 184k, False: 63.6M]
  ------------------
  555|   184k|                            ((part_mode == PART_Nx2N) || (part_mode == PART_nLx2N) ||
  ------------------
  |  Branch (555:30): [True: 82.8k, False: 101k]
  |  Branch (555:58): [True: 16.1k, False: 85.0k]
  ------------------
  556|  84.9k|                                            (part_mode == PART_nRx2N)))
  ------------------
  |  Branch (556:45): [True: 6.14k, False: 78.8k]
  ------------------
  557|   105k|            {
  558|   105k|                nbr_avail[NBR_A1] = 0;
  559|   105k|            }
  560|  70.7M|            sum_avail_a0_a1_b0_b1 += nbr_avail[NBR_A1];
  561|  70.7M|            if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (561:16): [True: 63.7M, False: 7.08M]
  ------------------
  562|  63.7M|            {
  563|  63.7M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_A1];
  564|  63.7M|                candidate_cnt++;
  565|  63.7M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (565:20): [True: 63.2M, False: 439k]
  ------------------
  566|  63.2M|                {
  567|  63.2M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  568|  63.2M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  569|  63.2M|                    return;
  570|  63.2M|                }
  571|  63.7M|            }
  572|  70.7M|        }
  573|  71.7M|    }
  574|       |
  575|       |    /* B1 */
  576|  8.51M|    nbr_x = part_pos_x + part_wd - 1;
  577|  8.51M|    nbr_y = part_pos_y - 1;
  578|       |
  579|  8.51M|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  580|  8.51M|    ps_nbr_pu[NBR_B1] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  581|       |
  582|  8.51M|    nbr_avail[NBR_B1] = t_avail
  ------------------
  |  Branch (582:25): [True: 9.19M, False: 18.4E]
  ------------------
  583|  9.19M|                    && (!ps_nbr_pu[NBR_B1]->b1_intra_flag); /* B1 */
  ------------------
  |  Branch (583:24): [True: 9.18M, False: 2.64k]
  ------------------
  584|       |
  585|  8.51M|    {
  586|  8.51M|        WORD32 avail_flag;
  587|  8.51M|        avail_flag = nbr_avail[NBR_B1];
  588|       |
  589|  8.51M|        if(nbr_avail[NBR_B1])
  ------------------
  |  Branch (589:12): [True: 9.19M, False: 18.4E]
  ------------------
  590|  9.19M|        {
  591|       |            /* if at same merge level */
  592|  9.19M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (592:16): [True: 7.68M, False: 1.50M]
  ------------------
  593|  7.68M|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (593:16): [True: 4.15M, False: 3.53M]
  ------------------
  594|  4.15M|            {
  595|  4.15M|                nbr_avail[NBR_B1] = 0;
  596|  4.15M|                avail_flag = 0;
  597|  4.15M|            }
  598|       |
  599|       |            /* if single MCL is 0 , second part of 2 part in CU */
  600|  5.10M|            else if((single_mcl_flag == 0) && (part_idx == 1) &&
  ------------------
  |  Branch (600:21): [True: 5.10M, False: 18.4E]
  |  Branch (600:47): [True: 131k, False: 4.97M]
  ------------------
  601|   131k|                            ((part_mode == PART_2NxN) || (part_mode == PART_2NxnU) ||
  ------------------
  |  Branch (601:30): [True: 33.0k, False: 98.0k]
  |  Branch (601:58): [True: 2.80k, False: 95.2k]
  ------------------
  602|  95.2k|                                            (part_mode == PART_2NxnD)))
  ------------------
  |  Branch (602:45): [True: 2.77k, False: 92.4k]
  ------------------
  603|  38.8k|            {
  604|  38.8k|                nbr_avail[NBR_B1] = 0;
  605|  38.8k|                avail_flag = 0;
  606|  38.8k|            }
  607|       |
  608|  5.00M|            else if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (608:21): [True: 374k, False: 4.62M]
  ------------------
  609|   374k|            {
  610|   374k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_B1]);
  611|   374k|            }
  612|       |
  613|  9.19M|            sum_avail_a0_a1_b0_b1 += avail_flag;
  614|  9.19M|            if(avail_flag)
  ------------------
  |  Branch (614:16): [True: 4.96M, False: 4.23M]
  ------------------
  615|  4.96M|            {
  616|  4.96M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B1];
  617|  4.96M|                candidate_cnt++;
  618|  4.96M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (618:20): [True: 4.79M, False: 171k]
  ------------------
  619|  4.79M|                {
  620|  4.79M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  621|  4.79M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  622|  4.79M|                    return;
  623|  4.79M|                }
  624|  4.96M|            }
  625|  9.19M|        }
  626|  8.51M|    }
  627|       |    /* B0 */
  628|  3.72M|    nbr_x = part_pos_x + part_wd;
  629|  3.72M|    nbr_y = part_pos_y - 1;
  630|       |
  631|  3.72M|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  632|  3.72M|    ps_nbr_pu[NBR_B0] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  633|       |
  634|  3.72M|    nbr_avail[NBR_B0] = tr_avail
  ------------------
  |  Branch (634:25): [True: 2.72M, False: 1.00M]
  ------------------
  635|  2.72M|                    && (!ps_nbr_pu[NBR_B0]->b1_intra_flag); /* B0 */
  ------------------
  |  Branch (635:24): [True: 2.71M, False: 7.53k]
  ------------------
  636|       |
  637|  3.72M|    {
  638|  3.72M|        WORD32 avail_flag;
  639|  3.72M|        avail_flag = nbr_avail[NBR_B0];
  640|       |
  641|       |        /* if at same merge level */
  642|  3.72M|        if(nbr_avail[NBR_B0])
  ------------------
  |  Branch (642:12): [True: 2.71M, False: 1.01M]
  ------------------
  643|  2.71M|        {
  644|  2.71M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (644:16): [True: 842k, False: 1.87M]
  ------------------
  645|   842k|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (645:16): [True: 839k, False: 3.22k]
  ------------------
  646|   839k|            {
  647|   839k|                nbr_avail[NBR_B0] = 0;
  648|   839k|                avail_flag = 0;
  649|   839k|            }
  650|  1.87M|            else if(nbr_avail[NBR_B1])
  ------------------
  |  Branch (650:21): [True: 197k, False: 1.67M]
  ------------------
  651|   197k|            {
  652|   197k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_B1], ps_nbr_pu[NBR_B0]);
  653|   197k|            }
  654|       |
  655|  2.71M|            sum_avail_a0_a1_b0_b1 += avail_flag;
  656|  2.71M|            if(avail_flag)
  ------------------
  |  Branch (656:16): [True: 1.79M, False: 922k]
  ------------------
  657|  1.79M|            {
  658|  1.79M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B0];
  659|  1.79M|                candidate_cnt++;
  660|  1.79M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (660:20): [True: 1.74M, False: 47.0k]
  ------------------
  661|  1.74M|                {
  662|  1.74M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  663|  1.74M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  664|  1.74M|                    return;
  665|  1.74M|                }
  666|  1.79M|            }
  667|  2.71M|        }
  668|  3.72M|    }
  669|       |    /* A0 */
  670|  1.98M|    nbr_x = part_pos_x - 1;
  671|  1.98M|    nbr_y = part_pos_y + part_ht; /* A0 */
  672|       |
  673|  1.98M|    nbr_pu_idx = *(pu4_left_pu_idx + ((nbr_y - part_pos_y) >> 2) * left_nbr_4x4_strd);
  674|  1.98M|    ps_nbr_pu[NBR_A0] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  675|       |
  676|  1.98M|    nbr_avail[NBR_A0] = lb_avail
  ------------------
  |  Branch (676:25): [True: 91.4k, False: 1.88M]
  ------------------
  677|  91.4k|                    && (!ps_nbr_pu[NBR_A0]->b1_intra_flag); /* A0 */
  ------------------
  |  Branch (677:24): [True: 87.4k, False: 3.91k]
  ------------------
  678|  1.98M|    {
  679|  1.98M|        WORD32 avail_flag;
  680|  1.98M|        avail_flag = nbr_avail[NBR_A0];
  681|       |
  682|  1.98M|        if(nbr_avail[NBR_A0])
  ------------------
  |  Branch (682:12): [True: 87.4k, False: 1.89M]
  ------------------
  683|  87.4k|        {
  684|       |            /* if at same merge level */
  685|  87.4k|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (685:16): [True: 697, False: 86.8k]
  ------------------
  686|    697|                            (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (686:29): [True: 697, False: 0]
  ------------------
  687|    697|            {
  688|    697|                nbr_avail[NBR_A0] = 0;
  689|    697|                avail_flag = 0;
  690|    697|            }
  691|  86.8k|            else if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (691:21): [True: 84.9k, False: 1.88k]
  ------------------
  692|  84.9k|            {
  693|  84.9k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_A0]);
  694|  84.9k|            }
  695|       |
  696|  87.4k|            sum_avail_a0_a1_b0_b1 += avail_flag;
  697|  87.4k|            if(avail_flag)
  ------------------
  |  Branch (697:16): [True: 35.8k, False: 51.6k]
  ------------------
  698|  35.8k|            {
  699|  35.8k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_A0];
  700|  35.8k|                candidate_cnt++;
  701|  35.8k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (701:20): [True: 20.0k, False: 15.8k]
  ------------------
  702|  20.0k|                {
  703|  20.0k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  704|  20.0k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  705|  20.0k|                    return;
  706|  20.0k|                }
  707|  35.8k|            }
  708|  87.4k|        }
  709|  1.98M|    }
  710|       |    /* B2 */
  711|       |
  712|  1.96M|    nbr_x = part_pos_x - 1;
  713|  1.96M|    nbr_y = part_pos_y - 1; /* B2 */
  714|       |
  715|  1.96M|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  716|  1.96M|    ps_nbr_pu[NBR_B2] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  717|       |
  718|  1.96M|    nbr_avail[NBR_B2] = tl_avail
  ------------------
  |  Branch (718:25): [True: 2.46M, False: 18.4E]
  ------------------
  719|  2.46M|                    && (!ps_nbr_pu[NBR_B2]->b1_intra_flag); /* B2 */
  ------------------
  |  Branch (719:24): [True: 2.45M, False: 8.99k]
  ------------------
  720|       |
  721|  1.96M|    {
  722|  1.96M|        WORD32 avail_flag;
  723|  1.96M|        avail_flag = nbr_avail[NBR_B2];
  724|       |
  725|  1.96M|        if(nbr_avail[NBR_B2])
  ------------------
  |  Branch (725:12): [True: 2.45M, False: 18.4E]
  ------------------
  726|  2.45M|        {
  727|       |            /* if at same merge level */
  728|  2.45M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (728:16): [True: 2.21M, False: 242k]
  ------------------
  729|  2.21M|                            (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (729:29): [True: 2.21M, False: 2.93k]
  ------------------
  730|  2.21M|            {
  731|  2.21M|                nbr_avail[NBR_B2] = 0;
  732|  2.21M|                avail_flag = 0;
  733|  2.21M|            }
  734|   245k|            else if(4 == sum_avail_a0_a1_b0_b1)
  ------------------
  |  Branch (734:21): [True: 2.39k, False: 243k]
  ------------------
  735|  2.39k|            {
  736|  2.39k|                avail_flag = 0;
  737|  2.39k|            }
  738|       |
  739|   243k|            else
  740|   243k|            {
  741|   243k|                if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (741:20): [True: 210k, False: 32.3k]
  ------------------
  742|   210k|                {
  743|   210k|                    avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_B2]);
  744|   210k|                }
  745|       |
  746|   243k|                if(avail_flag && nbr_avail[NBR_B1])
  ------------------
  |  Branch (746:20): [True: 136k, False: 106k]
  |  Branch (746:34): [True: 121k, False: 14.7k]
  ------------------
  747|   121k|                {
  748|   121k|                    avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_B1], ps_nbr_pu[NBR_B2]);
  749|   121k|                }
  750|   243k|            }
  751|       |
  752|  2.45M|            if(avail_flag)
  ------------------
  |  Branch (752:16): [True: 89.5k, False: 2.36M]
  ------------------
  753|  89.5k|            {
  754|  89.5k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B2];
  755|  89.5k|                candidate_cnt++;
  756|  89.5k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (756:20): [True: 51.2k, False: 38.2k]
  ------------------
  757|  51.2k|                {
  758|  51.2k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  759|  51.2k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  760|  51.2k|                    return;
  761|  51.2k|                }
  762|  89.5k|            }
  763|  2.45M|        }
  764|  1.96M|    }
  765|       |
  766|       |    /***********************************************************/
  767|       |    /*          Collocated MV prediction                       */
  768|       |    /***********************************************************/
  769|  1.90M|    {
  770|  1.90M|        mv_t as_mv_col[2];
  771|  1.90M|        WORD32 avail_col_flag[2] = { 0 }, x_col, y_col;
  772|  1.90M|        WORD32 avail_col_l0, avail_col_l1;
  773|       |//        ihevcd_collocated_mvp(ps_mv_ctxt,ps_pu,part_pos_x,part_pos_y,part_wd,part_ht,as_mv_col,avail_col_flag,0);
  774|       |
  775|       |        /* Checking Collocated MV availability at Bottom right of PU*/
  776|  1.90M|        x_col = part_pos_x + part_wd;
  777|  1.90M|        y_col = part_pos_y + part_ht;
  778|  1.90M|        ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 0, x_col, y_col);
  779|       |
  780|  1.90M|        avail_col_l0 = avail_col_flag[0];
  781|  1.90M|        avail_col_l1 = avail_col_flag[1];
  782|       |
  783|  2.21M|        if(avail_col_l0 || avail_col_l1)
  ------------------
  |  Branch (783:12): [True: 18.4E, False: 2.21M]
  |  Branch (783:28): [True: 627, False: 2.21M]
  ------------------
  784|   691k|        {
  785|   691k|            as_pu_merge_list[candidate_cnt].mv.s_l0_mv = as_mv_col[0];
  786|   691k|            as_pu_merge_list[candidate_cnt].mv.s_l1_mv = as_mv_col[1];
  787|   691k|        }
  788|       |
  789|  1.90M|        if(avail_col_l0 == 0 || avail_col_l1 == 0)
  ------------------
  |  Branch (789:12): [True: 1.21M, False: 697k]
  |  Branch (789:33): [True: 2.85k, False: 694k]
  ------------------
  790|  2.21M|        {
  791|       |            /* Checking Collocated MV availability at Center of PU */
  792|  2.21M|            x_col = part_pos_x + (part_wd >> 1);
  793|  2.21M|            y_col = part_pos_y + (part_ht >> 1);
  794|  2.21M|            ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 0, x_col, y_col);
  795|       |
  796|  2.21M|            if(avail_col_l0 == 0)
  ------------------
  |  Branch (796:16): [True: 2.19M, False: 17.6k]
  ------------------
  797|  2.19M|            {
  798|  2.19M|                as_pu_merge_list[candidate_cnt].mv.s_l0_mv = as_mv_col[0];
  799|  2.19M|            }
  800|  2.21M|            if(avail_col_l1 == 0)
  ------------------
  |  Branch (800:16): [True: 2.20M, False: 14.2k]
  ------------------
  801|  2.20M|            {
  802|  2.20M|                as_pu_merge_list[candidate_cnt].mv.s_l1_mv = as_mv_col[1];
  803|  2.20M|            }
  804|       |
  805|  2.21M|            avail_col_l0 |= avail_col_flag[0];
  806|  2.21M|            avail_col_l1 |= avail_col_flag[1];
  807|  2.21M|        }
  808|       |
  809|  1.90M|        as_pu_merge_list[candidate_cnt].mv.i1_l0_ref_idx = 0;
  810|  1.90M|        as_pu_merge_list[candidate_cnt].mv.i1_l1_ref_idx = 0;
  811|  1.90M|        as_pu_merge_list[candidate_cnt].b2_pred_mode = avail_col_l0 ? (avail_col_l1 ? PRED_BI : PRED_L0) : PRED_L1;
  ------------------
  |  Branch (811:56): [True: 1.27M, False: 636k]
  |  Branch (811:72): [True: 1.26M, False: 4.98k]
  ------------------
  812|       |
  813|  1.90M|        candidate_cnt += (avail_col_l0 || avail_col_l1);
  ------------------
  |  Branch (813:27): [True: 286k, False: 1.62M]
  |  Branch (813:43): [True: 2.74k, False: 1.61M]
  ------------------
  814|       |
  815|  1.90M|        if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (815:12): [True: 1.20M, False: 703k]
  ------------------
  816|  1.20M|        {
  817|  1.20M|            ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  818|  1.20M|            ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  819|  1.20M|            return;
  820|  1.20M|        }
  821|       |
  822|  1.90M|    }
  823|   703k|    {
  824|   703k|        WORD32 slice_type;
  825|       |
  826|   703k|        slice_type = ps_slice_hdr->i1_slice_type;
  827|       |        /* Colocated mv has to be added to list, if available */
  828|       |
  829|       |        /******************************************************/
  830|       |        /*      Bi pred merge candidates                      */
  831|       |        /******************************************************/
  832|   703k|        if(slice_type == BSLICE)
  ------------------
  |  Branch (832:12): [True: 1.63M, False: 18.4E]
  ------------------
  833|  1.63M|        {
  834|  1.63M|            if((candidate_cnt > 1) && (candidate_cnt < MAX_NUM_MERGE_CAND))
  ------------------
  |  |  455|  98.0k|#define MAX_NUM_MERGE_CAND 5
  ------------------
  |  Branch (834:16): [True: 98.0k, False: 1.54M]
  |  Branch (834:39): [True: 98.0k, False: 18.4E]
  ------------------
  835|  98.0k|            {
  836|  98.0k|                WORD32 priority_list0[12] =
  837|  98.0k|                    { 0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3 };
  838|  98.0k|                WORD32 priority_list1[12] =
  839|  98.0k|                    { 1, 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2 };
  840|  98.0k|                WORD32 l0_cand, l1_cand;
  841|  98.0k|                WORD32 bi_pred_idx = 0;
  842|  98.0k|                WORD32 total_bi_pred_cand =
  843|  98.0k|                                candidate_cnt * (candidate_cnt - 1);
  844|       |
  845|   234k|                while(bi_pred_idx < total_bi_pred_cand)
  ------------------
  |  Branch (845:23): [True: 234k, False: 18.4E]
  ------------------
  846|   234k|                {
  847|   234k|                    l0_cand = priority_list0[bi_pred_idx];
  848|   234k|                    l1_cand = priority_list1[bi_pred_idx];
  849|       |
  850|   234k|                    if((as_pu_merge_list[l0_cand].b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (850:24): [True: 222k, False: 11.9k]
  ------------------
  851|   222k|                                    && (as_pu_merge_list[l1_cand].b2_pred_mode
  ------------------
  |  Branch (851:40): [True: 146k, False: 76.1k]
  ------------------
  852|   222k|                                                    != PRED_L0))
  853|   146k|                    {
  854|   146k|                        WORD8 i1_l0_ref_idx, i1_l1_ref_idx;
  855|   146k|                        mv_t s_l0_mv, s_l1_mv;
  856|   146k|                        pic_buf_t *ps_pic_buf_l0, *ps_pic_buf_l1;
  857|       |
  858|   146k|                        i1_l0_ref_idx = as_pu_merge_list[l0_cand].mv.i1_l0_ref_idx;
  859|   146k|                        i1_l1_ref_idx = as_pu_merge_list[l1_cand].mv.i1_l1_ref_idx;
  860|   146k|                        ps_pic_buf_l0 = (pic_buf_t *)((ps_ref_list[0][i1_l0_ref_idx].pv_pic_buf));
  861|   146k|                        ps_pic_buf_l1 = (pic_buf_t *)((ps_ref_list[1][i1_l1_ref_idx].pv_pic_buf));
  862|   146k|                        s_l0_mv = as_pu_merge_list[l0_cand].mv.s_l0_mv;
  863|   146k|                        s_l1_mv = as_pu_merge_list[l1_cand].mv.s_l1_mv;
  864|       |
  865|   146k|                        if((ps_pic_buf_l0->i4_abs_poc != ps_pic_buf_l1->i4_abs_poc)
  ------------------
  |  Branch (865:28): [True: 36.1k, False: 110k]
  ------------------
  866|   110k|                                        || (s_l0_mv.i2_mvx != s_l1_mv.i2_mvx)
  ------------------
  |  Branch (866:44): [True: 44.4k, False: 65.9k]
  ------------------
  867|  65.9k|                                        || (s_l0_mv.i2_mvy != s_l1_mv.i2_mvy))
  ------------------
  |  Branch (867:44): [True: 11.8k, False: 54.0k]
  ------------------
  868|  92.7k|                        {
  869|  92.7k|                            candidate_cnt++;
  870|  92.7k|                            if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (870:32): [True: 58.3k, False: 34.4k]
  ------------------
  871|  58.3k|                            {
  872|  58.3k|                                ps_pu[0].mv.s_l0_mv = s_l0_mv;
  873|  58.3k|                                ps_pu[0].mv.s_l1_mv = s_l1_mv;
  874|  58.3k|                                ps_pu[0].mv.i1_l0_ref_idx = i1_l0_ref_idx;
  875|  58.3k|                                ps_pu[0].mv.i1_l1_ref_idx = i1_l1_ref_idx;
  876|  58.3k|                                ps_pu[0].b2_pred_mode = PRED_BI;
  877|  58.3k|                                return;
  878|  58.3k|                            }
  879|  92.7k|                        }
  880|   146k|                    }
  881|       |
  882|   176k|                    bi_pred_idx++;
  883|       |
  884|   176k|                    if((bi_pred_idx == total_bi_pred_cand)
  ------------------
  |  Branch (884:24): [True: 39.3k, False: 137k]
  ------------------
  885|   137k|                                    || (candidate_cnt == MAX_NUM_MERGE_CAND))
  ------------------
  |  |  455|   137k|#define MAX_NUM_MERGE_CAND 5
  ------------------
  |  Branch (885:40): [True: 18.4E, False: 137k]
  ------------------
  886|  39.9k|                    {
  887|  39.9k|                        break;
  888|  39.9k|                    }
  889|   176k|                }
  890|  98.0k|            }
  891|  1.63M|        }
  892|       |
  893|       |        /******************************************************/
  894|       |        /*      Zero merge candidates                         */
  895|       |        /******************************************************/
  896|       |//        if(candidate_cnt < max_num_merge_cand)
  897|   645k|        {
  898|   645k|            WORD32 num_ref_idx;
  899|   645k|            WORD32 zero_idx;
  900|       |
  901|   645k|            zero_idx = max_num_merge_cand - candidate_cnt - 1;
  902|       |
  903|   645k|            if(slice_type == PSLICE)
  ------------------
  |  Branch (903:16): [True: 49.8k, False: 595k]
  ------------------
  904|  49.8k|                num_ref_idx = ps_slice_hdr->i1_num_ref_idx_l0_active;
  905|   595k|            else
  906|       |                /* Slice type B */
  907|   595k|                num_ref_idx = MIN(ps_slice_hdr->i1_num_ref_idx_l0_active, ps_slice_hdr->i1_num_ref_idx_l1_active);
  ------------------
  |  |   43|   595k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 52.3k, False: 543k]
  |  |  ------------------
  ------------------
  908|       |
  909|   645k|            if(zero_idx >= num_ref_idx)
  ------------------
  |  Branch (909:16): [True: 23.9k, False: 621k]
  ------------------
  910|  23.9k|                zero_idx = 0;
  911|       |
  912|   645k|            ps_pu[0].mv.i1_l0_ref_idx = zero_idx;
  913|   645k|            if(slice_type == PSLICE)
  ------------------
  |  Branch (913:16): [True: 49.8k, False: 595k]
  ------------------
  914|  49.8k|            {
  915|  49.8k|                ps_pu[0].mv.i1_l1_ref_idx = 0;
  916|  49.8k|                ps_pu[0].b2_pred_mode = PRED_L0;
  917|  49.8k|            }
  918|   595k|            else /* Slice type B */
  919|   595k|            {
  920|   595k|                ps_pu[0].mv.i1_l1_ref_idx = zero_idx;
  921|   595k|                ps_pu[0].b2_pred_mode = PRED_BI;
  922|   595k|            }
  923|       |
  924|   645k|            ps_pu[0].mv.s_l0_mv.i2_mvx = 0;
  925|   645k|            ps_pu[0].mv.s_l0_mv.i2_mvy = 0;
  926|   645k|            ps_pu[0].mv.s_l1_mv.i2_mvx = 0;
  927|   645k|            ps_pu[0].mv.s_l1_mv.i2_mvy = 0;
  928|       |
  929|   645k|            candidate_cnt++;
  930|   645k|        }
  931|   645k|    }
  932|       |
  933|      0|    return;
  934|   703k|}

ihevcd_scale_mv:
  107|   156k|{
  108|   156k|    WORD32 td, tb, tx;
  109|   156k|    WORD32 dist_scale_factor;
  110|   156k|    WORD32 mvx, mvy;
  111|       |
  112|   156k|    td = CLIP_S8(cur_poc - nbr_ref_poc);
  ------------------
  |  |   41|   156k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   156k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 19, False: 156k]
  |  |  |  |  |  Branch (40:53): [True: 2.17k, False: 154k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|   156k|    tb = CLIP_S8(cur_poc - cur_ref_poc);
  ------------------
  |  |   41|   156k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   156k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 19, False: 156k]
  |  |  |  |  |  Branch (40:53): [True: 2.85k, False: 153k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|   156k|    if(0 != td)
  ------------------
  |  Branch (115:8): [True: 153k, False: 2.34k]
  ------------------
  116|   153k|    {
  117|   153k|        tx = (16384 + (abs(td) >> 1)) / td;
  118|       |
  119|   153k|        dist_scale_factor = (tb * tx + 32) >> 6;
  120|   153k|        dist_scale_factor = CLIP3(dist_scale_factor, -4096, 4095);
  ------------------
  |  |   40|   153k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.75k, False: 150k]
  |  |  |  Branch (40:53): [True: 2.45k, False: 147k]
  |  |  ------------------
  ------------------
  121|       |
  122|   153k|        mvx = ps_mv->i2_mvx;
  123|   153k|        mvy = ps_mv->i2_mvy;
  124|       |
  125|   153k|        mvx = SIGN(dist_scale_factor * mvx)
  ------------------
  |  |   44|   153k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 109k, False: 44.0k]
  |  |  |  Branch (44:34): [True: 44.4k, False: 65.3k]
  |  |  ------------------
  ------------------
  126|   153k|                        * ((abs(dist_scale_factor * mvx) + 127) >> 8);
  127|   153k|        mvy = SIGN(dist_scale_factor * mvy)
  ------------------
  |  |   44|   153k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 110k, False: 43.0k]
  |  |  |  Branch (44:34): [True: 49.1k, False: 61.7k]
  |  |  ------------------
  ------------------
  128|   153k|                        * ((abs(dist_scale_factor * mvy) + 127) >> 8);
  129|       |
  130|   153k|        ps_mv->i2_mvx = CLIP_S16(mvx);
  ------------------
  |  |   53|   153k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   153k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.78k, False: 152k]
  |  |  |  |  |  Branch (40:53): [True: 2.98k, False: 149k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|   153k|        ps_mv->i2_mvy = CLIP_S16(mvy);
  ------------------
  |  |   53|   153k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   153k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.15k, False: 150k]
  |  |  |  |  |  Branch (40:53): [True: 1.65k, False: 149k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|   153k|    }
  133|   156k|}
ihevcd_scale_collocated_mv:
  169|  1.00M|{
  170|  1.00M|    WORD32 td, tb, tx;
  171|  1.00M|    WORD32 dist_scale_factor;
  172|  1.00M|    WORD32 mvx, mvy;
  173|       |
  174|  1.00M|    td = CLIP_S8(col_poc - col_ref_poc);
  ------------------
  |  |   41|  1.00M|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|  1.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 56.9k, False: 950k]
  |  |  |  |  |  Branch (40:53): [True: 8.20k, False: 942k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|  1.00M|    tb = CLIP_S8(cur_poc - cur_ref_poc);
  ------------------
  |  |   41|  1.00M|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|  1.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.00M]
  |  |  |  |  |  Branch (40:53): [True: 10.3k, False: 997k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|       |
  177|  1.00M|    tx = (16384 + (abs(td) >> 1)) / td;
  178|       |
  179|  1.00M|    dist_scale_factor = (tb * tx + 32) >> 6;
  180|  1.00M|    dist_scale_factor = CLIP3(dist_scale_factor, -4096, 4095);
  ------------------
  |  |   40|  1.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 4.24k, False: 1.00M]
  |  |  |  Branch (40:53): [True: 450k, False: 552k]
  |  |  ------------------
  ------------------
  181|       |
  182|  1.00M|    mvx = ps_mv->i2_mvx;
  183|  1.00M|    mvy = ps_mv->i2_mvy;
  184|       |
  185|  1.00M|    mvx = SIGN(dist_scale_factor * mvx)
  ------------------
  |  |   44|  1.00M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 899k, False: 108k]
  |  |  |  Branch (44:34): [True: 89.4k, False: 809k]
  |  |  ------------------
  ------------------
  186|  1.00M|                    * ((abs(dist_scale_factor * mvx) + 127) >> 8);
  187|  1.00M|    mvy = SIGN(dist_scale_factor * mvy)
  ------------------
  |  |   44|  1.00M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 878k, False: 128k]
  |  |  |  Branch (44:34): [True: 184k, False: 694k]
  |  |  ------------------
  ------------------
  188|  1.00M|                    * ((abs(dist_scale_factor * mvy) + 127) >> 8);
  189|       |
  190|  1.00M|    ps_mv->i2_mvx = CLIP_S16(mvx);
  ------------------
  |  |   53|  1.00M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 14.8k, False: 992k]
  |  |  |  |  |  Branch (40:53): [True: 25.1k, False: 967k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  1.00M|    ps_mv->i2_mvy = CLIP_S16(mvy);
  ------------------
  |  |   53|  1.00M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 112k, False: 895k]
  |  |  |  |  |  Branch (40:53): [True: 53.3k, False: 841k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  1.00M|}
GET_MV_NBR_ST:
  226|  1.45M|{
  227|  1.45M|    WORD32 i, nbr_pred_lx;
  228|  1.45M|    pic_buf_t *ps_nbr_pic_buf_lx;
  229|       |    /* Short Term */
  230|       |    /* L0 */
  231|  1.45M|    if(0 == lx)
  ------------------
  |  Branch (231:8): [True: 1.08M, False: 366k]
  ------------------
  232|  1.08M|    {
  233|  1.28M|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (233:20): [True: 1.08M, False: 197k]
  ------------------
  234|  1.08M|        {
  235|  1.08M|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  236|  1.08M|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[0][aps_nbr_pu[i]->mv.i1_l0_ref_idx].pv_pic_buf));
  237|  1.08M|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|  1.08M|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|  1.08M|{                                                                                           \
  |  |  197|  1.08M|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 926k, False: 157k]
  |  |  |  Branch (197:30): [True: 791k, False: 135k]
  |  |  ------------------
  |  |  198|  1.08M|    {                                                                                       \
  |  |  199|   791k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|   791k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|   791k|        break ;                                                                             \
  |  |  202|   791k|    }                                                                                       \
  |  |  203|  1.08M|}
  ------------------
  238|  1.08M|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  239|   292k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  240|       |
  241|   292k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  242|   292k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[1][aps_nbr_pu[i]->mv.i1_l1_ref_idx].pv_pic_buf));
  243|   292k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   292k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   292k|{                                                                                           \
  |  |  197|   292k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 205k, False: 87.3k]
  |  |  |  Branch (197:30): [True: 101k, False: 103k]
  |  |  ------------------
  |  |  198|   292k|    {                                                                                       \
  |  |  199|   101k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|   101k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|   101k|        break ;                                                                             \
  |  |  202|   101k|    }                                                                                       \
  |  |  203|   292k|}
  ------------------
  244|   292k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  245|   190k|        }
  246|  1.08M|    }
  247|       |    /* L1 */
  248|   366k|    else
  249|   366k|    {
  250|   454k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (250:20): [True: 370k, False: 84.0k]
  ------------------
  251|   370k|        {
  252|   370k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  253|   370k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[1][aps_nbr_pu[i]->mv.i1_l1_ref_idx].pv_pic_buf));
  254|   370k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   370k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   370k|{                                                                                           \
  |  |  197|   370k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 243k, False: 126k]
  |  |  |  Branch (197:30): [True: 209k, False: 33.8k]
  |  |  ------------------
  |  |  198|   370k|    {                                                                                       \
  |  |  199|   209k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|   209k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|   209k|        break ;                                                                             \
  |  |  202|   209k|    }                                                                                       \
  |  |  203|   370k|}
  ------------------
  255|   370k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  256|       |
  257|   160k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  258|   160k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[0][aps_nbr_pu[i]->mv.i1_l0_ref_idx].pv_pic_buf));
  259|   160k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   160k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   160k|{                                                                                           \
  |  |  197|   160k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 146k, False: 13.7k]
  |  |  |  Branch (197:30): [True: 73.1k, False: 73.7k]
  |  |  ------------------
  |  |  198|   160k|    {                                                                                       \
  |  |  199|  73.1k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|  73.1k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|  73.1k|        break ;                                                                             \
  |  |  202|  73.1k|    }                                                                                       \
  |  |  203|   160k|}
  ------------------
  260|   160k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  261|  87.5k|        }
  262|   366k|    }
  263|  1.45M|}
GET_MV_NBR_LT:
  266|   270k|{
  267|   270k|    WORD32 i, nbr_pred_lx;
  268|   270k|    pic_buf_t *ps_nbr_pic_buf_lx;
  269|       |    /* Long Term*/
  270|       |    /* L0 */
  271|   270k|    if(0 == lx)
  ------------------
  |  Branch (271:8): [True: 186k, False: 84.2k]
  ------------------
  272|   186k|    {
  273|   189k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (273:20): [True: 116k, False: 73.0k]
  ------------------
  274|   116k|        {
  275|   116k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  276|   116k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[0][aps_nbr_pu[i]->mv.i1_l0_ref_idx].pv_pic_buf));
  277|   116k|            CHECK_NBR_MV_LT(pi4_avail_flag, ps_cur_pic_buf_lx->u1_used_as_ref, ps_slice_hdr->i4_abs_pic_order_cnt, ps_cur_pic_buf_lx->i4_abs_poc,
  ------------------
  |  |  206|   116k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|   116k|{                                                                                            \
  |  |  208|   116k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|   116k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|   116k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|   116k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 74.0k, False: 42.8k]
  |  |  |  Branch (211:30): [True: 73.1k, False: 842]
  |  |  ------------------
  |  |  212|   116k|    {                                                                                        \
  |  |  213|  73.1k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  73.1k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  73.1k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 68.8k, False: 4.34k]
  |  |  ------------------
  |  |  216|  73.1k|        {                                                                                    \
  |  |  217|  68.8k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  68.8k|                                                cur_poc);                                    \
  |  |  219|  68.8k|        }                                                                                    \
  |  |  220|  73.1k|        break ;                                                                              \
  |  |  221|  73.1k|    }                                                                                        \
  |  |  222|   116k|}
  ------------------
  278|   116k|                            nbr_pred_lx,
  279|   116k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  280|   116k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  281|       |
  282|  43.6k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  283|  43.6k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[1][aps_nbr_pu[i]->mv.i1_l1_ref_idx].pv_pic_buf));
  284|  43.6k|            CHECK_NBR_MV_LT(pi4_avail_flag, ps_cur_pic_buf_lx->u1_used_as_ref, ps_slice_hdr->i4_abs_pic_order_cnt, ps_cur_pic_buf_lx->i4_abs_poc,
  ------------------
  |  |  206|  43.6k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  43.6k|{                                                                                            \
  |  |  208|  43.6k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  43.6k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  43.6k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  43.6k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 43.3k, False: 373]
  |  |  |  Branch (211:30): [True: 39.9k, False: 3.40k]
  |  |  ------------------
  |  |  212|  43.6k|    {                                                                                        \
  |  |  213|  39.9k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  39.9k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  39.9k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 38.6k, False: 1.26k]
  |  |  ------------------
  |  |  216|  39.9k|        {                                                                                    \
  |  |  217|  38.6k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  38.6k|                                                cur_poc);                                    \
  |  |  219|  38.6k|        }                                                                                    \
  |  |  220|  39.9k|        break ;                                                                              \
  |  |  221|  39.9k|    }                                                                                        \
  |  |  222|  43.6k|}
  ------------------
  285|  43.6k|                            nbr_pred_lx,
  286|  43.6k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  287|  43.6k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  288|  3.77k|        }
  289|   186k|    }
  290|       |    /* L1 */
  291|  84.2k|    else
  292|  84.2k|    {
  293|  85.9k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (293:20): [True: 54.3k, False: 31.5k]
  ------------------
  294|  54.3k|        {
  295|  54.3k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  296|  54.3k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[1][aps_nbr_pu[i]->mv.i1_l1_ref_idx].pv_pic_buf));
  297|  54.3k|            CHECK_NBR_MV_LT(pi4_avail_flag, ps_cur_pic_buf_lx->u1_used_as_ref, ps_slice_hdr->i4_abs_pic_order_cnt, ps_cur_pic_buf_lx->i4_abs_poc,
  ------------------
  |  |  206|  54.3k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  54.3k|{                                                                                            \
  |  |  208|  54.3k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  54.3k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  54.3k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  54.3k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 21.8k, False: 32.5k]
  |  |  |  Branch (211:30): [True: 20.2k, False: 1.61k]
  |  |  ------------------
  |  |  212|  54.3k|    {                                                                                        \
  |  |  213|  20.2k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  20.2k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  20.2k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 17.6k, False: 2.57k]
  |  |  ------------------
  |  |  216|  20.2k|        {                                                                                    \
  |  |  217|  17.6k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  17.6k|                                                cur_poc);                                    \
  |  |  219|  17.6k|        }                                                                                    \
  |  |  220|  20.2k|        break ;                                                                              \
  |  |  221|  20.2k|    }                                                                                        \
  |  |  222|  54.3k|}
  ------------------
  298|  54.3k|                            nbr_pred_lx,
  299|  54.3k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  300|  54.3k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  301|       |
  302|  34.1k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  303|  34.1k|            ps_nbr_pic_buf_lx = (pic_buf_t *)((ps_ref_pic_list[0][aps_nbr_pu[i]->mv.i1_l0_ref_idx].pv_pic_buf));
  304|  34.1k|            CHECK_NBR_MV_LT(pi4_avail_flag, ps_cur_pic_buf_lx->u1_used_as_ref, ps_slice_hdr->i4_abs_pic_order_cnt, ps_cur_pic_buf_lx->i4_abs_poc,
  ------------------
  |  |  206|  34.1k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  34.1k|{                                                                                            \
  |  |  208|  34.1k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  34.1k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  34.1k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  34.1k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 33.3k, False: 776]
  |  |  |  Branch (211:30): [True: 32.3k, False: 976]
  |  |  ------------------
  |  |  212|  34.1k|    {                                                                                        \
  |  |  213|  32.3k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  32.3k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  32.3k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 31.6k, False: 684]
  |  |  ------------------
  |  |  216|  32.3k|        {                                                                                    \
  |  |  217|  31.6k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  31.6k|                                                cur_poc);                                    \
  |  |  219|  31.6k|        }                                                                                    \
  |  |  220|  32.3k|        break ;                                                                              \
  |  |  221|  32.3k|    }                                                                                        \
  |  |  222|  34.1k|}
  ------------------
  305|  34.1k|                            nbr_pred_lx,
  306|  34.1k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  307|  34.1k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  308|  1.75k|        }
  309|  84.2k|    }
  310|   270k|}
ihevcd_mv_pred:
  366|   702k|{
  367|   702k|    slice_header_t *ps_slice_hdr;
  368|   702k|    ref_list_t *ps_ref_pic_list[2];
  369|   702k|    pu_t *ps_pic_pu;
  370|   702k|    WORD32 max_l0_mvp_cand, max_l1_mvp_cand;
  371|   702k|    WORD32 l0_done_flag, l1_done_flag;
  372|   702k|    WORD32 num_l0_mvp_cand, num_l1_mvp_cand;
  373|   702k|    WORD32 is_scaled_flag_list /* Indicates whether A0 or A1 is available */;
  374|   702k|    WORD32 avail_a_flag[2];
  375|   702k|    mv_t as_mv_a[2];
  376|   702k|    WORD32 part_pos_x;
  377|   702k|    WORD32 part_pos_y;
  378|   702k|    WORD32 part_wd;
  379|   702k|    WORD32 part_ht;
  380|   702k|    pic_buf_t *ps_cur_pic_buf_l0, *ps_cur_pic_buf_l1;
  381|   702k|    WORD32 nbr_avail[3]; /*[A0/A1] */ /* [B0/B1/B2] */
  382|   702k|    pu_t *aps_nbr_pu[3];  /*[A0/A1] */ /* [B0/B1/B2] */
  383|   702k|    WORD32 num_nbrs = 0;
  384|       |
  385|       |    /*******************************************/
  386|       |    /* Neighbor location: Graphical indication */
  387|       |    /*                                         */
  388|       |    /*          B2 _____________B1 B0          */
  389|       |    /*            |               |            */
  390|       |    /*            |               |            */
  391|       |    /*            |               |            */
  392|       |    /*            |      PU     ht|            */
  393|       |    /*            |               |            */
  394|       |    /*            |               |            */
  395|       |    /*          A1|______wd_______|            */
  396|       |    /*          A0                             */
  397|       |    /*                                         */
  398|       |    /*******************************************/
  399|       |
  400|   702k|    ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  401|   702k|    ps_pic_pu = ps_mv_ctxt->ps_pic_pu;
  402|   702k|    max_l0_mvp_cand = ps_pu->b1_l0_mvp_idx + 1;
  403|   702k|    max_l1_mvp_cand = ps_pu->b1_l1_mvp_idx + 1;
  404|   702k|    num_l0_mvp_cand = 0;
  405|   702k|    num_l1_mvp_cand = 0;
  406|       |
  407|       |    /* Initializing reference list */
  408|   702k|    ps_ref_pic_list[0] = ps_slice_hdr->as_ref_pic_list0;
  409|   702k|    ps_ref_pic_list[1] = ps_slice_hdr->as_ref_pic_list1;
  410|   702k|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (410:8): [True: 3.37k, False: 699k]
  ------------------
  411|  3.37k|        ps_ref_pic_list[1] = ps_slice_hdr->as_ref_pic_list0;
  412|       |
  413|   702k|    ps_cur_pic_buf_l0 = (pic_buf_t *)((ps_ref_pic_list[0][ps_pu->mv.i1_l0_ref_idx].pv_pic_buf));
  414|   702k|    ps_cur_pic_buf_l1 = (pic_buf_t *)((ps_ref_pic_list[1][ps_pu->mv.i1_l1_ref_idx].pv_pic_buf));
  415|       |
  416|   702k|    is_scaled_flag_list = 0;
  417|       |
  418|   702k|    part_pos_x = ps_pu->b4_pos_x << 2;
  419|   702k|    part_pos_y = ps_pu->b4_pos_y << 2;
  420|   702k|    part_wd = (ps_pu->b4_wd + 1) << 2;
  421|   702k|    part_ht = (ps_pu->b4_ht + 1) << 2;
  422|       |
  423|       |    /************************************************************/
  424|       |    /* Calculating of motion vector A from neighbors A0 and A1  */
  425|       |    /************************************************************/
  426|   702k|    {
  427|   702k|        nbr_avail[0] = 0;
  428|   702k|        nbr_avail[1] = 0;
  429|       |
  430|       |        /* Pointers to A0 and A1 */
  431|   702k|        {
  432|   702k|            WORD32 y_a0, y_a1;
  433|   702k|            WORD32 pu_idx_a0, pu_idx_a1;
  434|       |
  435|       |            /* TODO: y_a0, y_a1 is coded assuming left nbr pointer starts at PU */
  436|   702k|            y_a0 = (part_ht >> 2);
  437|   702k|            y_a1 = ((part_ht - 1) >> 2);
  438|       |
  439|   702k|            pu_idx_a0 = *(pu4_left_pu_idx + (y_a0 * left_nbr_4x4_strd));
  440|   702k|            pu_idx_a1 = *(pu4_left_pu_idx + (y_a1 * left_nbr_4x4_strd));
  441|       |
  442|   702k|            if(lb_avail && (!ps_pic_pu[pu_idx_a0].b1_intra_flag))
  ------------------
  |  Branch (442:16): [True: 216k, False: 485k]
  |  Branch (442:28): [True: 208k, False: 7.69k]
  ------------------
  443|   208k|            {
  444|   208k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_a0];
  445|   208k|                num_nbrs++;
  446|   208k|                nbr_avail[0] = 1;
  447|   208k|            }
  448|   702k|            if(l_avail && (!ps_pic_pu[pu_idx_a1].b1_intra_flag))
  ------------------
  |  Branch (448:16): [True: 655k, False: 47.2k]
  |  Branch (448:27): [True: 639k, False: 15.8k]
  ------------------
  449|   639k|            {
  450|   639k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_a1];
  451|   639k|                num_nbrs++;
  452|   639k|                nbr_avail[1] = 1;
  453|   639k|            }
  454|   702k|        }
  455|       |        /* Setting is scaled flag based on availability of A0 and A1 */
  456|   702k|        if((nbr_avail[0] == 1) || (nbr_avail[1]))
  ------------------
  |  Branch (456:12): [True: 202k, False: 499k]
  |  Branch (456:35): [True: 437k, False: 61.8k]
  ------------------
  457|   642k|        {
  458|   642k|            is_scaled_flag_list = 1;
  459|   642k|        }
  460|       |
  461|   702k|        avail_a_flag[0] = 0;
  462|   702k|        avail_a_flag[1] = 0;
  463|       |
  464|       |        /* L0 */
  465|   702k|        GET_MV_NBR_ST(ps_ref_pic_list, &avail_a_flag[0], ps_cur_pic_buf_l0, aps_nbr_pu, &as_mv_a[0], num_nbrs, 0);
  466|   702k|        if(0 == avail_a_flag[0])
  ------------------
  |  Branch (466:12): [True: 146k, False: 555k]
  ------------------
  467|   146k|        {
  468|   146k|            GET_MV_NBR_LT(ps_ref_pic_list, ps_slice_hdr, &avail_a_flag[0], ps_cur_pic_buf_l0, aps_nbr_pu, &as_mv_a[0], num_nbrs, 0);
  469|   146k|        }
  470|       |
  471|       |        /* L1 */
  472|   702k|        if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (472:12): [True: 238k, False: 464k]
  ------------------
  473|   238k|        {
  474|   238k|            GET_MV_NBR_ST(ps_ref_pic_list, &avail_a_flag[1], ps_cur_pic_buf_l1, aps_nbr_pu, &as_mv_a[1], num_nbrs, 1);
  475|   238k|            if(0 == avail_a_flag[1])
  ------------------
  |  Branch (475:16): [True: 65.6k, False: 172k]
  ------------------
  476|  65.6k|            {
  477|  65.6k|                GET_MV_NBR_LT(ps_ref_pic_list, ps_slice_hdr, &avail_a_flag[1], ps_cur_pic_buf_l1, aps_nbr_pu, &as_mv_a[1], num_nbrs, 1);
  478|  65.6k|            }
  479|   238k|        }
  480|       |
  481|   702k|        l0_done_flag = (PRED_L1 == ps_pu->b2_pred_mode);
  482|   702k|        l1_done_flag = (PRED_L0 == ps_pu->b2_pred_mode);
  483|       |
  484|   702k|        if(avail_a_flag[0])
  ------------------
  |  Branch (484:12): [True: 637k, False: 64.5k]
  ------------------
  485|   637k|        {
  486|   637k|            num_l0_mvp_cand++;
  487|   637k|            if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (487:16): [True: 374k, False: 263k]
  ------------------
  488|   374k|            {
  489|   374k|                ps_pred_mv->s_l0_mv = as_mv_a[0];
  490|   374k|                l0_done_flag = 1;
  491|   374k|            }
  492|   637k|        }
  493|   702k|        if(avail_a_flag[1])
  ------------------
  |  Branch (493:12): [True: 209k, False: 492k]
  ------------------
  494|   209k|        {
  495|   209k|            num_l1_mvp_cand++;
  496|   209k|            if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (496:16): [True: 114k, False: 95.0k]
  ------------------
  497|   114k|            {
  498|   114k|                ps_pred_mv->s_l1_mv = as_mv_a[1];
  499|   114k|                l1_done_flag = 1;
  500|   114k|            }
  501|   209k|        }
  502|   702k|        if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (502:12): [True: 388k, False: 313k]
  |  Branch (502:28): [True: 312k, False: 76.2k]
  ------------------
  503|   312k|            return;
  504|   702k|    }
  505|       |
  506|       |    /************************************************************/
  507|       |    /* Calculating of motion vector B from neighbors B0 and B1  */
  508|       |    /************************************************************/
  509|   389k|    {
  510|   389k|        WORD32 avail_b_flag[2];
  511|   389k|        mv_t as_mv_b[2];
  512|       |
  513|       |        /* Pointers to B0, B1 and B2 */
  514|   389k|        {
  515|   389k|            WORD32 x_b0, x_b1, x_b2;
  516|   389k|            WORD32 pu_idx_b0, pu_idx_b1, pu_idx_b2;
  517|       |
  518|       |            /* Relative co-ordiante of Xp,Yp w.r.t CTB start will work */
  519|       |            /* as long as minCTB = 16                                  */
  520|   389k|            x_b0 = (part_pos_x + part_wd);
  521|   389k|            x_b1 = (part_pos_x + part_wd - 1);
  522|   389k|            x_b2 = (part_pos_x - 1);
  523|       |            /* Getting offset back to given pointer */
  524|   389k|            x_b0 = x_b0 - part_pos_x;
  525|   389k|            x_b1 = x_b1 - part_pos_x;
  526|   389k|            x_b2 = x_b2 - part_pos_x;
  527|       |
  528|       |            /* Below derivation are based on top pointer */
  529|       |            /* is pointing first pixel of PU             */
  530|   389k|            pu_idx_b0 = *(pu4_top_pu_idx + (x_b0 >> 2));
  531|   389k|            pu_idx_b0 = pu_idx_b0 * tr_avail;
  532|   389k|            pu_idx_b1 = *(pu4_top_pu_idx + (x_b1 >> 2));
  533|   389k|            pu_idx_b1 = pu_idx_b1 * t_avail;
  534|       |            /* At CTB boundary, use top-left passed in */
  535|   389k|            if(part_pos_y)
  ------------------
  |  Branch (535:16): [True: 295k, False: 94.2k]
  ------------------
  536|   295k|            {
  537|   295k|                pu_idx_b2 = *pu4_top_left_pu_idx;
  538|   295k|            }
  539|  94.2k|            else
  540|  94.2k|            {
  541|       |                /* Not at CTB boundary, use top and  */
  542|       |                /* add correction to go to top-left */
  543|  94.2k|                pu_idx_b2 = *((pu4_top_pu_idx)+(x_b2 >> 2));
  544|  94.2k|            }
  545|   389k|            pu_idx_b2 = pu_idx_b2 * tl_avail;
  546|       |
  547|   389k|            num_nbrs = 0;
  548|   389k|            nbr_avail[0] = 0;
  549|   389k|            nbr_avail[1] = 0;
  550|   389k|            nbr_avail[2] = 0;
  551|       |
  552|   389k|            if(tr_avail && (!ps_pic_pu[pu_idx_b0].b1_intra_flag))
  ------------------
  |  Branch (552:16): [True: 244k, False: 145k]
  |  Branch (552:28): [True: 237k, False: 6.65k]
  ------------------
  553|   237k|            {
  554|   237k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b0];
  555|   237k|                num_nbrs++;
  556|   237k|                nbr_avail[0] = 1;
  557|   237k|            }
  558|   389k|            if(t_avail && (!ps_pic_pu[pu_idx_b1].b1_intra_flag))
  ------------------
  |  Branch (558:16): [True: 369k, False: 20.2k]
  |  Branch (558:27): [True: 360k, False: 9.07k]
  ------------------
  559|   360k|            {
  560|   360k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b1];
  561|   360k|                num_nbrs++;
  562|   360k|                nbr_avail[1] = 1;
  563|   360k|            }
  564|   389k|            if(tl_avail && (!ps_pic_pu[pu_idx_b2].b1_intra_flag))
  ------------------
  |  Branch (564:16): [True: 328k, False: 61.5k]
  |  Branch (564:28): [True: 316k, False: 12.3k]
  ------------------
  565|   316k|            {
  566|   316k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b2];
  567|   316k|                num_nbrs++;
  568|   316k|                nbr_avail[2] = 1;
  569|   316k|            }
  570|   389k|        }
  571|       |
  572|       |        /* L0 */
  573|   389k|        avail_b_flag[0] = 0;
  574|   389k|        avail_b_flag[1] = 0;
  575|       |
  576|   389k|        GET_MV_NBR_ST(ps_ref_pic_list, &avail_b_flag[0], ps_cur_pic_buf_l0, aps_nbr_pu, &as_mv_b[0], num_nbrs, 0);
  577|       |
  578|       |        /* L1 */
  579|   389k|        if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (579:12): [True: 134k, False: 255k]
  ------------------
  580|   134k|        {
  581|       |            /* B0 Short Term */
  582|   134k|            GET_MV_NBR_ST(ps_ref_pic_list, &avail_b_flag[1], ps_cur_pic_buf_l1, aps_nbr_pu, &as_mv_b[1], num_nbrs, 1);
  583|   134k|        }
  584|       |
  585|   389k|        if(avail_b_flag[0])
  ------------------
  |  Branch (585:12): [True: 337k, False: 52.8k]
  ------------------
  586|   337k|        {
  587|   337k|            if(((0 == num_l0_mvp_cand)
  ------------------
  |  Branch (587:17): [True: 44.8k, False: 292k]
  ------------------
  588|   292k|                            || (as_mv_a[0].i2_mvx != as_mv_b[0].i2_mvx)
  ------------------
  |  Branch (588:32): [True: 119k, False: 173k]
  ------------------
  589|   172k|                            || (as_mv_a[0].i2_mvy != as_mv_b[0].i2_mvy)))
  ------------------
  |  Branch (589:32): [True: 33.7k, False: 139k]
  ------------------
  590|   199k|            {
  591|   199k|                num_l0_mvp_cand++;
  592|   199k|                if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (592:20): [True: 157k, False: 41.9k]
  ------------------
  593|   157k|                {
  594|   157k|                    ps_pred_mv->s_l0_mv = as_mv_b[0];
  595|   157k|                    l0_done_flag = 1;
  596|   157k|                }
  597|   199k|            }
  598|   337k|        }
  599|   389k|        if(avail_b_flag[1])
  ------------------
  |  Branch (599:12): [True: 109k, False: 280k]
  ------------------
  600|   109k|        {
  601|   109k|            if(((0 == num_l1_mvp_cand)
  ------------------
  |  Branch (601:17): [True: 20.6k, False: 89.1k]
  ------------------
  602|  89.1k|                            || (as_mv_a[1].i2_mvx != as_mv_b[1].i2_mvx)
  ------------------
  |  Branch (602:32): [True: 36.8k, False: 52.3k]
  ------------------
  603|  52.2k|                            || (as_mv_a[1].i2_mvy != as_mv_b[1].i2_mvy)))
  ------------------
  |  Branch (603:32): [True: 11.1k, False: 41.1k]
  ------------------
  604|  69.0k|            {
  605|  69.0k|                num_l1_mvp_cand++;
  606|  69.0k|                if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (606:20): [True: 52.9k, False: 16.0k]
  ------------------
  607|  52.9k|                {
  608|  52.9k|                    ps_pred_mv->s_l1_mv = as_mv_b[1];
  609|  52.9k|                    l1_done_flag = 1;
  610|  52.9k|                }
  611|  69.0k|            }
  612|   109k|        }
  613|   389k|        if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (613:12): [True: 225k, False: 164k]
  |  Branch (613:28): [True: 176k, False: 48.7k]
  ------------------
  614|   176k|            return;
  615|       |
  616|   212k|        if((is_scaled_flag_list == 0) && (avail_b_flag[0] == 1))
  ------------------
  |  Branch (616:12): [True: 39.3k, False: 173k]
  |  Branch (616:42): [True: 23.0k, False: 16.2k]
  ------------------
  617|  23.0k|        {
  618|  23.0k|            avail_a_flag[0] = 1;
  619|  23.0k|            as_mv_a[0] = as_mv_b[0];
  620|  23.0k|        }
  621|   212k|        if((is_scaled_flag_list == 0) && (avail_b_flag[1] == 1))
  ------------------
  |  Branch (621:12): [True: 39.3k, False: 173k]
  |  Branch (621:42): [True: 11.9k, False: 27.3k]
  ------------------
  622|  11.9k|        {
  623|  11.9k|            avail_a_flag[1] = 1;
  624|  11.9k|            as_mv_a[1] = as_mv_b[1];
  625|  11.9k|        }
  626|       |
  627|   212k|        if(0 == is_scaled_flag_list)
  ------------------
  |  Branch (627:12): [True: 39.3k, False: 173k]
  ------------------
  628|  39.3k|        {
  629|  39.3k|            avail_b_flag[0] = avail_b_flag[1] = 0;
  630|       |
  631|  39.3k|            GET_MV_NBR_LT(ps_ref_pic_list, ps_slice_hdr, &avail_b_flag[0], ps_cur_pic_buf_l0, aps_nbr_pu, &as_mv_b[0], num_nbrs, 0);
  632|       |
  633|  39.3k|            if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (633:16): [True: 19.0k, False: 20.2k]
  ------------------
  634|  19.0k|            {
  635|  19.0k|                GET_MV_NBR_LT(ps_ref_pic_list, ps_slice_hdr, &avail_b_flag[1], ps_cur_pic_buf_l1, aps_nbr_pu, &as_mv_b[1], num_nbrs, 1);
  636|  19.0k|            }
  637|       |
  638|  39.3k|            if(avail_b_flag[0])
  ------------------
  |  Branch (638:16): [True: 30.5k, False: 8.83k]
  ------------------
  639|  30.5k|            {
  640|  30.5k|                if(((0 == num_l0_mvp_cand)
  ------------------
  |  Branch (640:21): [True: 7.42k, False: 23.0k]
  ------------------
  641|  23.0k|                                || (as_mv_a[0].i2_mvx != as_mv_b[0].i2_mvx)
  ------------------
  |  Branch (641:36): [True: 725, False: 22.3k]
  ------------------
  642|  22.3k|                                || (as_mv_a[0].i2_mvy != as_mv_b[0].i2_mvy)))
  ------------------
  |  Branch (642:36): [True: 429, False: 21.9k]
  ------------------
  643|  8.58k|                {
  644|  8.58k|                    num_l0_mvp_cand++;
  645|  8.58k|                    if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (645:24): [True: 4.86k, False: 3.72k]
  ------------------
  646|  4.86k|                    {
  647|  4.86k|                        ps_pred_mv->s_l0_mv = as_mv_b[0];
  648|  4.86k|                        l0_done_flag = 1;
  649|  4.86k|                    }
  650|  8.58k|                }
  651|  30.5k|            }
  652|  39.3k|            if(avail_b_flag[1])
  ------------------
  |  Branch (652:16): [True: 15.2k, False: 24.0k]
  ------------------
  653|  15.2k|            {
  654|  15.2k|                if(((0 == num_l1_mvp_cand)
  ------------------
  |  Branch (654:21): [True: 3.33k, False: 11.9k]
  ------------------
  655|  11.9k|                                || (as_mv_a[1].i2_mvx != as_mv_b[1].i2_mvx)
  ------------------
  |  Branch (655:36): [True: 728, False: 11.2k]
  ------------------
  656|  11.2k|                                || (as_mv_a[1].i2_mvy != as_mv_b[1].i2_mvy)))
  ------------------
  |  Branch (656:36): [True: 662, False: 10.5k]
  ------------------
  657|  4.72k|                {
  658|  4.72k|                    num_l1_mvp_cand++;
  659|  4.72k|                    if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (659:24): [True: 2.83k, False: 1.89k]
  ------------------
  660|  2.83k|                    {
  661|  2.83k|                        ps_pred_mv->s_l1_mv = as_mv_b[1];
  662|  2.83k|                        l1_done_flag = 1;
  663|  2.83k|                    }
  664|  4.72k|                }
  665|  15.2k|            }
  666|  39.3k|            if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (666:16): [True: 12.9k, False: 26.3k]
  |  Branch (666:32): [True: 4.72k, False: 8.25k]
  ------------------
  667|  4.72k|                return;
  668|  39.3k|        }
  669|       |        /***********************************************************/
  670|       |        /*          Collocated MV prediction                       */
  671|       |        /***********************************************************/
  672|   208k|        if((2 != num_l0_mvp_cand) || (2 != num_l1_mvp_cand))
  ------------------
  |  Branch (672:12): [True: 199k, False: 8.19k]
  |  Branch (672:38): [True: 8.19k, False: 0]
  ------------------
  673|   214k|        {
  674|   214k|            mv_t as_mv_col[2], s_mv_col_l0, s_mv_col_l1;
  675|   214k|            WORD32 avail_col_flag[2] = { 0 };
  676|   214k|            WORD32 x_col, y_col, avail_col_l0, avail_col_l1;
  677|       |//            ihevcd_collocated_mvp((mv_ctxt_t *)ps_mv_ctxt,ps_pu,part_pos_x,part_pos_y,part_wd,part_ht,as_mv_col,avail_col_flag,1);
  678|   214k|            x_col = part_pos_x + part_wd;
  679|   214k|            y_col = part_pos_y + part_ht;
  680|   214k|            ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 1, x_col, y_col);
  681|       |
  682|   214k|            avail_col_l0 = avail_col_flag[0];
  683|   214k|            avail_col_l1 = avail_col_flag[1];
  684|   214k|            if(avail_col_l0 || avail_col_l1)
  ------------------
  |  Branch (684:16): [True: 111k, False: 102k]
  |  Branch (684:32): [True: 559, False: 102k]
  ------------------
  685|   113k|            {
  686|   113k|                s_mv_col_l0 = as_mv_col[0];
  687|   113k|                s_mv_col_l1 = as_mv_col[1];
  688|   113k|            }
  689|       |
  690|   214k|            if(avail_col_l0 == 0 || avail_col_l1 == 0)
  ------------------
  |  Branch (690:16): [True: 101k, False: 113k]
  |  Branch (690:37): [True: 455, False: 112k]
  ------------------
  691|   103k|            {
  692|       |                /* Checking Collocated MV availability at Center of PU */
  693|   103k|                x_col = part_pos_x + (part_wd >> 1);
  694|   103k|                y_col = part_pos_y + (part_ht >> 1);
  695|   103k|                ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 1, x_col, y_col);
  696|       |
  697|   103k|                if(avail_col_l0 == 0)
  ------------------
  |  Branch (697:20): [True: 102k, False: 616]
  ------------------
  698|   102k|                {
  699|   102k|                    s_mv_col_l0 = as_mv_col[0];
  700|   102k|                }
  701|   103k|                if(avail_col_l1 == 0)
  ------------------
  |  Branch (701:20): [True: 102k, False: 680]
  ------------------
  702|   102k|                {
  703|   102k|                    s_mv_col_l1 = as_mv_col[1];
  704|   102k|                }
  705|       |
  706|   103k|                avail_col_l0 |= avail_col_flag[0];
  707|   103k|                avail_col_l1 |= avail_col_flag[1];
  708|   103k|            }
  709|       |
  710|       |            /* Checking if mvp index matches collocated mv */
  711|   214k|            if(avail_col_l0)
  ------------------
  |  Branch (711:16): [True: 166k, False: 47.8k]
  ------------------
  712|   166k|            {
  713|   166k|                if(2 != num_l0_mvp_cand)
  ------------------
  |  Branch (713:20): [True: 160k, False: 6.45k]
  ------------------
  714|   160k|                {
  715|   160k|                    num_l0_mvp_cand++;
  716|   160k|                    if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (716:24): [True: 129k, False: 30.6k]
  ------------------
  717|   129k|                    {
  718|   129k|                        ps_pred_mv->s_l0_mv = s_mv_col_l0;
  719|   129k|                        l0_done_flag = 1;
  720|   129k|                    }
  721|   160k|                }
  722|   166k|            }
  723|   214k|            if(avail_col_l1)
  ------------------
  |  Branch (723:16): [True: 166k, False: 47.8k]
  ------------------
  724|   166k|            {
  725|   166k|                if(2 != num_l1_mvp_cand)
  ------------------
  |  Branch (725:20): [True: 163k, False: 2.66k]
  ------------------
  726|   163k|                {
  727|   163k|                    num_l1_mvp_cand++;
  728|   163k|                    if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (728:24): [True: 160k, False: 3.77k]
  ------------------
  729|   160k|                    {
  730|   160k|                        ps_pred_mv->s_l1_mv = s_mv_col_l1;
  731|   160k|                        l1_done_flag = 1;
  732|   160k|                    }
  733|   163k|                }
  734|   166k|            }
  735|   214k|            if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (735:16): [True: 176k, False: 37.5k]
  |  Branch (735:32): [True: 165k, False: 11.4k]
  ------------------
  736|   165k|                return;
  737|   214k|        }
  738|       |
  739|  42.6k|        if(0 == l0_done_flag)
  ------------------
  |  Branch (739:12): [True: 37.9k, False: 4.75k]
  ------------------
  740|  37.9k|        {
  741|  37.9k|            ps_pred_mv->s_l0_mv.i2_mvx = 0;
  742|  37.9k|            ps_pred_mv->s_l0_mv.i2_mvy = 0;
  743|  37.9k|        }
  744|  42.6k|        if(0 == l1_done_flag)
  ------------------
  |  Branch (744:12): [True: 17.3k, False: 25.3k]
  ------------------
  745|  17.3k|        {
  746|  17.3k|            ps_pred_mv->s_l1_mv.i2_mvx = 0;
  747|  17.3k|            ps_pred_mv->s_l1_mv.i2_mvy = 0;
  748|  17.3k|        }
  749|  42.6k|    }
  750|  42.6k|}

ihevcd_nal_search_start_code:
   97|   545k|{
   98|   545k|    WORD32 ofst;
   99|       |
  100|   545k|    WORD32 zero_byte_cnt;
  101|   545k|    WORD32 start_code_found;
  102|       |
  103|   545k|    ofst = -1;
  104|       |
  105|   545k|    zero_byte_cnt = 0;
  106|   545k|    start_code_found = 0;
  107|  83.5M|    while(ofst < (bytes_remaining - 1))
  ------------------
  |  Branch (107:11): [True: 83.5M, False: 366]
  ------------------
  108|  83.5M|    {
  109|  83.5M|        ofst++;
  110|  83.5M|        if(pu1_buf[ofst] != 0)
  ------------------
  |  Branch (110:12): [True: 8.38M, False: 75.2M]
  ------------------
  111|  8.38M|        {
  112|  8.38M|            zero_byte_cnt = 0;
  113|  8.38M|            continue;
  114|  8.38M|        }
  115|       |
  116|  75.2M|        zero_byte_cnt++;
  117|  75.2M|        if((ofst < (bytes_remaining - 1)) &&
  ------------------
  |  Branch (117:12): [True: 75.2M, False: 65]
  ------------------
  118|  75.2M|           (pu1_buf[ofst + 1] == START_CODE_PREFIX_BYTE) &&
  ------------------
  |  |   47|  75.2M|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (118:12): [True: 562k, False: 74.6M]
  ------------------
  119|   562k|           (zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
  ------------------
  |  |   57|   562k|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (119:12): [True: 544k, False: 18.0k]
  ------------------
  120|   544k|        {
  121|       |            /* Found the start code */
  122|   544k|            ofst++;
  123|   544k|            start_code_found = 1;
  124|   544k|            break;
  125|   544k|        }
  126|  75.2M|    }
  127|   545k|    if((0 == start_code_found) && (ofst < bytes_remaining))
  ------------------
  |  Branch (127:8): [True: 366, False: 544k]
  |  Branch (127:35): [True: 366, False: 0]
  ------------------
  128|    366|    {
  129|    366|        if((START_CODE_PREFIX_BYTE == pu1_buf[ofst]) &&
  ------------------
  |  |   47|    366|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (129:12): [True: 19, False: 347]
  ------------------
  130|     19|           (zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
  ------------------
  |  |   57|     19|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (130:12): [True: 0, False: 19]
  ------------------
  131|      0|        {
  132|       |            /* Found a start code at the end*/
  133|      0|            ofst++;
  134|      0|        }
  135|    366|    }
  136|       |    /* Since ofst started at -1, increment it by 1 */
  137|   545k|    ofst++;
  138|       |
  139|   545k|    return ofst;
  140|   545k|}
ihevcd_nal_remv_emuln_bytes:
  186|   544k|{
  187|   544k|    WORD32 src_cnt;
  188|   544k|    WORD32 dst_cnt;
  189|   544k|    WORD32 zero_byte_cnt;
  190|   544k|    WORD32 start_code_found;
  191|   544k|    UWORD8 u1_src;
  192|   544k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  193|       |
  194|   544k|    src_cnt = 0;
  195|   544k|    dst_cnt = 0;
  196|   544k|    zero_byte_cnt = 0;
  197|   544k|    start_code_found = 0;
  198|   259M|    while(src_cnt < (bytes_remaining - 1))
  ------------------
  |  Branch (198:11): [True: 258M, False: 53.4k]
  ------------------
  199|   258M|    {
  200|   258M|        u1_src = pu1_src[src_cnt++];
  201|       |
  202|   258M|        pu1_dst[dst_cnt++] = u1_src;
  203|   258M|        if(u1_src != 0)
  ------------------
  |  Branch (203:12): [True: 82.6M, False: 176M]
  ------------------
  204|  82.6M|        {
  205|  82.6M|            zero_byte_cnt = 0;
  206|  82.6M|            continue;
  207|  82.6M|        }
  208|       |
  209|   176M|        zero_byte_cnt++;
  210|   176M|        if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
  ------------------
  |  |   57|   176M|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (210:12): [True: 174M, False: 1.54M]
  ------------------
  211|   174M|        {
  212|   174M|            u1_src = pu1_src[src_cnt];
  213|   174M|            if(START_CODE_PREFIX_BYTE == u1_src)
  ------------------
  |  |   47|   174M|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (213:16): [True: 491k, False: 174M]
  ------------------
  214|   491k|            {
  215|       |                /* Found the start code */
  216|   491k|                src_cnt -= zero_byte_cnt;
  217|   491k|                dst_cnt -= zero_byte_cnt;
  218|   491k|                start_code_found = 1;
  219|   491k|                break;
  220|   491k|            }
  221|   174M|            else if(EMULATION_PREVENT_BYTE == u1_src)
  ------------------
  |  |   53|   174M|#define EMULATION_PREVENT_BYTE      3
  ------------------
  |  Branch (221:21): [True: 26.2k, False: 174M]
  ------------------
  222|  26.2k|            {
  223|       |                /* Found the emulation prevention byte */
  224|  26.2k|                src_cnt++;
  225|  26.2k|                zero_byte_cnt = 0;
  226|       |
  227|       |                /* Decrement dst_cnt so that the next byte overwrites
  228|       |                 * the emulation prevention byte already copied to dst above
  229|       |                 */
  230|  26.2k|            }
  231|   174M|        }
  232|       |
  233|   176M|    }
  234|       |
  235|   544k|    if((0 == start_code_found) && (src_cnt < bytes_remaining))
  ------------------
  |  Branch (235:8): [True: 53.4k, False: 491k]
  |  Branch (235:35): [True: 53.3k, False: 78]
  ------------------
  236|  53.3k|    {
  237|  53.3k|        u1_src = pu1_src[src_cnt++];
  238|  53.3k|        if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
  ------------------
  |  |   57|  53.3k|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (238:12): [True: 2.16k, False: 51.1k]
  ------------------
  239|  2.16k|        {
  240|       |
  241|  2.16k|            if(START_CODE_PREFIX_BYTE == u1_src)
  ------------------
  |  |   47|  2.16k|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (241:16): [True: 0, False: 2.16k]
  ------------------
  242|      0|            {
  243|       |                /* Found a start code at the end*/
  244|      0|                src_cnt -= zero_byte_cnt;
  245|      0|            }
  246|  2.16k|            else if(EMULATION_PREVENT_BYTE == u1_src)
  ------------------
  |  |   53|  2.16k|#define EMULATION_PREVENT_BYTE      3
  ------------------
  |  Branch (246:21): [True: 0, False: 2.16k]
  ------------------
  247|      0|            {
  248|       |                /* Found the emulation prevention byte at the end*/
  249|      0|                src_cnt++;
  250|       |                /* Decrement dst_cnt so that the next byte overwrites
  251|       |                 * the emulation prevention byte already copied to dst above
  252|       |                 */
  253|      0|                dst_cnt--;
  254|      0|            }
  255|  2.16k|        }
  256|  51.1k|        else
  257|  51.1k|        {
  258|  51.1k|            pu1_dst[dst_cnt++] = u1_src;
  259|  51.1k|        }
  260|       |
  261|       |
  262|  53.3k|    }
  263|   544k|    *pi4_nal_len = src_cnt;
  264|   544k|    *pi4_dst_len = dst_cnt;
  265|   544k|    return ret;
  266|   544k|}
ihevcd_nal_unit_header:
  290|   544k|{
  291|   544k|    WORD32 unused;
  292|   544k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  293|   544k|    UNUSED(unused);
  ------------------
  |  |   38|   544k|#define UNUSED(x) ((void)(x))
  ------------------
  294|       |    /* Syntax : forbidden_zero_bit */
  295|   544k|    unused = ihevcd_bits_get(ps_bitstrm, 1);
  296|       |
  297|       |    /* Syntax : nal_unit_type */
  298|   544k|    ps_nal->i1_nal_unit_type = ihevcd_bits_get(ps_bitstrm, 6);
  299|       |
  300|       |    /* Syntax : nuh_reserved_zero_6bits */
  301|   544k|    unused = ihevcd_bits_get(ps_bitstrm, 6);
  302|       |
  303|       |    /* Syntax : nuh_temporal_id_plus1 */
  304|   544k|    ps_nal->i1_nuh_temporal_id = (WORD32)ihevcd_bits_get(ps_bitstrm, 3) - 1;
  305|       |
  306|   544k|    return ret;
  307|       |
  308|   544k|}
ihevcd_nal_unit:
  332|   544k|{
  333|   544k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  334|       |
  335|       |    /* NAL Header */
  336|   544k|    nal_header_t s_nal;
  337|       |
  338|   544k|    ret = ihevcd_nal_unit_header(&ps_codec->s_parse.s_bitstrm, &s_nal);
  339|   544k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   544k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 544k]
  |  |  ------------------
  ------------------
  340|       |
  341|   544k|    if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (341:8): [True: 30.3k, False: 514k]
  ------------------
  342|  30.3k|        s_nal.i1_nal_unit_type = ps_codec->s_parse.ps_slice_hdr->i1_nal_unit_type;
  343|       |
  344|       |    /* Setting RASL Output flag */
  345|   544k|    switch(s_nal.i1_nal_unit_type)
  346|   544k|    {
  347|  3.65k|        case NAL_BLA_W_LP    :
  ------------------
  |  Branch (347:9): [True: 3.65k, False: 541k]
  ------------------
  348|  18.1k|        case NAL_BLA_W_DLP   :
  ------------------
  |  Branch (348:9): [True: 14.5k, False: 530k]
  ------------------
  349|  22.0k|        case NAL_BLA_N_LP    :
  ------------------
  |  Branch (349:9): [True: 3.88k, False: 540k]
  ------------------
  350|  22.0k|            ps_codec->i4_rasl_output_flag = 0;
  351|  22.0k|            break;
  352|       |
  353|       |        //TODO: After IDR, there is no case of open GOP
  354|       |        //To be fixed appropriately by ignoring RASL only if the
  355|       |        // required references are not found
  356|  34.2k|        case NAL_IDR_W_LP    :
  ------------------
  |  Branch (356:9): [True: 34.2k, False: 510k]
  ------------------
  357|   107k|        case NAL_IDR_N_LP    :
  ------------------
  |  Branch (357:9): [True: 73.1k, False: 471k]
  ------------------
  358|   107k|            ps_codec->i4_rasl_output_flag = 1;
  359|   107k|            break;
  360|       |
  361|  4.08k|        case NAL_CRA         :
  ------------------
  |  Branch (361:9): [True: 4.08k, False: 540k]
  ------------------
  362|  4.08k|            ps_codec->i4_rasl_output_flag = (0 != ps_codec->i4_cra_as_first_pic) ? 0 : 1;
  ------------------
  |  Branch (362:45): [True: 1.17k, False: 2.91k]
  ------------------
  363|  4.08k|            break;
  364|       |
  365|   411k|        default:
  ------------------
  |  Branch (365:9): [True: 411k, False: 133k]
  ------------------
  366|   411k|            break;
  367|   544k|    }
  368|       |
  369|   544k|    switch(s_nal.i1_nal_unit_type)
  370|   544k|    {
  371|  3.65k|        case NAL_BLA_W_LP    :
  ------------------
  |  Branch (371:9): [True: 3.65k, False: 541k]
  ------------------
  372|  18.1k|        case NAL_BLA_W_DLP   :
  ------------------
  |  Branch (372:9): [True: 14.5k, False: 530k]
  ------------------
  373|  22.0k|        case NAL_BLA_N_LP    :
  ------------------
  |  Branch (373:9): [True: 3.88k, False: 540k]
  ------------------
  374|  56.2k|        case NAL_IDR_W_LP    :
  ------------------
  |  Branch (374:9): [True: 34.2k, False: 510k]
  ------------------
  375|   129k|        case NAL_IDR_N_LP    :
  ------------------
  |  Branch (375:9): [True: 73.1k, False: 471k]
  ------------------
  376|   133k|        case NAL_CRA         :
  ------------------
  |  Branch (376:9): [True: 4.08k, False: 540k]
  ------------------
  377|   240k|        case NAL_TRAIL_N     :
  ------------------
  |  Branch (377:9): [True: 106k, False: 437k]
  ------------------
  378|   248k|        case NAL_TRAIL_R     :
  ------------------
  |  Branch (378:9): [True: 8.20k, False: 536k]
  ------------------
  379|   252k|        case NAL_TSA_N       :
  ------------------
  |  Branch (379:9): [True: 4.22k, False: 540k]
  ------------------
  380|   255k|        case NAL_TSA_R       :
  ------------------
  |  Branch (380:9): [True: 3.09k, False: 541k]
  ------------------
  381|   275k|        case NAL_STSA_N      :
  ------------------
  |  Branch (381:9): [True: 19.2k, False: 525k]
  ------------------
  382|   279k|        case NAL_STSA_R      :
  ------------------
  |  Branch (382:9): [True: 4.69k, False: 540k]
  ------------------
  383|   283k|        case NAL_RADL_N      :
  ------------------
  |  Branch (383:9): [True: 3.33k, False: 541k]
  ------------------
  384|   284k|        case NAL_RADL_R      :
  ------------------
  |  Branch (384:9): [True: 1.61k, False: 543k]
  ------------------
  385|   288k|        case NAL_RASL_N      :
  ------------------
  |  Branch (385:9): [True: 3.96k, False: 540k]
  ------------------
  386|   293k|        case NAL_RASL_R      :
  ------------------
  |  Branch (386:9): [True: 5.21k, False: 539k]
  ------------------
  387|   293k|            if(ps_codec->i4_header_mode)
  ------------------
  |  Branch (387:16): [True: 75.9k, False: 217k]
  ------------------
  388|  75.9k|                return IHEVCD_SLICE_IN_HEADER_MODE;
  389|       |
  390|   217k|            if((0 == ps_codec->i4_sps_done) ||
  ------------------
  |  Branch (390:16): [True: 4.25k, False: 213k]
  ------------------
  391|   213k|                            (0 == ps_codec->i4_pps_done))
  ------------------
  |  Branch (391:29): [True: 4.01k, False: 209k]
  ------------------
  392|  8.26k|            {
  393|  8.26k|                return IHEVCD_INVALID_HEADER;
  394|  8.26k|            }
  395|       |
  396|   209k|            ps_codec->i4_header_in_slice_mode = 0;
  397|   209k|            ps_codec->i4_cra_as_first_pic = 0;
  398|       |
  399|   209k|            ret = ihevcd_parse_slice_header(ps_codec, &s_nal);
  400|   209k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  401|   209k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (401:16): [True: 125k, False: 84.2k]
  ------------------
  402|   125k|            {
  403|   125k|                if((s_nal.i1_nal_unit_type != NAL_RASL_N && s_nal.i1_nal_unit_type != NAL_RASL_R) ||
  ------------------
  |  Branch (403:21): [True: 123k, False: 1.47k]
  |  Branch (403:61): [True: 120k, False: 2.98k]
  ------------------
  404|  4.46k|                                ps_codec->i4_rasl_output_flag ||
  ------------------
  |  Branch (404:33): [True: 265, False: 4.19k]
  ------------------
  405|  4.19k|                                ps_codec->i4_slice_error)
  ------------------
  |  Branch (405:33): [True: 644, False: 3.55k]
  ------------------
  406|   121k|                    ret = ihevcd_parse_slice_data(ps_codec);
  407|   125k|            }
  408|   209k|            break;
  409|       |
  410|  2.12k|        case NAL_VPS        :
  ------------------
  |  Branch (410:9): [True: 2.12k, False: 542k]
  ------------------
  411|       |            // ret = ihevcd_parse_vps(ps_codec);
  412|  2.12k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  413|  2.12k|            break;
  414|       |
  415|   119k|        case NAL_SPS        :
  ------------------
  |  Branch (415:9): [True: 119k, False: 425k]
  ------------------
  416|   119k|            if(0 == ps_codec->i4_header_mode)
  ------------------
  |  Branch (416:16): [True: 77.1k, False: 42.2k]
  ------------------
  417|  77.1k|            {
  418|  77.1k|                ps_codec->i4_header_in_slice_mode = 1;
  419|  77.1k|                if(ps_codec->i4_sps_done &&
  ------------------
  |  Branch (419:20): [True: 59.7k, False: 17.3k]
  ------------------
  420|  59.7k|                                ps_codec->i4_pic_present)
  ------------------
  |  Branch (420:33): [True: 11.3k, False: 48.4k]
  ------------------
  421|  11.3k|                    break;
  422|  77.1k|            }
  423|       |
  424|   108k|            ret = ihevcd_parse_sps(ps_codec);
  425|   108k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (425:16): [True: 42.6k, False: 65.4k]
  ------------------
  426|  42.6k|            {
  427|  42.6k|                sps_t *ps_sps = ps_codec->ps_sps_base + MAX_SPS_CNT - 1;
  ------------------
  |  |  327|  42.6k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  428|  42.6k|                ihevcd_copy_sps(ps_codec, ps_sps->i1_sps_id, MAX_SPS_CNT - 1);
  ------------------
  |  |  327|  42.6k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  429|  42.6k|            }
  430|   108k|            ps_codec->i4_error_code = ret;
  431|       |
  432|   108k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  433|   108k|            break;
  434|       |
  435|  86.7k|        case NAL_PPS        :
  ------------------
  |  Branch (435:9): [True: 86.7k, False: 458k]
  ------------------
  436|  86.7k|            if(0 == ps_codec->i4_header_mode)
  ------------------
  |  Branch (436:16): [True: 60.4k, False: 26.2k]
  ------------------
  437|  60.4k|            {
  438|  60.4k|                ps_codec->i4_header_in_slice_mode = 1;
  439|  60.4k|                if(ps_codec->i4_pps_done &&
  ------------------
  |  Branch (439:20): [True: 49.6k, False: 10.8k]
  ------------------
  440|  49.6k|                                ps_codec->i4_pic_present)
  ------------------
  |  Branch (440:33): [True: 5.89k, False: 43.7k]
  ------------------
  441|  5.89k|                    break;
  442|  60.4k|            }
  443|       |
  444|  80.8k|            ret = ihevcd_parse_pps(ps_codec);
  445|  80.8k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (445:16): [True: 62.2k, False: 18.6k]
  ------------------
  446|  62.2k|            {
  447|  62.2k|                pps_t *ps_pps = ps_codec->ps_pps_base + MAX_PPS_CNT - 1;
  ------------------
  |  |  344|  62.2k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  448|  62.2k|                ihevcd_copy_pps(ps_codec, ps_pps->i1_pps_id, MAX_PPS_CNT - 1);
  ------------------
  |  |  344|  62.2k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  449|  62.2k|            }
  450|  80.8k|            ps_codec->i4_error_code = ret;
  451|  80.8k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  452|  80.8k|            break;
  453|       |
  454|      0|#ifndef DISABLE_SEI
  455|  15.7k|        case NAL_PREFIX_SEI:
  ------------------
  |  Branch (455:9): [True: 15.7k, False: 529k]
  ------------------
  456|  19.2k|        case NAL_SUFFIX_SEI:
  ------------------
  |  Branch (456:9): [True: 3.55k, False: 541k]
  ------------------
  457|  19.2k|            if(IVD_DECODE_HEADER == ps_codec->i4_header_mode)
  ------------------
  |  Branch (457:16): [True: 5.97k, False: 13.2k]
  ------------------
  458|  5.97k|            {
  459|  5.97k|                return IHEVCD_SLICE_IN_HEADER_MODE;
  460|  5.97k|            }
  461|       |
  462|  13.2k|            ret = ihevcd_parse_sei(ps_codec, &s_nal);
  463|  13.2k|            break;
  464|       |
  465|      0|#endif
  466|    654|        case NAL_EOS        :
  ------------------
  |  Branch (466:9): [True: 654, False: 544k]
  ------------------
  467|    654|            ps_codec->i4_cra_as_first_pic = 1;
  468|    654|            break;
  469|       |
  470|  22.6k|        default:
  ------------------
  |  Branch (470:9): [True: 22.6k, False: 522k]
  ------------------
  471|  22.6k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  472|  22.6k|            break;
  473|   544k|    }
  474|       |
  475|   454k|    return ret;
  476|   544k|}

ihevcd_parse_pred_wt_ofst:
  161|  17.7k|{
  162|  17.7k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  163|  17.7k|    WORD32 value;
  164|  17.7k|    UWORD32 u4_value;
  165|  17.7k|    WORD32 i;
  166|       |
  167|  17.7k|    WORD32 wp_ofst_half_rng_y;
  168|  17.7k|    WORD32 wp_ofst_half_rng_c;
  169|       |
  170|  17.7k|    pred_wt_ofst_t *ps_wt_ofst = &ps_slice_hdr->s_wt_ofst;
  171|  17.7k|    UNUSED(ps_pps);
  ------------------
  |  |   38|  17.7k|#define UNUSED(x) ((void)(x))
  ------------------
  172|       |
  173|  17.7k|    wp_ofst_half_rng_y = 1 << (ps_sps->i1_use_high_precision_pred_wt ?
  ------------------
  |  Branch (173:32): [True: 529, False: 17.1k]
  ------------------
  174|  17.1k|        (ps_sps->i1_bit_depth_luma_minus8 + 8 - 1) : 7);
  175|  17.7k|    wp_ofst_half_rng_c = 1 << (ps_sps->i1_use_high_precision_pred_wt ?
  ------------------
  |  Branch (175:32): [True: 529, False: 17.1k]
  ------------------
  176|  17.1k|        (ps_sps->i1_bit_depth_chroma_minus8 + 8 - 1) : 7);
  177|       |
  178|  17.7k|    UEV_PARSE("luma_log2_weight_denom", u4_value, ps_bitstrm);
  ------------------
  |  |  155|  17.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  179|  17.7k|    if(u4_value > 7)
  ------------------
  |  Branch (179:8): [True: 4.91k, False: 12.7k]
  ------------------
  180|  4.91k|    {
  181|  4.91k|        return IHEVCD_INVALID_PARAMETER;
  182|  4.91k|    }
  183|  12.7k|    ps_wt_ofst->i1_luma_log2_weight_denom = u4_value;
  184|       |
  185|  12.7k|    if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (185:8): [True: 12.2k, False: 562]
  ------------------
  186|  12.2k|    {
  187|  12.2k|        SEV_PARSE("delta_chroma_log2_weight_denom", value, ps_bitstrm);
  ------------------
  |  |  162|  12.2k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  188|  12.2k|        if((value < -7) || (value > 7))
  ------------------
  |  Branch (188:12): [True: 594, False: 11.6k]
  |  Branch (188:28): [True: 642, False: 10.9k]
  ------------------
  189|  1.23k|        {
  190|  1.23k|            return IHEVCD_INVALID_PARAMETER;
  191|  1.23k|        }
  192|       |
  193|  10.9k|        if(((ps_wt_ofst->i1_luma_log2_weight_denom + value) < 0) ||
  ------------------
  |  Branch (193:12): [True: 1.38k, False: 9.61k]
  ------------------
  194|  9.61k|                ((ps_wt_ofst->i1_luma_log2_weight_denom + value) > 7))
  ------------------
  |  Branch (194:17): [True: 249, False: 9.36k]
  ------------------
  195|  1.63k|        {
  196|  1.63k|            return IHEVCD_INVALID_PARAMETER;
  197|  1.63k|        }
  198|  9.36k|        ps_wt_ofst->i1_chroma_log2_weight_denom = ps_wt_ofst->i1_luma_log2_weight_denom + value;
  199|  9.36k|    }
  200|       |
  201|  33.6k|    for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (201:16): [True: 23.7k, False: 9.92k]
  ------------------
  202|  23.7k|    {
  203|  23.7k|        BITS_PARSE("luma_weight_l0_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  23.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  204|  23.7k|        ps_wt_ofst->i1_luma_weight_l0_flag[i] = value;
  205|  23.7k|    }
  206|       |
  207|       |
  208|       |
  209|  9.92k|    if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (209:8): [True: 9.36k, False: 562]
  ------------------
  210|  9.36k|    {
  211|  32.3k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (211:20): [True: 22.9k, False: 9.36k]
  ------------------
  212|  22.9k|        {
  213|  22.9k|            BITS_PARSE("chroma_weight_l0_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  22.9k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  214|  22.9k|            ps_wt_ofst->i1_chroma_weight_l0_flag[i] = value;
  215|  22.9k|        }
  216|  9.36k|    }
  217|    562|    else
  218|    562|    {
  219|  1.27k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (219:20): [True: 717, False: 562]
  ------------------
  220|    717|        {
  221|    717|            ps_wt_ofst->i1_chroma_weight_l0_flag[i] = 0;
  222|    717|        }
  223|    562|    }
  224|       |
  225|       |
  226|  23.6k|    for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (226:16): [True: 16.9k, False: 6.68k]
  ------------------
  227|  16.9k|    {
  228|  16.9k|        if(ps_wt_ofst->i1_luma_weight_l0_flag[i])
  ------------------
  |  Branch (228:12): [True: 9.30k, False: 7.68k]
  ------------------
  229|  9.30k|        {
  230|  9.30k|            SEV_PARSE("delta_luma_weight_l0[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|  9.30k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  231|  9.30k|            if( value < -128 || value > 127 )
  ------------------
  |  Branch (231:17): [True: 242, False: 9.06k]
  |  Branch (231:33): [True: 401, False: 8.66k]
  ------------------
  232|    643|            {
  233|    643|                return IHEVCD_INVALID_PARAMETER;
  234|    643|            }
  235|       |
  236|  8.66k|            ps_wt_ofst->i2_luma_weight_l0[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom) + value;
  237|       |
  238|  8.66k|            SEV_PARSE("luma_offset_l0[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|  8.66k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  239|  8.66k|            if((value < -wp_ofst_half_rng_y) || (value > (wp_ofst_half_rng_y - 1)))
  ------------------
  |  Branch (239:16): [True: 288, False: 8.37k]
  |  Branch (239:49): [True: 297, False: 8.07k]
  ------------------
  240|    585|            {
  241|    585|                return IHEVCD_INVALID_PARAMETER;
  242|    585|            }
  243|  8.07k|            ps_wt_ofst->i2_luma_offset_l0[i] = value;
  244|       |
  245|  8.07k|        }
  246|  7.68k|        else
  247|  7.68k|        {
  248|  7.68k|            ps_wt_ofst->i2_luma_weight_l0[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom);
  249|  7.68k|            ps_wt_ofst->i2_luma_offset_l0[i] = 0;
  250|  7.68k|        }
  251|  15.7k|        if(ps_wt_ofst->i1_chroma_weight_l0_flag[i])
  ------------------
  |  Branch (251:12): [True: 7.80k, False: 7.95k]
  ------------------
  252|  7.80k|        {
  253|  7.80k|            WORD32 ofst;
  254|  7.80k|            WORD32 shift = wp_ofst_half_rng_c;
  255|  7.80k|            SEV_PARSE("delta_chroma_weight_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  7.80k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  256|  7.80k|            if(value < -128 || value > 127)
  ------------------
  |  Branch (256:16): [True: 227, False: 7.57k]
  |  Branch (256:32): [True: 270, False: 7.30k]
  ------------------
  257|    497|            {
  258|    497|                return IHEVCD_INVALID_PARAMETER;
  259|    497|            }
  260|  7.30k|            ps_wt_ofst->i2_chroma_weight_l0_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;
  261|       |
  262|       |
  263|  7.30k|            SEV_PARSE("delta_chroma_offset_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  7.30k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  264|  7.30k|            if((value < (-4 * wp_ofst_half_rng_c)) || (value > (4 * wp_ofst_half_rng_c - 1)))
  ------------------
  |  Branch (264:16): [True: 221, False: 7.08k]
  |  Branch (264:55): [True: 337, False: 6.74k]
  ------------------
  265|    558|            {
  266|    558|                return IHEVCD_INVALID_PARAMETER;
  267|    558|            }
  268|  6.74k|            ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l0_cb[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  269|  6.74k|            ofst = value - ofst + shift;
  270|       |
  271|  6.74k|            ps_wt_ofst->i2_chroma_offset_l0_cb[i] = CLIP3(ofst, -wp_ofst_half_rng_c, wp_ofst_half_rng_c - 1);
  ------------------
  |  |   40|  6.74k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 849, False: 5.90k]
  |  |  |  Branch (40:53): [True: 1.12k, False: 4.77k]
  |  |  ------------------
  ------------------
  272|       |
  273|  6.74k|            SEV_PARSE("delta_chroma_weight_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  6.74k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  274|  6.74k|            if(value < -128 || value > 127)
  ------------------
  |  Branch (274:16): [True: 277, False: 6.47k]
  |  Branch (274:32): [True: 237, False: 6.23k]
  ------------------
  275|    514|            {
  276|    514|                return IHEVCD_INVALID_PARAMETER;
  277|    514|            }
  278|  6.23k|            ps_wt_ofst->i2_chroma_weight_l0_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;
  279|       |
  280|       |
  281|  6.23k|            SEV_PARSE("delta_chroma_offset_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  6.23k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  282|  6.23k|            if((value < (-4 * wp_ofst_half_rng_c)) || (value > (4 * wp_ofst_half_rng_c - 1)))
  ------------------
  |  Branch (282:16): [True: 205, False: 6.03k]
  |  Branch (282:55): [True: 240, False: 5.79k]
  ------------------
  283|    445|            {
  284|    445|                return IHEVCD_INVALID_PARAMETER;
  285|    445|            }
  286|  5.79k|            ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l0_cr[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  287|  5.79k|            ofst = value - ofst + shift;
  288|       |
  289|  5.79k|            ps_wt_ofst->i2_chroma_offset_l0_cr[i] = CLIP3(ofst, -wp_ofst_half_rng_c, wp_ofst_half_rng_c - 1);
  ------------------
  |  |   40|  5.79k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 634, False: 5.15k]
  |  |  |  Branch (40:53): [True: 1.04k, False: 4.10k]
  |  |  ------------------
  ------------------
  290|       |
  291|  5.79k|        }
  292|  7.95k|        else
  293|  7.95k|        {
  294|  7.95k|            ps_wt_ofst->i2_chroma_weight_l0_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  295|  7.95k|            ps_wt_ofst->i2_chroma_weight_l0_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  296|       |
  297|  7.95k|            ps_wt_ofst->i2_chroma_offset_l0_cb[i] = 0;
  298|  7.95k|            ps_wt_ofst->i2_chroma_offset_l0_cr[i] = 0;
  299|  7.95k|        }
  300|  15.7k|    }
  301|  6.68k|    if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (301:8): [True: 6.17k, False: 511]
  ------------------
  302|  6.17k|    {
  303|  22.3k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (303:20): [True: 16.2k, False: 6.17k]
  ------------------
  304|  16.2k|        {
  305|  16.2k|            BITS_PARSE("luma_weight_l1_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  16.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  306|  16.2k|            ps_wt_ofst->i1_luma_weight_l1_flag[i] = value;
  307|  16.2k|        }
  308|       |
  309|  6.17k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (309:12): [True: 5.66k, False: 511]
  ------------------
  310|  5.66k|        {
  311|  21.2k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (311:24): [True: 15.5k, False: 5.66k]
  ------------------
  312|  15.5k|            {
  313|  15.5k|                BITS_PARSE("chroma_weight_l1_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  15.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  314|  15.5k|                ps_wt_ofst->i1_chroma_weight_l1_flag[i] = value;
  315|  15.5k|            }
  316|  5.66k|        }
  317|    511|        else
  318|    511|        {
  319|  1.13k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (319:24): [True: 626, False: 511]
  ------------------
  320|    626|            {
  321|    626|                ps_wt_ofst->i1_chroma_weight_l1_flag[i] = 0;
  322|    626|            }
  323|    511|        }
  324|       |
  325|  15.4k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (325:20): [True: 12.0k, False: 3.46k]
  ------------------
  326|  12.0k|        {
  327|  12.0k|            if(ps_wt_ofst->i1_luma_weight_l1_flag[i])
  ------------------
  |  Branch (327:16): [True: 7.05k, False: 4.95k]
  ------------------
  328|  7.05k|            {
  329|  7.05k|                SEV_PARSE("delta_luma_weight_l1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|  7.05k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  330|  7.05k|                if( value < -128 || value > 127 )
  ------------------
  |  Branch (330:21): [True: 170, False: 6.88k]
  |  Branch (330:37): [True: 116, False: 6.77k]
  ------------------
  331|    286|                {
  332|    286|                    return IHEVCD_INVALID_PARAMETER;
  333|    286|                }
  334|       |
  335|  6.77k|                ps_wt_ofst->i2_luma_weight_l1[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom) + value;
  336|       |
  337|  6.77k|                SEV_PARSE("luma_offset_l1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|  6.77k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  338|  6.77k|                if((value < -wp_ofst_half_rng_y) || (value > (wp_ofst_half_rng_y - 1)))
  ------------------
  |  Branch (338:20): [True: 193, False: 6.57k]
  |  Branch (338:53): [True: 145, False: 6.43k]
  ------------------
  339|    338|                {
  340|    338|                    return IHEVCD_INVALID_PARAMETER;
  341|    338|                }
  342|  6.43k|                ps_wt_ofst->i2_luma_offset_l1[i] = value;
  343|       |
  344|  6.43k|            }
  345|  4.95k|            else
  346|  4.95k|            {
  347|  4.95k|                ps_wt_ofst->i2_luma_weight_l1[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom);
  348|  4.95k|                ps_wt_ofst->i2_luma_offset_l1[i] = 0;
  349|  4.95k|            }
  350|       |
  351|  11.3k|            if(ps_wt_ofst->i1_chroma_weight_l1_flag[i])
  ------------------
  |  Branch (351:16): [True: 6.67k, False: 4.71k]
  ------------------
  352|  6.67k|            {
  353|  6.67k|                WORD32 ofst;
  354|  6.67k|                WORD32 shift = wp_ofst_half_rng_c;
  355|  6.67k|                SEV_PARSE("delta_chroma_weight_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  6.67k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  356|  6.67k|                if(value < -128 || value > 127)
  ------------------
  |  Branch (356:20): [True: 250, False: 6.42k]
  |  Branch (356:36): [True: 249, False: 6.18k]
  ------------------
  357|    499|                {
  358|    499|                    return IHEVCD_INVALID_PARAMETER;
  359|    499|                }
  360|  6.18k|                ps_wt_ofst->i2_chroma_weight_l1_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;;
  361|       |
  362|       |
  363|  6.18k|                SEV_PARSE("delta_chroma_offset_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  6.18k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  364|  6.18k|                if((value < (-4 * wp_ofst_half_rng_c)) || (value > (4 * wp_ofst_half_rng_c - 1)))
  ------------------
  |  Branch (364:20): [True: 210, False: 5.97k]
  |  Branch (364:59): [True: 419, False: 5.55k]
  ------------------
  365|    629|                {
  366|    629|                    return IHEVCD_INVALID_PARAMETER;
  367|    629|                }
  368|  5.55k|                ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l1_cb[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  369|  5.55k|                ofst = value - ofst + shift;
  370|       |
  371|  5.55k|                ps_wt_ofst->i2_chroma_offset_l1_cb[i] = CLIP3(ofst, -wp_ofst_half_rng_c, wp_ofst_half_rng_c - 1);
  ------------------
  |  |   40|  5.55k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 617, False: 4.93k]
  |  |  |  Branch (40:53): [True: 767, False: 4.16k]
  |  |  ------------------
  ------------------
  372|       |
  373|  5.55k|                SEV_PARSE("delta_chroma_weight_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  5.55k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  374|  5.55k|                if(value < -128 || value > 127)
  ------------------
  |  Branch (374:20): [True: 221, False: 5.33k]
  |  Branch (374:36): [True: 239, False: 5.09k]
  ------------------
  375|    460|                {
  376|    460|                    return IHEVCD_INVALID_PARAMETER;
  377|    460|                }
  378|  5.09k|                ps_wt_ofst->i2_chroma_weight_l1_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;
  379|       |
  380|       |
  381|  5.09k|                SEV_PARSE("delta_chroma_offset_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  5.09k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  382|  5.09k|                if((value < (-4 * wp_ofst_half_rng_c)) || (value > (4 * wp_ofst_half_rng_c - 1)))
  ------------------
  |  Branch (382:20): [True: 213, False: 4.87k]
  |  Branch (382:59): [True: 281, False: 4.59k]
  ------------------
  383|    494|                {
  384|    494|                    return IHEVCD_INVALID_PARAMETER;
  385|    494|                }
  386|  4.59k|                ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l1_cr[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  387|  4.59k|                ofst = value - ofst + shift;
  388|       |
  389|  4.59k|                ps_wt_ofst->i2_chroma_offset_l1_cr[i] = CLIP3(ofst, -wp_ofst_half_rng_c, wp_ofst_half_rng_c - 1);
  ------------------
  |  |   40|  4.59k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 444, False: 4.15k]
  |  |  |  Branch (40:53): [True: 787, False: 3.36k]
  |  |  ------------------
  ------------------
  390|       |
  391|  4.59k|            }
  392|  4.71k|            else
  393|  4.71k|            {
  394|  4.71k|                ps_wt_ofst->i2_chroma_weight_l1_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  395|  4.71k|                ps_wt_ofst->i2_chroma_weight_l1_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  396|       |
  397|  4.71k|                ps_wt_ofst->i2_chroma_offset_l1_cb[i] = 0;
  398|  4.71k|                ps_wt_ofst->i2_chroma_offset_l1_cr[i] = 0;
  399|       |
  400|  4.71k|            }
  401|  11.3k|        }
  402|  6.17k|    }
  403|  3.97k|    return ret;
  404|  6.68k|}
ihevcd_short_term_ref_pic_set:
  439|  68.2k|{
  440|  68.2k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  441|  68.2k|    UWORD32 value;
  442|  68.2k|    stref_picset_t *ps_stref_picset_ref;
  443|  68.2k|    WORD32 delta_idx, delta_rps;
  444|  68.2k|    WORD32 r_idx;
  445|  68.2k|    WORD32 i;
  446|  68.2k|    WORD32 j, k, temp;
  447|  68.2k|    if(idx > 0)
  ------------------
  |  Branch (447:8): [True: 46.0k, False: 22.2k]
  ------------------
  448|  46.0k|    {
  449|  46.0k|        BITS_PARSE("inter_ref_pic_set_prediction_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  46.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  450|  46.0k|        ps_stref_picset->i1_inter_ref_pic_set_prediction_flag = value;
  451|  46.0k|    }
  452|  22.2k|    else
  453|  22.2k|        ps_stref_picset->i1_inter_ref_pic_set_prediction_flag = 0;
  454|       |
  455|  68.2k|    if(ps_stref_picset->i1_inter_ref_pic_set_prediction_flag)
  ------------------
  |  Branch (455:8): [True: 38.2k, False: 29.9k]
  ------------------
  456|  38.2k|    {
  457|  38.2k|        WORD32 delta_rps_sign;
  458|  38.2k|        WORD32 abs_delta_rps;
  459|  38.2k|        WORD32 num_neg_pics = 0;
  460|  38.2k|        WORD32 num_pos_pics = 0;
  461|  38.2k|        WORD32 num_pics = 0;
  462|       |
  463|  38.2k|        if(idx == num_short_term_ref_pic_sets)
  ------------------
  |  Branch (463:12): [True: 3.94k, False: 34.3k]
  ------------------
  464|  3.94k|        {
  465|  3.94k|            UEV_PARSE("delta_idx_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  3.94k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  466|  3.94k|            if(value > num_short_term_ref_pic_sets - 1)
  ------------------
  |  Branch (466:16): [True: 320, False: 3.62k]
  ------------------
  467|    320|            {
  468|    320|                return IHEVCD_INVALID_PARAMETER;
  469|    320|            }
  470|  3.62k|            delta_idx = value + 1;
  471|  3.62k|        }
  472|  34.3k|        else
  473|  34.3k|        {
  474|  34.3k|            delta_idx = 1;
  475|  34.3k|        }
  476|  37.9k|        r_idx = idx - delta_idx;
  477|  37.9k|        r_idx = CLIP3(r_idx, 0, idx - 1);
  ------------------
  |  |   40|  37.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 37.9k]
  |  |  |  Branch (40:53): [True: 0, False: 37.9k]
  |  |  ------------------
  ------------------
  478|       |
  479|  37.9k|        ps_stref_picset_ref = ps_stref_picset_base + r_idx;
  480|       |
  481|  37.9k|        BITS_PARSE("delta_rps_sign", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  37.9k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  482|  37.9k|        delta_rps_sign = value;
  483|       |
  484|  37.9k|        UEV_PARSE("abs_delta_rps_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  37.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  485|  37.9k|        if(value > 32767)
  ------------------
  |  Branch (485:12): [True: 299, False: 37.6k]
  ------------------
  486|    299|        {
  487|    299|            return IHEVCD_INVALID_PARAMETER;
  488|    299|        }
  489|  37.6k|        abs_delta_rps = value + 1;
  490|       |
  491|  37.6k|        delta_rps = (1 - 2 * delta_rps_sign) * (abs_delta_rps);
  492|       |
  493|       |
  494|       |
  495|   231k|        for(i = 0; i <= ps_stref_picset_ref->i1_num_delta_pocs; i++)
  ------------------
  |  Branch (495:20): [True: 193k, False: 37.6k]
  ------------------
  496|   193k|        {
  497|   193k|            WORD32 ref_idc;
  498|       |
  499|       |            /*****************************************************************/
  500|       |            /* ref_idc is parsed as below                                    */
  501|       |            /* bits "1" ref_idc 1                                            */
  502|       |            /* bits "01" ref_idc 2                                           */
  503|       |            /* bits "00" ref_idc 0                                           */
  504|       |            /*****************************************************************/
  505|   193k|            BITS_PARSE("used_by_curr_pic_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   193k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  506|   193k|            ref_idc = value;
  507|   193k|            ps_stref_picset->ai1_used[num_pics] = value;
  508|       |            /* If ref_idc is zero check for next bit */
  509|   193k|            if(0 == ref_idc)
  ------------------
  |  Branch (509:16): [True: 31.4k, False: 162k]
  ------------------
  510|  31.4k|            {
  511|  31.4k|                BITS_PARSE("use_delta_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  31.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  512|  31.4k|                ref_idc = value << 1;
  513|  31.4k|            }
  514|   193k|            if((ref_idc == 1) || (ref_idc == 2))
  ------------------
  |  Branch (514:16): [True: 162k, False: 31.4k]
  |  Branch (514:34): [True: 9.14k, False: 22.2k]
  ------------------
  515|   171k|            {
  516|   171k|                WORD32 delta_poc;
  517|   171k|                delta_poc = delta_rps;
  518|   171k|                delta_poc +=
  519|   171k|                                ((i < ps_stref_picset_ref->i1_num_delta_pocs) ?
  ------------------
  |  Branch (519:34): [True: 141k, False: 29.7k]
  ------------------
  520|   141k|                                ps_stref_picset_ref->ai2_delta_poc[i] :
  521|   171k|                                0);
  522|       |
  523|   171k|                ps_stref_picset->ai2_delta_poc[num_pics] = delta_poc;
  524|       |
  525|   171k|                if(delta_poc < 0)
  ------------------
  |  Branch (525:20): [True: 119k, False: 51.5k]
  ------------------
  526|   119k|                {
  527|   119k|                    num_neg_pics++;
  528|   119k|                }
  529|  51.5k|                else
  530|  51.5k|                {
  531|  51.5k|                    num_pos_pics++;
  532|  51.5k|                }
  533|   171k|                num_pics++;
  534|   171k|            }
  535|   193k|            ps_stref_picset->ai1_ref_idc[i] = ref_idc;
  536|   193k|        }
  537|       |
  538|  37.6k|        num_neg_pics = CLIP3(num_neg_pics, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|  37.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 214, False: 37.4k]
  |  |  |  Branch (40:53): [True: 0, False: 37.4k]
  |  |  ------------------
  ------------------
  539|  37.6k|        num_pos_pics = CLIP3(num_pos_pics, 0, (MAX_DPB_SIZE - 1 - num_neg_pics));
  ------------------
  |  |   40|  37.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 231, False: 37.4k]
  |  |  |  Branch (40:53): [True: 0, False: 37.4k]
  |  |  ------------------
  ------------------
  540|  37.6k|        num_pics = num_neg_pics + num_pos_pics;
  541|       |
  542|  37.6k|        ps_stref_picset->i1_num_ref_idc =
  543|  37.6k|                        ps_stref_picset_ref->i1_num_delta_pocs + 1;
  544|  37.6k|        ps_stref_picset->i1_num_delta_pocs = num_pics;
  545|  37.6k|        ps_stref_picset->i1_num_pos_pics = num_pos_pics;
  546|  37.6k|        ps_stref_picset->i1_num_neg_pics = num_neg_pics;
  547|       |
  548|       |
  549|   171k|        for(j = 1; j < num_pics; j++)
  ------------------
  |  Branch (549:20): [True: 134k, False: 37.6k]
  ------------------
  550|   134k|        {
  551|   134k|            WORD32 delta_poc = ps_stref_picset->ai2_delta_poc[j];
  552|   134k|            WORD8 i1_used = ps_stref_picset->ai1_used[j];
  553|   580k|            for(k = j - 1; k >= 0; k--)
  ------------------
  |  Branch (553:28): [True: 446k, False: 134k]
  ------------------
  554|   446k|            {
  555|   446k|                temp = ps_stref_picset->ai2_delta_poc[k];
  556|   446k|                if(delta_poc < temp)
  ------------------
  |  Branch (556:20): [True: 233k, False: 212k]
  ------------------
  557|   233k|                {
  558|   233k|                    ps_stref_picset->ai2_delta_poc[k + 1] = temp;
  559|   233k|                    ps_stref_picset->ai1_used[k + 1] = ps_stref_picset->ai1_used[k];
  560|   233k|                    ps_stref_picset->ai2_delta_poc[k] = delta_poc;
  561|   233k|                    ps_stref_picset->ai1_used[k] = i1_used;
  562|   233k|                }
  563|   446k|            }
  564|   134k|        }
  565|       |        // flip the negative values to largest first
  566|  89.0k|        for(j = 0, k = num_neg_pics - 1; j < num_neg_pics >> 1; j++, k--)
  ------------------
  |  Branch (566:42): [True: 51.3k, False: 37.6k]
  ------------------
  567|  51.3k|        {
  568|  51.3k|            WORD32 delta_poc = ps_stref_picset->ai2_delta_poc[j];
  569|  51.3k|            WORD8 i1_used = ps_stref_picset->ai1_used[j];
  570|  51.3k|            ps_stref_picset->ai2_delta_poc[j] = ps_stref_picset->ai2_delta_poc[k];
  571|  51.3k|            ps_stref_picset->ai1_used[j] = ps_stref_picset->ai1_used[k];
  572|  51.3k|            ps_stref_picset->ai2_delta_poc[k] = delta_poc;
  573|  51.3k|            ps_stref_picset->ai1_used[k] = i1_used;
  574|  51.3k|        }
  575|       |
  576|  37.6k|    }
  577|  29.9k|    else
  578|  29.9k|    {
  579|  29.9k|        WORD32 prev_poc = 0;
  580|  29.9k|        WORD32 poc;
  581|       |
  582|  29.9k|        UEV_PARSE("num_negative_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  29.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  583|  29.9k|        if(value > MAX_DPB_SIZE - 1)
  ------------------
  |  |  291|  29.9k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (583:12): [True: 1.24k, False: 28.7k]
  ------------------
  584|  1.24k|        {
  585|  1.24k|            return IHEVCD_INVALID_PARAMETER;
  586|  1.24k|        }
  587|  28.7k|        ps_stref_picset->i1_num_neg_pics = value;
  588|       |
  589|  28.7k|        UEV_PARSE("num_positive_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  28.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  590|  28.7k|        if(value > (MAX_DPB_SIZE - 1 - ps_stref_picset->i1_num_neg_pics))
  ------------------
  |  |  291|  28.7k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (590:12): [True: 605, False: 28.1k]
  ------------------
  591|    605|        {
  592|    605|            return IHEVCD_INVALID_PARAMETER;
  593|    605|        }
  594|  28.1k|        ps_stref_picset->i1_num_pos_pics = value;
  595|       |
  596|  28.1k|        ps_stref_picset->i1_num_delta_pocs =
  597|  28.1k|                        ps_stref_picset->i1_num_neg_pics +
  598|  28.1k|                        ps_stref_picset->i1_num_pos_pics;
  599|       |
  600|       |
  601|  61.3k|        for(i = 0; i < ps_stref_picset->i1_num_neg_pics; i++)
  ------------------
  |  Branch (601:20): [True: 33.5k, False: 27.7k]
  ------------------
  602|  33.5k|        {
  603|  33.5k|            UEV_PARSE("delta_poc_s0_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  33.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  604|  33.5k|            if(value > 32767)
  ------------------
  |  Branch (604:16): [True: 362, False: 33.2k]
  ------------------
  605|    362|            {
  606|    362|                return IHEVCD_INVALID_PARAMETER;
  607|    362|            }
  608|  33.2k|            poc = prev_poc - ((WORD32)(value + 1));
  609|  33.2k|            prev_poc = poc;
  610|  33.2k|            ps_stref_picset->ai2_delta_poc[i] = poc;
  611|       |
  612|  33.2k|            BITS_PARSE("used_by_curr_pic_s0_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  33.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  613|  33.2k|            ps_stref_picset->ai1_used[i] = value;
  614|       |
  615|  33.2k|        }
  616|  27.7k|        prev_poc = 0;
  617|  27.7k|        for(i = ps_stref_picset->i1_num_neg_pics;
  618|  63.8k|                        i < ps_stref_picset->i1_num_delta_pocs;
  ------------------
  |  Branch (618:25): [True: 36.4k, False: 27.4k]
  ------------------
  619|  36.0k|                        i++)
  620|  36.4k|        {
  621|  36.4k|            UEV_PARSE("delta_poc_s1_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  36.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  622|  36.4k|            if(value > 32767)
  ------------------
  |  Branch (622:16): [True: 323, False: 36.0k]
  ------------------
  623|    323|            {
  624|    323|                return IHEVCD_INVALID_PARAMETER;
  625|    323|            }
  626|  36.0k|            poc = prev_poc + (value + 1);
  627|  36.0k|            prev_poc = poc;
  628|  36.0k|            ps_stref_picset->ai2_delta_poc[i] = poc;
  629|       |
  630|  36.0k|            BITS_PARSE("used_by_curr_pic_s1_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  36.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  631|  36.0k|            ps_stref_picset->ai1_used[i] = value;
  632|       |
  633|  36.0k|        }
  634|       |
  635|  27.7k|    }
  636|       |
  637|  65.0k|    return ret;
  638|  68.2k|}
ihevcd_scaling_list_data:
 1204|  26.7k|{
 1205|  26.7k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1206|  26.7k|    WORD32 size_id;
 1207|  26.7k|    WORD32 matrix_id;
 1208|  26.7k|    WORD32 value, dc_value = 0;
 1209|  26.7k|    UWORD32 u4_value;
 1210|  26.7k|    WORD32 next_coef;
 1211|  26.7k|    WORD32 coef_num;
 1212|  26.7k|    WORD32 i, j, k, offset;
 1213|  26.7k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1214|  26.7k|    WORD16 *pi2_scaling_mat_offset;
 1215|  26.7k|    WORD32 scaling_mat_offset[] = {0,   16,  32,  48,   64,   80,   96,   160,  224,  288,  352,  416,
 1216|  26.7k|                                   480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136};
 1217|  26.7k|    UWORD8 *scan_table;
 1218|       |
 1219|  40.1k|    for(size_id = 0; size_id < 4; size_id++)
  ------------------
  |  Branch (1219:22): [True: 39.3k, False: 816]
  ------------------
 1220|  39.3k|    {
 1221|   128k|        for(matrix_id = 0; matrix_id < 6; matrix_id += (size_id == 3) ? 3 : 1)
  ------------------
  |  Branch (1221:28): [True: 115k, False: 13.4k]
  |  Branch (1221:56): [True: 1.86k, False: 87.7k]
  ------------------
 1222|   115k|        {
 1223|   115k|            WORD32 scaling_list_pred_mode_flag;
 1224|   115k|            WORD32 scaling_list_delta_coef;
 1225|   115k|            BITS_PARSE("scaling_list_pred_mode_flag", scaling_list_pred_mode_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|   115k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1226|       |
 1227|   115k|            offset = size_id * 6 + matrix_id;
 1228|   115k|            pi2_scaling_mat_offset = pi2_scaling_mat + scaling_mat_offset[offset];
 1229|       |
 1230|   115k|            if(!scaling_list_pred_mode_flag)
  ------------------
  |  Branch (1230:16): [True: 79.4k, False: 36.0k]
  ------------------
 1231|  79.4k|            {
 1232|  79.4k|                WORD32 num_elements;
 1233|  79.4k|                UEV_PARSE("scaling_list_pred_matrix_id_delta", u4_value,
  ------------------
  |  |  155|  79.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1234|  79.4k|                          ps_bitstrm);
 1235|  79.4k|                if(size_id <= 2)
  ------------------
  |  Branch (1235:20): [True: 78.4k, False: 1.00k]
  ------------------
 1236|  78.4k|                {
 1237|  78.4k|                    if(u4_value > matrix_id)
  ------------------
  |  Branch (1237:24): [True: 18.4k, False: 59.9k]
  ------------------
 1238|  18.4k|                        return IHEVCD_INVALID_PARAMETER;
 1239|  78.4k|                }
 1240|  1.00k|                else
 1241|  1.00k|                {
 1242|  1.00k|                    if(u4_value > matrix_id / 3)
  ------------------
  |  Branch (1242:24): [True: 202, False: 804]
  ------------------
 1243|    202|                        return IHEVCD_INVALID_PARAMETER;
 1244|  1.00k|                }
 1245|       |
 1246|  60.7k|                num_elements = (1 << (4 + (size_id << 1)));
 1247|  60.7k|                if(0 != u4_value)
  ------------------
  |  Branch (1247:20): [True: 44.2k, False: 16.5k]
  ------------------
 1248|  44.2k|                {
 1249|  44.2k|                    memmove(pi2_scaling_mat_offset,
 1250|  44.2k|                            pi2_scaling_mat_offset - (u4_value * (size_id == 3 ? 3 : 1)) * num_elements,
  ------------------
  |  Branch (1250:67): [True: 473, False: 43.7k]
  ------------------
 1251|  44.2k|                            num_elements * sizeof(WORD16));
 1252|  44.2k|                }
 1253|  60.7k|            }
 1254|  36.0k|            else
 1255|  36.0k|            {
 1256|  36.0k|                next_coef = 8;
 1257|  36.0k|                coef_num = MIN(64, (1 << (4 + (size_id << 1))));
  ------------------
  |  |   43|  36.0k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 6.31k, False: 29.7k]
  |  |  ------------------
  ------------------
 1258|       |
 1259|  36.0k|                if(size_id > 1)
  ------------------
  |  Branch (1259:20): [True: 6.31k, False: 29.7k]
  ------------------
 1260|  6.31k|                {
 1261|  6.31k|                    SEV_PARSE("scaling_list_dc_coef_minus8", value,
  ------------------
  |  |  162|  6.31k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1262|  6.31k|                              ps_bitstrm);
 1263|  6.31k|                    if(value < -7 || value > 247)
  ------------------
  |  Branch (1263:24): [True: 310, False: 6.00k]
  |  Branch (1263:38): [True: 227, False: 5.77k]
  ------------------
 1264|    537|                    {
 1265|    537|                        return IHEVCD_INVALID_PARAMETER;
 1266|    537|                    }
 1267|  5.77k|                    next_coef = value + 8;
 1268|  5.77k|                    dc_value = next_coef;
 1269|  5.77k|                }
 1270|  35.5k|                if(size_id < 2)
  ------------------
  |  Branch (1270:20): [True: 29.7k, False: 5.77k]
  ------------------
 1271|  29.7k|                {
 1272|  29.7k|                    scan_table = (UWORD8 *)gapv_ihevc_invscan[size_id + 1];
 1273|       |
 1274|   666k|                    for(i = 0; i < coef_num; i++)
  ------------------
  |  Branch (1274:32): [True: 642k, False: 24.6k]
  ------------------
 1275|   642k|                    {
 1276|   642k|                        SEV_PARSE("scaling_list_delta_coef",
  ------------------
  |  |  162|   642k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1277|   642k|                                  scaling_list_delta_coef, ps_bitstrm);
 1278|   642k|                        if((scaling_list_delta_coef < -256) || (scaling_list_delta_coef > 255))
  ------------------
  |  Branch (1278:28): [True: 1.25k, False: 640k]
  |  Branch (1278:64): [True: 3.86k, False: 637k]
  ------------------
 1279|  5.11k|                        {
 1280|  5.11k|                            return IHEVCD_INVALID_PARAMETER;
 1281|  5.11k|                        }
 1282|   637k|                        next_coef = (next_coef + scaling_list_delta_coef + 256)
 1283|   637k|                                        % 256;
 1284|   637k|                        pi2_scaling_mat_offset[scan_table[i]] = next_coef;
 1285|   637k|                    }
 1286|  29.7k|                }
 1287|  5.77k|                else if(size_id == 2)
  ------------------
  |  Branch (1287:25): [True: 4.23k, False: 1.54k]
  ------------------
 1288|  4.23k|                {
 1289|  4.23k|                    scan_table = (UWORD8 *)gapv_ihevc_invscan[2];
 1290|       |
 1291|   222k|                    for(i = 0; i < coef_num; i++)
  ------------------
  |  Branch (1291:32): [True: 219k, False: 3.16k]
  ------------------
 1292|   219k|                    {
 1293|   219k|                        SEV_PARSE("scaling_list_delta_coef",
  ------------------
  |  |  162|   219k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1294|   219k|                                  scaling_list_delta_coef, ps_bitstrm);
 1295|   219k|                        if((scaling_list_delta_coef < -256) || (scaling_list_delta_coef > 255))
  ------------------
  |  Branch (1295:28): [True: 555, False: 218k]
  |  Branch (1295:64): [True: 511, False: 218k]
  ------------------
 1296|  1.06k|                        {
 1297|  1.06k|                            return IHEVCD_INVALID_PARAMETER;
 1298|  1.06k|                        }
 1299|   218k|                        next_coef = (next_coef + scaling_list_delta_coef + 256)
 1300|   218k|                                        % 256;
 1301|       |
 1302|   218k|                        offset = scan_table[i];
 1303|   218k|                        offset = (offset >> 3) * 16 * 2 + (offset & 0x7) * 2;
 1304|   218k|                        pi2_scaling_mat_offset[offset] = next_coef;
 1305|   218k|                        pi2_scaling_mat_offset[offset + 1] = next_coef;
 1306|   218k|                        pi2_scaling_mat_offset[offset + 16] = next_coef;
 1307|   218k|                        pi2_scaling_mat_offset[offset + 16 + 1] = next_coef;
 1308|   218k|                    }
 1309|  3.16k|                    pi2_scaling_mat_offset[0] = dc_value;
 1310|  3.16k|                }
 1311|  1.54k|                else
 1312|  1.54k|                {
 1313|  1.54k|                    scan_table = (UWORD8 *)gapv_ihevc_invscan[2];
 1314|       |
 1315|  76.5k|                    for(i = 0; i < coef_num; i++)
  ------------------
  |  Branch (1315:32): [True: 75.5k, False: 1.05k]
  ------------------
 1316|  75.5k|                    {
 1317|  75.5k|                        SEV_PARSE("scaling_list_delta_coef",
  ------------------
  |  |  162|  75.5k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1318|  75.5k|                                  scaling_list_delta_coef, ps_bitstrm);
 1319|  75.5k|                        if((scaling_list_delta_coef < -256) || (scaling_list_delta_coef > 255))
  ------------------
  |  Branch (1319:28): [True: 226, False: 75.3k]
  |  Branch (1319:64): [True: 258, False: 75.0k]
  ------------------
 1320|    484|                        {
 1321|    484|                            return IHEVCD_INVALID_PARAMETER;
 1322|    484|                        }
 1323|  75.0k|                        next_coef = (next_coef + scaling_list_delta_coef + 256)
 1324|  75.0k|                                        % 256;
 1325|       |
 1326|  75.0k|                        offset = scan_table[i];
 1327|  75.0k|                        offset = (offset >> 3) * 32 * 4 + (offset & 0x7) * 4;
 1328|       |
 1329|   375k|                        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (1329:36): [True: 300k, False: 75.0k]
  ------------------
 1330|   300k|                        {
 1331|   300k|                            pi2_scaling_mat_offset[offset + j * 32] = next_coef;
 1332|   300k|                            pi2_scaling_mat_offset[offset + 1 + j * 32] = next_coef;
 1333|   300k|                            pi2_scaling_mat_offset[offset + 2 + j * 32] = next_coef;
 1334|   300k|                            pi2_scaling_mat_offset[offset + 3 + j * 32] = next_coef;
 1335|   300k|                        }
 1336|  75.0k|                        pi2_scaling_mat_offset[0] = dc_value;
 1337|  75.0k|                    }
 1338|  1.54k|                }
 1339|  35.5k|            }
 1340|   115k|        }
 1341|  39.3k|    }
 1342|       |    // derive 32x32 CbCr scaling list from 16x16 CbCr scaling list
 1343|    816|    if(chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1343:8): [True: 0, False: 816]
  ------------------
 1344|      0|    {
 1345|      0|        WORD32 matrix_ids[] = { 1, 2, 4, 5 };
 1346|      0|        WORD16 *pi2_ref_scaling_mat;
 1347|       |
 1348|      0|        scan_table = (UWORD8 *)gapv_ihevc_invscan[2];
 1349|      0|        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1349:20): [True: 0, False: 0]
  ------------------
 1350|      0|        {
 1351|      0|            matrix_id = matrix_ids[i];
 1352|      0|            pi2_ref_scaling_mat = pi2_scaling_mat + scaling_mat_offset[2 * 6 + matrix_id];
 1353|      0|            pi2_scaling_mat_offset = pi2_scaling_mat + scaling_mat_offset[3 * 6 + matrix_id];
 1354|       |
 1355|      0|            for(j = 0; j < 64; j++)
  ------------------
  |  Branch (1355:24): [True: 0, False: 0]
  ------------------
 1356|      0|            {
 1357|      0|                offset = scan_table[j];
 1358|      0|                offset = (offset >> 3) * 16 * 2 + (offset & 0x7) * 2;
 1359|       |                // the index 0 value may be overwritten by scaling_list_dc_coef. pick its alternative
 1360|      0|                next_coef = offset == 0 ? pi2_ref_scaling_mat[1] : pi2_ref_scaling_mat[offset];
  ------------------
  |  Branch (1360:29): [True: 0, False: 0]
  ------------------
 1361|       |
 1362|      0|                offset = scan_table[j];
 1363|      0|                offset = (offset >> 3) * 32 * 4 + (offset & 0x7) * 4;
 1364|       |
 1365|      0|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1365:28): [True: 0, False: 0]
  ------------------
 1366|      0|                {
 1367|      0|                    pi2_scaling_mat_offset[offset + k * 32] = next_coef;
 1368|      0|                    pi2_scaling_mat_offset[offset + 1 + k * 32] = next_coef;
 1369|      0|                    pi2_scaling_mat_offset[offset + 2 + k * 32] = next_coef;
 1370|      0|                    pi2_scaling_mat_offset[offset + 3 + k * 32] = next_coef;
 1371|      0|                }
 1372|      0|            }
 1373|      0|            pi2_scaling_mat_offset[0] = pi2_ref_scaling_mat[0];
 1374|      0|        }
 1375|      0|    }
 1376|       |
 1377|    816|    return ret;
 1378|  26.7k|}
ihevcd_parse_sps:
 1522|   108k|{
 1523|   108k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1524|   108k|    UWORD32 value;
 1525|       |
 1526|   108k|    WORD32 i;
 1527|   108k|    WORD32 vps_id;
 1528|   108k|    WORD32 sps_max_sub_layers;
 1529|   108k|    WORD32 sps_id;
 1530|   108k|    WORD32 sps_temporal_id_nesting_flag;
 1531|   108k|    WORD32 i4_profile_idc;
 1532|   108k|    sps_t *ps_sps;
 1533|   108k|    profile_tier_lvl_info_t s_ptl = {0};
 1534|   108k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1535|   108k|    WORD32 ctb_log2_size_y = 0;
 1536|       |
 1537|       |
 1538|   108k|    BITS_PARSE("video_parameter_set_id", value, ps_bitstrm, 4);
  ------------------
  |  |  148|   108k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1539|   108k|    if(value > MAX_VPS_CNT - 1)
  ------------------
  |  |  299|   108k|#define MAX_VPS_CNT         16
  ------------------
  |  Branch (1539:8): [True: 0, False: 108k]
  ------------------
 1540|      0|    {
 1541|      0|        return IHEVCD_INVALID_PARAMETER;
 1542|      0|    }
 1543|   108k|    vps_id = value;
 1544|       |
 1545|   108k|    BITS_PARSE("sps_max_sub_layers_minus1", value, ps_bitstrm, 3);
  ------------------
  |  |  148|   108k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1546|   108k|    if(value > SPS_MAX_SUB_LAYERS - 1)
  ------------------
  |  |  330|   108k|#define SPS_MAX_SUB_LAYERS  7
  ------------------
  |  Branch (1546:8): [True: 558, False: 107k]
  ------------------
 1547|    558|    {
 1548|    558|        return IHEVCD_INVALID_PARAMETER;
 1549|    558|    }
 1550|   107k|    sps_max_sub_layers = value + 1;
 1551|       |
 1552|   107k|    BITS_PARSE("sps_temporal_id_nesting_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   107k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1553|   107k|    sps_temporal_id_nesting_flag = value;
 1554|       |
 1555|       |    //profile_and_level( 1, sps_max_sub_layers_minus1 )
 1556|   107k|    ret = ihevcd_profile_tier_level(ps_bitstrm, &(s_ptl), 1,
 1557|   107k|                                    (sps_max_sub_layers - 1));
 1558|   107k|    if ((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1558:9): [True: 0, False: 107k]
  ------------------
 1559|      0|    {
 1560|      0|        ps_codec->s_parse.i4_error_code = ret;
 1561|      0|        return ret;
 1562|      0|    }
 1563|       |
 1564|   107k|    i4_profile_idc = (WORD32)s_ptl.s_ptl_gen.i1_profile_idc;
 1565|       |
 1566|   107k|    UEV_PARSE("seq_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|   107k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1567|   107k|    sps_id = value;
 1568|   107k|    if((sps_id >= MAX_SPS_CNT) || (sps_id < 0))
  ------------------
  |  |  327|   107k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1568:8): [True: 46.5k, False: 60.9k]
  |  Branch (1568:35): [True: 3.60k, False: 57.3k]
  ------------------
 1569|  50.1k|    {
 1570|  50.1k|        if(ps_codec->i4_sps_done)
  ------------------
  |  Branch (1570:12): [True: 22.4k, False: 27.7k]
  ------------------
 1571|  22.4k|            return IHEVCD_UNSUPPORTED_SPS_ID;
 1572|  27.7k|        else
 1573|  27.7k|            sps_id = 0;
 1574|  50.1k|    }
 1575|       |
 1576|       |
 1577|  85.1k|    ps_sps = (ps_codec->s_parse.ps_sps_base + MAX_SPS_CNT - 1);
  ------------------
  |  |  327|  85.1k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
 1578|       |    /* Reset SPS to zero */
 1579|  85.1k|    {
 1580|  85.1k|        WORD16 *pi2_scaling_mat = ps_sps->pi2_scaling_mat;
 1581|  85.1k|        memset(ps_sps, 0, sizeof(sps_t));
 1582|  85.1k|        ps_sps->pi2_scaling_mat = pi2_scaling_mat;
 1583|  85.1k|    }
 1584|  85.1k|    ps_sps->i1_sps_id = sps_id;
 1585|  85.1k|    ps_sps->i1_vps_id = vps_id;
 1586|  85.1k|    ps_sps->i1_sps_max_sub_layers = sps_max_sub_layers;
 1587|  85.1k|    ps_sps->i1_sps_temporal_id_nesting_flag = sps_temporal_id_nesting_flag;
 1588|       |
 1589|  85.1k|    memcpy(&ps_sps->s_ptl, &s_ptl, sizeof(profile_tier_lvl_info_t));
 1590|       |
 1591|  85.1k|    UEV_PARSE("chroma_format_idc", value, ps_bitstrm);
  ------------------
  |  |  155|  85.1k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1592|  85.1k|    if(value > 3)
  ------------------
  |  Branch (1592:8): [True: 6.27k, False: 78.8k]
  ------------------
 1593|  6.27k|    {
 1594|  6.27k|        return IHEVCD_INVALID_PARAMETER;
 1595|  6.27k|    }
 1596|       |
 1597|  78.8k|    WORD32 profile = ihevcd_get_profile(&ps_sps->s_ptl.s_ptl_gen);
 1598|  78.8k|    if(profile == IHEVC_PROFILE_UNKNOWN)
  ------------------
  |  Branch (1598:8): [True: 3.41k, False: 75.4k]
  ------------------
 1599|  3.41k|    {
 1600|  3.41k|        return IHEVCD_UNSUPPORTED_TOOL_SET;
 1601|  3.41k|    }
 1602|       |
 1603|  75.4k|    switch(value) {
 1604|  5.87k|        case CHROMA_FMT_IDC_MONOCHROME: {
  ------------------
  |  Branch (1604:9): [True: 5.87k, False: 69.5k]
  ------------------
 1605|  5.87k|                if (!(ps_codec->u4_enable_yuv_formats & (1 << CHROMA_FMT_IDC_MONOCHROME))) {
  ------------------
  |  Branch (1605:21): [True: 0, False: 5.87k]
  ------------------
 1606|      0|                    ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1607|      0|                    return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1608|      0|                }
 1609|  5.87k|                if(profile != IHEVC_PROFILE_MAIN_REXT)
  ------------------
  |  Branch (1609:20): [True: 3.10k, False: 2.77k]
  ------------------
 1610|  3.10k|                    return IHEVCD_INVALID_PARAMETER;
 1611|  5.87k|            }
 1612|  2.77k|            break;
 1613|  63.0k|        case CHROMA_FMT_IDC_YUV420:
  ------------------
  |  Branch (1613:9): [True: 63.0k, False: 12.4k]
  ------------------
 1614|  63.0k|            break;
 1615|    934|        case CHROMA_FMT_IDC_YUV444: {
  ------------------
  |  Branch (1615:9): [True: 934, False: 74.4k]
  ------------------
 1616|    934|                if (!(ps_codec->u4_enable_yuv_formats & (1 << CHROMA_FMT_IDC_YUV444))) {
  ------------------
  |  Branch (1616:21): [True: 0, False: 934]
  ------------------
 1617|      0|                    ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1618|      0|                    return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1619|      0|                }
 1620|    934|                if(profile != IHEVC_PROFILE_MAIN_REXT)
  ------------------
  |  Branch (1620:20): [True: 644, False: 290]
  ------------------
 1621|    644|                    return IHEVCD_INVALID_PARAMETER;
 1622|    934|            }
 1623|    290|            break;
 1624|  5.60k|        case CHROMA_FMT_IDC_YUV422: {
  ------------------
  |  Branch (1624:9): [True: 5.60k, False: 69.8k]
  ------------------
 1625|  5.60k|                if (!(ps_codec->u4_enable_yuv_formats & (1 << CHROMA_FMT_IDC_YUV422))) {
  ------------------
  |  Branch (1625:21): [True: 0, False: 5.60k]
  ------------------
 1626|      0|                    ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1627|      0|                    return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1628|      0|                }
 1629|  5.60k|                if(profile != IHEVC_PROFILE_MAIN_REXT)
  ------------------
  |  Branch (1629:20): [True: 626, False: 4.97k]
  ------------------
 1630|    626|                    return IHEVCD_INVALID_PARAMETER;
 1631|  5.60k|            }
 1632|  4.97k|            break;
 1633|  4.97k|        default: {
  ------------------
  |  Branch (1633:9): [True: 0, False: 75.4k]
  ------------------
 1634|      0|                ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1635|      0|                return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1636|  5.60k|            }
 1637|      0|            break;
 1638|  75.4k|    }
 1639|  71.0k|    ps_sps->i1_chroma_format_idc = value;
 1640|       |
 1641|  71.0k|    if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1641:8): [True: 290, False: 70.7k]
  ------------------
 1642|    290|    {
 1643|    290|        BITS_PARSE("separate_colour_plane_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    290|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1644|    290|        ps_sps->i1_separate_colour_plane_flag = value;
 1645|    290|    }
 1646|  70.7k|    else
 1647|  70.7k|    {
 1648|  70.7k|        ps_sps->i1_separate_colour_plane_flag = 0;
 1649|  70.7k|    }
 1650|       |
 1651|  71.0k|    UEV_PARSE("pic_width_in_luma_samples", value, ps_bitstrm);
  ------------------
  |  |  155|  71.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1652|  71.0k|    if(value > INT16_MAX)
  ------------------
  |  Branch (1652:8): [True: 295, False: 70.7k]
  ------------------
 1653|    295|    {
 1654|    295|        return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1655|    295|    }
 1656|  70.7k|    ps_sps->i2_pic_width_in_luma_samples = value;
 1657|       |
 1658|  70.7k|    UEV_PARSE("pic_height_in_luma_samples", value, ps_bitstrm);
  ------------------
  |  |  155|  70.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1659|  70.7k|    if(value > INT16_MAX)
  ------------------
  |  Branch (1659:8): [True: 725, False: 70.0k]
  ------------------
 1660|    725|    {
 1661|    725|        return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1662|    725|    }
 1663|  70.0k|    ps_sps->i2_pic_height_in_luma_samples = value;
 1664|       |
 1665|  70.0k|    if((0 >= ps_sps->i2_pic_width_in_luma_samples) || (0 >= ps_sps->i2_pic_height_in_luma_samples))
  ------------------
  |  Branch (1665:8): [True: 877, False: 69.1k]
  |  Branch (1665:55): [True: 954, False: 68.2k]
  ------------------
 1666|  1.83k|        return IHEVCD_INVALID_PARAMETER;
 1667|       |
 1668|  68.2k|    BITS_PARSE("pic_cropping_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  68.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1669|  68.2k|    ps_sps->i1_pic_cropping_flag = value;
 1670|       |
 1671|  68.2k|    if(ps_sps->i1_pic_cropping_flag)
  ------------------
  |  Branch (1671:8): [True: 44.0k, False: 24.1k]
  ------------------
 1672|  44.0k|    {
 1673|       |
 1674|  44.0k|        UEV_PARSE("pic_crop_left_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  44.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1675|  44.0k|        if (value >= ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1675:13): [True: 289, False: 43.7k]
  ------------------
 1676|    289|        {
 1677|    289|            return IHEVCD_INVALID_PARAMETER;
 1678|    289|        }
 1679|  43.7k|        ps_sps->i2_pic_crop_left_offset = value;
 1680|       |
 1681|  43.7k|        UEV_PARSE("pic_crop_right_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  43.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1682|  43.7k|        if (value >= ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1682:13): [True: 296, False: 43.4k]
  ------------------
 1683|    296|        {
 1684|    296|            return IHEVCD_INVALID_PARAMETER;
 1685|    296|        }
 1686|  43.4k|        ps_sps->i2_pic_crop_right_offset = value;
 1687|       |
 1688|  43.4k|        UEV_PARSE("pic_crop_top_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  43.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1689|  43.4k|        if (value >= ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1689:13): [True: 308, False: 43.1k]
  ------------------
 1690|    308|        {
 1691|    308|            return IHEVCD_INVALID_PARAMETER;
 1692|    308|        }
 1693|  43.1k|        ps_sps->i2_pic_crop_top_offset = value;
 1694|       |
 1695|  43.1k|        UEV_PARSE("pic_crop_bottom_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  43.1k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1696|  43.1k|        if (value >= ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1696:13): [True: 276, False: 42.9k]
  ------------------
 1697|    276|        {
 1698|    276|            return IHEVCD_INVALID_PARAMETER;
 1699|    276|        }
 1700|  42.9k|        ps_sps->i2_pic_crop_bottom_offset = value;
 1701|  42.9k|    }
 1702|  24.1k|    else
 1703|  24.1k|    {
 1704|  24.1k|        ps_sps->i2_pic_crop_left_offset = 0;
 1705|  24.1k|        ps_sps->i2_pic_crop_right_offset = 0;
 1706|  24.1k|        ps_sps->i2_pic_crop_top_offset = 0;
 1707|  24.1k|        ps_sps->i2_pic_crop_bottom_offset = 0;
 1708|  24.1k|    }
 1709|       |
 1710|       |
 1711|  67.0k|    UEV_PARSE("bit_depth_luma_minus8", value, ps_bitstrm);
  ------------------
  |  |  155|  67.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1712|  67.0k|    if ((0 == ps_codec->u4_enable_hbd) && (0 != value))
  ------------------
  |  Branch (1712:9): [True: 0, False: 67.0k]
  |  Branch (1712:43): [True: 0, False: 0]
  ------------------
 1713|      0|    {
 1714|      0|        ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1715|      0|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1716|      0|    }
 1717|       |    // Limit the support to 8-bit and 10-bit
 1718|  67.0k|    if ((0 != value) && (2 != value))
  ------------------
  |  Branch (1718:9): [True: 7.82k, False: 59.2k]
  |  Branch (1718:25): [True: 904, False: 6.91k]
  ------------------
 1719|    904|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1720|       |
 1721|  66.1k|    if (((1 == i4_profile_idc) && (0 != value)) ||
  ------------------
  |  Branch (1721:10): [True: 4.80k, False: 61.3k]
  |  Branch (1721:35): [True: 200, False: 4.60k]
  ------------------
 1722|  65.9k|        ((2 == i4_profile_idc) && (2 < value)) ||
  ------------------
  |  Branch (1722:10): [True: 1.96k, False: 63.9k]
  |  Branch (1722:35): [True: 0, False: 1.96k]
  ------------------
 1723|  65.9k|        ((4 == i4_profile_idc) && (4 < value)))
  ------------------
  |  Branch (1723:10): [True: 1.57k, False: 64.3k]
  |  Branch (1723:35): [True: 0, False: 1.57k]
  ------------------
 1724|    200|    {
 1725|    200|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1726|    200|    }
 1727|  65.9k|    ps_sps->i1_bit_depth_luma_minus8 = value;
 1728|       |
 1729|  65.9k|    UEV_PARSE("bit_depth_chroma_minus8", value, ps_bitstrm);
  ------------------
  |  |  155|  65.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1730|  65.9k|    if ((0 == ps_codec->u4_enable_hbd) && (0 != value))
  ------------------
  |  Branch (1730:9): [True: 0, False: 65.9k]
  |  Branch (1730:43): [True: 0, False: 0]
  ------------------
 1731|      0|    {
 1732|      0|        ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1733|      0|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1734|      0|    }
 1735|       |    // Limit the support to 8-bit and 10-bit
 1736|  65.9k|    if ((0 != value) && (2 != value))
  ------------------
  |  Branch (1736:9): [True: 7.35k, False: 58.5k]
  |  Branch (1736:25): [True: 393, False: 6.96k]
  ------------------
 1737|    393|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1738|       |
 1739|  65.5k|    if (((1 == i4_profile_idc) && (0 != value)) ||
  ------------------
  |  Branch (1739:10): [True: 4.59k, False: 60.9k]
  |  Branch (1739:35): [True: 199, False: 4.39k]
  ------------------
 1740|  65.3k|        ((2 == i4_profile_idc) && (2 < value)) ||
  ------------------
  |  Branch (1740:10): [True: 1.95k, False: 63.3k]
  |  Branch (1740:35): [True: 0, False: 1.95k]
  ------------------
 1741|  65.3k|        ((4 == i4_profile_idc) && (4 < value)))
  ------------------
  |  Branch (1741:10): [True: 1.55k, False: 63.7k]
  |  Branch (1741:35): [True: 0, False: 1.55k]
  ------------------
 1742|    199|    {
 1743|    199|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1744|    199|    }
 1745|  65.3k|    ps_sps->i1_bit_depth_chroma_minus8 = value;
 1746|       |
 1747|  65.3k|    if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1747:8): [True: 63.5k, False: 1.76k]
  ------------------
 1748|  63.5k|    {
 1749|  63.5k|        if (ps_sps->i1_bit_depth_luma_minus8 != ps_sps->i1_bit_depth_chroma_minus8)
  ------------------
  |  Branch (1749:13): [True: 404, False: 63.1k]
  ------------------
 1750|    404|            return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1751|  63.5k|    }
 1752|       |
 1753|  64.9k|    UEV_PARSE("log2_max_pic_order_cnt_lsb_minus4", value, ps_bitstrm);
  ------------------
  |  |  155|  64.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1754|  64.9k|    if(value > 12)
  ------------------
  |  Branch (1754:8): [True: 263, False: 64.6k]
  ------------------
 1755|    263|        return IHEVCD_INVALID_PARAMETER;
 1756|  64.6k|    ps_sps->i1_log2_max_pic_order_cnt_lsb = value + 4;
 1757|       |
 1758|  64.6k|    BITS_PARSE("sps_sub_layer_ordering_info_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  64.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1759|       |
 1760|  64.6k|    ps_sps->i1_sps_sub_layer_ordering_info_present_flag = value;
 1761|       |
 1762|       |
 1763|  64.6k|    i = (ps_sps->i1_sps_sub_layer_ordering_info_present_flag ? 0 : (ps_sps->i1_sps_max_sub_layers - 1));
  ------------------
  |  Branch (1763:10): [True: 35.9k, False: 28.7k]
  ------------------
 1764|   170k|    for(; i < ps_sps->i1_sps_max_sub_layers; i++)
  ------------------
  |  Branch (1764:11): [True: 106k, False: 63.5k]
  ------------------
 1765|   106k|    {
 1766|   106k|        UEV_PARSE("max_dec_pic_buffering", value, ps_bitstrm);
  ------------------
  |  |  155|   106k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1767|   106k|        if(value > (MAX_DPB_SIZE - 1))
  ------------------
  |  |  291|   106k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1767:12): [True: 302, False: 106k]
  ------------------
 1768|    302|        {
 1769|    302|            return IHEVCD_INVALID_PARAMETER;
 1770|    302|        }
 1771|   106k|        ps_sps->ai1_sps_max_dec_pic_buffering[i] = value + 1;
 1772|       |
 1773|   106k|        UEV_PARSE("num_reorder_pics", value, ps_bitstrm);
  ------------------
  |  |  155|   106k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1774|   106k|        if(value >= ps_sps->ai1_sps_max_dec_pic_buffering[i])
  ------------------
  |  Branch (1774:12): [True: 657, False: 105k]
  ------------------
 1775|    657|        {
 1776|    657|            return IHEVCD_INVALID_PARAMETER;
 1777|    657|        }
 1778|   105k|        ps_sps->ai1_sps_max_num_reorder_pics[i] = value;
 1779|       |
 1780|   105k|        UEV_PARSE("max_latency_increase", value, ps_bitstrm);
  ------------------
  |  |  155|   105k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1781|   105k|        if(value > UINT_MAX - 2)
  ------------------
  |  Branch (1781:12): [True: 194, False: 105k]
  ------------------
 1782|    194|        {
 1783|    194|            return IHEVCD_INVALID_PARAMETER;
 1784|    194|        }
 1785|   105k|        ps_sps->ai1_sps_max_latency_increase[i] = value;
 1786|   105k|    }
 1787|       |
 1788|       |    /* Check if sps_max_dec_pic_buffering or sps_max_num_reorder_pics
 1789|       |       has changed */
 1790|  63.5k|    if(0 != ps_codec->u4_allocate_dynamic_done)
  ------------------
  |  Branch (1790:8): [True: 22.4k, False: 41.0k]
  ------------------
 1791|  22.4k|    {
 1792|  22.4k|        sps_t *ps_sps_old = ps_codec->s_parse.ps_sps;
 1793|  22.4k|        if(ps_sps_old->ai1_sps_max_dec_pic_buffering[ps_sps_old->i1_sps_max_sub_layers - 1] !=
  ------------------
  |  Branch (1793:12): [True: 759, False: 21.6k]
  ------------------
 1794|  22.4k|                    ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1])
 1795|    759|        {
 1796|    759|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1796:16): [True: 244, False: 515]
  ------------------
 1797|    244|            {
 1798|    244|                return IHEVCD_INVALID_PARAMETER;
 1799|    244|            }
 1800|    515|            ps_codec->i4_reset_flag = 1;
 1801|    515|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1802|    759|        }
 1803|       |
 1804|  21.6k|        if(ps_sps_old->ai1_sps_max_num_reorder_pics[ps_sps_old->i1_sps_max_sub_layers - 1] !=
  ------------------
  |  Branch (1804:12): [True: 223, False: 21.4k]
  ------------------
 1805|  21.6k|                    ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1])
 1806|    223|        {
 1807|    223|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1807:16): [True: 84, False: 139]
  ------------------
 1808|     84|            {
 1809|     84|                return IHEVCD_INVALID_PARAMETER;
 1810|     84|            }
 1811|    139|            ps_codec->i4_reset_flag = 1;
 1812|    139|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1813|    223|        }
 1814|  21.6k|    }
 1815|       |
 1816|  62.5k|    UEV_PARSE("log2_min_coding_block_size_minus3", value, ps_bitstrm);
  ------------------
  |  |  155|  62.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1817|  62.5k|    if(value > (LOG2_MAX_CU_SIZE - 3))
  ------------------
  |  |  374|  62.5k|#define LOG2_MAX_CU_SIZE    6
  ------------------
  |  Branch (1817:8): [True: 547, False: 61.9k]
  ------------------
 1818|    547|    {
 1819|    547|        return IHEVCD_INVALID_PARAMETER;
 1820|    547|    }
 1821|  61.9k|    ps_sps->i1_log2_min_coding_block_size = value + 3;
 1822|  61.9k|    if((ps_sps->i2_pic_width_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0) ||
  ------------------
  |  Branch (1822:8): [True: 476, False: 61.5k]
  ------------------
 1823|  61.5k|                    (ps_sps->i2_pic_height_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0))
  ------------------
  |  Branch (1823:21): [True: 221, False: 61.2k]
  ------------------
 1824|    697|    {
 1825|    697|        return IHEVCD_INVALID_PARAMETER;
 1826|    697|    }
 1827|       |
 1828|  61.2k|    UEV_PARSE("log2_diff_max_min_coding_block_size", value, ps_bitstrm);
  ------------------
  |  |  155|  61.2k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1829|  61.2k|    if(value > (LOG2_MAX_CU_SIZE - ps_sps->i1_log2_min_coding_block_size))
  ------------------
  |  |  374|  61.2k|#define LOG2_MAX_CU_SIZE    6
  ------------------
  |  Branch (1829:8): [True: 340, False: 60.9k]
  ------------------
 1830|    340|    {
 1831|    340|        return IHEVCD_INVALID_PARAMETER;
 1832|    340|    }
 1833|  60.9k|    ps_sps->i1_log2_diff_max_min_coding_block_size = value;
 1834|       |
 1835|  60.9k|    ctb_log2_size_y = ps_sps->i1_log2_min_coding_block_size + ps_sps->i1_log2_diff_max_min_coding_block_size;
 1836|       |
 1837|  60.9k|    if((ctb_log2_size_y < LOG2_MIN_CTB_SIZE) || (ctb_log2_size_y > LOG2_MAX_CTB_SIZE))
  ------------------
  |  |  354|  60.9k|#define LOG2_MIN_CTB_SIZE   4
  ------------------
                  if((ctb_log2_size_y < LOG2_MIN_CTB_SIZE) || (ctb_log2_size_y > LOG2_MAX_CTB_SIZE))
  ------------------
  |  |  353|  60.7k|#define LOG2_MAX_CTB_SIZE   6
  ------------------
  |  Branch (1837:8): [True: 240, False: 60.7k]
  |  Branch (1837:49): [True: 0, False: 60.7k]
  ------------------
 1838|    240|    {
 1839|    240|        return IHEVCD_INVALID_PARAMETER;
 1840|    240|    }
 1841|       |    /* Check if CTB size is different in case of multiple SPS with same ID */
 1842|  60.7k|    {
 1843|  60.7k|        sps_t *ps_sps_old = (ps_codec->s_parse.ps_sps_base + sps_id);
 1844|  60.7k|        if(ps_sps_old->i1_sps_valid && ps_sps_old->i1_log2_ctb_size != ctb_log2_size_y)
  ------------------
  |  Branch (1844:12): [True: 20.4k, False: 40.3k]
  |  Branch (1844:40): [True: 194, False: 20.2k]
  ------------------
 1845|    194|        {
 1846|    194|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1846:16): [True: 77, False: 117]
  ------------------
 1847|     77|            {
 1848|     77|                return IHEVCD_INVALID_PARAMETER;
 1849|     77|            }
 1850|    117|            ps_codec->i4_reset_flag = 1;
 1851|    117|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1852|    194|        }
 1853|  60.7k|    }
 1854|  60.5k|    ps_sps->i1_log2_ctb_size = ctb_log2_size_y;
 1855|       |
 1856|  60.5k|    UEV_PARSE("log2_min_transform_block_size_minus2", value, ps_bitstrm);
  ------------------
  |  |  155|  60.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1857|  60.5k|    if(value > (LOG2_MAX_TU_SIZE - 2))
  ------------------
  |  |  359|  60.5k|#define LOG2_MAX_TU_SIZE    5
  ------------------
  |  Branch (1857:8): [True: 614, False: 59.9k]
  ------------------
 1858|    614|    {
 1859|    614|        return IHEVCD_INVALID_PARAMETER;
 1860|    614|    }
 1861|  59.9k|    ps_sps->i1_log2_min_transform_block_size = value + 2;
 1862|  59.9k|    if(ps_sps->i1_log2_min_transform_block_size >= ps_sps->i1_log2_min_coding_block_size)
  ------------------
  |  Branch (1862:8): [True: 204, False: 59.7k]
  ------------------
 1863|    204|    {
 1864|    204|        return IHEVCD_INVALID_PARAMETER;
 1865|    204|    }
 1866|       |
 1867|  59.7k|    UEV_PARSE("log2_diff_max_min_transform_block_size", value, ps_bitstrm);
  ------------------
  |  |  155|  59.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1868|  59.7k|    if(value > (LOG2_MAX_TU_SIZE - ps_sps->i1_log2_min_transform_block_size))
  ------------------
  |  |  359|  59.7k|#define LOG2_MAX_TU_SIZE    5
  ------------------
  |  Branch (1868:8): [True: 271, False: 59.4k]
  ------------------
 1869|    271|    {
 1870|    271|        return IHEVCD_INVALID_PARAMETER;
 1871|    271|    }
 1872|  59.4k|    ps_sps->i1_log2_diff_max_min_transform_block_size = value;
 1873|       |
 1874|  59.4k|    ps_sps->i1_log2_max_transform_block_size = ps_sps->i1_log2_min_transform_block_size +
 1875|  59.4k|                    ps_sps->i1_log2_diff_max_min_transform_block_size;
 1876|       |
 1877|  59.4k|    if(ps_sps->i1_log2_max_transform_block_size > ps_sps->i1_log2_ctb_size)
  ------------------
  |  Branch (1877:8): [True: 196, False: 59.2k]
  ------------------
 1878|    196|    {
 1879|    196|        return IHEVCD_INVALID_PARAMETER;
 1880|    196|    }
 1881|       |
 1882|  59.2k|    ps_sps->i1_log2_min_pcm_coding_block_size = 0;
 1883|  59.2k|    ps_sps->i1_log2_diff_max_min_pcm_coding_block_size = 0;
 1884|       |
 1885|  59.2k|    UEV_PARSE("max_transform_hierarchy_depth_inter", value, ps_bitstrm);
  ------------------
  |  |  155|  59.2k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1886|  59.2k|    if(value > (ps_sps->i1_log2_ctb_size - ps_sps->i1_log2_min_transform_block_size))
  ------------------
  |  Branch (1886:8): [True: 231, False: 59.0k]
  ------------------
 1887|    231|    {
 1888|    231|        return IHEVCD_INVALID_PARAMETER;
 1889|    231|    }
 1890|  59.0k|    ps_sps->i1_max_transform_hierarchy_depth_inter = value;
 1891|       |
 1892|  59.0k|    UEV_PARSE("max_transform_hierarchy_depth_intra", value, ps_bitstrm);
  ------------------
  |  |  155|  59.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1893|  59.0k|    if(value > (ps_sps->i1_log2_ctb_size - ps_sps->i1_log2_min_transform_block_size))
  ------------------
  |  Branch (1893:8): [True: 307, False: 58.6k]
  ------------------
 1894|    307|    {
 1895|    307|        return IHEVCD_INVALID_PARAMETER;
 1896|    307|    }
 1897|  58.6k|    ps_sps->i1_max_transform_hierarchy_depth_intra = value;
 1898|       |
 1899|       |    /* String has a d (enabled) in order to match with HM */
 1900|  58.6k|    BITS_PARSE("scaling_list_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  58.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1901|  58.6k|    ps_sps->i1_scaling_list_enable_flag = value;
 1902|       |
 1903|  58.6k|    if(ps_sps->i1_scaling_list_enable_flag)
  ------------------
  |  Branch (1903:8): [True: 32.5k, False: 26.1k]
  ------------------
 1904|  32.5k|    {
 1905|  32.5k|        COPY_DEFAULT_SCALING_LIST(ps_sps->pi2_scaling_mat);
  ------------------
  |  |   77|  32.5k|#define COPY_DEFAULT_SCALING_LIST(pi2_scaling_mat)                                                                                      \
  |  |   78|  32.5k|{                                                                                                                                       \
  |  |   79|  32.5k|    WORD32 scaling_mat_offset[] = {0,   16,  32,  48,   64,   80,   96,   160,  224,  288,  352,  416,                                  \
  |  |   80|  32.5k|                                   480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136};                                \
  |  |   81|  32.5k|                                                                                                                                        \
  |  |   82|  32.5k|    /* scaling matrix for 4x4 */                                                                                                        \
  |  |   83|  32.5k|    memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16));                                                             \
  |  |   84|  32.5k|    /* scaling matrix for 8x8 */                                                                                                        \
  |  |   85|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   86|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[7], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   87|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[8], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   88|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[9], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   89|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[10], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   90|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[11], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   91|  32.5k|    /* scaling matrix for 16x16 */                                                                                                      \
  |  |   92|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   93|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[13], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   94|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[14], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   95|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   96|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[16], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   97|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[17], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   98|  32.5k|    /* scaling matrix for 32x32 */                                                                                                      \
  |  |   99|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  100|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  101|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[20], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  102|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[21], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  103|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[22], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  104|  32.5k|    memcpy(pi2_scaling_mat + scaling_mat_offset[23], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  105|  32.5k|}
  ------------------
 1906|  32.5k|        BITS_PARSE("sps_scaling_list_data_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  32.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1907|  32.5k|        ps_sps->i1_sps_scaling_list_data_present_flag = value;
 1908|       |
 1909|  32.5k|        if(ps_sps->i1_sps_scaling_list_data_present_flag)
  ------------------
  |  Branch (1909:12): [True: 9.28k, False: 23.2k]
  ------------------
 1910|  9.28k|            ihevcd_scaling_list_data(ps_codec, ps_sps->pi2_scaling_mat, ps_sps->i1_chroma_format_idc);
 1911|  32.5k|    }
 1912|  26.1k|    else
 1913|  26.1k|    {
 1914|  26.1k|        COPY_FLAT_SCALING_LIST(ps_sps->pi2_scaling_mat);
  ------------------
  |  |  107|  26.1k|#define COPY_FLAT_SCALING_LIST(pi2_scaling_mat)                                                                                         \
  |  |  108|  26.1k|{                                                                                                                                       \
  |  |  109|  26.1k|    WORD32 scaling_mat_offset[] = {0,   16,  32,  48,   64,   80,   96,   160,  224,  288,  352,  416,                                  \
  |  |  110|  26.1k|                                   480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136};                                \
  |  |  111|  26.1k|                                                                                                                                        \
  |  |  112|  26.1k|    /* scaling matrix for 4x4 */                                                                                                        \
  |  |  113|  26.1k|    memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16));                                                             \
  |  |  114|  26.1k|    /* scaling matrix for 8x8 */                                                                                                        \
  |  |  115|  26.1k|    memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_flat_scale_mat_32x32, 6*64*sizeof(WORD16));                                     \
  |  |  116|  26.1k|    /* scaling matrix for 16x16 */                                                                                                      \
  |  |  117|  26.1k|    memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_flat_scale_mat_32x32, 3*256*sizeof(WORD16));                                   \
  |  |  118|  26.1k|    memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_flat_scale_mat_32x32, 3*256*sizeof(WORD16));                                   \
  |  |  119|  26.1k|    /* scaling matrix for 32x32 */                                                                                                      \
  |  |  120|   182k|    for (WORD32 i = 0; i < 6; i++)                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (120:24): [True: 156k, False: 26.1k]
  |  |  ------------------
  |  |  121|   156k|    {                                                                                                                                   \
  |  |  122|   156k|        memcpy(pi2_scaling_mat + scaling_mat_offset[18 + i], gi2_flat_scale_mat_32x32, 1024*sizeof(WORD16));                            \
  |  |  123|   156k|    }                                                                                                                                   \
  |  |  124|  26.1k|}
  ------------------
 1915|  26.1k|    }
 1916|       |    /* String is asymmetric_motion_partitions_enabled_flag instead of amp_enabled_flag in order to match with HM */
 1917|  58.6k|    BITS_PARSE("asymmetric_motion_partitions_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  58.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1918|  58.6k|    ps_sps->i1_amp_enabled_flag = value;
 1919|       |
 1920|  58.6k|    BITS_PARSE("sample_adaptive_offset_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  58.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1921|  58.6k|    ps_sps->i1_sample_adaptive_offset_enabled_flag = value;
 1922|       |
 1923|  58.6k|    BITS_PARSE("pcm_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  58.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1924|  58.6k|    ps_sps->i1_pcm_enabled_flag = value;
 1925|       |
 1926|  58.6k|    if(ps_sps->i1_pcm_enabled_flag)
  ------------------
  |  Branch (1926:8): [True: 21.7k, False: 36.9k]
  ------------------
 1927|  21.7k|    {
 1928|  21.7k|        BITS_PARSE("pcm_sample_bit_depth_luma", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  21.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1929|  21.7k|        ps_sps->i1_pcm_sample_bit_depth_luma = value + 1;
 1930|       |
 1931|  21.7k|        BITS_PARSE("pcm_sample_bit_depth_chroma", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  21.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1932|  21.7k|        ps_sps->i1_pcm_sample_bit_depth_chroma = value + 1;
 1933|       |
 1934|  21.7k|        UEV_PARSE("log2_min_pcm_coding_block_size_minus3", value, ps_bitstrm);
  ------------------
  |  |  155|  21.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1935|  21.7k|        if(value < (MIN(ps_sps->i1_log2_min_coding_block_size, 5) - 3) || value > (MIN(ctb_log2_size_y, 5) - 3))
  ------------------
  |  |   43|  21.7k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 21.6k, False: 70]
  |  |  ------------------
  ------------------
                      if(value < (MIN(ps_sps->i1_log2_min_coding_block_size, 5) - 3) || value > (MIN(ctb_log2_size_y, 5) - 3))
  ------------------
  |  |   43|  21.6k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 521, False: 21.1k]
  |  |  ------------------
  ------------------
  |  Branch (1935:12): [True: 71, False: 21.6k]
  |  Branch (1935:75): [True: 665, False: 20.9k]
  ------------------
 1936|    736|        {
 1937|    736|            return IHEVCD_INVALID_PARAMETER;
 1938|    736|        }
 1939|  20.9k|        ps_sps->i1_log2_min_pcm_coding_block_size = value + 3;
 1940|       |
 1941|  20.9k|        UEV_PARSE("log2_diff_max_min_pcm_coding_block_size", value, ps_bitstrm);
  ------------------
  |  |  155|  20.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1942|  20.9k|        if(value > MIN(ctb_log2_size_y, 5) - ps_sps->i1_log2_min_pcm_coding_block_size)
  ------------------
  |  |   43|  20.9k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 487, False: 20.4k]
  |  |  ------------------
  ------------------
  |  Branch (1942:12): [True: 310, False: 20.6k]
  ------------------
 1943|    310|        {
 1944|    310|            return IHEVCD_INVALID_PARAMETER;
 1945|    310|        }
 1946|  20.6k|        ps_sps->i1_log2_diff_max_min_pcm_coding_block_size = value;
 1947|  20.6k|        BITS_PARSE("pcm_loop_filter_disable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  20.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1948|  20.6k|        ps_sps->i1_pcm_loop_filter_disable_flag = value;
 1949|       |
 1950|  20.6k|    }
 1951|  57.6k|    UEV_PARSE("num_short_term_ref_pic_sets", value, ps_bitstrm);
  ------------------
  |  |  155|  57.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1952|  57.6k|    if(value > MAX_STREF_PICS_SPS)
  ------------------
  |  |  335|  57.6k|#define MAX_STREF_PICS_SPS 64
  ------------------
  |  Branch (1952:8): [True: 933, False: 56.7k]
  ------------------
 1953|    933|    {
 1954|    933|        return IHEVCD_INVALID_PARAMETER;
 1955|    933|    }
 1956|  56.7k|    ps_sps->i1_num_short_term_ref_pic_sets = value;
 1957|       |
 1958|   109k|    for(i = 0; i < ps_sps->i1_num_short_term_ref_pic_sets; i++)
  ------------------
  |  Branch (1958:16): [True: 54.8k, False: 55.0k]
  ------------------
 1959|  54.8k|    {
 1960|  54.8k|        ret = ihevcd_short_term_ref_pic_set(ps_bitstrm, &ps_sps->as_stref_picset[0], ps_sps->i1_num_short_term_ref_pic_sets, i, &ps_sps->as_stref_picset[i]);
 1961|  54.8k|        if (ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (1961:13): [True: 1.67k, False: 53.1k]
  ------------------
 1962|  1.67k|        {
 1963|  1.67k|            return ret;
 1964|  1.67k|        }
 1965|  54.8k|    }
 1966|       |
 1967|  55.0k|    BITS_PARSE("long_term_ref_pics_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  55.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1968|  55.0k|    ps_sps->i1_long_term_ref_pics_present_flag = value;
 1969|       |
 1970|  55.0k|    if(ps_sps->i1_long_term_ref_pics_present_flag)
  ------------------
  |  Branch (1970:8): [True: 12.4k, False: 42.5k]
  ------------------
 1971|  12.4k|    {
 1972|  12.4k|        UEV_PARSE("num_long_term_ref_pics_sps", value, ps_bitstrm);
  ------------------
  |  |  155|  12.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1973|  12.4k|        if(value > MAX_LTREF_PICS_SPS)
  ------------------
  |  |  333|  12.4k|#define MAX_LTREF_PICS_SPS 32
  ------------------
  |  Branch (1973:12): [True: 198, False: 12.2k]
  ------------------
 1974|    198|        {
 1975|    198|            return IHEVCD_INVALID_PARAMETER;
 1976|    198|        }
 1977|  12.2k|        ps_sps->i1_num_long_term_ref_pics_sps = value;
 1978|       |
 1979|  18.5k|        for(i = 0; i < ps_sps->i1_num_long_term_ref_pics_sps; i++)
  ------------------
  |  Branch (1979:20): [True: 6.25k, False: 12.2k]
  ------------------
 1980|  6.25k|        {
 1981|  6.25k|            BITS_PARSE("lt_ref_pic_poc_lsb_sps[ i ]", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|  6.25k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1982|  6.25k|            ps_sps->au2_lt_ref_pic_poc_lsb_sps[i] = value;
 1983|       |
 1984|  6.25k|            BITS_PARSE("used_by_curr_pic_lt_sps_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  6.25k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1985|  6.25k|            ps_sps->ai1_used_by_curr_pic_lt_sps_flag[i] = value;
 1986|  6.25k|        }
 1987|  12.2k|    }
 1988|       |
 1989|  54.8k|    BITS_PARSE("sps_temporal_mvp_enable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  54.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1990|  54.8k|    ps_sps->i1_sps_temporal_mvp_enable_flag = value;
 1991|       |
 1992|       |    /* Print matches HM 8-2 */
 1993|  54.8k|    BITS_PARSE("sps_strong_intra_smoothing_enable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  54.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1994|  54.8k|    ps_sps->i1_strong_intra_smoothing_enable_flag = value;
 1995|       |
 1996|  54.8k|    BITS_PARSE("vui_parameters_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  54.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1997|  54.8k|    ps_sps->i1_vui_parameters_present_flag = value;
 1998|       |
 1999|  54.8k|    if(ps_sps->i1_vui_parameters_present_flag)
  ------------------
  |  Branch (1999:8): [True: 18.4k, False: 36.3k]
  ------------------
 2000|  18.4k|    {
 2001|  18.4k|        ret = ihevcd_parse_vui_parameters(ps_bitstrm,
 2002|  18.4k|                                          &ps_sps->s_vui_parameters,
 2003|  18.4k|                                          ps_sps->i1_sps_max_sub_layers - 1);
 2004|  18.4k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  18.4k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 2.36k, False: 16.1k]
  |  |  ------------------
  ------------------
 2005|       |
 2006|  16.1k|        if (0 != ps_codec->u4_allocate_dynamic_done) {
  ------------------
  |  Branch (2006:13): [True: 4.79k, False: 11.3k]
  ------------------
 2007|       |
 2008|  4.79k|            vui_t *ps_vui = &ps_sps->s_vui_parameters;
 2009|  4.79k|            sps_t *ps_sps_old = ps_codec->s_parse.ps_sps;
 2010|  4.79k|            vui_t *ps_vui_old = &ps_sps_old->s_vui_parameters;
 2011|       |
 2012|  4.79k|            if (ps_vui->u1_video_full_range_flag != ps_vui_old->u1_video_full_range_flag ||
  ------------------
  |  Branch (2012:17): [True: 552, False: 4.24k]
  ------------------
 2013|  4.24k|                ps_vui->u1_colour_primaries != ps_vui_old->u1_colour_primaries ||
  ------------------
  |  Branch (2013:17): [True: 940, False: 3.30k]
  ------------------
 2014|  3.30k|                ps_vui->u1_transfer_characteristics != ps_vui_old->u1_transfer_characteristics ||
  ------------------
  |  Branch (2014:17): [True: 82, False: 3.22k]
  ------------------
 2015|  3.22k|                ps_vui->u1_matrix_coefficients != ps_vui_old->u1_matrix_coefficients) {
  ------------------
  |  Branch (2015:17): [True: 250, False: 2.97k]
  ------------------
 2016|  1.82k|                ps_codec->i4_reset_flag = 1;
 2017|  1.82k|                return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 2018|  1.82k|            }
 2019|  4.79k|        }
 2020|  16.1k|    }
 2021|       |
 2022|  50.6k|    BITS_PARSE("sps_extension_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  50.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2023|  50.6k|    ps_sps->i1_sps_extension_present_flag = value;
 2024|       |
 2025|  50.6k|    if(ps_sps->i1_sps_extension_present_flag)
  ------------------
  |  Branch (2025:8): [True: 4.02k, False: 46.6k]
  ------------------
 2026|  4.02k|    {
 2027|  4.02k|        BITS_PARSE("sps_range_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.02k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2028|  4.02k|        ps_sps->i1_sps_range_extension_flag = value;
 2029|       |
 2030|  4.02k|        BITS_PARSE("sps_multilayer_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.02k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2031|  4.02k|        ps_sps->i1_sps_multilayer_extension_flag = value;
 2032|       |
 2033|  4.02k|        BITS_PARSE("sps_3d_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.02k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2034|  4.02k|        ps_sps->i1_sps_3d_extension_flag = value;
 2035|       |
 2036|  4.02k|        BITS_PARSE("sps_scc_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.02k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2037|  4.02k|        ps_sps->i1_sps_scc_extension_flag = value;
 2038|       |
 2039|  4.02k|        BITS_PARSE("sps_extension_4bits", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  4.02k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2040|  4.02k|        ps_sps->i1_sps_extension_4bits = value;
 2041|  4.02k|    }
 2042|  46.6k|    else
 2043|  46.6k|    {
 2044|  46.6k|        ps_sps->i1_sps_range_extension_flag = 0;
 2045|  46.6k|        ps_sps->i1_sps_multilayer_extension_flag = 0;
 2046|  46.6k|        ps_sps->i1_sps_3d_extension_flag = 0;
 2047|  46.6k|        ps_sps->i1_sps_scc_extension_flag = 0;
 2048|  46.6k|        ps_sps->i1_sps_extension_4bits = 0;
 2049|  46.6k|    }
 2050|       |
 2051|  50.6k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2052|  50.6k|    if(ps_sps->i1_sps_range_extension_flag)
  ------------------
  |  Branch (2052:8): [True: 2.82k, False: 47.8k]
  ------------------
 2053|  2.82k|    {
 2054|       |        /* ITU-T H.265 Section 7.3.2.2.2 Range extension sequence parameter set syntax */
 2055|  2.82k|        BITS_PARSE("transform_skip_rotation_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2056|  2.82k|        ps_sps->i1_transform_skip_rotation_enabled_flag = value;
 2057|       |
 2058|  2.82k|        BITS_PARSE("transform_skip_context_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2059|  2.82k|        ps_sps->i1_transform_skip_context_enabled_flag = value;
 2060|       |
 2061|  2.82k|        BITS_PARSE("implicit_rdpcm_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2062|  2.82k|        ps_sps->i1_implicit_rdpcm_enabled_flag = value;
 2063|       |
 2064|  2.82k|        BITS_PARSE("explicit_rdpcm_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2065|  2.82k|        ps_sps->i1_explicit_rdpcm_enabled_flag = value;
 2066|       |
 2067|  2.82k|        BITS_PARSE("extended_precision_processing_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2068|  2.82k|        ps_sps->i1_extended_precision_processing_flag = value;
 2069|       |
 2070|  2.82k|        BITS_PARSE("intra_smoothing_disabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2071|  2.82k|        ps_sps->i1_intra_smoothing_disabled_flag = value;
 2072|       |
 2073|  2.82k|        BITS_PARSE("high_precision_offsets_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2074|  2.82k|        ps_sps->i1_use_high_precision_pred_wt = value;
 2075|       |
 2076|  2.82k|        BITS_PARSE("persistent_rice_adaptation_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2077|  2.82k|        ps_sps->i1_persistent_rice_adaptation_enabled_flag = value;
 2078|       |
 2079|  2.82k|        BITS_PARSE("cabac_bypass_alignment_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2080|  2.82k|        ps_sps->i1_align_cabac_before_bypass = value;
 2081|  2.82k|    }
 2082|  50.6k|    if(profile != IHEVC_PROFILE_MAIN_REXT)
  ------------------
  |  Branch (2082:8): [True: 41.9k, False: 8.71k]
  ------------------
 2083|  41.9k|    {
 2084|  41.9k|        if(ps_sps->i1_transform_skip_rotation_enabled_flag
  ------------------
  |  Branch (2084:12): [True: 464, False: 41.4k]
  ------------------
 2085|  41.4k|                        || ps_sps->i1_transform_skip_context_enabled_flag
  ------------------
  |  Branch (2085:28): [True: 200, False: 41.2k]
  ------------------
 2086|  41.2k|                        || ps_sps->i1_implicit_rdpcm_enabled_flag
  ------------------
  |  Branch (2086:28): [True: 216, False: 41.0k]
  ------------------
 2087|  41.0k|                        || ps_sps->i1_explicit_rdpcm_enabled_flag
  ------------------
  |  Branch (2087:28): [True: 197, False: 40.8k]
  ------------------
 2088|  40.8k|                        || ps_sps->i1_extended_precision_processing_flag
  ------------------
  |  Branch (2088:28): [True: 202, False: 40.6k]
  ------------------
 2089|  40.6k|                        || ps_sps->i1_intra_smoothing_disabled_flag
  ------------------
  |  Branch (2089:28): [True: 212, False: 40.4k]
  ------------------
 2090|  40.4k|                        || ps_sps->i1_persistent_rice_adaptation_enabled_flag
  ------------------
  |  Branch (2090:28): [True: 202, False: 40.2k]
  ------------------
 2091|  40.2k|                        || ps_sps->i1_align_cabac_before_bypass)
  ------------------
  |  Branch (2091:28): [True: 194, False: 40.0k]
  ------------------
 2092|  1.88k|        {
 2093|  1.88k|            return IHEVCD_INVALID_PARAMETER;
 2094|  1.88k|        }
 2095|  41.9k|    }
 2096|  48.7k|    if(ps_sps->i1_extended_precision_processing_flag || ps_sps->i1_align_cabac_before_bypass)
  ------------------
  |  Branch (2096:8): [True: 198, False: 48.5k]
  |  Branch (2096:57): [True: 74, False: 48.4k]
  ------------------
 2097|    272|    {
 2098|       |        // main-rext 8-bit profiles require these fields to be off
 2099|    272|        return IHEVCD_INVALID_PARAMETER;
 2100|    272|    }
 2101|  48.4k|    if(ps_sps->i1_sps_multilayer_extension_flag || ps_sps->i1_sps_3d_extension_flag
  ------------------
  |  Branch (2101:8): [True: 247, False: 48.2k]
  |  Branch (2101:52): [True: 378, False: 47.8k]
  ------------------
 2102|  47.8k|                    || ps_sps->i1_sps_scc_extension_flag)
  ------------------
  |  Branch (2102:24): [True: 202, False: 47.6k]
  ------------------
 2103|    827|    {
 2104|    827|        return IHEVCD_UNSUPPORTED_TOOL_SET;
 2105|    827|    }
 2106|       |#else
 2107|       |    if(ps_sps->i1_sps_range_extension_flag || ps_sps->i1_sps_multilayer_extension_flag
 2108|       |                    || ps_sps->i1_sps_3d_extension_flag || ps_sps->i1_sps_scc_extension_flag)
 2109|       |    {
 2110|       |        // TODO: add support for parsing these syntax elements
 2111|       |        return IHEVCD_UNSUPPORTED_TOOL_SET;
 2112|       |    }
 2113|       |#endif
 2114|       |
 2115|  47.6k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (2115:8): [True: 2.26k, False: 45.4k]
  ------------------
 2116|  2.26k|    {
 2117|  2.26k|        return IHEVCD_INVALID_PARAMETER;
 2118|  2.26k|    }
 2119|       |
 2120|  45.4k|    {
 2121|  45.4k|        WORD32 numerator;
 2122|  45.4k|        WORD32 ceil_offset;
 2123|       |
 2124|  45.4k|        ceil_offset = (1 << ps_sps->i1_log2_ctb_size) - 1;
 2125|  45.4k|        numerator = ps_sps->i2_pic_width_in_luma_samples;
 2126|       |
 2127|  45.4k|        ps_sps->i2_pic_wd_in_ctb = ((numerator + ceil_offset) /
 2128|  45.4k|                        (1 << ps_sps->i1_log2_ctb_size));
 2129|       |
 2130|  45.4k|        numerator = ps_sps->i2_pic_height_in_luma_samples;
 2131|  45.4k|        ps_sps->i2_pic_ht_in_ctb = ((numerator + ceil_offset) /
 2132|  45.4k|                        (1 << ps_sps->i1_log2_ctb_size));
 2133|       |
 2134|  45.4k|        ps_sps->i4_pic_size_in_ctb = ps_sps->i2_pic_ht_in_ctb *
 2135|  45.4k|                        ps_sps->i2_pic_wd_in_ctb;
 2136|       |
 2137|  45.4k|        if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (2137:12): [True: 26.3k, False: 19.1k]
  ------------------
 2138|  26.3k|            ps_codec->s_parse.i4_next_ctb_indx = ps_sps->i4_pic_size_in_ctb;
 2139|       |
 2140|  45.4k|        numerator = ps_sps->i2_pic_width_in_luma_samples;
 2141|  45.4k|        ps_sps->i2_pic_wd_in_min_cb = numerator  /
 2142|  45.4k|                        (1 << ps_sps->i1_log2_min_coding_block_size);
 2143|       |
 2144|  45.4k|        numerator = ps_sps->i2_pic_height_in_luma_samples;
 2145|  45.4k|        ps_sps->i2_pic_ht_in_min_cb = numerator  /
 2146|  45.4k|                        (1 << ps_sps->i1_log2_min_coding_block_size);
 2147|  45.4k|    }
 2148|  45.4k|    if((0 != ps_codec->u4_allocate_dynamic_done) &&
  ------------------
  |  Branch (2148:8): [True: 19.1k, False: 26.3k]
  ------------------
 2149|  19.1k|                    ((ps_codec->i4_wd != ps_sps->i2_pic_width_in_luma_samples) ||
  ------------------
  |  Branch (2149:22): [True: 114, False: 18.9k]
  ------------------
 2150|  18.9k|                    (ps_codec->i4_ht != ps_sps->i2_pic_height_in_luma_samples)))
  ------------------
  |  Branch (2150:21): [True: 186, False: 18.8k]
  ------------------
 2151|    300|    {
 2152|    300|        if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (2152:12): [True: 145, False: 155]
  ------------------
 2153|    145|        {
 2154|    145|            return IHEVCD_INVALID_PARAMETER;
 2155|    145|        }
 2156|    155|        ps_codec->i4_reset_flag = 1;
 2157|    155|        return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 2158|    300|    }
 2159|       |
 2160|       |    // Ensure both i2_pic_width_in_luma_samples and i2_pic_height_in_luma_samples do
 2161|       |    // not exceed MAX_WD and their product doesn't exceed MAX_WD * MAX_HT
 2162|  45.1k|    if((ps_sps->i2_pic_width_in_luma_samples > MAX_WD) ||
  ------------------
  |  |   53|  45.1k|#define MAX_WD   8448
  ------------------
  |  Branch (2162:8): [True: 66, False: 45.0k]
  ------------------
 2163|  45.0k|                    (ps_sps->i2_pic_height_in_luma_samples > MAX_WD) ||
  ------------------
  |  |   53|  45.0k|#define MAX_WD   8448
  ------------------
  |  Branch (2163:21): [True: 208, False: 44.8k]
  ------------------
 2164|  44.8k|                    ((ps_sps->i2_pic_width_in_luma_samples * ps_sps->i2_pic_height_in_luma_samples) >
  ------------------
  |  Branch (2164:21): [True: 0, False: 44.8k]
  ------------------
 2165|  44.8k|                    (MAX_WD * MAX_HT)))
  ------------------
  |  |   53|  44.8k|#define MAX_WD   8448
  ------------------
                                  (MAX_WD * MAX_HT)))
  ------------------
  |  |   64|  44.8k|#define MAX_HT   4320
  ------------------
 2166|    274|    {
 2167|    274|        return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 2168|    274|    }
 2169|       |
 2170|       |    // limit format conversions
 2171|  44.8k|    if(ps_codec->e_chroma_fmt == IV_YUV_444P
  ------------------
  |  Branch (2171:8): [True: 230, False: 44.5k]
  ------------------
 2172|    230|                    && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (2172:24): [True: 230, False: 0]
  ------------------
 2173|    230|    {
 2174|    230|        return (IHEVCD_ERROR_T)IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
 2175|    230|    }
 2176|  44.5k|    if(ps_codec->e_chroma_fmt == IV_YUV_422P
  ------------------
  |  Branch (2176:8): [True: 991, False: 43.6k]
  ------------------
 2177|    991|                    && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (2177:24): [True: 402, False: 589]
  ------------------
 2178|    402|    {
 2179|    402|        return (IHEVCD_ERROR_T)IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
 2180|    402|    }
 2181|  44.1k|    if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV || ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)
  ------------------
  |  Branch (2181:9): [True: 8.38k, False: 35.8k]
  |  Branch (2181:54): [True: 6.79k, False: 29.0k]
  ------------------
 2182|  15.1k|                    && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (2182:24): [True: 261, False: 14.9k]
  ------------------
 2183|    261|    {
 2184|    261|        return (IHEVCD_ERROR_T)IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
 2185|    261|    }
 2186|       |
 2187|       |    /* Update display width and display height */
 2188|  43.9k|    {
 2189|  43.9k|        WORD32 disp_wd, disp_ht;
 2190|  43.9k|        WORD32 crop_unit_x, crop_unit_y;
 2191|  43.9k|        crop_unit_x = 1;
 2192|  43.9k|        crop_unit_y = 1;
 2193|       |
 2194|  43.9k|        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (2194:12): [True: 38.6k, False: 5.32k]
  ------------------
 2195|  38.6k|        {
 2196|  38.6k|            crop_unit_x = 2;
 2197|  38.6k|            crop_unit_y = 2;
 2198|  38.6k|        }
 2199|  5.32k|        else if(CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (2199:17): [True: 4.27k, False: 1.04k]
  ------------------
 2200|  4.27k|        {
 2201|  4.27k|            crop_unit_x = 2;
 2202|  4.27k|            crop_unit_y = 1;
 2203|  4.27k|        }
 2204|       |
 2205|  43.9k|        disp_wd = ps_sps->i2_pic_width_in_luma_samples;
 2206|  43.9k|        disp_wd -= ps_sps->i2_pic_crop_left_offset * crop_unit_x;
 2207|  43.9k|        disp_wd -= ps_sps->i2_pic_crop_right_offset * crop_unit_x;
 2208|       |
 2209|       |
 2210|  43.9k|        disp_ht = ps_sps->i2_pic_height_in_luma_samples;
 2211|  43.9k|        disp_ht -= ps_sps->i2_pic_crop_top_offset * crop_unit_y;
 2212|  43.9k|        disp_ht -= ps_sps->i2_pic_crop_bottom_offset * crop_unit_y;
 2213|       |
 2214|  43.9k|        if((0 >= disp_wd) || (0 >= disp_ht))
  ------------------
  |  Branch (2214:12): [True: 71, False: 43.8k]
  |  Branch (2214:30): [True: 233, False: 43.6k]
  ------------------
 2215|    304|            return IHEVCD_INVALID_PARAMETER;
 2216|       |
 2217|  43.6k|        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (2217:12): [True: 38.3k, False: 5.32k]
  ------------------
 2218|  38.3k|        {
 2219|  38.3k|            if(disp_wd % 2 != 0 || disp_ht % 2 != 0)
  ------------------
  |  Branch (2219:16): [True: 0, False: 38.3k]
  |  Branch (2219:36): [True: 0, False: 38.3k]
  ------------------
 2220|      0|                return IHEVCD_INVALID_PARAMETER;
 2221|  38.3k|        }
 2222|  5.32k|        else if(CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (2222:17): [True: 4.27k, False: 1.04k]
  ------------------
 2223|  4.27k|        {
 2224|  4.27k|            if(disp_wd % 2 != 0)
  ------------------
  |  Branch (2224:16): [True: 0, False: 4.27k]
  ------------------
 2225|      0|                return IHEVCD_INVALID_PARAMETER;
 2226|  4.27k|        }
 2227|       |
 2228|  43.6k|        if((0 != ps_codec->u4_allocate_dynamic_done) &&
  ------------------
  |  Branch (2228:12): [True: 18.8k, False: 24.8k]
  ------------------
 2229|  18.8k|                            ((ps_codec->i4_disp_wd != disp_wd) ||
  ------------------
  |  Branch (2229:30): [True: 146, False: 18.6k]
  ------------------
 2230|  18.6k|                            (ps_codec->i4_disp_ht != disp_ht) ||
  ------------------
  |  Branch (2230:29): [True: 548, False: 18.1k]
  ------------------
 2231|  18.1k|                            (ps_codec->i4_bit_depth_luma != ps_sps->i1_bit_depth_luma_minus8 + 8) ||
  ------------------
  |  Branch (2231:29): [True: 146, False: 17.9k]
  ------------------
 2232|  17.9k|                            (ps_codec->i4_bit_depth_chroma != ps_sps->i1_bit_depth_chroma_minus8 + 8) ||
  ------------------
  |  Branch (2232:29): [True: 34, False: 17.9k]
  ------------------
 2233|  17.9k|                            (ps_codec->i4_chroma_format_idc != ps_sps->i1_chroma_format_idc)))
  ------------------
  |  Branch (2233:29): [True: 100, False: 17.8k]
  ------------------
 2234|    974|        {
 2235|    974|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (2235:16): [True: 277, False: 697]
  ------------------
 2236|    277|            {
 2237|    277|                return IHEVCD_INVALID_PARAMETER;
 2238|    277|            }
 2239|       |
 2240|       |            // Do not support change in bit-depth once decoder is initialized
 2241|    697|            if(ps_codec->i4_bit_depth_luma != ps_sps->i1_bit_depth_luma_minus8 + 8 ||
  ------------------
  |  Branch (2241:16): [True: 86, False: 611]
  ------------------
 2242|    611|               ps_codec->i4_bit_depth_chroma != ps_sps->i1_bit_depth_chroma_minus8 + 8)
  ------------------
  |  Branch (2242:16): [True: 67, False: 544]
  ------------------
 2243|    153|            {
 2244|    153|                return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_BIT_DEPTH;
 2245|    153|            }
 2246|       |
 2247|       |            // Do not support change in chroma format once decoder is initialized
 2248|    544|            if(ps_codec->i4_chroma_format_idc != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (2248:16): [True: 66, False: 478]
  ------------------
 2249|     66|            {
 2250|     66|                return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 2251|     66|            }
 2252|       |
 2253|    478|            ps_codec->i4_reset_flag = 1;
 2254|    478|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 2255|    544|        }
 2256|       |
 2257|  42.6k|        ps_codec->i4_disp_wd = disp_wd;
 2258|  42.6k|        ps_codec->i4_disp_ht = disp_ht;
 2259|       |
 2260|  42.6k|        ps_codec->i4_chroma_format_idc = ps_sps->i1_chroma_format_idc;
 2261|  42.6k|        ps_codec->i4_bit_depth_luma = ps_sps->i1_bit_depth_luma_minus8 + 8;
 2262|  42.6k|        ps_codec->i4_pixel_size_y   = 1 + (ps_sps->i1_bit_depth_luma_minus8 > 0);
 2263|  42.6k|        ps_codec->i4_qp_bd_offset_y = 6 * ps_sps->i1_bit_depth_luma_minus8;
 2264|       |
 2265|  42.6k|        ps_codec->i4_bit_depth_chroma = ps_sps->i1_bit_depth_chroma_minus8 + 8;
 2266|  42.6k|        ps_codec->i4_pixel_size_uv    = 1 + (ps_sps->i1_bit_depth_chroma_minus8 > 0);
 2267|  42.6k|        ps_codec->i4_qp_bd_offset_uv  = 6 * ps_sps->i1_bit_depth_chroma_minus8;
 2268|       |
 2269|       |
 2270|  42.6k|        ps_codec->i4_wd = ps_sps->i2_pic_width_in_luma_samples;
 2271|  42.6k|        ps_codec->i4_ht = ps_sps->i2_pic_height_in_luma_samples;
 2272|  42.6k|        ps_codec->u4_num_8x8_blks = ALIGN64(ps_codec->i4_wd) * ALIGN64(ps_codec->i4_ht) >> 6;
  ------------------
  |  |   50|  42.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
                      ps_codec->u4_num_8x8_blks = ALIGN64(ps_codec->i4_wd) * ALIGN64(ps_codec->i4_ht) >> 6;
  ------------------
  |  |   50|  42.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2273|       |
 2274|  42.6k|        {
 2275|  42.6k|            WORD32 ref_strd;
 2276|  42.6k|            ref_strd = ALIGN32(ps_sps->i2_pic_width_in_luma_samples + PAD_WD);
  ------------------
  |  |   51|  42.6k|#define ALIGN32(x)  ((((x) + 31) >> 5) << 5)
  ------------------
 2277|  42.6k|            if(ps_codec->i4_strd < ref_strd)
  ------------------
  |  Branch (2277:16): [True: 24.8k, False: 17.8k]
  ------------------
 2278|  24.8k|            {
 2279|  24.8k|                ps_codec->i4_strd = ref_strd;
 2280|  24.8k|            }
 2281|  42.6k|        }
 2282|       |
 2283|  42.6k|        if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (2283:12): [True: 42.6k, False: 0]
  ------------------
 2284|  42.6k|        {
 2285|  42.6k|            if(ps_codec->i4_disp_strd < ps_codec->i4_disp_wd)
  ------------------
  |  Branch (2285:16): [True: 24.8k, False: 17.8k]
  ------------------
 2286|  24.8k|            {
 2287|  24.8k|                ps_codec->i4_disp_strd = ps_codec->i4_disp_wd;
 2288|  24.8k|            }
 2289|  42.6k|        }
 2290|      0|        else
 2291|      0|        {
 2292|      0|            if(ps_codec->i4_disp_strd < ps_codec->i4_strd)
  ------------------
  |  Branch (2292:16): [True: 0, False: 0]
  ------------------
 2293|      0|            {
 2294|      0|                ps_codec->i4_disp_strd = ps_codec->i4_strd;
 2295|      0|            }
 2296|      0|        }
 2297|  42.6k|    }
 2298|       |
 2299|       |    /* This is used only during initialization to get reorder count etc */
 2300|      0|    ps_codec->i4_sps_id = sps_id;
 2301|       |
 2302|  42.6k|    ps_codec->i4_sps_done = 1;
 2303|  42.6k|    return ret;
 2304|  43.6k|}
ihevcd_copy_sps:
 2322|  42.6k|{
 2323|  42.6k|    sps_t *ps_sps, *ps_sps_ref;
 2324|  42.6k|    WORD16 *pi2_scaling_mat_backup;
 2325|  42.6k|    WORD32 scaling_mat_size;
 2326|       |
 2327|  42.6k|    SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  186|  42.6k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  187|  42.6k|{                                                                            \
  |  |  188|  42.6k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  42.6k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  42.6k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  189|  42.6k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  42.6k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  42.6k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  190|  42.6k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  42.6k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  42.6k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  191|  42.6k|    m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  42.6k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  42.6k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  192|  42.6k|}
  ------------------
 2328|  42.6k|    ps_sps_ref = ps_codec->ps_sps_base + sps_id_ref;
 2329|  42.6k|    ps_sps = ps_codec->ps_sps_base + sps_id;
 2330|       |
 2331|  42.6k|    if(ps_sps->i1_sps_valid)
  ------------------
  |  Branch (2331:8): [True: 17.7k, False: 24.8k]
  ------------------
 2332|  17.7k|    {
 2333|  17.7k|        if((ps_sps->i1_log2_ctb_size != ps_sps_ref->i1_log2_ctb_size) ||
  ------------------
  |  Branch (2333:12): [True: 0, False: 17.7k]
  ------------------
 2334|  17.7k|                        (ps_sps->i2_pic_wd_in_ctb != ps_sps_ref->i2_pic_wd_in_ctb) ||
  ------------------
  |  Branch (2334:25): [True: 0, False: 17.7k]
  ------------------
 2335|  17.7k|                        (ps_sps->i2_pic_ht_in_ctb != ps_sps_ref->i2_pic_ht_in_ctb))
  ------------------
  |  Branch (2335:25): [True: 0, False: 17.7k]
  ------------------
 2336|      0|        {
 2337|      0|            ihevcd_unmark_pps(ps_codec, sps_id);
 2338|      0|        }
 2339|  17.7k|    }
 2340|       |
 2341|  42.6k|    pi2_scaling_mat_backup = ps_sps->pi2_scaling_mat;
 2342|       |
 2343|  42.6k|    memcpy(ps_sps, ps_sps_ref, sizeof(sps_t));
 2344|  42.6k|    ps_sps->pi2_scaling_mat = pi2_scaling_mat_backup;
 2345|  42.6k|    memcpy(ps_sps->pi2_scaling_mat, ps_sps_ref->pi2_scaling_mat, scaling_mat_size * sizeof(WORD16));
 2346|  42.6k|    ps_sps->i1_sps_valid = 1;
 2347|       |
 2348|  42.6k|    ps_codec->s_parse.ps_sps = ps_sps;
 2349|  42.6k|}
ihevcd_parse_pps:
 2374|  80.8k|{
 2375|  80.8k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2376|  80.8k|    UWORD32 value;
 2377|  80.8k|    WORD32 i4_value;
 2378|  80.8k|    WORD32 pps_id;
 2379|       |
 2380|  80.8k|    pps_t *ps_pps;
 2381|  80.8k|    sps_t *ps_sps;
 2382|  80.8k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 2383|       |
 2384|       |
 2385|  80.8k|    if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (2385:8): [True: 8.27k, False: 72.5k]
  ------------------
 2386|  8.27k|        return IHEVCD_INVALID_HEADER;
 2387|       |
 2388|  72.5k|    UEV_PARSE("pic_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|  72.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2389|       |
 2390|  72.5k|    pps_id = value;
 2391|  72.5k|    if((pps_id >= MAX_PPS_CNT) || (pps_id < 0))
  ------------------
  |  |  344|  72.5k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (2391:8): [True: 2.23k, False: 70.3k]
  |  Branch (2391:35): [True: 2.39k, False: 67.9k]
  ------------------
 2392|  4.63k|    {
 2393|  4.63k|        if(ps_codec->i4_pps_done)
  ------------------
  |  Branch (2393:12): [True: 941, False: 3.69k]
  ------------------
 2394|    941|            return IHEVCD_UNSUPPORTED_PPS_ID;
 2395|  3.69k|        else
 2396|  3.69k|            pps_id = 0;
 2397|  4.63k|    }
 2398|       |
 2399|       |
 2400|  71.6k|    ps_pps = (ps_codec->s_parse.ps_pps_base + MAX_PPS_CNT - 1);
  ------------------
  |  |  344|  71.6k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 2401|       |    /* Reset PPS to zero */
 2402|  71.6k|    {
 2403|  71.6k|        WORD16 *pi2_scaling_mat = ps_pps->pi2_scaling_mat;
 2404|  71.6k|        tile_t *ps_tile = ps_pps->ps_tile;
 2405|  71.6k|        memset(ps_pps, 0, sizeof(pps_t));
 2406|  71.6k|        ps_pps->pi2_scaling_mat = pi2_scaling_mat;
 2407|  71.6k|        ps_pps->ps_tile = ps_tile;
 2408|  71.6k|    }
 2409|       |
 2410|  71.6k|    ps_pps->i1_pps_id = pps_id;
 2411|       |
 2412|  71.6k|    UEV_PARSE("seq_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|  71.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2413|  71.6k|    if(value > MAX_SPS_CNT - 2)
  ------------------
  |  |  327|  71.6k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (2413:8): [True: 462, False: 71.1k]
  ------------------
 2414|    462|    {
 2415|    462|        return IHEVCD_INVALID_PARAMETER;
 2416|    462|    }
 2417|  71.1k|    ps_pps->i1_sps_id = value;
 2418|       |
 2419|  71.1k|    ps_sps = (ps_codec->s_parse.ps_sps_base + ps_pps->i1_sps_id);
 2420|       |
 2421|       |    /* If the SPS that is being referred to has not been parsed,
 2422|       |     * copy an existing SPS to the current location */
 2423|  71.1k|    if(0 == ps_sps->i1_sps_valid)
  ------------------
  |  Branch (2423:8): [True: 2.39k, False: 68.7k]
  ------------------
 2424|  2.39k|    {
 2425|  2.39k|        return IHEVCD_INVALID_HEADER;
 2426|       |
 2427|       |/*
 2428|       |        sps_t *ps_sps_ref = ps_codec->ps_sps_base;
 2429|       |        while(0 == ps_sps_ref->i1_sps_valid)
 2430|       |            ps_sps_ref++;
 2431|       |        ihevcd_copy_sps(ps_codec, ps_pps->i1_sps_id, ps_sps_ref->i1_sps_id);
 2432|       |*/
 2433|  2.39k|    }
 2434|       |
 2435|  68.7k|    BITS_PARSE("dependent_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  68.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2436|  68.7k|    ps_pps->i1_dependent_slice_enabled_flag = value;
 2437|       |
 2438|  68.7k|    BITS_PARSE("output_flag_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  68.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2439|  68.7k|    ps_pps->i1_output_flag_present_flag = value;
 2440|       |
 2441|  68.7k|    BITS_PARSE("num_extra_slice_header_bits", value, ps_bitstrm, 3);
  ------------------
  |  |  148|  68.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2442|  68.7k|    ps_pps->i1_num_extra_slice_header_bits = value;
 2443|       |
 2444|       |
 2445|  68.7k|    BITS_PARSE("sign_data_hiding_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  68.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2446|  68.7k|    ps_pps->i1_sign_data_hiding_flag = value;
 2447|       |
 2448|  68.7k|    BITS_PARSE("cabac_init_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  68.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2449|  68.7k|    ps_pps->i1_cabac_init_present_flag = value;
 2450|       |
 2451|  68.7k|    UEV_PARSE("num_ref_idx_l0_default_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  68.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2452|  68.7k|    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  291|  68.7k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (2452:8): [True: 423, False: 68.3k]
  ------------------
 2453|    423|    {
 2454|    423|         return IHEVCD_INVALID_PARAMETER;
 2455|    423|    }
 2456|  68.3k|    ps_pps->i1_num_ref_idx_l0_default_active = value + 1;
 2457|       |
 2458|  68.3k|    UEV_PARSE("num_ref_idx_l1_default_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  68.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2459|  68.3k|    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  291|  68.3k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (2459:8): [True: 240, False: 68.1k]
  ------------------
 2460|    240|    {
 2461|    240|        return IHEVCD_INVALID_PARAMETER;
 2462|    240|    }
 2463|  68.1k|    ps_pps->i1_num_ref_idx_l1_default_active = value + 1;
 2464|       |
 2465|  68.1k|    SEV_PARSE("pic_init_qp_minus26", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  68.1k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2466|  68.1k|    if(i4_value < -26 || i4_value > 25)
  ------------------
  |  Branch (2466:8): [True: 141, False: 67.9k]
  |  Branch (2466:26): [True: 192, False: 67.7k]
  ------------------
 2467|    333|    {
 2468|    333|        return IHEVCD_INVALID_PARAMETER;
 2469|    333|    }
 2470|  67.7k|    ps_pps->i1_pic_init_qp = i4_value + 26;
 2471|       |
 2472|  67.7k|    BITS_PARSE("constrained_intra_pred_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  67.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2473|  67.7k|    ps_pps->i1_constrained_intra_pred_flag = value;
 2474|       |
 2475|  67.7k|    BITS_PARSE("transform_skip_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  67.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2476|  67.7k|    ps_pps->i1_transform_skip_enabled_flag = value;
 2477|       |
 2478|  67.7k|    BITS_PARSE("cu_qp_delta_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  67.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2479|  67.7k|    ps_pps->i1_cu_qp_delta_enabled_flag = value;
 2480|       |
 2481|  67.7k|    if(ps_pps->i1_cu_qp_delta_enabled_flag)
  ------------------
  |  Branch (2481:8): [True: 21.8k, False: 45.9k]
  ------------------
 2482|  21.8k|    {
 2483|  21.8k|        UEV_PARSE("diff_cu_qp_delta_depth", value, ps_bitstrm);
  ------------------
  |  |  155|  21.8k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2484|  21.8k|        if(value > ps_sps->i1_log2_diff_max_min_coding_block_size)
  ------------------
  |  Branch (2484:12): [True: 1.05k, False: 20.7k]
  ------------------
 2485|  1.05k|        {
 2486|  1.05k|            return IHEVCD_INVALID_PARAMETER;
 2487|  1.05k|        }
 2488|  20.7k|        ps_pps->i1_diff_cu_qp_delta_depth = value;
 2489|  20.7k|    }
 2490|  45.9k|    else
 2491|  45.9k|    {
 2492|  45.9k|        ps_pps->i1_diff_cu_qp_delta_depth = 0;
 2493|  45.9k|    }
 2494|  66.7k|    ps_pps->i1_log2_min_cu_qp_delta_size = ps_sps->i1_log2_ctb_size - ps_pps->i1_diff_cu_qp_delta_depth;
 2495|       |    /* Print different */
 2496|  66.7k|    SEV_PARSE("cb_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  66.7k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2497|  66.7k|    if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (2497:8): [True: 147, False: 66.5k]
  |  Branch (2497:26): [True: 237, False: 66.3k]
  ------------------
 2498|    384|    {
 2499|    384|        return IHEVCD_INVALID_PARAMETER;
 2500|    384|    }
 2501|  66.3k|    ps_pps->i1_pic_cb_qp_offset = i4_value;
 2502|       |
 2503|       |    /* Print different */
 2504|  66.3k|    SEV_PARSE("cr_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  66.3k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2505|  66.3k|    if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (2505:8): [True: 182, False: 66.1k]
  |  Branch (2505:26): [True: 145, False: 66.0k]
  ------------------
 2506|    327|    {
 2507|    327|        return IHEVCD_INVALID_PARAMETER;
 2508|    327|    }
 2509|  66.0k|    ps_pps->i1_pic_cr_qp_offset = i4_value;
 2510|       |
 2511|       |    /* Print different */
 2512|  66.0k|    BITS_PARSE("slicelevel_chroma_qp_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  66.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2513|  66.0k|    ps_pps->i1_pic_slice_level_chroma_qp_offsets_present_flag = value;
 2514|       |
 2515|  66.0k|    BITS_PARSE("weighted_pred_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  66.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2516|  66.0k|    ps_pps->i1_weighted_pred_flag = value;
 2517|       |
 2518|  66.0k|    BITS_PARSE("weighted_bipred_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  66.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2519|  66.0k|    ps_pps->i1_weighted_bipred_flag = value;
 2520|       |
 2521|  66.0k|    BITS_PARSE("transquant_bypass_enable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  66.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2522|  66.0k|    ps_pps->i1_transquant_bypass_enable_flag = value;
 2523|       |
 2524|  66.0k|    BITS_PARSE("tiles_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  66.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2525|  66.0k|    ps_pps->i1_tiles_enabled_flag = value;
 2526|       |
 2527|       |    /* When tiles are enabled and width or height is >= 4096,
 2528|       |     * CTB Size should at least be 32 while if width or height is >= 8192,
 2529|       |     * CTB Size should at least be 64 and so on. 16x16 CTBs can result
 2530|       |     * in tile position greater than 255 for 4096 while 32x32 CTBs can result
 2531|       |     * in tile position greater than 255 for 8192,
 2532|       |     * which decoder does not support.
 2533|       |     */
 2534|  66.0k|    if (ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2534:9): [True: 10.9k, False: 55.1k]
  ------------------
 2535|  10.9k|    {
 2536|  10.9k|        if((ps_sps->i1_log2_ctb_size == 4) &&
  ------------------
  |  Branch (2536:12): [True: 1.78k, False: 9.12k]
  ------------------
 2537|  1.78k|            ((ps_sps->i2_pic_width_in_luma_samples >= 4096) ||
  ------------------
  |  Branch (2537:14): [True: 70, False: 1.71k]
  ------------------
 2538|  1.71k|            (ps_sps->i2_pic_height_in_luma_samples >= 4096)))
  ------------------
  |  Branch (2538:13): [True: 69, False: 1.64k]
  ------------------
 2539|    139|        {
 2540|    139|            return IHEVCD_INVALID_HEADER;
 2541|    139|        }
 2542|  10.7k|        if((ps_sps->i1_log2_ctb_size == 5) &&
  ------------------
  |  Branch (2542:12): [True: 5.73k, False: 5.03k]
  ------------------
 2543|  5.73k|            ((ps_sps->i2_pic_width_in_luma_samples >= 8192) ||
  ------------------
  |  Branch (2543:14): [True: 95, False: 5.63k]
  ------------------
 2544|  5.63k|            (ps_sps->i2_pic_height_in_luma_samples >= 8192)))
  ------------------
  |  Branch (2544:13): [True: 66, False: 5.56k]
  ------------------
 2545|    161|        {
 2546|    161|            return IHEVCD_INVALID_HEADER;
 2547|    161|        }
 2548|  10.6k|        if((ps_sps->i1_log2_ctb_size == 6) &&
  ------------------
  |  Branch (2548:12): [True: 3.39k, False: 7.21k]
  ------------------
 2549|  3.39k|            ((ps_sps->i2_pic_width_in_luma_samples >= 16384) ||
  ------------------
  |  Branch (2549:14): [True: 0, False: 3.39k]
  ------------------
 2550|  3.39k|            (ps_sps->i2_pic_height_in_luma_samples >= 16384)))
  ------------------
  |  Branch (2550:13): [True: 0, False: 3.39k]
  ------------------
 2551|      0|        {
 2552|      0|            return IHEVCD_INVALID_HEADER;
 2553|      0|        }
 2554|  10.6k|    }
 2555|       |
 2556|  65.7k|    BITS_PARSE("entropy_coding_sync_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  65.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2557|  65.7k|    ps_pps->i1_entropy_coding_sync_enabled_flag = value;
 2558|       |
 2559|  65.7k|    ps_pps->i1_loop_filter_across_tiles_enabled_flag = 0;
 2560|  65.7k|    if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2560:8): [True: 10.6k, False: 55.1k]
  ------------------
 2561|  10.6k|    {
 2562|  10.6k|        WORD32 wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  10.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2563|  10.6k|        WORD32 ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  10.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2564|       |
 2565|  10.6k|        WORD32 max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  10.6k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  10.6k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                      WORD32 max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  10.6k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  10.6k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2566|  10.6k|        WORD32 max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  10.6k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  10.6k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                      WORD32 max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  10.6k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  10.6k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2567|       |
 2568|  10.6k|        UEV_PARSE("num_tile_columns_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  10.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2569|  10.6k|        ps_pps->i1_num_tile_columns = value + 1;
 2570|       |
 2571|  10.6k|        UEV_PARSE("num_tile_rows_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  10.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2572|  10.6k|        ps_pps->i1_num_tile_rows = value + 1;
 2573|       |
 2574|  10.6k|        if((ps_pps->i1_num_tile_columns < 1) ||
  ------------------
  |  Branch (2574:12): [True: 102, False: 10.5k]
  ------------------
 2575|  10.5k|                        (ps_pps->i1_num_tile_columns > max_tile_cols) ||
  ------------------
  |  Branch (2575:25): [True: 226, False: 10.2k]
  ------------------
 2576|  10.2k|                        (ps_pps->i1_num_tile_rows < 1) ||
  ------------------
  |  Branch (2576:25): [True: 82, False: 10.1k]
  ------------------
 2577|  10.1k|                        (ps_pps->i1_num_tile_rows > max_tile_rows))
  ------------------
  |  Branch (2577:25): [True: 119, False: 10.0k]
  ------------------
 2578|    529|            return IHEVCD_INVALID_HEADER;
 2579|       |
 2580|  10.0k|        BITS_PARSE("uniform_spacing_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2581|  10.0k|        ps_pps->i1_uniform_spacing_flag = value;
 2582|       |
 2583|       |
 2584|  10.0k|        {
 2585|       |
 2586|  10.0k|            UWORD32 start;
 2587|  10.0k|            WORD32 i, j;
 2588|       |
 2589|       |
 2590|  10.0k|            start = 0;
 2591|  27.3k|            for(i = 0; i < ps_pps->i1_num_tile_columns; i++)
  ------------------
  |  Branch (2591:24): [True: 17.4k, False: 9.87k]
  ------------------
 2592|  17.4k|            {
 2593|  17.4k|                tile_t *ps_tile;
 2594|  17.4k|                if(!ps_pps->i1_uniform_spacing_flag)
  ------------------
  |  Branch (2594:20): [True: 8.02k, False: 9.42k]
  ------------------
 2595|  8.02k|                {
 2596|  8.02k|                    if(i < (ps_pps->i1_num_tile_columns - 1))
  ------------------
  |  Branch (2596:24): [True: 2.96k, False: 5.06k]
  ------------------
 2597|  2.96k|                    {
 2598|  2.96k|                        UEV_PARSE("column_width_minus1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|  2.96k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2599|  2.96k|                        value += 1;
 2600|  2.96k|                        if (value >= ps_sps->i2_pic_wd_in_ctb - start)
  ------------------
  |  Branch (2600:29): [True: 202, False: 2.76k]
  ------------------
 2601|    202|                        {
 2602|    202|                            return IHEVCD_INVALID_HEADER;
 2603|    202|                        }
 2604|  2.96k|                    }
 2605|  5.06k|                    else
 2606|  5.06k|                    {
 2607|  5.06k|                        value = ps_sps->i2_pic_wd_in_ctb - start;
 2608|  5.06k|                    }
 2609|  8.02k|                }
 2610|  9.42k|                else
 2611|  9.42k|                {
 2612|  9.42k|                    value = ((i + 1) * ps_sps->i2_pic_wd_in_ctb) / ps_pps->i1_num_tile_columns -
 2613|  9.42k|                                    (i * ps_sps->i2_pic_wd_in_ctb) / ps_pps->i1_num_tile_columns;
 2614|  9.42k|                }
 2615|       |
 2616|  77.3k|                for(j = 0; j < ps_pps->i1_num_tile_rows; j++)
  ------------------
  |  Branch (2616:28): [True: 60.1k, False: 17.2k]
  ------------------
 2617|  60.1k|                {
 2618|  60.1k|                    ps_tile = ps_pps->ps_tile + j * ps_pps->i1_num_tile_columns + i;
 2619|  60.1k|                    ps_tile->u1_pos_x = start;
 2620|  60.1k|                    ps_tile->u2_wd = value;
 2621|  60.1k|                }
 2622|  17.2k|                start += value;
 2623|       |
 2624|  17.2k|                if((start > ps_sps->i2_pic_wd_in_ctb) ||
  ------------------
  |  Branch (2624:20): [True: 0, False: 17.2k]
  ------------------
 2625|  17.2k|                                (value == 0))
  ------------------
  |  Branch (2625:33): [True: 0, False: 17.2k]
  ------------------
 2626|      0|                    return IHEVCD_INVALID_HEADER;
 2627|  17.2k|            }
 2628|       |
 2629|  9.87k|            start = 0;
 2630|  43.0k|            for(i = 0; i < (ps_pps->i1_num_tile_rows); i++)
  ------------------
  |  Branch (2630:24): [True: 33.3k, False: 9.77k]
  ------------------
 2631|  33.3k|            {
 2632|  33.3k|                tile_t *ps_tile;
 2633|  33.3k|                if(!ps_pps->i1_uniform_spacing_flag)
  ------------------
  |  Branch (2633:20): [True: 6.99k, False: 26.3k]
  ------------------
 2634|  6.99k|                {
 2635|  6.99k|                    if(i < (ps_pps->i1_num_tile_rows - 1))
  ------------------
  |  Branch (2635:24): [True: 2.03k, False: 4.96k]
  ------------------
 2636|  2.03k|                    {
 2637|       |
 2638|  2.03k|                        UEV_PARSE("row_height_minus1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|  2.03k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2639|  2.03k|                        value += 1;
 2640|  2.03k|                        if (value >= ps_sps->i2_pic_ht_in_ctb - start)
  ------------------
  |  Branch (2640:29): [True: 102, False: 1.93k]
  ------------------
 2641|    102|                        {
 2642|    102|                            return IHEVCD_INVALID_HEADER;
 2643|    102|                        }
 2644|  2.03k|                    }
 2645|  4.96k|                    else
 2646|  4.96k|                    {
 2647|  4.96k|                        value = ps_sps->i2_pic_ht_in_ctb - start;
 2648|  4.96k|                    }
 2649|  6.99k|                }
 2650|  26.3k|                else
 2651|  26.3k|                {
 2652|  26.3k|                    value = ((i + 1) * ps_sps->i2_pic_ht_in_ctb) / ps_pps->i1_num_tile_rows -
 2653|  26.3k|                                    (i * ps_sps->i2_pic_ht_in_ctb) / ps_pps->i1_num_tile_rows;
 2654|  26.3k|                }
 2655|       |
 2656|  89.4k|                for(j = 0; j < ps_pps->i1_num_tile_columns; j++)
  ------------------
  |  Branch (2656:28): [True: 56.2k, False: 33.1k]
  ------------------
 2657|  56.2k|                {
 2658|  56.2k|                    ps_tile = ps_pps->ps_tile + i * ps_pps->i1_num_tile_columns + j;
 2659|  56.2k|                    ps_tile->u1_pos_y = start;
 2660|  56.2k|                    ps_tile->u2_ht = value;
 2661|  56.2k|                }
 2662|  33.1k|                start += value;
 2663|       |
 2664|  33.1k|                if((start > ps_sps->i2_pic_ht_in_ctb) ||
  ------------------
  |  Branch (2664:20): [True: 0, False: 33.1k]
  ------------------
 2665|  33.1k|                                (value == 0))
  ------------------
  |  Branch (2665:33): [True: 0, False: 33.1k]
  ------------------
 2666|      0|                    return IHEVCD_INVALID_HEADER;
 2667|  33.1k|            }
 2668|  9.87k|        }
 2669|       |
 2670|       |
 2671|  9.77k|        BITS_PARSE("loop_filter_across_tiles_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  9.77k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2672|  9.77k|        ps_pps->i1_loop_filter_across_tiles_enabled_flag = value;
 2673|       |
 2674|  9.77k|    }
 2675|  55.1k|    else
 2676|  55.1k|    {
 2677|       |        /* If tiles are not present, set first tile in each PPS to have tile
 2678|       |        width and height equal to picture width and height */
 2679|  55.1k|        ps_pps->i1_num_tile_columns = 1;
 2680|  55.1k|        ps_pps->i1_num_tile_rows = 1;
 2681|  55.1k|        ps_pps->i1_uniform_spacing_flag = 1;
 2682|       |
 2683|  55.1k|        ps_pps->ps_tile->u1_pos_x = 0;
 2684|  55.1k|        ps_pps->ps_tile->u1_pos_y = 0;
 2685|  55.1k|        ps_pps->ps_tile->u2_wd = ps_sps->i2_pic_wd_in_ctb;
 2686|  55.1k|        ps_pps->ps_tile->u2_ht = ps_sps->i2_pic_ht_in_ctb;
 2687|  55.1k|    }
 2688|       |
 2689|  64.8k|    BITS_PARSE("loop_filter_across_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  64.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2690|  64.8k|    ps_pps->i1_loop_filter_across_slices_enabled_flag = value;
 2691|       |
 2692|  64.8k|    BITS_PARSE("deblocking_filter_control_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  64.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2693|  64.8k|    ps_pps->i1_deblocking_filter_control_present_flag = value;
 2694|       |
 2695|       |    /* Default values */
 2696|  64.8k|    ps_pps->i1_pic_disable_deblocking_filter_flag = 0;
 2697|  64.8k|    ps_pps->i1_deblocking_filter_override_enabled_flag = 0;
 2698|  64.8k|    ps_pps->i1_beta_offset_div2 = 0;
 2699|  64.8k|    ps_pps->i1_tc_offset_div2 = 0;
 2700|       |
 2701|  64.8k|    if(ps_pps->i1_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (2701:8): [True: 8.50k, False: 56.3k]
  ------------------
 2702|  8.50k|    {
 2703|       |
 2704|  8.50k|        BITS_PARSE("deblocking_filter_override_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.50k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2705|  8.50k|        ps_pps->i1_deblocking_filter_override_enabled_flag = value;
 2706|       |
 2707|  8.50k|        BITS_PARSE("pic_disable_deblocking_filter_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.50k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2708|  8.50k|        ps_pps->i1_pic_disable_deblocking_filter_flag = value;
 2709|       |
 2710|  8.50k|        if(!ps_pps->i1_pic_disable_deblocking_filter_flag)
  ------------------
  |  Branch (2710:12): [True: 4.49k, False: 4.01k]
  ------------------
 2711|  4.49k|        {
 2712|       |
 2713|  4.49k|            SEV_PARSE("pps_beta_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  4.49k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2714|  4.49k|            if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (2714:16): [True: 149, False: 4.34k]
  |  Branch (2714:33): [True: 111, False: 4.23k]
  ------------------
 2715|    260|            {
 2716|    260|                return IHEVCD_INVALID_PARAMETER;
 2717|    260|            }
 2718|  4.23k|            ps_pps->i1_beta_offset_div2 = i4_value;
 2719|       |
 2720|  4.23k|            SEV_PARSE("pps_tc_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  4.23k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2721|  4.23k|            if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (2721:16): [True: 80, False: 4.15k]
  |  Branch (2721:33): [True: 92, False: 4.05k]
  ------------------
 2722|    172|            {
 2723|    172|                return IHEVCD_INVALID_PARAMETER;
 2724|    172|            }
 2725|  4.05k|            ps_pps->i1_tc_offset_div2 = i4_value;
 2726|       |
 2727|  4.05k|        }
 2728|  8.50k|    }
 2729|       |
 2730|  64.4k|    BITS_PARSE("pps_scaling_list_data_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  64.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2731|  64.4k|    ps_pps->i1_pps_scaling_list_data_present_flag = value;
 2732|       |
 2733|  64.4k|    if(ps_pps->i1_pps_scaling_list_data_present_flag)
  ------------------
  |  Branch (2733:8): [True: 17.4k, False: 47.0k]
  ------------------
 2734|  17.4k|    {
 2735|  17.4k|        COPY_DEFAULT_SCALING_LIST(ps_pps->pi2_scaling_mat);
  ------------------
  |  |   77|  17.4k|#define COPY_DEFAULT_SCALING_LIST(pi2_scaling_mat)                                                                                      \
  |  |   78|  17.4k|{                                                                                                                                       \
  |  |   79|  17.4k|    WORD32 scaling_mat_offset[] = {0,   16,  32,  48,   64,   80,   96,   160,  224,  288,  352,  416,                                  \
  |  |   80|  17.4k|                                   480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136};                                \
  |  |   81|  17.4k|                                                                                                                                        \
  |  |   82|  17.4k|    /* scaling matrix for 4x4 */                                                                                                        \
  |  |   83|  17.4k|    memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16));                                                             \
  |  |   84|  17.4k|    /* scaling matrix for 8x8 */                                                                                                        \
  |  |   85|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   86|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[7], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   87|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[8], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   88|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[9], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   89|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[10], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   90|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[11], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   91|  17.4k|    /* scaling matrix for 16x16 */                                                                                                      \
  |  |   92|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   93|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[13], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   94|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[14], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   95|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   96|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[16], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   97|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[17], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   98|  17.4k|    /* scaling matrix for 32x32 */                                                                                                      \
  |  |   99|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  100|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  101|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[20], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  102|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[21], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  103|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[22], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  104|  17.4k|    memcpy(pi2_scaling_mat + scaling_mat_offset[23], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |  105|  17.4k|}
  ------------------
 2736|  17.4k|        ihevcd_scaling_list_data(ps_codec, ps_pps->pi2_scaling_mat, ps_sps->i1_chroma_format_idc);
 2737|  17.4k|    }
 2738|       |
 2739|  64.4k|    BITS_PARSE("lists_modification_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  64.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2740|  64.4k|    ps_pps->i1_lists_modification_present_flag = value;
 2741|  64.4k|    UEV_PARSE("log2_parallel_merge_level_minus2", value, ps_bitstrm);
  ------------------
  |  |  155|  64.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2742|  64.4k|    if(value > (ps_sps->i1_log2_min_coding_block_size + ps_sps->i1_log2_diff_max_min_coding_block_size))
  ------------------
  |  Branch (2742:8): [True: 821, False: 63.6k]
  ------------------
 2743|    821|    {
 2744|    821|        return IHEVCD_INVALID_PARAMETER;
 2745|    821|    }
 2746|  63.6k|    ps_pps->i1_log2_parallel_merge_level = value + 2;
 2747|       |
 2748|  63.6k|    BITS_PARSE("slice_header_extension_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  63.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2749|  63.6k|    ps_pps->i1_slice_header_extension_present_flag = value;
 2750|       |
 2751|  63.6k|    BITS_PARSE("pps_extension_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  63.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2752|  63.6k|    ps_pps->i1_pps_extension_present_flag = value;
 2753|       |
 2754|  63.6k|    if(ps_pps->i1_pps_extension_present_flag)
  ------------------
  |  Branch (2754:8): [True: 5.27k, False: 58.3k]
  ------------------
 2755|  5.27k|    {
 2756|  5.27k|        BITS_PARSE("pps_range_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.27k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2757|  5.27k|        ps_pps->i1_pps_range_extension_flag = value;
 2758|       |
 2759|  5.27k|        BITS_PARSE("pps_multilayer_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.27k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2760|  5.27k|        ps_pps->i1_pps_multilayer_extension_flag = value;
 2761|       |
 2762|  5.27k|        BITS_PARSE("pps_3d_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.27k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2763|  5.27k|        ps_pps->i1_pps_3d_extension_flag = value;
 2764|       |
 2765|  5.27k|        BITS_PARSE("pps_scc_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.27k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2766|  5.27k|        ps_pps->i1_pps_scc_extension_flag = value;
 2767|       |
 2768|  5.27k|        BITS_PARSE("pps_extension_4bits", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  5.27k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2769|  5.27k|        ps_pps->i1_pps_extension_4bits = value;
 2770|  5.27k|    }
 2771|  58.3k|    else
 2772|  58.3k|    {
 2773|  58.3k|        ps_pps->i1_pps_range_extension_flag = 0;
 2774|  58.3k|        ps_pps->i1_pps_multilayer_extension_flag = 0;
 2775|  58.3k|        ps_pps->i1_pps_3d_extension_flag = 0;
 2776|  58.3k|        ps_pps->i1_pps_scc_extension_flag = 0;
 2777|  58.3k|        ps_pps->i1_pps_extension_4bits = 0;
 2778|  58.3k|    }
 2779|       |
 2780|  63.6k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2781|  63.6k|    if(ps_pps->i1_pps_range_extension_flag)
  ------------------
  |  Branch (2781:8): [True: 3.35k, False: 60.2k]
  ------------------
 2782|  3.35k|    {
 2783|       |        /* ITU-T H.265 Section 7.3.2.3.2 Range extension PPS syntax */
 2784|  3.35k|        if(ps_pps->i1_transform_skip_enabled_flag)
  ------------------
  |  Branch (2784:12): [True: 1.64k, False: 1.70k]
  ------------------
 2785|  1.64k|        {
 2786|  1.64k|            UEV_PARSE("log2_max_transform_skip_block_size_minus2", value, ps_bitstrm);
  ------------------
  |  |  155|  1.64k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2787|  1.64k|            ps_pps->i1_log2_max_transform_skip_block_size_minus2 = value;
 2788|  1.64k|        }
 2789|       |
 2790|  3.35k|        BITS_PARSE("cross_component_prediction_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.35k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2791|  3.35k|        ps_pps->i1_cross_component_prediction_enabled_flag = value;
 2792|       |
 2793|       |        // Parse other bits to maintain bitstream alignment
 2794|  3.35k|        BITS_PARSE("chroma_qp_offset_list_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.35k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2795|  3.35k|        ps_pps->i1_chroma_qp_offset_list_enabled_flag = value;
 2796|       |
 2797|  3.35k|        if(ps_pps->i1_chroma_qp_offset_list_enabled_flag)
  ------------------
  |  Branch (2797:12): [True: 2.86k, False: 488]
  ------------------
 2798|  2.86k|        {
 2799|  2.86k|            UEV_PARSE("diff_cu_chroma_qp_offset_depth", value, ps_bitstrm);
  ------------------
  |  |  155|  2.86k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2800|  2.86k|            ps_pps->i4_diff_cu_chroma_qp_offset_depth = value;
 2801|       |
 2802|  2.86k|            UEV_PARSE("chroma_qp_offset_list_len_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  2.86k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2803|  2.86k|            ps_pps->i4_chroma_qp_offset_list_len_minus1 = value;
 2804|  2.86k|            if(ps_pps->i4_chroma_qp_offset_list_len_minus1 < 0
  ------------------
  |  Branch (2804:16): [True: 94, False: 2.76k]
  ------------------
 2805|  2.76k|                            || ps_pps->i4_chroma_qp_offset_list_len_minus1 > 5)
  ------------------
  |  Branch (2805:32): [True: 104, False: 2.66k]
  ------------------
 2806|    198|            {
 2807|    198|                return IHEVCD_INVALID_PARAMETER;
 2808|    198|            }
 2809|       |
 2810|  6.40k|            for(int i = 0; i <= ps_pps->i4_chroma_qp_offset_list_len_minus1; i++)
  ------------------
  |  Branch (2810:28): [True: 3.74k, False: 2.66k]
  ------------------
 2811|  3.74k|            {
 2812|       |                // cb_qp_offset_list[i] (se-v)
 2813|  3.74k|                SEV_PARSE("cb_qp_offset_list", value, ps_bitstrm);
  ------------------
  |  |  162|  3.74k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2814|  3.74k|                ps_pps->i4_cb_qp_offset_list[i] = value;
 2815|       |
 2816|       |                // cr_qp_offset_list[i] (se-v)
 2817|  3.74k|                SEV_PARSE("cr_qp_offset_list", value, ps_bitstrm);
  ------------------
  |  |  162|  3.74k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2818|  3.74k|                ps_pps->i4_cr_qp_offset_list[i] = value;
 2819|  3.74k|            }
 2820|  2.66k|        }
 2821|       |
 2822|       |        // log2_sao_offset_scale_luma (ue-v)
 2823|  3.15k|        UEV_PARSE("log2_sao_ofst_scale_luma", value, ps_bitstrm);
  ------------------
  |  |  155|  3.15k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2824|  3.15k|        ps_pps->i1_log2_sao_ofst_scale_luma = value;
 2825|       |
 2826|       |        // log2_sao_offset_scale_chroma (ue-v)
 2827|  3.15k|        UEV_PARSE("log2_sao_ofst_scale_chroma", value, ps_bitstrm);
  ------------------
  |  |  155|  3.15k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2828|  3.15k|        ps_pps->i1_log2_sao_ofst_scale_chroma = value;
 2829|  3.15k|    }
 2830|       |
 2831|  63.4k|    WORD32 profile = ihevcd_get_profile(&ps_sps->s_ptl.s_ptl_gen);
 2832|  63.4k|    if(profile != IHEVC_PROFILE_MAIN_REXT)
  ------------------
  |  Branch (2832:8): [True: 45.2k, False: 18.2k]
  ------------------
 2833|  45.2k|    {
 2834|  45.2k|        if(ps_pps->i1_log2_max_transform_skip_block_size_minus2
  ------------------
  |  Branch (2834:12): [True: 101, False: 45.1k]
  ------------------
 2835|  45.1k|                        || ps_pps->i1_cross_component_prediction_enabled_flag
  ------------------
  |  Branch (2835:28): [True: 150, False: 44.9k]
  ------------------
 2836|  44.9k|                        || ps_pps->i1_chroma_qp_offset_list_enabled_flag
  ------------------
  |  Branch (2836:28): [True: 69, False: 44.9k]
  ------------------
 2837|  44.9k|                        || ps_pps->i1_log2_sao_ofst_scale_luma
  ------------------
  |  Branch (2837:28): [True: 99, False: 44.8k]
  ------------------
 2838|  44.8k|                        || ps_pps->i1_log2_sao_ofst_scale_chroma)
  ------------------
  |  Branch (2838:28): [True: 71, False: 44.7k]
  ------------------
 2839|    490|        {
 2840|    490|            return IHEVCD_INVALID_PARAMETER;
 2841|    490|        }
 2842|  45.2k|    }
 2843|  62.9k|    if(ps_pps->i1_log2_sao_ofst_scale_luma
  ------------------
  |  Branch (2843:8): [True: 172, False: 62.7k]
  ------------------
 2844|  62.7k|                   || ps_pps->i1_log2_sao_ofst_scale_chroma)
  ------------------
  |  Branch (2844:23): [True: 78, False: 62.6k]
  ------------------
 2845|    250|    {
 2846|       |        // main-rext 8-bit profiles require these fields to be off
 2847|    250|        return IHEVCD_INVALID_PARAMETER;
 2848|    250|    }
 2849|       |
 2850|  62.6k|    if(ps_pps->i1_pps_multilayer_extension_flag || ps_pps->i1_pps_3d_extension_flag
  ------------------
  |  Branch (2850:8): [True: 136, False: 62.5k]
  |  Branch (2850:52): [True: 126, False: 62.4k]
  ------------------
 2851|  62.4k|                    || ps_pps->i1_pps_scc_extension_flag)
  ------------------
  |  Branch (2851:24): [True: 93, False: 62.3k]
  ------------------
 2852|    355|    {
 2853|       |        // TODO: add support for parsing these syntax elements
 2854|    355|        return IHEVCD_UNSUPPORTED_TOOL_SET;
 2855|    355|    }
 2856|       |#else
 2857|       |    if(ps_pps->i1_pps_range_extension_flag || ps_pps->i1_pps_multilayer_extension_flag
 2858|       |                    || ps_pps->i1_pps_3d_extension_flag || ps_pps->i1_pps_scc_extension_flag)
 2859|       |    {
 2860|       |        // TODO: add support for parsing these syntax elements
 2861|       |        return IHEVCD_UNSUPPORTED_TOOL_SET;
 2862|       |    }
 2863|       |#endif
 2864|       |
 2865|  62.3k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (2865:8): [True: 131, False: 62.2k]
  ------------------
 2866|    131|        return IHEVCD_INVALID_PARAMETER;
 2867|       |
 2868|  62.2k|    ps_codec->i4_pps_done = 1;
 2869|  62.2k|    return ret;
 2870|  62.3k|}
ihevcd_copy_pps:
 2874|  77.3k|{
 2875|  77.3k|    pps_t *ps_pps, *ps_pps_ref;
 2876|  77.3k|    WORD16 *pi2_scaling_mat_backup;
 2877|  77.3k|    WORD32 scaling_mat_size;
 2878|  77.3k|    tile_t *ps_tile_backup;
 2879|  77.3k|    WORD32 max_tile_cols, max_tile_rows;
 2880|  77.3k|    WORD32 wd, ht;
 2881|  77.3k|    wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  77.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2882|  77.3k|    ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  77.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2883|       |
 2884|  77.3k|    SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  186|  77.3k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  187|  77.3k|{                                                                            \
  |  |  188|  77.3k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  77.3k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  429|  77.3k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  189|  77.3k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  77.3k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  430|  77.3k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  190|  77.3k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  77.3k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  431|  77.3k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  191|  77.3k|    m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  77.3k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  432|  77.3k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  192|  77.3k|}
  ------------------
 2885|  77.3k|    max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  77.3k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  77.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  315|  77.3k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  77.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2886|  77.3k|    max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  77.3k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  77.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  318|  77.3k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  351|  77.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2887|       |
 2888|  77.3k|    ps_pps_ref = ps_codec->ps_pps_base + pps_id_ref;
 2889|  77.3k|    ps_pps = ps_codec->ps_pps_base + pps_id;
 2890|       |
 2891|  77.3k|    pi2_scaling_mat_backup = ps_pps->pi2_scaling_mat;
 2892|  77.3k|    ps_tile_backup = ps_pps->ps_tile;
 2893|       |
 2894|  77.3k|    memcpy(ps_pps, ps_pps_ref, sizeof(pps_t));
 2895|  77.3k|    ps_pps->pi2_scaling_mat = pi2_scaling_mat_backup;
 2896|  77.3k|    ps_pps->ps_tile = ps_tile_backup;
 2897|  77.3k|    memcpy(ps_pps->pi2_scaling_mat, ps_pps_ref->pi2_scaling_mat, scaling_mat_size * sizeof(WORD16));
 2898|  77.3k|    memcpy(ps_pps->ps_tile, ps_pps_ref->ps_tile, max_tile_cols * max_tile_rows * sizeof(tile_t));
 2899|       |
 2900|  77.3k|    ps_pps->i1_pps_valid = 1;
 2901|       |
 2902|  77.3k|    ps_codec->s_parse.ps_pps = ps_pps;
 2903|  77.3k|}
ihevcd_parse_buffering_period_sei:
 2909|  1.46k|{
 2910|  1.46k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 2911|  1.46k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 2912|  1.46k|    UWORD32 value;
 2913|  1.46k|    vui_t *ps_vui;
 2914|  1.46k|    buf_period_sei_params_t *ps_buf_period_sei_params;
 2915|  1.46k|    UWORD32 i;
 2916|  1.46k|    hrd_params_t *ps_vui_hdr;
 2917|  1.46k|    UWORD32 u4_cpb_cnt;
 2918|       |
 2919|  1.46k|    ps_vui = &ps_sps->s_vui_parameters;
 2920|  1.46k|    ps_vui_hdr = &ps_vui->s_vui_hrd_parameters;
 2921|       |
 2922|  1.46k|    ps_buf_period_sei_params = &ps_parse->s_sei_params.s_buf_period_sei_params;
 2923|       |
 2924|  1.46k|    ps_parse->s_sei_params.i1_buf_period_params_present_flag = 1;
 2925|       |
 2926|  1.46k|    UEV_PARSE("bp_seq_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|  1.46k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2927|  1.46k|    if(value > MAX_SPS_CNT - 2)
  ------------------
  |  |  327|  1.46k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (2927:8): [True: 495, False: 970]
  ------------------
 2928|    495|    {
 2929|    495|        return IHEVCD_INVALID_PARAMETER;
 2930|    495|    }
 2931|    970|    ps_buf_period_sei_params->u1_bp_seq_parameter_set_id = value;
 2932|       |
 2933|    970|    if(!ps_vui_hdr->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (2933:8): [True: 729, False: 241]
  ------------------
 2934|    729|    {
 2935|    729|        BITS_PARSE("irap_cpb_params_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    729|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2936|    729|        ps_buf_period_sei_params->u1_rap_cpb_params_present_flag = value;
 2937|    729|    }
 2938|       |
 2939|    970|    if(ps_buf_period_sei_params->u1_rap_cpb_params_present_flag)
  ------------------
  |  Branch (2939:8): [True: 237, False: 733]
  ------------------
 2940|    237|    {
 2941|    237|        BITS_PARSE("cpb_delay_offset",
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2942|    237|                   value,
 2943|    237|                   ps_bitstrm,
 2944|    237|                   (ps_vui_hdr->u1_au_cpb_removal_delay_length_minus1
 2945|    237|                                   + 1));
 2946|    237|        ps_buf_period_sei_params->u4_cpb_delay_offset = value;
 2947|       |
 2948|    237|        BITS_PARSE("dpb_delay_offset",
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2949|    237|                   value,
 2950|    237|                   ps_bitstrm,
 2951|    237|                   (ps_vui_hdr->u1_dpb_output_delay_length_minus1
 2952|    237|                                   + 1));
 2953|    237|        ps_buf_period_sei_params->u4_dpb_delay_offset = value;
 2954|    237|    }
 2955|    733|    else
 2956|    733|    {
 2957|    733|        ps_buf_period_sei_params->u4_cpb_delay_offset = 0;
 2958|    733|        ps_buf_period_sei_params->u4_dpb_delay_offset = 0;
 2959|    733|    }
 2960|       |
 2961|    970|    BITS_PARSE("concatenation_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    970|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2962|    970|    ps_buf_period_sei_params->u1_concatenation_flag = value;
 2963|       |
 2964|    970|    BITS_PARSE("au_cpb_removal_delay_delta_minus1",
  ------------------
  |  |  148|    970|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2965|    970|               value,
 2966|    970|               ps_bitstrm,
 2967|    970|               (ps_vui_hdr->u1_au_cpb_removal_delay_length_minus1
 2968|    970|                               + 1));
 2969|    970|    ps_buf_period_sei_params->u4_au_cpb_removal_delay_delta_minus1 = value;
 2970|       |
 2971|    970|    if(ps_vui_hdr->u1_nal_hrd_parameters_present_flag)
  ------------------
  |  Branch (2971:8): [True: 278, False: 692]
  ------------------
 2972|    278|    {
 2973|    278|        u4_cpb_cnt = ps_vui_hdr->au1_cpb_cnt_minus1[0];
 2974|       |
 2975|  2.70k|        for(i = 0; i <= u4_cpb_cnt; i++)
  ------------------
  |  Branch (2975:20): [True: 2.42k, False: 278]
  ------------------
 2976|  2.42k|        {
 2977|  2.42k|            BITS_PARSE("nal_initial_cpb_removal_delay[i]",
  ------------------
  |  |  148|  2.42k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2978|  2.42k|                       value,
 2979|  2.42k|                       ps_bitstrm,
 2980|  2.42k|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2981|  2.42k|                                       + 1));
 2982|  2.42k|            ps_buf_period_sei_params->au4_nal_initial_cpb_removal_delay[i] =
 2983|  2.42k|                            value;
 2984|       |
 2985|  2.42k|            BITS_PARSE("nal_initial_cpb_removal_delay_offset",
  ------------------
  |  |  148|  2.42k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2986|  2.42k|                       value,
 2987|  2.42k|                       ps_bitstrm,
 2988|  2.42k|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2989|  2.42k|                                       + 1));
 2990|  2.42k|            ps_buf_period_sei_params->au4_nal_initial_cpb_removal_delay_offset[i] =
 2991|  2.42k|                            value;
 2992|       |
 2993|  2.42k|            if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag
  ------------------
  |  Branch (2993:16): [True: 417, False: 2.00k]
  ------------------
 2994|  2.00k|                            || ps_buf_period_sei_params->u1_rap_cpb_params_present_flag)
  ------------------
  |  Branch (2994:32): [True: 672, False: 1.33k]
  ------------------
 2995|  1.08k|            {
 2996|  1.08k|                BITS_PARSE("nal_initial_alt_cpb_removal_delay[i]",
  ------------------
  |  |  148|  1.08k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2997|  1.08k|                           value,
 2998|  1.08k|                           ps_bitstrm,
 2999|  1.08k|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 3000|  1.08k|                                           + 1));
 3001|  1.08k|                ps_buf_period_sei_params->au4_nal_initial_alt_cpb_removal_delay[i] =
 3002|  1.08k|                                value;
 3003|       |
 3004|  1.08k|                BITS_PARSE("nal_initial_alt_cpb_removal_delay_offset",
  ------------------
  |  |  148|  1.08k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3005|  1.08k|                           value,
 3006|  1.08k|                           ps_bitstrm,
 3007|  1.08k|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 3008|  1.08k|                                           + 1));
 3009|  1.08k|                ps_buf_period_sei_params->au4_nal_initial_alt_cpb_removal_delay_offset[i] =
 3010|  1.08k|                                value;
 3011|  1.08k|            }
 3012|  2.42k|        }
 3013|    278|    }
 3014|       |
 3015|    970|    if(ps_vui_hdr->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (3015:8): [True: 285, False: 685]
  ------------------
 3016|    285|    {
 3017|    285|        u4_cpb_cnt = ps_vui_hdr->au1_cpb_cnt_minus1[0];
 3018|       |
 3019|  3.47k|        for(i = 0; i <= u4_cpb_cnt; i++)
  ------------------
  |  Branch (3019:20): [True: 3.19k, False: 285]
  ------------------
 3020|  3.19k|        {
 3021|  3.19k|            BITS_PARSE("vcl_initial_cpb_removal_delay[i]",
  ------------------
  |  |  148|  3.19k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3022|  3.19k|                       value,
 3023|  3.19k|                       ps_bitstrm,
 3024|  3.19k|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 3025|  3.19k|                                       + 1));
 3026|  3.19k|            ps_buf_period_sei_params->au4_vcl_initial_cpb_removal_delay[i] =
 3027|  3.19k|                            value;
 3028|       |
 3029|  3.19k|            BITS_PARSE("vcl_initial_cpb_removal_delay_offset",
  ------------------
  |  |  148|  3.19k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3030|  3.19k|                       value,
 3031|  3.19k|                       ps_bitstrm,
 3032|  3.19k|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 3033|  3.19k|                                       + 1));
 3034|  3.19k|            ps_buf_period_sei_params->au4_vcl_initial_cpb_removal_delay_offset[i] =
 3035|  3.19k|                            value;
 3036|       |
 3037|  3.19k|            if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag
  ------------------
  |  Branch (3037:16): [True: 2.39k, False: 795]
  ------------------
 3038|    795|                            || ps_buf_period_sei_params->u1_rap_cpb_params_present_flag)
  ------------------
  |  Branch (3038:32): [True: 287, False: 508]
  ------------------
 3039|  2.68k|            {
 3040|  2.68k|                BITS_PARSE("vcl_initial_alt_cpb_removal_delay[i]",
  ------------------
  |  |  148|  2.68k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3041|  2.68k|                           value,
 3042|  2.68k|                           ps_bitstrm,
 3043|  2.68k|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 3044|  2.68k|                                           + 1));
 3045|  2.68k|                ps_buf_period_sei_params->au4_vcl_initial_alt_cpb_removal_delay[i] =
 3046|  2.68k|                                value;
 3047|       |
 3048|  2.68k|                BITS_PARSE("vcl_initial_alt_cpb_removal_delay_offset",
  ------------------
  |  |  148|  2.68k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3049|  2.68k|                           value,
 3050|  2.68k|                           ps_bitstrm,
 3051|  2.68k|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 3052|  2.68k|                                           + 1));
 3053|  2.68k|                ps_buf_period_sei_params->au4_vcl_initial_alt_cpb_removal_delay_offset[i] =
 3054|  2.68k|                                value;
 3055|  2.68k|            }
 3056|  3.19k|        }
 3057|    285|    }
 3058|       |
 3059|    970|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3060|  1.46k|}
ihevcd_parse_pic_timing_sei:
 3063|  2.92k|{
 3064|  2.92k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3065|  2.92k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3066|  2.92k|    UWORD32 value;
 3067|  2.92k|    vui_t *ps_vui;
 3068|  2.92k|    UWORD32 i;
 3069|  2.92k|    hrd_params_t *ps_vui_hdr;
 3070|  2.92k|    UWORD32 u4_cpb_dpb_delays_present_flag = 0;
 3071|  2.92k|    pic_timing_sei_params_t *ps_pic_timing;
 3072|       |
 3073|  2.92k|    ps_pic_timing = &ps_parse->s_sei_params.s_pic_timing_sei_params;
 3074|  2.92k|    ps_vui = &ps_sps->s_vui_parameters;
 3075|  2.92k|    ps_vui_hdr = &ps_vui->s_vui_hrd_parameters;
 3076|  2.92k|    ps_parse->s_sei_params.i1_pic_timing_params_present_flag = 1;
 3077|  2.92k|    if(ps_vui->u1_frame_field_info_present_flag)
  ------------------
  |  Branch (3077:8): [True: 1.88k, False: 1.03k]
  ------------------
 3078|  1.88k|    {
 3079|  1.88k|        BITS_PARSE("pic_struct", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  1.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3080|  1.88k|        ps_pic_timing->u4_pic_struct = value;
 3081|       |
 3082|  1.88k|        BITS_PARSE("source_scan_type", value, ps_bitstrm, 2);
  ------------------
  |  |  148|  1.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3083|  1.88k|        ps_pic_timing->u4_source_scan_type = value;
 3084|       |
 3085|  1.88k|        BITS_PARSE("duplicate_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3086|  1.88k|        ps_pic_timing->u1_duplicate_flag = value;
 3087|  1.88k|    }
 3088|       |
 3089|  2.92k|    if(ps_vui_hdr->u1_nal_hrd_parameters_present_flag
  ------------------
  |  Branch (3089:8): [True: 1.52k, False: 1.39k]
  ------------------
 3090|  1.39k|                    || ps_vui_hdr->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (3090:24): [True: 356, False: 1.04k]
  ------------------
 3091|  1.88k|    {
 3092|  1.88k|        u4_cpb_dpb_delays_present_flag = 1;
 3093|  1.88k|    }
 3094|  1.04k|    else
 3095|  1.04k|    {
 3096|  1.04k|        u4_cpb_dpb_delays_present_flag = 0;
 3097|  1.04k|    }
 3098|       |
 3099|  2.92k|    if(u4_cpb_dpb_delays_present_flag)
  ------------------
  |  Branch (3099:8): [True: 1.88k, False: 1.04k]
  ------------------
 3100|  1.88k|    {
 3101|  1.88k|        BITS_PARSE("au_cpb_removal_delay_minus1", value, ps_bitstrm,
  ------------------
  |  |  148|  1.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3102|  1.88k|                   (ps_vui_hdr->u1_au_cpb_removal_delay_length_minus1 + 1));
 3103|  1.88k|        ps_pic_timing->u4_au_cpb_removal_delay_minus1 = value;
 3104|       |
 3105|  1.88k|        BITS_PARSE("pic_dpb_output_delay", value, ps_bitstrm,
  ------------------
  |  |  148|  1.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3106|  1.88k|                   (ps_vui_hdr->u1_dpb_output_delay_length_minus1 + 1));
 3107|  1.88k|        ps_pic_timing->u4_pic_dpb_output_delay = value;
 3108|       |
 3109|  1.88k|        if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (3109:12): [True: 1.68k, False: 198]
  ------------------
 3110|  1.68k|        {
 3111|  1.68k|            BITS_PARSE("pic_dpb_output_du_delay", value, ps_bitstrm,
  ------------------
  |  |  148|  1.68k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3112|  1.68k|                       (ps_vui_hdr->u1_dpb_output_delay_du_length_minus1 + 1));
 3113|  1.68k|            ps_pic_timing->u4_pic_dpb_output_du_delay = value;
 3114|  1.68k|        }
 3115|       |
 3116|  1.88k|        if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag
  ------------------
  |  Branch (3116:12): [True: 1.68k, False: 198]
  ------------------
 3117|  1.68k|                        && ps_vui_hdr->u1_sub_pic_cpb_params_in_pic_timing_sei_flag)
  ------------------
  |  Branch (3117:28): [True: 1.45k, False: 231]
  ------------------
 3118|  1.45k|        {
 3119|  1.45k|            UWORD32 num_units_minus1;
 3120|  1.45k|            UWORD32 array_size;
 3121|       |
 3122|  1.45k|            UEV_PARSE("num_decoding_units_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  1.45k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 3123|  1.45k|            if(value > (ps_sps->i4_pic_size_in_ctb -1))
  ------------------
  |  Branch (3123:16): [True: 551, False: 903]
  ------------------
 3124|    551|            {
 3125|    551|                return IHEVCD_INVALID_PARAMETER;
 3126|    551|            }
 3127|    903|            ps_pic_timing->u4_num_decoding_units_minus1 = value;
 3128|       |
 3129|    903|            num_units_minus1 = ps_pic_timing->u4_num_decoding_units_minus1;
 3130|    903|            array_size = (sizeof(ps_pic_timing->au4_num_nalus_in_du_minus1)
 3131|    903|                       / sizeof(ps_pic_timing->au4_num_nalus_in_du_minus1[0]));
 3132|    903|            num_units_minus1 = CLIP3(num_units_minus1, 0,(array_size - 1));
  ------------------
  |  |   40|    903|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 72, False: 831]
  |  |  |  Branch (40:53): [True: 0, False: 831]
  |  |  ------------------
  ------------------
 3133|    903|            ps_pic_timing->u4_num_decoding_units_minus1 = num_units_minus1;
 3134|       |
 3135|    903|            BITS_PARSE("du_common_cpb_removal_delay_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    903|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3136|    903|            ps_pic_timing->u1_du_common_cpb_removal_delay_flag = value;
 3137|       |
 3138|    903|            if(ps_pic_timing->u1_du_common_cpb_removal_delay_flag)
  ------------------
  |  Branch (3138:16): [True: 459, False: 444]
  ------------------
 3139|    459|            {
 3140|    459|                BITS_PARSE("du_common_cpb_removal_delay_increment_minus1",
  ------------------
  |  |  148|    459|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3141|    459|                           value,
 3142|    459|                           ps_bitstrm,
 3143|    459|                           (ps_vui_hdr->u1_du_cpb_removal_delay_increment_length_minus1
 3144|    459|                                           + 1));
 3145|    459|                ps_pic_timing->u4_du_common_cpb_removal_delay_increment_minus1 =
 3146|    459|                                value;
 3147|    459|            }
 3148|       |
 3149|  5.93k|            for(i = 0; i <= ps_pic_timing->u4_num_decoding_units_minus1; i++)
  ------------------
  |  Branch (3149:24): [True: 5.41k, False: 523]
  ------------------
 3150|  5.41k|            {
 3151|  5.41k|                UEV_PARSE("num_nalus_in_du_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  5.41k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 3152|  5.41k|                if(value > (ps_sps->i4_pic_size_in_ctb -1))
  ------------------
  |  Branch (3152:20): [True: 380, False: 5.03k]
  ------------------
 3153|    380|                {
 3154|    380|                    return IHEVCD_INVALID_PARAMETER;
 3155|    380|                }
 3156|  5.03k|                ps_pic_timing->au4_num_nalus_in_du_minus1[i] = value;
 3157|       |
 3158|  5.03k|                if((!ps_pic_timing->u1_du_common_cpb_removal_delay_flag)
  ------------------
  |  Branch (3158:20): [True: 1.04k, False: 3.99k]
  ------------------
 3159|  1.04k|                                && (i < ps_pic_timing->u4_num_decoding_units_minus1))
  ------------------
  |  Branch (3159:36): [True: 731, False: 311]
  ------------------
 3160|    731|                {
 3161|    731|                    BITS_PARSE("du_common_cpb_removal_delay_increment_minus1",
  ------------------
  |  |  148|    731|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3162|    731|                               value,
 3163|    731|                               ps_bitstrm,
 3164|    731|                               (ps_vui_hdr->u1_du_cpb_removal_delay_increment_length_minus1
 3165|    731|                                               + 1));
 3166|    731|                    ps_pic_timing->au4_du_cpb_removal_delay_increment_minus1[i] =
 3167|    731|                                    value;
 3168|    731|                }
 3169|  5.03k|            }
 3170|    903|        }
 3171|  1.88k|    }
 3172|       |
 3173|  1.99k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3174|  2.92k|}
ihevcd_parse_time_code_sei:
 3177|  1.54k|{
 3178|  1.54k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3179|  1.54k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3180|  1.54k|    UWORD32 value;
 3181|  1.54k|    time_code_t *ps_time_code;
 3182|  1.54k|    WORD32 i;
 3183|       |
 3184|  1.54k|    ps_parse->s_sei_params.i1_time_code_present_flag = 1;
 3185|  1.54k|    ps_time_code = &ps_parse->s_sei_params.s_time_code;
 3186|       |
 3187|  1.54k|    BITS_PARSE("num_clock_ts", value, ps_bitstrm, 2);
  ------------------
  |  |  148|  1.54k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3188|  1.54k|    ps_time_code->u1_num_clock_ts = value;
 3189|       |
 3190|  5.42k|    for(i = 0; i < ps_time_code->u1_num_clock_ts; i++)
  ------------------
  |  Branch (3190:16): [True: 3.88k, False: 1.54k]
  ------------------
 3191|  3.88k|    {
 3192|  3.88k|        BITS_PARSE("clock_timestamp_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3193|  3.88k|        ps_time_code->au1_clock_timestamp_flag[i] = value;
 3194|       |
 3195|  3.88k|        if(ps_time_code->au1_clock_timestamp_flag[i])
  ------------------
  |  Branch (3195:12): [True: 2.37k, False: 1.51k]
  ------------------
 3196|  2.37k|        {
 3197|  2.37k|            BITS_PARSE("units_field_based_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3198|  2.37k|            ps_time_code->au1_units_field_based_flag[i] = value;
 3199|       |
 3200|  2.37k|            BITS_PARSE("counting_type[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3201|  2.37k|            ps_time_code->au1_counting_type[i] = value;
 3202|       |
 3203|  2.37k|            BITS_PARSE("full_timestamp_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3204|  2.37k|            ps_time_code->au1_full_timestamp_flag[i] = value;
 3205|       |
 3206|  2.37k|            BITS_PARSE("discontinuity_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3207|  2.37k|            ps_time_code->au1_discontinuity_flag[i] = value;
 3208|       |
 3209|  2.37k|            BITS_PARSE("cnt_dropped_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3210|  2.37k|            ps_time_code->au1_cnt_dropped_flag[i] = value;
 3211|       |
 3212|  2.37k|            BITS_PARSE("n_frames[i]", value, ps_bitstrm, 9);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3213|  2.37k|            ps_time_code->au2_n_frames[i] = value;
 3214|       |
 3215|  2.37k|            if(ps_time_code->au1_full_timestamp_flag[i])
  ------------------
  |  Branch (3215:16): [True: 303, False: 2.07k]
  ------------------
 3216|    303|            {
 3217|    303|                BITS_PARSE("seconds_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|    303|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3218|    303|                ps_time_code->au1_seconds_value[i] = value;
 3219|       |
 3220|    303|                BITS_PARSE("minutes_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|    303|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3221|    303|                ps_time_code->au1_minutes_value[i] = value;
 3222|       |
 3223|    303|                BITS_PARSE("hours_value[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|    303|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3224|    303|                ps_time_code->au1_hours_value[i] = value;
 3225|    303|            }
 3226|  2.07k|            else
 3227|  2.07k|            {
 3228|  2.07k|                BITS_PARSE("seconds_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.07k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3229|  2.07k|                ps_time_code->au1_seconds_flag[i] = value;
 3230|       |
 3231|  2.07k|                if(ps_time_code->au1_seconds_flag[i])
  ------------------
  |  Branch (3231:20): [True: 1.49k, False: 580]
  ------------------
 3232|  1.49k|                {
 3233|  1.49k|                    BITS_PARSE("seconds_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|  1.49k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3234|  1.49k|                    ps_time_code->au1_seconds_value[i] = value;
 3235|       |
 3236|  1.49k|                    BITS_PARSE("minutes_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.49k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3237|  1.49k|                    ps_time_code->au1_minutes_flag[i] = value;
 3238|       |
 3239|  1.49k|                    if(ps_time_code->au1_minutes_flag[i])
  ------------------
  |  Branch (3239:24): [True: 530, False: 960]
  ------------------
 3240|    530|                    {
 3241|    530|                        BITS_PARSE("minutes_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|    530|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3242|    530|                        ps_time_code->au1_minutes_value[i] = value;
 3243|       |
 3244|    530|                        BITS_PARSE("hours_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    530|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3245|    530|                        ps_time_code->au1_hours_flag[i] = value;
 3246|       |
 3247|    530|                        if(ps_time_code->au1_hours_flag[i])
  ------------------
  |  Branch (3247:28): [True: 445, False: 85]
  ------------------
 3248|    445|                        {
 3249|    445|                            BITS_PARSE("hours_value[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|    445|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3250|    445|                            ps_time_code->au1_hours_value[i] = value;
 3251|    445|                        }
 3252|    530|                    }
 3253|  1.49k|                }
 3254|  2.07k|            }
 3255|       |
 3256|  2.37k|            BITS_PARSE("time_offset_length[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|  2.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3257|  2.37k|            ps_time_code->au1_time_offset_length[i] = value;
 3258|       |
 3259|  2.37k|            if(ps_time_code->au1_time_offset_length[i] > 0)
  ------------------
  |  Branch (3259:16): [True: 1.91k, False: 457]
  ------------------
 3260|  1.91k|            {
 3261|  1.91k|                BITS_PARSE("time_offset_value[i]", value, ps_bitstrm,
  ------------------
  |  |  148|  1.91k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3262|  1.91k|                           ps_time_code->au1_time_offset_length[i]);
 3263|  1.91k|                ps_time_code->au1_time_offset_value[i] = value;
 3264|  1.91k|            }
 3265|    457|            else
 3266|    457|            {
 3267|    457|                ps_time_code->au1_time_offset_value[i] = 0;
 3268|    457|            }
 3269|  2.37k|        }
 3270|  3.88k|    }
 3271|       |
 3272|  1.54k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3273|  1.54k|}
ihevcd_parse_mastering_disp_params_sei:
 3276|    132|{
 3277|    132|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3278|    132|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3279|    132|    UWORD32 value;
 3280|    132|    mastering_dis_col_vol_sei_params_t *ps_mastering_dis_col_vol;
 3281|    132|    WORD32 i;
 3282|       |
 3283|    132|    ps_parse->s_sei_params.i4_sei_mastering_disp_colour_vol_params_present_flags = 1;
 3284|       |
 3285|    132|    ps_mastering_dis_col_vol = &ps_parse->s_sei_params.s_mastering_dis_col_vol_sei_params;
 3286|       |
 3287|    528|    for(i = 0; i < 3; i++)
  ------------------
  |  Branch (3287:16): [True: 396, False: 132]
  ------------------
 3288|    396|    {
 3289|    396|        BITS_PARSE("display_primaries_x[c]", value, ps_bitstrm, 16);
  ------------------
  |  |  148|    396|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3290|    396|        ps_mastering_dis_col_vol->au2_display_primaries_x[i] = value;
 3291|       |
 3292|    396|        BITS_PARSE("display_primaries_y[c]", value, ps_bitstrm, 16);
  ------------------
  |  |  148|    396|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3293|    396|        ps_mastering_dis_col_vol->au2_display_primaries_y[i] = value;
 3294|    396|    }
 3295|       |
 3296|    132|    BITS_PARSE("white_point_x", value, ps_bitstrm, 16);
  ------------------
  |  |  148|    132|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3297|    132|    ps_mastering_dis_col_vol->u2_white_point_x = value;
 3298|       |
 3299|    132|    BITS_PARSE("white_point_y", value, ps_bitstrm, 16);
  ------------------
  |  |  148|    132|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3300|    132|    ps_mastering_dis_col_vol->u2_white_point_y = value;
 3301|       |
 3302|    132|    BITS_PARSE("max_display_mastering_luminance", value, ps_bitstrm, 32);
  ------------------
  |  |  148|    132|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3303|    132|    ps_mastering_dis_col_vol->u4_max_display_mastering_luminance = value;
 3304|       |
 3305|    132|    BITS_PARSE("min_display_mastering_luminance", value, ps_bitstrm, 32);
  ------------------
  |  |  148|    132|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3306|    132|    ps_mastering_dis_col_vol->u4_min_display_mastering_luminance = value;
 3307|       |
 3308|    132|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3309|    132|}
ihevcd_parse_user_data_registered_itu_t_t35:
 3313|    234|{
 3314|    234|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3315|    234|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3316|    234|    UWORD32 value;
 3317|    234|    user_data_registered_itu_t_t35_t *ps_user_data_registered_itu_t_t35;
 3318|    234|    UWORD32 i;
 3319|    234|    UWORD32 j = 0;
 3320|       |
 3321|    234|    ps_parse->s_sei_params.i1_user_data_registered_present_flag = 1;
 3322|    234|    ps_user_data_registered_itu_t_t35 =
 3323|    234|                    &ps_parse->s_sei_params.as_user_data_registered_itu_t_t35[ps_parse->s_sei_params.i4_sei_user_data_cnt];
 3324|    234|    ps_parse->s_sei_params.i4_sei_user_data_cnt++;
 3325|       |
 3326|    234|    ps_user_data_registered_itu_t_t35->i4_payload_size = u4_payload_size;
 3327|       |
 3328|    234|    if(u4_payload_size > MAX_USERDATA_PAYLOAD)
  ------------------
  |  |  531|    234|#define MAX_USERDATA_PAYLOAD 256
  ------------------
  |  Branch (3328:8): [True: 7, False: 227]
  ------------------
 3329|      7|    {
 3330|      7|        u4_payload_size = MAX_USERDATA_PAYLOAD;
  ------------------
  |  |  531|      7|#define MAX_USERDATA_PAYLOAD 256
  ------------------
 3331|      7|    }
 3332|       |
 3333|    234|    ps_user_data_registered_itu_t_t35->i4_valid_payload_size = u4_payload_size;
 3334|       |
 3335|    234|    BITS_PARSE("itu_t_t35_country_code", value, ps_bitstrm, 8);
  ------------------
  |  |  148|    234|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3336|    234|    ps_user_data_registered_itu_t_t35->u1_itu_t_t35_country_code = value;
 3337|       |
 3338|    234|    if(0xFF != ps_user_data_registered_itu_t_t35->u1_itu_t_t35_country_code)
  ------------------
  |  Branch (3338:8): [True: 215, False: 19]
  ------------------
 3339|    215|    {
 3340|    215|        i = 1;
 3341|    215|    }
 3342|     19|    else
 3343|     19|    {
 3344|     19|        BITS_PARSE("itu_t_t35_country_code_extension_byte", value, ps_bitstrm,
  ------------------
  |  |  148|     19|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3345|     19|                   8);
 3346|     19|        ps_user_data_registered_itu_t_t35->u1_itu_t_t35_country_code_extension_byte =
 3347|     19|                        value;
 3348|       |
 3349|     19|        i = 2;
 3350|     19|    }
 3351|       |
 3352|    234|    do
 3353|  3.45k|    {
 3354|  3.45k|        BITS_PARSE("itu_t_t35_payload_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  3.45k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3355|  3.45k|        ps_user_data_registered_itu_t_t35->u1_itu_t_t35_payload_byte[j++] =
 3356|  3.45k|                        value;
 3357|       |
 3358|  3.45k|        i++;
 3359|  3.45k|    }while(i < u4_payload_size);
  ------------------
  |  Branch (3359:12): [True: 3.22k, False: 234]
  ------------------
 3360|       |
 3361|    234|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3362|    234|}
ihevcd_parse_sei_payload:
 3368|   324k|{
 3369|   324k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3370|   324k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3371|   324k|    WORD32 payload_bits_remaining = 0;
 3372|   324k|    sps_t *ps_sps = NULL;
 3373|       |
 3374|   324k|    UWORD32 i;
 3375|       |
 3376|  5.69M|    for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  327|  5.69M|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (3376:16): [True: 5.37M, False: 314k]
  ------------------
 3377|  5.37M|    {
 3378|  5.37M|        if(ps_codec->ps_sps_base[i].i1_sps_valid)
  ------------------
  |  Branch (3378:12): [True: 9.59k, False: 5.36M]
  ------------------
 3379|  9.59k|        {
 3380|  9.59k|            ps_sps = ps_codec->ps_sps_base + i;
 3381|  9.59k|            break;
 3382|  9.59k|        }
 3383|  5.37M|    }
 3384|   324k|    if(!ps_sps)
  ------------------
  |  Branch (3384:8): [True: 314k, False: 9.59k]
  ------------------
 3385|   314k|    {
 3386|   314k|        return;
 3387|   314k|    }
 3388|       |
 3389|  9.59k|    if(NAL_PREFIX_SEI == i1_nal_type)
  ------------------
  |  Branch (3389:8): [True: 8.13k, False: 1.45k]
  ------------------
 3390|  8.13k|    {
 3391|  8.13k|        switch(u4_payload_type)
 3392|  8.13k|        {
 3393|  1.46k|            case SEI_BUFFERING_PERIOD:
  ------------------
  |  Branch (3393:13): [True: 1.46k, False: 6.67k]
  ------------------
 3394|  1.46k|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 3395|  1.46k|                ihevcd_parse_buffering_period_sei(ps_codec, ps_sps);
 3396|  1.46k|                break;
 3397|       |
 3398|  2.92k|            case SEI_PICTURE_TIMING:
  ------------------
  |  Branch (3398:13): [True: 2.92k, False: 5.21k]
  ------------------
 3399|  2.92k|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 3400|  2.92k|                ihevcd_parse_pic_timing_sei(ps_codec, ps_sps);
 3401|  2.92k|                break;
 3402|       |
 3403|  1.54k|            case SEI_TIME_CODE:
  ------------------
  |  Branch (3403:13): [True: 1.54k, False: 6.59k]
  ------------------
 3404|  1.54k|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 3405|  1.54k|                ihevcd_parse_time_code_sei(ps_codec);
 3406|  1.54k|                break;
 3407|       |
 3408|    132|            case SEI_MASTERING_DISPLAY_COLOUR_VOLUME:
  ------------------
  |  Branch (3408:13): [True: 132, False: 8.00k]
  ------------------
 3409|    132|                ps_parse->s_sei_params.i4_sei_mastering_disp_colour_vol_params_present_flags = 1;
 3410|    132|                ihevcd_parse_mastering_disp_params_sei(ps_codec);
 3411|    132|                break;
 3412|       |
 3413|    994|            case SEI_USER_DATA_REGISTERED_ITU_T_T35:
  ------------------
  |  Branch (3413:13): [True: 994, False: 7.14k]
  ------------------
 3414|    994|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 3415|    994|                if(ps_parse->s_sei_params.i4_sei_user_data_cnt >= USER_DATA_MAX)
  ------------------
  |  Branch (3415:20): [True: 884, False: 110]
  ------------------
 3416|    884|                {
 3417|  1.46k|                    for(i = 0; i < u4_payload_size / 4; i++)
  ------------------
  |  Branch (3417:32): [True: 580, False: 884]
  ------------------
 3418|    580|                    {
 3419|    580|                        ihevcd_bits_flush(ps_bitstrm, 4 * 8);
 3420|    580|                    }
 3421|       |
 3422|    884|                    ihevcd_bits_flush(ps_bitstrm, (u4_payload_size - i * 4) * 8);
 3423|    884|                }
 3424|    110|                else
 3425|    110|                {
 3426|    110|                    ihevcd_parse_user_data_registered_itu_t_t35(ps_codec,
 3427|    110|                                                                u4_payload_size);
 3428|    110|                }
 3429|    994|                break;
 3430|       |
 3431|  1.07k|            default:
  ------------------
  |  Branch (3431:13): [True: 1.07k, False: 7.05k]
  ------------------
 3432|  5.75k|                for(i = 0; i < u4_payload_size; i++)
  ------------------
  |  Branch (3432:28): [True: 4.67k, False: 1.07k]
  ------------------
 3433|  4.67k|                {
 3434|  4.67k|                    ihevcd_bits_flush(ps_bitstrm, 8);
 3435|  4.67k|                }
 3436|  1.07k|                break;
 3437|  8.13k|        }
 3438|  8.13k|    }
 3439|  1.45k|    else /* NAL_SUFFIX_SEI */
 3440|  1.45k|    {
 3441|  1.45k|        switch(u4_payload_type)
 3442|  1.45k|        {
 3443|    600|            case SEI_USER_DATA_REGISTERED_ITU_T_T35:
  ------------------
  |  Branch (3443:13): [True: 600, False: 857]
  ------------------
 3444|    600|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 3445|    600|                if(ps_parse->s_sei_params.i4_sei_user_data_cnt >= USER_DATA_MAX)
  ------------------
  |  Branch (3445:20): [True: 476, False: 124]
  ------------------
 3446|    476|                {
 3447|    965|                    for(i = 0; i < u4_payload_size / 4; i++)
  ------------------
  |  Branch (3447:32): [True: 489, False: 476]
  ------------------
 3448|    489|                    {
 3449|    489|                        ihevcd_bits_flush(ps_bitstrm, 4 * 8);
 3450|    489|                    }
 3451|       |
 3452|    476|                    ihevcd_bits_flush(ps_bitstrm, (u4_payload_size - i * 4) * 8);
 3453|    476|                }
 3454|    124|                else
 3455|    124|                {
 3456|    124|                    ihevcd_parse_user_data_registered_itu_t_t35(ps_codec,
 3457|    124|                                                                u4_payload_size);
 3458|    124|                }
 3459|    600|                break;
 3460|       |
 3461|    857|            default:
  ------------------
  |  Branch (3461:13): [True: 857, False: 600]
  ------------------
 3462|  16.5k|                for(i = 0; i < u4_payload_size; i++)
  ------------------
  |  Branch (3462:28): [True: 15.7k, False: 857]
  ------------------
 3463|  15.7k|                {
 3464|  15.7k|                    ihevcd_bits_flush(ps_bitstrm, 8);
 3465|  15.7k|                }
 3466|    857|                break;
 3467|  1.45k|        }
 3468|  1.45k|    }
 3469|       |
 3470|       |    /**
 3471|       |     * By definition the underlying bitstream terminates in a byte-aligned manner.
 3472|       |     * 1. Extract all bar the last MIN(bitsremaining,nine) bits as reserved_payload_extension_data
 3473|       |     * 2. Examine the final 8 bits to determine the payload_bit_equal_to_one marker
 3474|       |     * 3. Extract the remainingreserved_payload_extension_data bits.
 3475|       |     *
 3476|       |     * If there are fewer than 9 bits available, extract them.
 3477|       |     */
 3478|       |
 3479|  9.59k|    payload_bits_remaining = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3480|  9.59k|    if(payload_bits_remaining) /* more_data_in_payload() */
  ------------------
  |  Branch (3480:8): [True: 6.68k, False: 2.90k]
  ------------------
 3481|  6.68k|    {
 3482|  6.68k|        WORD32 final_bits;
 3483|  6.68k|        WORD32 final_payload_bits = 0;
 3484|  6.68k|        WORD32 mask = 0xFF;
 3485|  6.68k|        UWORD32 u4_dummy;
 3486|  6.68k|        UWORD32 u4_reserved_payload_extension_data;
 3487|  6.68k|        UNUSED(u4_dummy);
  ------------------
  |  |   38|  6.68k|#define UNUSED(x) ((void)(x))
  ------------------
 3488|  6.68k|        UNUSED(u4_reserved_payload_extension_data);
  ------------------
  |  |   38|  6.68k|#define UNUSED(x) ((void)(x))
  ------------------
 3489|       |
 3490|  6.34M|        while(payload_bits_remaining > 9)
  ------------------
  |  Branch (3490:15): [True: 6.33M, False: 6.68k]
  ------------------
 3491|  6.33M|        {
 3492|  6.33M|            BITS_PARSE("reserved_payload_extension_data",
  ------------------
  |  |  148|  6.33M|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3493|  6.33M|                       u4_reserved_payload_extension_data, ps_bitstrm, 1);
 3494|  6.33M|            payload_bits_remaining--;
 3495|  6.33M|        }
 3496|       |
 3497|  6.68k|        final_bits = ihevcd_bits_nxt(ps_bitstrm, payload_bits_remaining);
 3498|       |
 3499|  49.1k|        while(final_bits & (mask >> final_payload_bits))
  ------------------
  |  Branch (3499:15): [True: 42.4k, False: 6.68k]
  ------------------
 3500|  42.4k|        {
 3501|  42.4k|            final_payload_bits++;
 3502|  42.4k|            continue;
 3503|  42.4k|        }
 3504|       |
 3505|  47.4k|        while(payload_bits_remaining > (9 - final_payload_bits))
  ------------------
  |  Branch (3505:15): [True: 40.8k, False: 6.68k]
  ------------------
 3506|  40.8k|        {
 3507|  40.8k|            BITS_PARSE("reserved_payload_extension_data",
  ------------------
  |  |  148|  40.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3508|  40.8k|                       u4_reserved_payload_extension_data, ps_bitstrm, 1);
 3509|  40.8k|            payload_bits_remaining--;
 3510|  40.8k|        }
 3511|       |
 3512|  6.68k|        BITS_PARSE("payload_bit_equal_to_one", u4_dummy, ps_bitstrm, 1);
  ------------------
  |  |  148|  6.68k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3513|  6.68k|        payload_bits_remaining--;
 3514|  15.1k|        while(payload_bits_remaining)
  ------------------
  |  Branch (3514:15): [True: 8.47k, False: 6.68k]
  ------------------
 3515|  8.47k|        {
 3516|  8.47k|            BITS_PARSE("payload_bit_equal_to_zero", u4_dummy, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.47k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3517|  8.47k|            payload_bits_remaining--;
 3518|  8.47k|        }
 3519|  6.68k|    }
 3520|       |
 3521|  9.59k|    return;
 3522|  9.59k|}
ihevcd_read_rbsp_trailing_bits:
 3526|  1.06k|{
 3527|  1.06k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3528|  1.06k|    UWORD32 value;
 3529|  1.06k|    WORD32 cnt = 0;
 3530|  1.06k|    BITS_PARSE("rbsp_stop_one_bit", value, &ps_parse->s_bitstrm, 1);
  ------------------
  |  |  148|  1.06k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3531|  1.06k|    u4_bits_left--;
 3532|  1.06k|    if(value != 1)
  ------------------
  |  Branch (3532:8): [True: 319, False: 747]
  ------------------
 3533|    319|    {
 3534|    319|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
 3535|    319|    }
 3536|  5.97k|    while(u4_bits_left)
  ------------------
  |  Branch (3536:11): [True: 5.22k, False: 747]
  ------------------
 3537|  5.22k|    {
 3538|  5.22k|        BITS_PARSE("rbsp_alignment_zero_bit", value, &ps_parse->s_bitstrm, 1);
  ------------------
  |  |  148|  5.22k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3539|  5.22k|        u4_bits_left--;
 3540|  5.22k|        cnt++;
 3541|  5.22k|    }
 3542|    747|    ASSERT(cnt < 8);
  ------------------
  |  |   55|    747|#define ASSERT(x) {}
  ------------------
 3543|       |
 3544|    747|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3545|  1.06k|}
ihevcd_parse_sei:
 3566|  13.2k|{
 3567|  13.2k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3568|  13.2k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3569|  13.2k|    UWORD32 u4_payload_type = 0, u4_last_payload_type_byte = 0;
 3570|  13.2k|    UWORD32 u4_payload_size = 0, u4_last_payload_size_byte = 0;
 3571|  13.2k|    UWORD32 value;
 3572|  13.2k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3573|  13.2k|    UWORD32 u4_bits_left;
 3574|       |
 3575|  13.2k|    u4_bits_left = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3576|       |
 3577|   337k|    while(u4_bits_left > 8)
  ------------------
  |  Branch (3577:11): [True: 326k, False: 11.3k]
  ------------------
 3578|   326k|    {
 3579|   328k|        while(ihevcd_bits_nxt(ps_bitstrm, 8) == 0xFF)
  ------------------
  |  Branch (3579:15): [True: 2.80k, False: 326k]
  ------------------
 3580|  2.80k|        {
 3581|  2.80k|            ihevcd_bits_flush(ps_bitstrm, 8); /* equal to 0xFF */
 3582|  2.80k|            u4_payload_type += 255;
 3583|  2.80k|        }
 3584|       |
 3585|   326k|        BITS_PARSE("last_payload_type_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|   326k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3586|   326k|        u4_last_payload_type_byte = value;
 3587|       |
 3588|   326k|        u4_payload_type += u4_last_payload_type_byte;
 3589|       |
 3590|   327k|        while(ihevcd_bits_nxt(ps_bitstrm, 8) == 0xFF)
  ------------------
  |  Branch (3590:15): [True: 1.52k, False: 326k]
  ------------------
 3591|  1.52k|        {
 3592|  1.52k|            ihevcd_bits_flush(ps_bitstrm, 8); /* equal to 0xFF */
 3593|  1.52k|            u4_payload_size += 255;
 3594|  1.52k|        }
 3595|       |
 3596|   326k|        BITS_PARSE("last_payload_size_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|   326k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3597|   326k|        u4_last_payload_size_byte = value;
 3598|       |
 3599|   326k|        u4_payload_size += u4_last_payload_size_byte;
 3600|   326k|        u4_bits_left = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3601|   326k|        if(u4_payload_size > (u4_bits_left / 8))
  ------------------
  |  Branch (3601:12): [True: 1.96k, False: 324k]
  ------------------
 3602|  1.96k|        {
 3603|  1.96k|            return (IHEVCD_ERROR_T)IHEVCD_INVALID_PARAMETER;
 3604|  1.96k|        }
 3605|   324k|        ihevcd_parse_sei_payload(ps_codec, u4_payload_type, u4_payload_size,
 3606|   324k|                                 ps_nal->i1_nal_unit_type);
 3607|       |
 3608|       |        /* Calculate the bits left in the current payload */
 3609|   324k|        u4_bits_left = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3610|   324k|    }
 3611|       |
 3612|       |    // read rbsp_trailing_bits
 3613|  11.3k|    if(u4_bits_left)
  ------------------
  |  Branch (3613:8): [True: 1.06k, False: 10.2k]
  ------------------
 3614|  1.06k|    {
 3615|  1.06k|        ihevcd_read_rbsp_trailing_bits(ps_codec, u4_bits_left);
 3616|  1.06k|    }
 3617|       |
 3618|  11.3k|    return ret;
 3619|  13.2k|}
ihevcd_calc_poc:
 3682|   101k|{
 3683|   101k|    WORD32 i4_abs_poc, i4_poc_msb;
 3684|   101k|    WORD32 max_poc_lsb;
 3685|   101k|    WORD8 i1_nal_unit_type = ps_nal->i1_nal_unit_type;
 3686|   101k|    max_poc_lsb = (1 << i1_log2_max_poc_lsb);
 3687|       |
 3688|   101k|    if((!ps_codec->i4_first_pic_done) && (!ps_codec->i4_pic_present))
  ------------------
  |  Branch (3688:8): [True: 27.7k, False: 73.4k]
  |  Branch (3688:42): [True: 27.7k, False: 0]
  ------------------
 3689|  27.7k|        ps_codec->i4_prev_poc_msb = -2 * max_poc_lsb;
 3690|       |
 3691|   101k|    if(NAL_IDR_N_LP == i1_nal_unit_type
  ------------------
  |  Branch (3691:8): [True: 38.8k, False: 62.2k]
  ------------------
 3692|  62.2k|                    || NAL_IDR_W_LP == i1_nal_unit_type
  ------------------
  |  Branch (3692:24): [True: 14.4k, False: 47.8k]
  ------------------
 3693|  47.8k|                    || NAL_BLA_N_LP == i1_nal_unit_type
  ------------------
  |  Branch (3693:24): [True: 1.27k, False: 46.5k]
  ------------------
 3694|  46.5k|                    || NAL_BLA_W_DLP == i1_nal_unit_type
  ------------------
  |  Branch (3694:24): [True: 12.5k, False: 34.0k]
  ------------------
 3695|  34.0k|                    || NAL_BLA_W_LP == i1_nal_unit_type
  ------------------
  |  Branch (3695:24): [True: 1.10k, False: 32.9k]
  ------------------
 3696|  32.9k|                    || (NAL_CRA == i1_nal_unit_type && !ps_codec->i4_first_pic_done))
  ------------------
  |  Branch (3696:25): [True: 2.07k, False: 30.9k]
  |  Branch (3696:56): [True: 378, False: 1.69k]
  ------------------
 3697|  68.5k|    {
 3698|  68.5k|        i4_poc_msb = ps_codec->i4_prev_poc_msb + 2 * max_poc_lsb;
 3699|  68.5k|        ps_codec->i4_prev_poc_lsb = 0;
 3700|  68.5k|        ps_codec->i4_max_prev_poc_lsb = 0;
 3701|       |//        ps_codec->i4_prev_poc_msb = 0;
 3702|  68.5k|    }
 3703|  32.6k|    else
 3704|  32.6k|    {
 3705|       |
 3706|  32.6k|        if((i2_poc_lsb < ps_codec->i4_prev_poc_lsb)
  ------------------
  |  Branch (3706:12): [True: 1.31k, False: 31.2k]
  ------------------
 3707|  1.31k|                        && ((ps_codec->i4_prev_poc_lsb - i2_poc_lsb) >= max_poc_lsb / 2))
  ------------------
  |  Branch (3707:28): [True: 220, False: 1.09k]
  ------------------
 3708|    220|        {
 3709|    220|            i4_poc_msb = ps_codec->i4_prev_poc_msb + max_poc_lsb;
 3710|    220|        }
 3711|  32.3k|        else if((i2_poc_lsb > ps_codec->i4_prev_poc_lsb)
  ------------------
  |  Branch (3711:17): [True: 30.0k, False: 2.33k]
  ------------------
 3712|  30.0k|                        && ((i2_poc_lsb - ps_codec->i4_prev_poc_lsb) > max_poc_lsb / 2))
  ------------------
  |  Branch (3712:28): [True: 18.5k, False: 11.5k]
  ------------------
 3713|  18.5k|        {
 3714|  18.5k|            i4_poc_msb = ps_codec->i4_prev_poc_msb - max_poc_lsb;
 3715|  18.5k|        }
 3716|  13.8k|        else
 3717|  13.8k|        {
 3718|  13.8k|            i4_poc_msb = ps_codec->i4_prev_poc_msb;
 3719|  13.8k|        }
 3720|       |
 3721|       |
 3722|  32.6k|    }
 3723|       |
 3724|   101k|    i4_abs_poc = i4_poc_msb + i2_poc_lsb;
 3725|   101k|    ps_codec->i4_max_prev_poc_lsb = MAX(ps_codec->i4_max_prev_poc_lsb, i2_poc_lsb);
  ------------------
  |  |   42|   101k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 12.8k, False: 88.3k]
  |  |  ------------------
  ------------------
 3726|       |
 3727|   101k|    {
 3728|   101k|        WORD32 is_reference_nal = ((i1_nal_unit_type <= NAL_RSV_VCL_R15) && (i1_nal_unit_type % 2 != 0)) || ((i1_nal_unit_type >= NAL_BLA_W_LP) && (i1_nal_unit_type <= NAL_RSV_RAP_VCL23));
  ------------------
  |  Branch (3728:36): [True: 30.9k, False: 70.2k]
  |  Branch (3728:77): [True: 5.00k, False: 25.8k]
  |  Branch (3728:110): [True: 70.2k, False: 25.8k]
  |  Branch (3728:148): [True: 70.2k, False: 0]
  ------------------
 3729|   101k|        WORD32 update_prev_poc = ((is_reference_nal) && ((i1_nal_unit_type < NAL_RADL_N) || (i1_nal_unit_type > NAL_RASL_R)));
  ------------------
  |  Branch (3729:35): [True: 75.2k, False: 25.8k]
  |  Branch (3729:58): [True: 4.41k, False: 70.8k]
  |  Branch (3729:93): [True: 70.2k, False: 596]
  ------------------
 3730|       |
 3731|   101k|        if((0 == ps_nal->i1_nuh_temporal_id) &&
  ------------------
  |  Branch (3731:12): [True: 51.2k, False: 49.9k]
  ------------------
 3732|  51.2k|                        (update_prev_poc))
  ------------------
  |  Branch (3732:25): [True: 47.0k, False: 4.14k]
  ------------------
 3733|  47.0k|        {
 3734|  47.0k|            ps_codec->i4_prev_poc_lsb = i2_poc_lsb;
 3735|  47.0k|            ps_codec->i4_prev_poc_msb = i4_poc_msb;
 3736|  47.0k|        }
 3737|   101k|    }
 3738|       |
 3739|   101k|    return i4_abs_poc;
 3740|   101k|}
ihevcd_copy_slice_hdr:
 3744|  18.1k|{
 3745|  18.1k|    slice_header_t *ps_slice_hdr, *ps_slice_hdr_ref;
 3746|  18.1k|    WORD32 *pu4_entry_offset_backup;
 3747|       |
 3748|  18.1k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base + slice_idx;
 3749|  18.1k|    ps_slice_hdr_ref = ps_codec->s_parse.ps_slice_hdr_base + slice_idx_ref;
 3750|       |
 3751|  18.1k|    pu4_entry_offset_backup = ps_slice_hdr->pu4_entry_point_offset;
 3752|  18.1k|    memcpy(ps_slice_hdr, ps_slice_hdr_ref, sizeof(slice_header_t));
 3753|  18.1k|    ps_slice_hdr->pu4_entry_point_offset = pu4_entry_offset_backup;
 3754|  18.1k|    ps_slice_hdr->i2_ctb_x = -1;
 3755|  18.1k|    ps_slice_hdr->i2_ctb_y = -1;
 3756|  18.1k|}
ihevcd_parse_headers.c:ihevcd_profile_tier_level:
 1129|   107k|{
 1130|   107k|    WORD32 value;
 1131|   107k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1132|   107k|    WORD32 i;
 1133|       |
 1134|   107k|    if(profile_present)
  ------------------
  |  Branch (1134:8): [True: 107k, False: 0]
  ------------------
 1135|   107k|    {
 1136|   107k|        ret = ihevcd_parse_profile_tier_level_layer(ps_bitstrm, &ps_ptl->s_ptl_gen);
 1137|   107k|        if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1137:12): [True: 0, False: 107k]
  ------------------
 1138|      0|        {
 1139|      0|            return ret;
 1140|      0|        }
 1141|   107k|    }
 1142|       |
 1143|   107k|    BITS_PARSE("general_level_idc", value, ps_bitstrm, 8);
  ------------------
  |  |  148|   107k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1144|   107k|    ps_ptl->s_ptl_gen.u1_level_idc = value;
 1145|       |
 1146|       |
 1147|   182k|    for(i = 0; i < max_num_sub_layers; i++)
  ------------------
  |  Branch (1147:16): [True: 74.5k, False: 107k]
  ------------------
 1148|  74.5k|    {
 1149|  74.5k|        BITS_PARSE("sub_layer_profile_present_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  74.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1150|  74.5k|        ps_ptl->ai1_sub_layer_profile_present_flag[i] = value;
 1151|       |
 1152|  74.5k|        BITS_PARSE("sub_layer_level_present_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  74.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1153|  74.5k|        ps_ptl->ai1_sub_layer_level_present_flag[i] = value;
 1154|  74.5k|    }
 1155|       |
 1156|   107k|    if(max_num_sub_layers > 0)
  ------------------
  |  Branch (1156:8): [True: 20.0k, False: 87.5k]
  ------------------
 1157|  20.0k|    {
 1158|   105k|        for(i = max_num_sub_layers; i < 8; i++)
  ------------------
  |  Branch (1158:37): [True: 85.5k, False: 20.0k]
  ------------------
 1159|  85.5k|        {
 1160|  85.5k|            BITS_PARSE("reserved_zero_2bits", value, ps_bitstrm, 2);
  ------------------
  |  |  148|  85.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1161|  85.5k|        }
 1162|  20.0k|    }
 1163|       |
 1164|   182k|    for(i = 0; i < max_num_sub_layers; i++)
  ------------------
  |  Branch (1164:16): [True: 74.5k, False: 107k]
  ------------------
 1165|  74.5k|    {
 1166|  74.5k|        if(ps_ptl->ai1_sub_layer_profile_present_flag[i])
  ------------------
  |  Branch (1166:12): [True: 3.05k, False: 71.4k]
  ------------------
 1167|  3.05k|        {
 1168|  3.05k|            ret = ihevcd_parse_profile_tier_level_layer(ps_bitstrm,
 1169|  3.05k|                                                        &ps_ptl->as_ptl_sub[i]);
 1170|  3.05k|        }
 1171|  74.5k|        if(ps_ptl->ai1_sub_layer_level_present_flag[i])
  ------------------
  |  Branch (1171:12): [True: 3.58k, False: 70.9k]
  ------------------
 1172|  3.58k|        {
 1173|  3.58k|            BITS_PARSE("sub_layer_level_idc[i]", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  3.58k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1174|  3.58k|            ps_ptl->as_ptl_sub[i].u1_level_idc = value;
 1175|       |
 1176|  3.58k|        }
 1177|  74.5k|    }
 1178|       |
 1179|       |
 1180|       |
 1181|   107k|    return ret;
 1182|   107k|}
ihevcd_parse_headers.c:ihevcd_parse_profile_tier_level_layer:
 1054|   110k|{
 1055|   110k|    WORD32 value;
 1056|   110k|    WORD32 i;
 1057|   110k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1058|       |
 1059|   110k|    BITS_PARSE("XXX_profile_space[]", value, ps_bitstrm, 2);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1060|   110k|    ps_ptl->i1_profile_space = value;
 1061|       |
 1062|   110k|    BITS_PARSE("XXX_tier_flag[]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1063|   110k|    ps_ptl->i1_tier_flag = value;
 1064|       |
 1065|   110k|    BITS_PARSE("XXX_profile_idc[]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1066|   110k|    ps_ptl->i1_profile_idc = value;
 1067|       |
 1068|  3.64M|    for(i = 0; i < MAX_PROFILE_COMPATBLTY; i++)
  ------------------
  |  |  285|  3.64M|#define MAX_PROFILE_COMPATBLTY 32
  ------------------
  |  Branch (1068:16): [True: 3.53M, False: 110k]
  ------------------
 1069|  3.53M|    {
 1070|  3.53M|        BITS_PARSE("XXX_profile_compatibility_flag[][j]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.53M|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1071|  3.53M|        ps_ptl->ai1_profile_compatibility_flag[i] = value;
 1072|  3.53M|    }
 1073|       |
 1074|   110k|    BITS_PARSE("general_progressive_source_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1075|   110k|    ps_ptl->i1_general_progressive_source_flag = value;
 1076|       |
 1077|   110k|    BITS_PARSE("general_interlaced_source_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1078|   110k|    ps_ptl->i1_general_interlaced_source_flag = value;
 1079|       |
 1080|   110k|    BITS_PARSE("general_non_packed_constraint_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1081|   110k|    ps_ptl->i1_general_non_packed_constraint_flag = value;
 1082|       |
 1083|   110k|    BITS_PARSE("general_frame_only_constraint_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1084|   110k|    ps_ptl->i1_frame_only_constraint_flag = value;
 1085|       |
 1086|   110k|    BITS_PARSE("XXX_reserved_zero_44bits[0..15]", value, ps_bitstrm, 16);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1087|       |
 1088|   110k|    BITS_PARSE("XXX_reserved_zero_44bits[16..31]", value, ps_bitstrm, 16);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1089|       |
 1090|   110k|    BITS_PARSE("XXX_reserved_zero_44bits[32..43]", value, ps_bitstrm, 12);
  ------------------
  |  |  148|   110k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1091|   110k|    return ret;
 1092|   110k|}
ihevcd_parse_headers.c:ihevcd_get_profile:
 1009|   142k|{
 1010|   142k|    WORD32 profile = IHEVC_PROFILE_UNKNOWN;
 1011|       |
 1012|   142k|    if(ps_ptl->i1_profile_idc == 1 || ps_ptl->ai1_profile_compatibility_flag[1] == 1 ||
  ------------------
  |  Branch (1012:8): [True: 9.06k, False: 133k]
  |  Branch (1012:39): [True: 60.3k, False: 72.8k]
  ------------------
 1013|  72.8k|       ps_ptl->i1_profile_idc == 2 || ps_ptl->ai1_profile_compatibility_flag[2] == 1)
  ------------------
  |  Branch (1013:8): [True: 2.12k, False: 70.7k]
  |  Branch (1013:39): [True: 15.7k, False: 54.9k]
  ------------------
 1014|  87.2k|        profile = IHEVC_PROFILE_MAIN;
 1015|  54.9k|    else if(ps_ptl->i1_profile_idc == 3 || ps_ptl->ai1_profile_compatibility_flag[3] == 1)
  ------------------
  |  Branch (1015:13): [True: 12.8k, False: 42.1k]
  |  Branch (1015:44): [True: 8.77k, False: 33.3k]
  ------------------
 1016|  21.6k|        profile = IHEVC_PROFILE_MAIN_STILL;
 1017|  33.3k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1018|  33.3k|    else if(ps_ptl->i1_profile_idc == 4 || ps_ptl->ai1_profile_compatibility_flag[4] == 1)
  ------------------
  |  Branch (1018:13): [True: 2.95k, False: 30.3k]
  |  Branch (1018:44): [True: 26.9k, False: 3.41k]
  ------------------
 1019|  29.9k|        profile = IHEVC_PROFILE_MAIN_REXT;
 1020|   142k|#endif
 1021|       |
 1022|   142k|    return profile;
 1023|   142k|}
ihevcd_parse_headers.c:ihevcd_parse_vui_parameters:
  789|  18.4k|{
  790|  18.4k|    WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  791|  18.4k|    UWORD16 u2_sar_width = 0;
  792|  18.4k|    UWORD16 u2_sar_height = 0;
  793|       |
  794|  18.4k|    BITS_PARSE("aspect_ratio_info_present_flag", ps_vui->u1_aspect_ratio_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  795|       |
  796|  18.4k|    ps_vui->u1_aspect_ratio_idc = SAR_UNUSED;
  797|  18.4k|    u2_sar_width = 0;
  798|  18.4k|    u2_sar_height = 0;
  799|  18.4k|    if(ps_vui->u1_aspect_ratio_info_present_flag)
  ------------------
  |  Branch (799:8): [True: 11.2k, False: 7.27k]
  ------------------
  800|  11.2k|    {
  801|  11.2k|        BITS_PARSE("aspect_ratio_idc", ps_vui->u1_aspect_ratio_idc, ps_bitstrm, 8);
  ------------------
  |  |  148|  11.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  802|  11.2k|        switch(ps_vui->u1_aspect_ratio_idc)
  803|  11.2k|        {
  804|    206|            case SAR_1_1:
  ------------------
  |  Branch (804:13): [True: 206, False: 11.0k]
  ------------------
  805|    206|                u2_sar_width = 1;
  806|    206|                u2_sar_height = 1;
  807|    206|                break;
  808|    222|            case SAR_12_11:
  ------------------
  |  Branch (808:13): [True: 222, False: 10.9k]
  ------------------
  809|    222|                u2_sar_width = 12;
  810|    222|                u2_sar_height = 11;
  811|    222|                break;
  812|    392|            case SAR_10_11:
  ------------------
  |  Branch (812:13): [True: 392, False: 10.8k]
  ------------------
  813|    392|                u2_sar_width = 10;
  814|    392|                u2_sar_height = 11;
  815|    392|                break;
  816|    200|            case SAR_16_11:
  ------------------
  |  Branch (816:13): [True: 200, False: 11.0k]
  ------------------
  817|    200|                u2_sar_width = 16;
  818|    200|                u2_sar_height = 11;
  819|    200|                break;
  820|    198|            case SAR_40_33:
  ------------------
  |  Branch (820:13): [True: 198, False: 11.0k]
  ------------------
  821|    198|                u2_sar_width = 40;
  822|    198|                u2_sar_height = 33;
  823|    198|                break;
  824|    214|            case SAR_24_11:
  ------------------
  |  Branch (824:13): [True: 214, False: 11.0k]
  ------------------
  825|    214|                u2_sar_width = 24;
  826|    214|                u2_sar_height = 11;
  827|    214|                break;
  828|    219|            case SAR_20_11:
  ------------------
  |  Branch (828:13): [True: 219, False: 10.9k]
  ------------------
  829|    219|                u2_sar_width = 20;
  830|    219|                u2_sar_height = 11;
  831|    219|                break;
  832|    197|            case SAR_32_11:
  ------------------
  |  Branch (832:13): [True: 197, False: 11.0k]
  ------------------
  833|    197|                u2_sar_width = 32;
  834|    197|                u2_sar_height = 11;
  835|    197|                break;
  836|  1.00k|            case SAR_80_33:
  ------------------
  |  Branch (836:13): [True: 1.00k, False: 10.2k]
  ------------------
  837|  1.00k|                u2_sar_width = 80;
  838|  1.00k|                u2_sar_height = 33;
  839|  1.00k|                break;
  840|    214|            case SAR_18_11:
  ------------------
  |  Branch (840:13): [True: 214, False: 11.0k]
  ------------------
  841|    214|                u2_sar_width = 18;
  842|    214|                u2_sar_height = 11;
  843|    214|                break;
  844|    344|            case SAR_15_11:
  ------------------
  |  Branch (844:13): [True: 344, False: 10.8k]
  ------------------
  845|    344|                u2_sar_width = 15;
  846|    344|                u2_sar_height = 11;
  847|    344|                break;
  848|    207|            case SAR_64_33:
  ------------------
  |  Branch (848:13): [True: 207, False: 11.0k]
  ------------------
  849|    207|                u2_sar_width = 64;
  850|    207|                u2_sar_height = 33;
  851|    207|                break;
  852|    211|            case SAR_160_99:
  ------------------
  |  Branch (852:13): [True: 211, False: 11.0k]
  ------------------
  853|    211|                u2_sar_width = 160;
  854|    211|                u2_sar_height = 99;
  855|    211|                break;
  856|    198|            case SAR_4_3:
  ------------------
  |  Branch (856:13): [True: 198, False: 11.0k]
  ------------------
  857|    198|                u2_sar_width = 4;
  858|    198|                u2_sar_height = 3;
  859|    198|                break;
  860|    227|            case SAR_3_2:
  ------------------
  |  Branch (860:13): [True: 227, False: 10.9k]
  ------------------
  861|    227|                u2_sar_width = 3;
  862|    227|                u2_sar_height = 2;
  863|    227|                break;
  864|    227|            case SAR_2_1:
  ------------------
  |  Branch (864:13): [True: 227, False: 10.9k]
  ------------------
  865|    227|                u2_sar_width = 2;
  866|    227|                u2_sar_height = 1;
  867|    227|                break;
  868|  2.32k|            case EXTENDED_SAR:
  ------------------
  |  Branch (868:13): [True: 2.32k, False: 8.88k]
  ------------------
  869|  2.32k|                BITS_PARSE("sar_width", u2_sar_width, ps_bitstrm, 16);
  ------------------
  |  |  148|  2.32k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  870|  2.32k|                BITS_PARSE("sar_height", u2_sar_height, ps_bitstrm, 16);
  ------------------
  |  |  148|  2.32k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  871|  2.32k|                break;
  872|  4.41k|            default:
  ------------------
  |  Branch (872:13): [True: 4.41k, False: 6.80k]
  ------------------
  873|  4.41k|                u2_sar_width = 0;
  874|  4.41k|                u2_sar_height = 0;
  875|  4.41k|                break;
  876|  11.2k|        }
  877|  11.2k|    }
  878|       |
  879|  18.4k|    ps_vui->u2_sar_width    = u2_sar_width;
  880|  18.4k|    ps_vui->u2_sar_height   = u2_sar_height;
  881|       |
  882|  18.4k|    BITS_PARSE("overscan_info_present_flag", ps_vui->u1_overscan_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  883|  18.4k|    ps_vui->u1_overscan_appropriate_flag = 0;
  884|  18.4k|    if(ps_vui->u1_overscan_info_present_flag)
  ------------------
  |  Branch (884:8): [True: 7.49k, False: 10.9k]
  ------------------
  885|  7.49k|        BITS_PARSE("overscan_appropriate_flag", ps_vui->u1_overscan_appropriate_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.49k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  886|       |
  887|  18.4k|    BITS_PARSE("video_signal_type_present_flag", ps_vui->u1_video_signal_type_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  888|  18.4k|    ps_vui->u1_video_format = VID_FMT_UNSPECIFIED;
  889|  18.4k|    ps_vui->u1_video_full_range_flag = 0;
  890|  18.4k|    ps_vui->u1_colour_description_present_flag = 0;
  891|  18.4k|    ps_vui->u1_colour_primaries = 2;
  892|  18.4k|    ps_vui->u1_transfer_characteristics = 2;
  893|  18.4k|    ps_vui->u1_matrix_coefficients = 2;
  894|       |
  895|  18.4k|    if(ps_vui->u1_video_signal_type_present_flag)
  ------------------
  |  Branch (895:8): [True: 7.80k, False: 10.6k]
  ------------------
  896|  7.80k|    {
  897|  7.80k|        BITS_PARSE("video_format", ps_vui->u1_video_format, ps_bitstrm, 3);
  ------------------
  |  |  148|  7.80k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  898|  7.80k|        BITS_PARSE("video_full_range_flag", ps_vui->u1_video_full_range_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.80k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  899|  7.80k|        BITS_PARSE("colour_description_present_flag", ps_vui->u1_colour_description_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.80k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  900|  7.80k|        if(ps_vui->u1_colour_description_present_flag)
  ------------------
  |  Branch (900:12): [True: 5.62k, False: 2.17k]
  ------------------
  901|  5.62k|        {
  902|  5.62k|            BITS_PARSE("colour_primaries", ps_vui->u1_colour_primaries, ps_bitstrm, 8);
  ------------------
  |  |  148|  5.62k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  903|  5.62k|            BITS_PARSE("transfer_characteristics", ps_vui->u1_transfer_characteristics, ps_bitstrm, 8);
  ------------------
  |  |  148|  5.62k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  904|  5.62k|            BITS_PARSE("matrix_coeffs", ps_vui->u1_matrix_coefficients, ps_bitstrm, 8);
  ------------------
  |  |  148|  5.62k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  905|  5.62k|        }
  906|  7.80k|    }
  907|       |
  908|  18.4k|    BITS_PARSE("chroma_loc_info_present_flag", ps_vui->u1_chroma_loc_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  909|  18.4k|    ps_vui->u1_chroma_sample_loc_type_top_field = 0;
  910|  18.4k|    ps_vui->u1_chroma_sample_loc_type_bottom_field = 0;
  911|  18.4k|    if(ps_vui->u1_chroma_loc_info_present_flag)
  ------------------
  |  Branch (911:8): [True: 3.49k, False: 15.0k]
  ------------------
  912|  3.49k|    {
  913|  3.49k|        UEV_PARSE("chroma_sample_loc_type_top_field", ps_vui->u1_chroma_sample_loc_type_top_field, ps_bitstrm);
  ------------------
  |  |  155|  3.49k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  914|  3.49k|        if(ps_vui->u1_chroma_sample_loc_type_top_field > CHROMA_FMT_IDC_YUV444_PLANES + 1)
  ------------------
  |  Branch (914:12): [True: 201, False: 3.29k]
  ------------------
  915|    201|        {
  916|    201|            return IHEVCD_INVALID_PARAMETER;
  917|    201|        }
  918|  3.29k|        UEV_PARSE("chroma_sample_loc_type_bottom_field", ps_vui->u1_chroma_sample_loc_type_bottom_field, ps_bitstrm);
  ------------------
  |  |  155|  3.29k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  919|  3.29k|        if(ps_vui->u1_chroma_sample_loc_type_bottom_field > CHROMA_FMT_IDC_YUV444_PLANES + 1)
  ------------------
  |  Branch (919:12): [True: 202, False: 3.08k]
  ------------------
  920|    202|        {
  921|    202|            return IHEVCD_INVALID_PARAMETER;
  922|    202|        }
  923|  3.29k|    }
  924|       |
  925|  18.0k|    BITS_PARSE("neutral_chroma_indication_flag", ps_vui->u1_neutral_chroma_indication_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  926|  18.0k|    BITS_PARSE("field_seq_flag", ps_vui->u1_field_seq_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  927|  18.0k|    BITS_PARSE("frame_field_info_present_flag", ps_vui->u1_frame_field_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  928|  18.0k|    BITS_PARSE("default_display_window_flag", ps_vui->u1_default_display_window_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  929|  18.0k|    ps_vui->u4_def_disp_win_left_offset = 0;
  930|  18.0k|    ps_vui->u4_def_disp_win_right_offset = 0;
  931|  18.0k|    ps_vui->u4_def_disp_win_top_offset = 0;
  932|  18.0k|    ps_vui->u4_def_disp_win_bottom_offset = 0;
  933|  18.0k|    if(ps_vui->u1_default_display_window_flag)
  ------------------
  |  Branch (933:8): [True: 4.56k, False: 13.5k]
  ------------------
  934|  4.56k|    {
  935|  4.56k|        UEV_PARSE("def_disp_win_left_offset", ps_vui->u4_def_disp_win_left_offset, ps_bitstrm);
  ------------------
  |  |  155|  4.56k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  936|  4.56k|        UEV_PARSE("def_disp_win_right_offset", ps_vui->u4_def_disp_win_right_offset, ps_bitstrm);
  ------------------
  |  |  155|  4.56k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  937|  4.56k|        UEV_PARSE("def_disp_win_top_offset", ps_vui->u4_def_disp_win_top_offset, ps_bitstrm);
  ------------------
  |  |  155|  4.56k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  938|  4.56k|        UEV_PARSE("def_disp_win_bottom_offset", ps_vui->u4_def_disp_win_bottom_offset, ps_bitstrm);
  ------------------
  |  |  155|  4.56k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  939|  4.56k|    }
  940|       |
  941|  18.0k|    BITS_PARSE("vui_timing_info_present_flag", ps_vui->u1_vui_timing_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  942|  18.0k|    if(ps_vui->u1_vui_timing_info_present_flag)
  ------------------
  |  Branch (942:8): [True: 4.37k, False: 13.7k]
  ------------------
  943|  4.37k|    {
  944|  4.37k|        BITS_PARSE("vui_num_units_in_tick", ps_vui->u4_vui_num_units_in_tick, ps_bitstrm, 32);
  ------------------
  |  |  148|  4.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  945|  4.37k|        BITS_PARSE("vui_time_scale", ps_vui->u4_vui_time_scale, ps_bitstrm, 32);
  ------------------
  |  |  148|  4.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  946|  4.37k|        BITS_PARSE("vui_poc_proportional_to_timing_flag", ps_vui->u1_poc_proportional_to_timing_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  947|  4.37k|        if(ps_vui->u1_poc_proportional_to_timing_flag)
  ------------------
  |  Branch (947:12): [True: 2.42k, False: 1.95k]
  ------------------
  948|  2.42k|        {
  949|  2.42k|            UEV_PARSE("vui_num_ticks_poc_diff_one_minus1", ps_vui->u4_num_ticks_poc_diff_one_minus1, ps_bitstrm);
  ------------------
  |  |  155|  2.42k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  950|  2.42k|            if(ps_vui->u4_num_ticks_poc_diff_one_minus1 > UINT_MAX - 1)
  ------------------
  |  Branch (950:16): [True: 0, False: 2.42k]
  ------------------
  951|      0|            {
  952|      0|                return IHEVCD_INVALID_PARAMETER;
  953|      0|            }
  954|  2.42k|        }
  955|  4.37k|        BITS_PARSE("vui_hrd_parameters_present_flag", ps_vui->u1_vui_hrd_parameters_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.37k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  956|  4.37k|        if(ps_vui->u1_vui_hrd_parameters_present_flag)
  ------------------
  |  Branch (956:12): [True: 2.42k, False: 1.95k]
  ------------------
  957|  2.42k|        {
  958|  2.42k|            ret = ihevcd_parse_hrd_parameters(ps_bitstrm, &ps_vui->s_vui_hrd_parameters, 1, sps_max_sub_layers_minus1);
  959|  2.42k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  2.42k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 830, False: 1.59k]
  |  |  ------------------
  ------------------
  960|  1.59k|        }
  961|  4.37k|    }
  962|       |
  963|  17.2k|    BITS_PARSE("bitstream_restriction_flag", ps_vui->u1_bitstream_restriction_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  17.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  964|  17.2k|    ps_vui->u1_tiles_fixed_structure_flag = 0;
  965|  17.2k|    ps_vui->u1_motion_vectors_over_pic_boundaries_flag = 1;
  966|  17.2k|    ps_vui->u1_restricted_ref_pic_lists_flag = 0;
  967|  17.2k|    ps_vui->u4_min_spatial_segmentation_idc = 0;
  968|  17.2k|    ps_vui->u1_max_bytes_per_pic_denom = 2;
  969|  17.2k|    ps_vui->u1_max_bits_per_mincu_denom = 1;
  970|  17.2k|    ps_vui->u1_log2_max_mv_length_horizontal = 15;
  971|  17.2k|    ps_vui->u1_log2_max_mv_length_vertical = 15;
  972|  17.2k|    if(ps_vui->u1_bitstream_restriction_flag)
  ------------------
  |  Branch (972:8): [True: 4.14k, False: 13.1k]
  ------------------
  973|  4.14k|    {
  974|  4.14k|        BITS_PARSE("tiles_fixed_structure_flag", ps_vui->u1_tiles_fixed_structure_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.14k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  975|  4.14k|        BITS_PARSE("motion_vectors_over_pic_boundaries_flag", ps_vui->u1_motion_vectors_over_pic_boundaries_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.14k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  976|  4.14k|        BITS_PARSE("restricted_ref_pic_lists_flag", ps_vui->u1_restricted_ref_pic_lists_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.14k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  977|       |
  978|  4.14k|        UEV_PARSE("min_spatial_segmentation_idc", ps_vui->u4_min_spatial_segmentation_idc, ps_bitstrm);
  ------------------
  |  |  155|  4.14k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  979|  4.14k|        if(ps_vui->u4_min_spatial_segmentation_idc > 4095)
  ------------------
  |  Branch (979:12): [True: 237, False: 3.90k]
  ------------------
  980|    237|        {
  981|    237|            return IHEVCD_INVALID_PARAMETER;
  982|    237|        }
  983|  3.90k|        UEV_PARSE("max_bytes_per_pic_denom", ps_vui->u1_max_bytes_per_pic_denom, ps_bitstrm);
  ------------------
  |  |  155|  3.90k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  984|  3.90k|        if(ps_vui->u1_max_bytes_per_pic_denom > 16)
  ------------------
  |  Branch (984:12): [True: 273, False: 3.63k]
  ------------------
  985|    273|        {
  986|    273|            return IHEVCD_INVALID_PARAMETER;
  987|    273|        }
  988|  3.63k|        UEV_PARSE("max_bits_per_min_cu_denom", ps_vui->u1_max_bits_per_mincu_denom, ps_bitstrm);
  ------------------
  |  |  155|  3.63k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  989|  3.63k|        if(ps_vui->u1_max_bits_per_mincu_denom > 16)
  ------------------
  |  Branch (989:12): [True: 431, False: 3.20k]
  ------------------
  990|    431|        {
  991|    431|            return IHEVCD_INVALID_PARAMETER;
  992|    431|        }
  993|  3.20k|        UEV_PARSE("log2_max_mv_length_horizontal", ps_vui->u1_log2_max_mv_length_horizontal, ps_bitstrm);
  ------------------
  |  |  155|  3.20k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  994|  3.20k|        if(ps_vui->u1_max_bits_per_mincu_denom > 16)
  ------------------
  |  Branch (994:12): [True: 0, False: 3.20k]
  ------------------
  995|      0|        {
  996|      0|            return IHEVCD_INVALID_PARAMETER;
  997|      0|        }
  998|  3.20k|        UEV_PARSE("log2_max_mv_length_vertical", ps_vui->u1_log2_max_mv_length_vertical, ps_bitstrm);
  ------------------
  |  |  155|  3.20k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  999|  3.20k|        if(ps_vui->u1_max_bits_per_mincu_denom > 15)
  ------------------
  |  Branch (999:12): [True: 195, False: 3.00k]
  ------------------
 1000|    195|        {
 1001|    195|            return IHEVCD_INVALID_PARAMETER;
 1002|    195|        }
 1003|  3.20k|    }
 1004|       |
 1005|  16.1k|    return ret;
 1006|  17.2k|}
ihevcd_parse_headers.c:ihevcd_parse_hrd_parameters:
  685|  2.42k|{
  686|  2.42k|    WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  687|  2.42k|    WORD32 i;
  688|       |
  689|  2.42k|    ps_hrd->u1_nal_hrd_parameters_present_flag = 0;
  690|  2.42k|    ps_hrd->u1_vcl_hrd_parameters_present_flag = 0;
  691|       |
  692|  2.42k|    ps_hrd->u1_sub_pic_cpb_params_present_flag = 0;
  693|       |
  694|  2.42k|    ps_hrd->u1_tick_divisor_minus2 = 0;
  695|  2.42k|    ps_hrd->u1_du_cpb_removal_delay_increment_length_minus1 = 0;
  696|  2.42k|    ps_hrd->u1_sub_pic_cpb_params_in_pic_timing_sei_flag = 0;
  697|  2.42k|    ps_hrd->u1_dpb_output_delay_du_length_minus1 = 0;
  698|       |
  699|  2.42k|    ps_hrd->u4_bit_rate_scale = 0;
  700|  2.42k|    ps_hrd->u4_cpb_size_scale = 0;
  701|  2.42k|    ps_hrd->u4_cpb_size_du_scale = 0;
  702|       |
  703|  2.42k|    ps_hrd->u1_initial_cpb_removal_delay_length_minus1 = 23;
  704|  2.42k|    ps_hrd->u1_au_cpb_removal_delay_length_minus1 = 23;
  705|  2.42k|    ps_hrd->u1_dpb_output_delay_length_minus1 = 23;
  706|       |
  707|  2.42k|    if(common_info_present_flag)
  ------------------
  |  Branch (707:8): [True: 2.42k, False: 0]
  ------------------
  708|  2.42k|    {
  709|  2.42k|        BITS_PARSE("nal_hrd_parameters_present_flag", ps_hrd->u1_nal_hrd_parameters_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.42k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  710|  2.42k|        BITS_PARSE("vcl_hrd_parameters_present_flag", ps_hrd->u1_vcl_hrd_parameters_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.42k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  711|       |
  712|  2.42k|        if(ps_hrd->u1_nal_hrd_parameters_present_flag  ||  ps_hrd->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (712:12): [True: 1.12k, False: 1.29k]
  |  Branch (712:60): [True: 826, False: 466]
  ------------------
  713|  1.95k|        {
  714|  1.95k|            BITS_PARSE("sub_pic_cpb_params_present_flag", ps_hrd->u1_sub_pic_cpb_params_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.95k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  715|  1.95k|            if(ps_hrd->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (715:16): [True: 1.12k, False: 826]
  ------------------
  716|  1.12k|            {
  717|  1.12k|                BITS_PARSE("tick_divisor_minus2", ps_hrd->u1_tick_divisor_minus2, ps_bitstrm, 8);
  ------------------
  |  |  148|  1.12k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  718|  1.12k|                BITS_PARSE("du_cpb_removal_delay_increment_length_minus1", ps_hrd->u1_du_cpb_removal_delay_increment_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|  1.12k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  719|  1.12k|                BITS_PARSE("sub_pic_cpb_params_in_pic_timing_sei_flag", ps_hrd->u1_sub_pic_cpb_params_in_pic_timing_sei_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.12k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  720|  1.12k|                BITS_PARSE("dpb_output_delay_du_length_minus1", ps_hrd->u1_dpb_output_delay_du_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|  1.12k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  721|  1.12k|            }
  722|       |
  723|  1.95k|            BITS_PARSE("bit_rate_scale", ps_hrd->u4_bit_rate_scale, ps_bitstrm, 4);
  ------------------
  |  |  148|  1.95k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  724|  1.95k|            BITS_PARSE("cpb_size_scale", ps_hrd->u4_cpb_size_scale, ps_bitstrm, 4);
  ------------------
  |  |  148|  1.95k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  725|  1.95k|            if(ps_hrd->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (725:16): [True: 1.12k, False: 826]
  ------------------
  726|  1.12k|                BITS_PARSE("cpb_size_du_scale", ps_hrd->u4_cpb_size_du_scale, ps_bitstrm, 4);
  ------------------
  |  |  148|  1.12k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  727|       |
  728|  1.95k|            BITS_PARSE("initial_cpb_removal_delay_length_minus1", ps_hrd->u1_initial_cpb_removal_delay_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|  1.95k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  729|  1.95k|            BITS_PARSE("au_cpb_removal_delay_length_minus1", ps_hrd->u1_au_cpb_removal_delay_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|  1.95k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  730|  1.95k|            BITS_PARSE("dpb_output_delay_length_minus1", ps_hrd->u1_dpb_output_delay_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|  1.95k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  731|  1.95k|        }
  732|  2.42k|    }
  733|       |
  734|       |
  735|  8.48k|    for(i = 0; i <= max_num_sub_layers_minus1; i++)
  ------------------
  |  Branch (735:16): [True: 6.88k, False: 1.59k]
  ------------------
  736|  6.88k|    {
  737|  6.88k|        BITS_PARSE("fixed_pic_rate_general_flag[ i ]", ps_hrd->au1_fixed_pic_rate_general_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|  6.88k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  738|       |
  739|  6.88k|        ps_hrd->au1_fixed_pic_rate_within_cvs_flag[i] = 1;
  740|  6.88k|        ps_hrd->au2_elemental_duration_in_tc_minus1[i] = 0;
  741|  6.88k|        ps_hrd->au1_low_delay_hrd_flag[i] = 0;
  742|  6.88k|        ps_hrd->au1_cpb_cnt_minus1[i] = 0;
  743|       |
  744|  6.88k|        if(!ps_hrd->au1_fixed_pic_rate_general_flag[i])
  ------------------
  |  Branch (744:12): [True: 3.20k, False: 3.68k]
  ------------------
  745|  3.20k|            BITS_PARSE("fixed_pic_rate_within_cvs_flag[ i ]", ps_hrd->au1_fixed_pic_rate_within_cvs_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|  3.20k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  746|       |
  747|  6.88k|        if(ps_hrd->au1_fixed_pic_rate_within_cvs_flag[i])
  ------------------
  |  Branch (747:12): [True: 5.30k, False: 1.58k]
  ------------------
  748|  5.30k|        {
  749|  5.30k|            UEV_PARSE("elemental_duration_in_tc_minus1[ i ]", ps_hrd->au2_elemental_duration_in_tc_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|  5.30k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  750|  5.30k|            if(ps_hrd->au2_elemental_duration_in_tc_minus1[i] > 2047)
  ------------------
  |  Branch (750:16): [True: 194, False: 5.10k]
  ------------------
  751|    194|            {
  752|    194|                return IHEVCD_INVALID_PARAMETER;
  753|    194|            }
  754|  5.30k|        }
  755|  1.58k|        else
  756|  1.58k|        {
  757|  1.58k|            BITS_PARSE("low_delay_hrd_flag[ i ]", ps_hrd->au1_low_delay_hrd_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|  1.58k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  758|  1.58k|        }
  759|       |
  760|  6.69k|        if(!ps_hrd->au1_low_delay_hrd_flag[i])
  ------------------
  |  Branch (760:12): [True: 5.94k, False: 747]
  ------------------
  761|  5.94k|        {
  762|  5.94k|            UEV_PARSE("cpb_cnt_minus1[ i ]", ps_hrd->au1_cpb_cnt_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|  5.94k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  763|  5.94k|            if(ps_hrd->au1_cpb_cnt_minus1[i] > (MAX_CPB_CNT - 1))
  ------------------
  |  |  533|  5.94k|#define MAX_CPB_CNT 32
  ------------------
  |  Branch (763:16): [True: 636, False: 5.31k]
  ------------------
  764|    636|            {
  765|    636|                return IHEVCD_INVALID_PARAMETER;
  766|    636|            }
  767|  5.94k|        }
  768|       |
  769|  6.05k|        if(ps_hrd->u1_nal_hrd_parameters_present_flag)
  ------------------
  |  Branch (769:12): [True: 1.12k, False: 4.93k]
  ------------------
  770|  1.12k|            ihevcd_parse_sub_layer_hrd_parameters(ps_bitstrm,
  771|  1.12k|                                                  &ps_hrd->as_sub_layer_hrd_params[i],
  772|  1.12k|                                                  ps_hrd->au1_cpb_cnt_minus1[i],
  773|  1.12k|                                                  ps_hrd->u1_sub_pic_cpb_params_present_flag);
  774|       |
  775|  6.05k|        if(ps_hrd->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (775:12): [True: 3.85k, False: 2.20k]
  ------------------
  776|  3.85k|            ihevcd_parse_sub_layer_hrd_parameters(ps_bitstrm,
  777|  3.85k|                                                  &ps_hrd->as_sub_layer_hrd_params[i],
  778|  3.85k|                                                  ps_hrd->au1_cpb_cnt_minus1[i],
  779|  3.85k|                                                  ps_hrd->u1_sub_pic_cpb_params_present_flag);
  780|  6.05k|    }
  781|       |
  782|  1.59k|    return ret;
  783|  2.42k|}
ihevcd_parse_headers.c:ihevcd_parse_sub_layer_hrd_parameters:
  645|  4.97k|{
  646|  4.97k|    WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  647|  4.97k|    WORD32 i;
  648|       |
  649|  17.4k|    for(i = 0; i <= cpb_cnt; i++)
  ------------------
  |  Branch (649:16): [True: 12.4k, False: 4.97k]
  ------------------
  650|  12.4k|    {
  651|  12.4k|        UEV_PARSE("bit_rate_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_bit_rate_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|  12.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  652|  12.4k|        if(ps_sub_layer_hrd_params->au4_bit_rate_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (652:12): [True: 0, False: 12.4k]
  ------------------
  653|      0|        {
  654|      0|            return IHEVCD_INVALID_PARAMETER;
  655|      0|        }
  656|  12.4k|        UEV_PARSE("cpb_size_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_cpb_size_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|  12.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  657|  12.4k|        if(ps_sub_layer_hrd_params->au4_cpb_size_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (657:12): [True: 0, False: 12.4k]
  ------------------
  658|      0|        {
  659|      0|            return IHEVCD_INVALID_PARAMETER;
  660|      0|        }
  661|  12.4k|        if(sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (661:12): [True: 5.05k, False: 7.39k]
  ------------------
  662|  5.05k|        {
  663|  5.05k|            UEV_PARSE("cpb_size_du_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_cpb_size_du_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|  5.05k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  664|  5.05k|            if(ps_sub_layer_hrd_params->au4_cpb_size_du_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (664:16): [True: 0, False: 5.05k]
  ------------------
  665|      0|            {
  666|      0|                return IHEVCD_INVALID_PARAMETER;
  667|      0|            }
  668|  5.05k|            UEV_PARSE("bit_rate_du_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_bit_rate_du_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|  5.05k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  669|  5.05k|            if(ps_sub_layer_hrd_params->au4_bit_rate_du_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (669:16): [True: 0, False: 5.05k]
  ------------------
  670|      0|            {
  671|      0|                return IHEVCD_INVALID_PARAMETER;
  672|      0|            }
  673|  5.05k|        }
  674|  12.4k|        BITS_PARSE("cbr_flag[ i ]", ps_sub_layer_hrd_params->au1_cbr_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|  12.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  675|  12.4k|    }
  676|       |
  677|  4.97k|    return ret;
  678|  4.97k|}

ihevcd_parse_residual_coding:
  185|  8.25M|{
  186|  8.25M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  187|  8.25M|    WORD32 transform_skip_flag;
  188|  8.25M|#ifdef ENABLE_MAIN_REXT_PROFILE
  189|  8.25M|    WORD32 explicit_rdpcm_flag, explicit_rdpcm_dir;
  190|  8.25M|#endif
  191|  8.25M|    WORD32 value;
  192|  8.25M|    sps_t *ps_sps;
  193|  8.25M|    pps_t *ps_pps;
  194|  8.25M|    WORD32 last_scan_pos, last_sub_blk;
  195|  8.25M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  196|  8.25M|    WORD32 last_significant_coeff_x_prefix, last_significant_coeff_y_prefix;
  197|  8.25M|    WORD32 last_significant_coeff_x, last_significant_coeff_y;
  198|  8.25M|    const UWORD8 *pu1_scan_blk = NULL, *pu1_scan_coeff;
  199|  8.25M|    WORD32 scan_idx;
  200|  8.25M|    WORD32 i;
  201|  8.25M|    WORD32 sign_data_hiding_flag;
  202|  8.25M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  203|  8.25M|    WORD32 gt1_ctxt = 1;
  204|  8.25M|    WORD32 c_max;
  205|  8.25M|    UWORD16 au2_csbf[9];
  206|  8.25M|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  207|  8.25M|    WORD8 *pi1_num_coded_subblks;
  208|  8.25M|    WORD32 num_subblks;
  209|  8.25M|    WORD32 sig_coeff_base_ctxt, abs_gt1_base_ctxt;
  210|  8.25M|    UNUSED(x0);
  ------------------
  |  |   38|  8.25M|#define UNUSED(x) ((void)(x))
  ------------------
  211|  8.25M|    UNUSED(y0);
  ------------------
  |  |   38|  8.25M|#define UNUSED(x) ((void)(x))
  ------------------
  212|  8.25M|    ps_sps = ps_codec->s_parse.ps_sps;
  213|  8.25M|    ps_pps = ps_codec->s_parse.ps_pps;
  214|       |
  215|  8.25M|    sign_data_hiding_flag = ps_pps->i1_sign_data_hiding_flag;
  216|  8.25M|    transform_skip_flag = 0;
  217|  8.25M|#ifdef ENABLE_MAIN_REXT_PROFILE
  218|  8.25M|    explicit_rdpcm_flag = 0;
  219|  8.25M|    explicit_rdpcm_dir = 0;
  220|  8.25M|#endif
  221|  8.25M|    if(ps_pps->i1_transform_skip_enabled_flag &&
  ------------------
  |  Branch (221:8): [True: 6.23M, False: 2.02M]
  ------------------
  222|  6.23M|       !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass &&
  ------------------
  |  Branch (222:8): [True: 6.09M, False: 134k]
  ------------------
  223|  6.09M|#ifdef ENABLE_MAIN_REXT_PROFILE
  224|  6.09M|       (log2_trafo_size <= ps_pps->i1_log2_max_transform_skip_block_size_minus2 + 2)
  ------------------
  |  Branch (224:8): [True: 2.68M, False: 3.41M]
  ------------------
  225|       |#else
  226|       |       (log2_trafo_size == 2)
  227|       |#endif
  228|  8.25M|       )
  229|  2.68M|    {
  230|  2.68M|        WORD32 ctxt_idx;
  231|       |
  232|  2.68M|        if(!c_idx)
  ------------------
  |  Branch (232:12): [True: 1.58M, False: 1.09M]
  ------------------
  233|  1.58M|        {
  234|  1.58M|            ctxt_idx = IHEVC_CAB_TFM_SKIP0;
  235|  1.58M|        }
  236|  1.09M|        else
  237|  1.09M|        {
  238|  1.09M|            ctxt_idx = IHEVC_CAB_TFM_SKIP12;
  239|  1.09M|        }
  240|  2.68M|        TRACE_CABAC_CTXT("transform_skip_flag", ps_cabac->u4_range, ctxt_idx);
  241|  2.68M|        value = ihevcd_cabac_decode_bin(ps_cabac,
  242|  2.68M|                                        ps_bitstrm,
  243|  2.68M|                                        ctxt_idx);
  244|  2.68M|        AEV_TRACE("transform_skip_flag", value, ps_cabac->u4_range);
  245|  2.68M|        transform_skip_flag = value;
  246|  2.68M|    }
  247|       |
  248|  8.25M|#ifdef ENABLE_MAIN_REXT_PROFILE
  249|  8.25M|    if(PRED_MODE_INTER == ps_codec->s_parse.s_cu.i4_pred_mode
  ------------------
  |  Branch (249:8): [True: 308k, False: 7.95M]
  ------------------
  250|   308k|                    && ps_sps->i1_explicit_rdpcm_enabled_flag
  ------------------
  |  Branch (250:24): [True: 3.71k, False: 304k]
  ------------------
  251|  3.71k|                    && (transform_skip_flag || ps_codec->s_parse.s_cu.i4_cu_transquant_bypass))
  ------------------
  |  Branch (251:25): [True: 484, False: 3.22k]
  |  Branch (251:48): [True: 2.54k, False: 680]
  ------------------
  252|       |
  253|  3.03k|    {
  254|  3.03k|        WORD32 ctxt_idx = IHEVC_CAB_EXPLICIT_RDPCM_FLAG + (c_idx != 0);
  255|  3.03k|        TRACE_CABAC_CTXT("explicit_rdpcm_flag", ps_cabac->u4_range, ctxt_idx);
  256|  3.03k|        value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  257|  3.03k|        AEV_TRACE("explicit_rdpcm_flag", value, ps_cabac->u4_range);
  258|  3.03k|        explicit_rdpcm_flag = value;
  259|       |
  260|  3.03k|        if(explicit_rdpcm_flag)
  ------------------
  |  Branch (260:12): [True: 2.19k, False: 836]
  ------------------
  261|  2.19k|        {
  262|  2.19k|            ctxt_idx = IHEVC_CAB_EXPLICIT_RDPCM_DIR + (c_idx != 0);
  263|  2.19k|            TRACE_CABAC_CTXT("explicit_rdpcm_dir_flag", ps_cabac->u4_range, ctxt_idx);
  264|  2.19k|            value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  265|  2.19k|            AEV_TRACE("explicit_rdpcm_dir_flag", value, ps_cabac->u4_range);
  266|  2.19k|            explicit_rdpcm_dir = value;
  267|  2.19k|        }
  268|  3.03k|    }
  269|  8.25M|#endif
  270|       |
  271|       |    /* code the last_coeff_x_prefix as tunary binarized code */
  272|  8.25M|    {
  273|  8.25M|        WORD32 ctxt_idx_x, ctxt_idx_y, ctx_shift;
  274|  8.25M|        WORD32 ctx_offset;
  275|  8.25M|        c_max = (log2_trafo_size << 1) - 1;
  276|       |
  277|  8.25M|        if(!c_idx)
  ------------------
  |  Branch (277:12): [True: 4.93M, False: 3.32M]
  ------------------
  278|  4.93M|        {
  279|  4.93M|            ctx_offset = (3 * (log2_trafo_size - 2)) + ((log2_trafo_size - 1) >> 2);
  280|  4.93M|            ctxt_idx_x = IHEVC_CAB_COEFFX_PREFIX + ctx_offset;
  281|  4.93M|            ctxt_idx_y = IHEVC_CAB_COEFFY_PREFIX + ctx_offset;
  282|  4.93M|            ctx_shift  = (log2_trafo_size + 1) >> 2;
  283|  4.93M|        }
  284|  3.32M|        else
  285|  3.32M|        {
  286|  3.32M|            ctxt_idx_x = IHEVC_CAB_COEFFX_PREFIX + 15;
  287|  3.32M|            ctxt_idx_y = IHEVC_CAB_COEFFY_PREFIX + 15;
  288|  3.32M|            ctx_shift  = log2_trafo_size  - 2;
  289|  3.32M|        }
  290|       |
  291|  8.25M|        TRACE_CABAC_CTXT("last_coeff_x_prefix", ps_cabac->u4_range, ctxt_idx_x);
  292|  8.25M|        last_significant_coeff_x_prefix = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  293|  8.25M|                                                                          ps_bitstrm,
  294|  8.25M|                                                                          c_max,
  295|  8.25M|                                                                          ctxt_idx_x,
  296|  8.25M|                                                                          ctx_shift,
  297|  8.25M|                                                                          c_max);
  298|       |
  299|  8.25M|        AEV_TRACE("last_coeff_x_prefix", last_significant_coeff_x_prefix, ps_cabac->u4_range);
  300|       |
  301|  8.25M|        TRACE_CABAC_CTXT("last_coeff_y_prefix", ps_cabac->u4_range, ctxt_idx_y);
  302|  8.25M|        last_significant_coeff_y_prefix = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  303|  8.25M|                                                                          ps_bitstrm,
  304|  8.25M|                                                                          c_max,
  305|  8.25M|                                                                          ctxt_idx_y,
  306|  8.25M|                                                                          ctx_shift,
  307|  8.25M|                                                                          c_max);
  308|       |
  309|  8.25M|        AEV_TRACE("last_coeff_y_prefix", last_significant_coeff_y_prefix, ps_cabac->u4_range);
  310|       |
  311|       |
  312|  8.25M|        last_significant_coeff_x = last_significant_coeff_x_prefix;
  313|  8.25M|        if(last_significant_coeff_x_prefix > 3)
  ------------------
  |  Branch (313:12): [True: 1.01M, False: 7.24M]
  ------------------
  314|  1.01M|        {
  315|  1.01M|            WORD32 suf_length = ((last_significant_coeff_x_prefix - 2) >> 1);
  316|       |
  317|  1.01M|            value = ihevcd_cabac_decode_bypass_bins(ps_cabac,
  318|  1.01M|                                                    ps_bitstrm,
  319|  1.01M|                                                    suf_length);
  320|       |
  321|  1.01M|            AEV_TRACE("last_coeff_x_suffix", value, ps_cabac->u4_range);
  322|       |
  323|       |
  324|  1.01M|            last_significant_coeff_x =
  325|  1.01M|                            (1 << ((last_significant_coeff_x_prefix >> 1) - 1)) *
  326|  1.01M|                            (2 + (last_significant_coeff_x_prefix & 1)) + value;
  327|  1.01M|        }
  328|       |
  329|       |
  330|  8.25M|        last_significant_coeff_y = last_significant_coeff_y_prefix;
  331|  8.25M|        if(last_significant_coeff_y_prefix > 3)
  ------------------
  |  Branch (331:12): [True: 1.13M, False: 7.12M]
  ------------------
  332|  1.13M|        {
  333|  1.13M|            WORD32 suf_length = ((last_significant_coeff_y_prefix - 2) >> 1);
  334|  1.13M|            value = ihevcd_cabac_decode_bypass_bins(ps_cabac,
  335|  1.13M|                                                    ps_bitstrm,
  336|  1.13M|                                                    suf_length);
  337|       |
  338|  1.13M|            AEV_TRACE("last_coeff_y_suffix", value, ps_cabac->u4_range);
  339|  1.13M|            last_significant_coeff_y =
  340|  1.13M|                            (1 << ((last_significant_coeff_y_prefix >> 1) - 1)) *
  341|  1.13M|                            (2 + (last_significant_coeff_y_prefix & 1)) + value;
  342|  1.13M|        }
  343|       |
  344|  8.25M|    }
  345|       |
  346|       |    /* Choose a scan matrix based on intra flag, intra pred mode, transform size
  347|       |     and luma/chroma */
  348|  8.25M|    scan_idx = SCAN_DIAG_UPRIGHT;
  349|  8.25M|    if(PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode)
  ------------------
  |  Branch (349:8): [True: 7.95M, False: 308k]
  ------------------
  350|  7.95M|    {
  351|  7.95M|        int is_YUV444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444;
  352|  7.95M|        if((2 == log2_trafo_size) || ((3 == log2_trafo_size) && (0 == c_idx || is_YUV444)))
  ------------------
  |  Branch (352:12): [True: 3.92M, False: 4.02M]
  |  Branch (352:39): [True: 1.27M, False: 2.74M]
  |  Branch (352:66): [True: 722k, False: 557k]
  |  Branch (352:80): [True: 0, False: 557k]
  ------------------
  353|  4.64M|        {
  354|  4.64M|            if((6 <= intra_pred_mode) &&
  ------------------
  |  Branch (354:16): [True: 1.58M, False: 3.06M]
  ------------------
  355|  1.58M|               (14 >= intra_pred_mode))
  ------------------
  |  Branch (355:16): [True: 368k, False: 1.21M]
  ------------------
  356|   368k|            {
  357|   368k|                scan_idx = SCAN_VERT;
  358|   368k|            }
  359|  4.28M|            else if((22 <= intra_pred_mode) &&
  ------------------
  |  Branch (359:21): [True: 950k, False: 3.33M]
  ------------------
  360|   950k|                    (30 >= intra_pred_mode))
  ------------------
  |  Branch (360:21): [True: 718k, False: 232k]
  ------------------
  361|   718k|            {
  362|   718k|                scan_idx = SCAN_HORZ;
  363|   718k|            }
  364|  4.64M|        }
  365|  7.95M|    }
  366|       |
  367|       |    /* In case the scan is vertical, then swap  X and Y positions */
  368|  8.25M|    if(SCAN_VERT == scan_idx)
  ------------------
  |  Branch (368:8): [True: 368k, False: 7.89M]
  ------------------
  369|   368k|    {
  370|   368k|        SWAP(last_significant_coeff_x, last_significant_coeff_y);
  ------------------
  |  |   87|   368k|#define SWAP(X,Y)                   \
  |  |   88|   368k|{                                   \
  |  |   89|   368k|    (X) = (X) ^ (Y);                \
  |  |   90|   368k|    (Y) = (X) ^ (Y);                \
  |  |   91|   368k|    (X) = (X) ^ (Y);                \
  |  |   92|   368k|}
  ------------------
  371|   368k|    }
  372|       |
  373|  8.25M|    {
  374|  8.25M|        WORD8 *pi1_scan_idx;
  375|  8.25M|        WORD8 *pi1_buf = (WORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  376|       |
  377|       |        /* First WORD8 gives number of coded subblocks */
  378|  8.25M|        pi1_num_coded_subblks = pi1_buf++;
  379|       |
  380|       |        /* Set number of coded subblocks in the current TU to zero */
  381|       |        /* This will be updated later */
  382|  8.25M|        *pi1_num_coded_subblks = 0;
  383|       |
  384|  8.25M|        pi1_scan_idx = pi1_buf++;
  385|  8.25M|#ifdef ENABLE_MAIN_REXT_PROFILE
  386|       |        /* Second WORD8 gives (explicit_rdpcm_dir << 5) | (explicit_rdpcm_flag << 4) | (scan idx << 1) | trans_skip */
  387|  8.25M|        *pi1_scan_idx = (explicit_rdpcm_dir << 5) | (explicit_rdpcm_flag << 4) | (scan_idx << 1)
  388|  8.25M|                        | transform_skip_flag;
  389|       |#else
  390|       |        /* Second WORD8 gives (scan idx << 1) | trans_skip */
  391|       |        *pi1_scan_idx = (scan_idx << 1) | transform_skip_flag;
  392|       |#endif
  393|       |
  394|       |        /* Store the incremented pointer in pv_tu_coeff_data */
  395|  8.25M|        ps_codec->s_parse.pv_tu_coeff_data = pi1_buf;
  396|       |
  397|  8.25M|    }
  398|       |    /**
  399|       |     * Given last_significant_coeff_y and last_significant_coeff_x find last sub block
  400|       |     * This is done by ignoring lower two bits of last_significant_coeff_y and last_significant_coeff_x
  401|       |     * and using scan matrix for lookup
  402|       |     */
  403|       |
  404|       |    /* If transform is 4x4, last_sub_blk is zero */
  405|  8.25M|    last_sub_blk = 0;
  406|       |
  407|       |    /* If transform is larger than 4x4, then based on scan_idx and transform size, choose a scan table */
  408|       |
  409|  8.25M|    if(log2_trafo_size > 2)
  ------------------
  |  Branch (409:8): [True: 4.17M, False: 4.08M]
  ------------------
  410|  4.17M|    {
  411|  4.17M|        WORD32 scan_pos;
  412|  4.17M|        WORD32 scan_mat_size;
  413|  4.17M|        pu1_scan_blk = (UWORD8 *)gapv_ihevc_scan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
  414|       |
  415|       |
  416|       |        /* Divide the current transform to 4x4 subblocks and count number of 4x4 in the first row */
  417|       |        /* This will be size of scan matrix to be used for subblock scanning */
  418|  4.17M|        scan_mat_size = 1 << (log2_trafo_size - 2);
  419|  4.17M|        scan_pos = ((last_significant_coeff_y >> 2) * scan_mat_size) +
  420|  4.17M|                        (last_significant_coeff_x >> 2);
  421|       |
  422|  4.17M|        last_sub_blk = pu1_scan_blk[scan_pos];
  423|  4.17M|    }
  424|  8.25M|    pu1_scan_coeff  = &gau1_ihevc_scan4x4[scan_idx][0];
  425|       |
  426|  8.25M|    {
  427|  8.25M|        WORD32 scan_pos;
  428|       |
  429|  8.25M|        scan_pos = ((last_significant_coeff_y & 3) << 2) +
  430|  8.25M|                        (last_significant_coeff_x & 3);
  431|       |
  432|  8.25M|        last_scan_pos = pu1_scan_coeff[scan_pos];
  433|  8.25M|    }
  434|  8.25M|    if(log2_trafo_size > 2)
  ------------------
  |  Branch (434:8): [True: 4.17M, False: 4.08M]
  ------------------
  435|  4.17M|        pu1_scan_blk = (UWORD8 *)gapv_ihevc_invscan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
  436|  8.25M|    pu1_scan_coeff  = &gau1_ihevc_invscan4x4[scan_idx][0];
  437|       |
  438|       |    /* Set CSBF array to zero */
  439|  8.25M|    {
  440|  8.25M|        UWORD32 *pu4_csbf;
  441|  8.25M|        pu4_csbf = (void *)au2_csbf;
  442|  8.25M|        *pu4_csbf++ = 0;
  443|  8.25M|        *pu4_csbf++ = 0;
  444|  8.25M|        *pu4_csbf++ = 0;
  445|  8.25M|        *pu4_csbf = 0;
  446|       |        /* To avoid a check for y pos, 9th WORD16 in the array is set to zero */
  447|  8.25M|        au2_csbf[8] = 0;
  448|  8.25M|    }
  449|       |
  450|       |    /*************************************************************************/
  451|       |    /* derive base context index for sig coeff as per section 9.3.3.1.4      */
  452|       |    /* TODO; convert to look up based on luma/chroma, scan type and tfr size */
  453|       |    /*************************************************************************/
  454|  8.25M|    if(!c_idx)
  ------------------
  |  Branch (454:8): [True: 4.93M, False: 3.32M]
  ------------------
  455|  4.93M|    {
  456|  4.93M|        sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG;
  457|  4.93M|        abs_gt1_base_ctxt = IHEVC_CAB_COEFABS_GRTR1_FLAG;
  458|       |
  459|  4.93M|        if(3 == log2_trafo_size)
  ------------------
  |  Branch (459:12): [True: 785k, False: 4.14M]
  ------------------
  460|   785k|        {
  461|       |            /* 8x8 transform size */
  462|   785k|            sig_coeff_base_ctxt += (scan_idx == SCAN_DIAG_UPRIGHT) ? 9 : 15;
  ------------------
  |  Branch (462:36): [True: 537k, False: 248k]
  ------------------
  463|   785k|        }
  464|  4.14M|        else  if(3 < log2_trafo_size)
  ------------------
  |  Branch (464:18): [True: 1.68M, False: 2.46M]
  ------------------
  465|  1.68M|        {
  466|       |            /* larger transform sizes */
  467|  1.68M|            sig_coeff_base_ctxt += 21;
  468|  1.68M|        }
  469|  4.93M|    }
  470|  3.32M|    else
  471|  3.32M|    {
  472|       |        /* chroma context initializations */
  473|  3.32M|        sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG + 27;
  474|  3.32M|        abs_gt1_base_ctxt = IHEVC_CAB_COEFABS_GRTR1_FLAG + 16;
  475|       |
  476|  3.32M|        if(3 == log2_trafo_size)
  ------------------
  |  Branch (476:12): [True: 563k, False: 2.76M]
  ------------------
  477|   563k|        {
  478|       |            /* 8x8 transform size */
  479|   563k|            sig_coeff_base_ctxt += 9;
  480|   563k|        }
  481|  2.76M|        else  if(3 < log2_trafo_size)
  ------------------
  |  Branch (481:18): [True: 1.13M, False: 1.62M]
  ------------------
  482|  1.13M|        {
  483|       |            /* larger transform sizes */
  484|  1.13M|            sig_coeff_base_ctxt += 12;
  485|  1.13M|        }
  486|  3.32M|    }
  487|  8.25M|    num_subblks = 0;
  488|       |    /* Parse each 4x4 subblocks */
  489|  23.7M|    for(i = last_sub_blk; i >= 0; i--)
  ------------------
  |  Branch (489:27): [True: 15.4M, False: 8.25M]
  ------------------
  490|  15.4M|    {
  491|  15.4M|        WORD32 sub_blk_pos;
  492|  15.4M|        WORD32 infer_sig_coeff_flag;
  493|  15.4M|        WORD32 cur_csbf;
  494|       |
  495|  15.4M|        WORD32 n;
  496|  15.4M|        WORD32 num_coeff;
  497|       |        /* Sig coeff map for 16 entries in raster scan order. Upper 16 bits are used.
  498|       |         * MSB gives sig coeff flag for 0th coeff and so on
  499|       |         * UWORD16 would have been enough but kept as UWORD32 for code optimizations
  500|       |         * In arm unnecessary masking operations are saved
  501|       |         */
  502|  15.4M|        UWORD32 u4_sig_coeff_map_raster;
  503|  15.4M|        WORD32 sign_hidden;
  504|       |
  505|       |        /* Sig coeff map in scan order */
  506|  15.4M|        UWORD32 u4_sig_coeff_map;
  507|  15.4M|        WORD32 coeff_abs_level_greater2_flag;
  508|  15.4M|        UWORD32 u4_coeff_abs_level_greater1_map;
  509|  15.4M|        UWORD32 u4_coeff_abs_level_greater2_map;
  510|  15.4M|        UWORD32 u4_coeff_sign_map;
  511|  15.4M|        WORD32 first_sig_scan_pos, last_sig_scan_pos, num_greater1_flag, first_greater1_scan_pos;
  512|  15.4M|        WORD32  num_sig_coeff, sum_abs_level;
  513|  15.4M|        WORD32 nbr_csbf;
  514|       |
  515|       |
  516|  15.4M|        WORD32 ctxt_set;
  517|  15.4M|        WORD32 rice_param;
  518|  15.4M|        WORD32 xs, ys;
  519|       |
  520|  15.4M|#ifdef ENABLE_MAIN_REXT_PROFILE
  521|  15.4M|        WORD8 i1_update_stats = ps_sps->i1_persistent_rice_adaptation_enabled_flag;
  522|  15.4M|#endif
  523|       |
  524|  15.4M|        sub_blk_pos  = 0;
  525|  15.4M|        if(i && (log2_trafo_size > 2))
  ------------------
  |  Branch (525:12): [True: 7.18M, False: 8.25M]
  |  Branch (525:17): [True: 7.18M, False: 0]
  ------------------
  526|  7.18M|            sub_blk_pos = pu1_scan_blk[i];
  527|       |
  528|       |        /* Get xs and ys from scan position */
  529|       |        /* This is needed for context modelling of significant coeff flag */
  530|  15.4M|        xs = sub_blk_pos & ((1 << (log2_trafo_size - 2)) - 1);
  531|  15.4M|        ys = sub_blk_pos >> (log2_trafo_size - 2);
  532|       |
  533|       |
  534|       |        /* Check if neighbor subblocks are coded */
  535|  15.4M|        {
  536|       |
  537|  15.4M|            nbr_csbf = 0;
  538|       |
  539|       |            /* Get Bottom sub blocks CSBF */
  540|  15.4M|            nbr_csbf |= (au2_csbf[ys + 1] >> xs) & 1;
  541|  15.4M|            nbr_csbf <<= 1;
  542|       |
  543|       |            /* Get Right sub blocks CSBF */
  544|       |            /* Even if xs is equal to (1 << (log2_trafo_size - 2 )) - 1,
  545|       |               since au2_csbf is set to zero at the beginning, csbf for
  546|       |               neighbor will be read as 0 */
  547|       |
  548|  15.4M|            nbr_csbf |= (au2_csbf[ys] >> (xs + 1)) & 1;
  549|       |
  550|       |
  551|  15.4M|        }
  552|  15.4M|        cur_csbf = 0;
  553|       |
  554|       |        /* DC coeff is inferred, only if coded_sub_block is explicitly parsed as 1 */
  555|       |        /* i.e. it is not inferred for first and last subblock */
  556|  15.4M|        infer_sig_coeff_flag = 0;
  557|  15.4M|        if((i < last_sub_blk) && (i > 0))
  ------------------
  |  Branch (557:12): [True: 7.18M, False: 8.25M]
  |  Branch (557:34): [True: 5.56M, False: 1.62M]
  ------------------
  558|  5.56M|        {
  559|  5.56M|            WORD32 ctxt_idx  = IHEVC_CAB_CODED_SUBLK_IDX;
  560|       |
  561|       |            /* ctxt based on right / bottom avail csbf, section 9.3.3.1.3 */
  562|  5.56M|            ctxt_idx += (nbr_csbf) ? 1 : 0;
  ------------------
  |  Branch (562:25): [True: 2.74M, False: 2.82M]
  ------------------
  563|       |
  564|       |            /* Ctxt based on luma or chroma */
  565|  5.56M|            ctxt_idx += c_idx  ? 2 : 0;
  ------------------
  |  Branch (565:25): [True: 983k, False: 4.58M]
  ------------------
  566|  5.56M|            TRACE_CABAC_CTXT("coded_sub_block_flag", ps_cabac->u4_range, ctxt_idx);
  567|  5.56M|            IHEVCD_CABAC_DECODE_BIN(cur_csbf, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  5.56M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  5.56M|{                                                                               \
  |  |   61|  5.56M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  5.56M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  5.56M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  5.56M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  5.56M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  5.56M|    WORD32 clz;                                                                 \
  |  |   67|  5.56M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  5.56M|                                                                                \
  |  |   69|  5.56M|    /* Sanity checks */                                                         \
  |  |   70|  5.56M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  5.56M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  5.56M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  5.56M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  5.56M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  5.56M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  5.56M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  5.56M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  5.56M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  5.56M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  5.56M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  5.56M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  5.56M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  5.56M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  5.56M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  5.56M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  5.56M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  5.56M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  5.56M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  5.56M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  5.56M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  5.56M|                                                                                \
  |  |   83|  5.56M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  5.56M|                                                                                \
  |  |   85|  5.56M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 262k, False: 5.30M]
  |  |  ------------------
  |  |   86|  5.56M|    {                                                                           \
  |  |   87|   262k|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|   262k|        u4_ofst -= u4_range;                                                    \
  |  |   89|   262k|        u4_range = u4_rlps;                                                     \
  |  |   90|   262k|    }                                                                           \
  |  |   91|  5.56M|                                                                                \
  |  |   92|  5.56M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  5.56M|                                                                                \
  |  |   94|  5.56M|    /*****************************************************************/         \
  |  |   95|  5.56M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  5.56M|    /*****************************************************************/         \
  |  |   97|  5.56M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 44.8k, False: 5.51M]
  |  |  ------------------
  |  |   98|  5.56M|    {                                                                           \
  |  |   99|  44.8k|        UWORD32 u4_bits;                                                        \
  |  |  100|  44.8k|        WORD32 numbits;                                                         \
  |  |  101|  44.8k|        numbits = CLZ(u4_range);                                                \
  |  |  102|  44.8k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  44.8k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  44.8k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  44.8k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  44.8k|{                                                               \
  |  |  |  |  152|  44.8k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  44.8k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  44.8k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  44.8k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  44.8k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  89.6k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 31.8k, False: 12.9k]
  |  |  |  |  ------------------
  |  |  |  |  156|  44.8k|    {                                                           \
  |  |  |  |  157|  31.8k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  31.8k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 31.8k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  31.8k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  31.8k|    }                                                           \
  |  |  |  |  160|  44.8k|                                                                \
  |  |  |  |  161|  44.8k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  89.6k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 33.2k, False: 11.6k]
  |  |  |  |  ------------------
  |  |  |  |  162|  44.8k|    {                                                           \
  |  |  |  |  163|  33.2k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  33.2k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  33.2k|        /* Getting the next word */                             \
  |  |  |  |  166|  33.2k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  33.2k|                                                                \
  |  |  |  |  168|  33.2k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  33.2k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  33.2k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  33.2k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  33.2k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  33.2k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  33.2k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  33.2k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  33.2k|    }                                                           \
  |  |  |  |  172|  44.8k|}
  |  |  ------------------
  |  |  104|  44.8k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  44.8k|                                                                                \
  |  |  106|  44.8k|        u4_ofst <<= numbits;                                                    \
  |  |  107|  44.8k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  44.8k|        u4_range <<= numbits;                                                   \
  |  |  109|  44.8k|                                                                                \
  |  |  110|  44.8k|    }                                                                           \
  |  |  111|  5.56M|    /* Update the cabac context */                                              \
  |  |  112|  5.56M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  5.56M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  5.56M|                                                                                \
  |  |  115|  5.56M|}
  ------------------
  568|  5.56M|            AEV_TRACE("coded_sub_block_flag", cur_csbf, ps_cabac->u4_range);
  569|       |
  570|  5.56M|            infer_sig_coeff_flag = 1;
  571|  5.56M|        }
  572|  9.88M|        else /* if((i == last_sub_blk) || (sub_blk_pos == 0)) */
  573|  9.88M|        {
  574|       |            /* CSBF is set to 1 for first and last subblock */
  575|       |            /* Note for these subblocks sig_coeff_map is not inferred but instead parsed */
  576|  9.88M|            cur_csbf = 1;
  577|  9.88M|        }
  578|       |
  579|       |        /* Set current sub blocks CSBF */
  580|  15.4M|        {
  581|  15.4M|            UWORD32 u4_mask = 1 << xs;
  582|  15.4M|            if(cur_csbf)
  ------------------
  |  Branch (582:16): [True: 12.1M, False: 3.27M]
  ------------------
  583|  12.1M|                au2_csbf[ys] |= u4_mask;
  584|  3.27M|            else
  585|  3.27M|                au2_csbf[ys] &= ~u4_mask;
  586|       |
  587|  15.4M|        }
  588|       |
  589|       |        /* If current subblock is not coded, proceed to the next subblock */
  590|  15.4M|        if(0 == cur_csbf)
  ------------------
  |  Branch (590:12): [True: 3.27M, False: 12.1M]
  ------------------
  591|  3.27M|            continue;
  592|       |
  593|  12.1M|        n = 15;
  594|  12.1M|        u4_sig_coeff_map_raster = 0;
  595|  12.1M|        u4_sig_coeff_map = 0;
  596|  12.1M|        num_coeff = 0;
  597|  12.1M|        if(i == last_sub_blk)
  ------------------
  |  Branch (597:12): [True: 8.25M, False: 3.91M]
  ------------------
  598|  8.25M|        {
  599|  8.25M|            WORD32 pos = ((last_significant_coeff_y & 3) << 2) +
  600|  8.25M|                            (last_significant_coeff_x & 3);
  601|  8.25M|            n = (last_scan_pos - 1);
  602|       |            /* Set Significant coeff map for last significant coeff flag as 1 */
  603|  8.25M|            u4_sig_coeff_map_raster = 1 << pos;
  604|  8.25M|            u4_sig_coeff_map = 1 << last_scan_pos;
  605|  8.25M|            num_coeff = 1;
  606|  8.25M|        }
  607|       |
  608|   108M|        for(; n >= 0; n--)
  ------------------
  |  Branch (608:15): [True: 96.6M, False: 12.1M]
  ------------------
  609|  96.6M|        {
  610|  96.6M|            WORD32 significant_coeff_flag;
  611|       |
  612|  96.6M|            if((n > 0 || !infer_sig_coeff_flag))
  ------------------
  |  Branch (612:17): [True: 88.3M, False: 8.31M]
  |  Branch (612:26): [True: 7.88M, False: 429k]
  ------------------
  613|  96.2M|            {
  614|       |                //WORD32 coeff_pos;
  615|  96.2M|                WORD32 sig_ctxinc;
  616|  96.2M|                WORD32 ctxt_idx;
  617|       |
  618|       |                /* Coefficient position is needed for deriving context index for significant_coeff_flag */
  619|       |                //coeff_pos = pu1_scan_coeff[n];
  620|       |                /* derive the context inc as per section 9.3.3.1.4 */
  621|  96.2M|                sig_ctxinc = 0;
  622|  96.2M|#ifdef ENABLE_MAIN_REXT_PROFILE
  623|  96.2M|                if(ps_sps->i1_transform_skip_context_enabled_flag
  ------------------
  |  Branch (623:20): [True: 303k, False: 95.9M]
  ------------------
  624|   303k|                                && (ps_codec->s_parse.s_cu.i4_cu_transquant_bypass
  ------------------
  |  Branch (624:37): [True: 169k, False: 133k]
  ------------------
  625|   133k|                                                || transform_skip_flag))
  ------------------
  |  Branch (625:52): [True: 26.5k, False: 107k]
  ------------------
  626|   196k|                {
  627|   196k|                    sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG;
  628|   196k|                    sig_coeff_base_ctxt += (0 == c_idx) ? 42 : 43;
  ------------------
  |  Branch (628:44): [True: 167k, False: 28.6k]
  ------------------
  629|   196k|                }
  630|  96.0M|                else if(2 == log2_trafo_size)
  ------------------
  |  Branch (630:25): [True: 26.6M, False: 69.3M]
  ------------------
  631|       |#else
  632|       |                if(2 == log2_trafo_size)
  633|       |#endif
  634|  26.6M|                {
  635|       |
  636|       |                    /* 4x4 transform size increment uses lookup */
  637|  26.6M|                    sig_ctxinc = gau1_ihevcd_sigcoeff_ctxtinc_tr4[scan_idx][n];
  638|  26.6M|                }
  639|  69.3M|                else if(n || i)
  ------------------
  |  Branch (639:25): [True: 64.3M, False: 5.05M]
  |  Branch (639:30): [True: 2.45M, False: 2.60M]
  ------------------
  640|  66.7M|                {
  641|       |                    /* ctxt for AC coeff depends on curpos and neigbour csbf */
  642|  66.7M|                    sig_ctxinc = gau1_ihevcd_sigcoeff_ctxtinc[scan_idx][nbr_csbf][n];
  643|       |
  644|       |                    /* based on luma subblock pos */
  645|  66.7M|                    sig_ctxinc += (i && (!c_idx)) ? 3 : 0;
  ------------------
  |  Branch (645:36): [True: 39.4M, False: 27.2M]
  |  Branch (645:41): [True: 32.5M, False: 6.96M]
  ------------------
  646|       |
  647|  66.7M|                }
  648|  2.60M|                else
  649|  2.60M|                {
  650|       |                    /* DC coeff has fixed context for luma and chroma */
  651|  2.60M|                    sig_coeff_base_ctxt = (0 == c_idx) ? IHEVC_CAB_COEFF_FLAG :
  ------------------
  |  Branch (651:43): [True: 1.80M, False: 792k]
  ------------------
  652|  2.60M|                                                         (IHEVC_CAB_COEFF_FLAG + 27);
  653|  2.60M|                }
  654|       |
  655|  96.2M|                ctxt_idx = sig_ctxinc + sig_coeff_base_ctxt;
  656|  96.2M|                TRACE_CABAC_CTXT("significant_coeff_flag", ps_cabac->u4_range, ctxt_idx);
  657|  96.2M|                IHEVCD_CABAC_DECODE_BIN(significant_coeff_flag, ps_cabac,
  ------------------
  |  |   59|  96.2M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  96.2M|{                                                                               \
  |  |   61|  96.2M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  96.2M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  96.2M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  96.2M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  96.2M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  96.2M|    WORD32 clz;                                                                 \
  |  |   67|  96.2M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  96.2M|                                                                                \
  |  |   69|  96.2M|    /* Sanity checks */                                                         \
  |  |   70|  96.2M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  96.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  96.2M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  96.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  96.2M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  96.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  96.2M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  96.2M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  96.2M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  96.2M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  96.2M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  96.2M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  96.2M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  96.2M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  96.2M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  96.2M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  96.2M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  96.2M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  96.2M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  96.2M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  96.2M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  96.2M|                                                                                \
  |  |   83|  96.2M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  96.2M|                                                                                \
  |  |   85|  96.2M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 7.39M, False: 88.8M]
  |  |  ------------------
  |  |   86|  96.2M|    {                                                                           \
  |  |   87|  7.39M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  7.39M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  7.39M|        u4_range = u4_rlps;                                                     \
  |  |   90|  7.39M|    }                                                                           \
  |  |   91|  96.2M|                                                                                \
  |  |   92|  96.2M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  96.2M|                                                                                \
  |  |   94|  96.2M|    /*****************************************************************/         \
  |  |   95|  96.2M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  96.2M|    /*****************************************************************/         \
  |  |   97|  96.2M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 1.05M, False: 95.2M]
  |  |  ------------------
  |  |   98|  96.2M|    {                                                                           \
  |  |   99|  1.05M|        UWORD32 u4_bits;                                                        \
  |  |  100|  1.05M|        WORD32 numbits;                                                         \
  |  |  101|  1.05M|        numbits = CLZ(u4_range);                                                \
  |  |  102|  1.05M|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  1.05M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  1.05M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  1.05M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  1.05M|{                                                               \
  |  |  |  |  152|  1.05M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  1.05M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.05M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  1.05M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  1.05M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.10M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 736k, False: 316k]
  |  |  |  |  ------------------
  |  |  |  |  156|  1.05M|    {                                                           \
  |  |  |  |  157|   736k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   736k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 736k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   736k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   736k|    }                                                           \
  |  |  |  |  160|  1.05M|                                                                \
  |  |  |  |  161|  1.05M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.10M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 769k, False: 284k]
  |  |  |  |  ------------------
  |  |  |  |  162|  1.05M|    {                                                           \
  |  |  |  |  163|   769k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   769k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   769k|        /* Getting the next word */                             \
  |  |  |  |  166|   769k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   769k|                                                                \
  |  |  |  |  168|   769k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   769k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   769k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   769k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   769k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   769k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   769k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   769k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   769k|    }                                                           \
  |  |  |  |  172|  1.05M|}
  |  |  ------------------
  |  |  104|  1.05M|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  1.05M|                                                                                \
  |  |  106|  1.05M|        u4_ofst <<= numbits;                                                    \
  |  |  107|  1.05M|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  1.05M|        u4_range <<= numbits;                                                   \
  |  |  109|  1.05M|                                                                                \
  |  |  110|  1.05M|    }                                                                           \
  |  |  111|  96.2M|    /* Update the cabac context */                                              \
  |  |  112|  96.2M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  96.2M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  96.2M|                                                                                \
  |  |  115|  96.2M|}
  ------------------
  658|  96.2M|                                        ps_bitstrm,
  659|  96.2M|                                        ctxt_idx);
  660|  96.2M|                AEV_TRACE("significant_coeff_flag", significant_coeff_flag, ps_cabac->u4_range);
  661|       |
  662|       |
  663|       |                /* If at least one non-zero coeff is signalled then do not infer sig coeff map */
  664|       |                /* for (0,0) coeff in the current sub block */
  665|  96.2M|                if(significant_coeff_flag)
  ------------------
  |  Branch (665:20): [True: 43.5M, False: 52.7M]
  ------------------
  666|  43.5M|                    infer_sig_coeff_flag = 0;
  667|       |
  668|       |//                u4_sig_coeff_map_raster |= significant_coeff_flag
  669|       |//                              << coeff_pos;
  670|  96.2M|                u4_sig_coeff_map |= significant_coeff_flag << n;
  671|  96.2M|                num_coeff += significant_coeff_flag;
  672|  96.2M|            }
  673|       |
  674|       |
  675|  96.6M|        }
  676|       |        /*********************************************************************/
  677|       |        /* If infer_sig_coeff_flag is 1 then treat the 0th coeff as non zero */
  678|       |        /* If infer_sig_coeff_flag is zero, then last significant_coeff_flag */
  679|       |        /* is parsed in the above loop                                       */
  680|       |        /*********************************************************************/
  681|  12.1M|        if(infer_sig_coeff_flag)
  ------------------
  |  Branch (681:12): [True: 429k, False: 11.7M]
  ------------------
  682|   429k|        {
  683|   429k|            u4_sig_coeff_map_raster |= 1;
  684|   429k|            u4_sig_coeff_map |= 1;
  685|   429k|            num_coeff++;
  686|   429k|        }
  687|       |
  688|       |        /*********************************************************************/
  689|       |        /* First subblock does not get an explicit csbf. It is assumed to    */
  690|       |        /* be 1. For this subblock there is chance of getting all            */
  691|       |        /* sig_coeff_flags to be zero. In such a case proceed to the next    */
  692|       |        /* subblock(which is end of parsing for the current transform block) */
  693|       |        /*********************************************************************/
  694|       |
  695|  12.1M|        if(0 == num_coeff)
  ------------------
  |  Branch (695:12): [True: 421k, False: 11.7M]
  ------------------
  696|   421k|            continue;
  697|       |
  698|       |        /* Increment number of coded subblocks for the current TU */
  699|  11.7M|        num_subblks++;
  700|       |
  701|       |        /* Set sig coeff map and subblock position */
  702|  11.7M|        ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)ps_codec->s_parse.pv_tu_coeff_data;
  703|  11.7M|        ps_tu_sblk_coeff_data->u2_sig_coeff_map = u4_sig_coeff_map;
  704|  11.7M|        ps_tu_sblk_coeff_data->u2_subblk_pos = (ys << 8) | xs;
  705|       |
  706|  11.7M|        first_sig_scan_pos = 16;
  707|  11.7M|        last_sig_scan_pos = -1;
  708|  11.7M|        num_greater1_flag = 0;
  709|  11.7M|        first_greater1_scan_pos = -1;
  710|  11.7M|        u4_coeff_abs_level_greater1_map = 0;
  711|       |
  712|       |
  713|       |        /* context set based on luma subblock pos */
  714|  11.7M|        ctxt_set = (i && (!c_idx)) ? 2 : 0;
  ------------------
  |  Branch (714:21): [True: 3.91M, False: 7.83M]
  |  Branch (714:26): [True: 3.06M, False: 852k]
  ------------------
  715|       |
  716|       |        /* See section 9.3.3.1.5           */
  717|  11.7M|        ctxt_set += (0 == gt1_ctxt) ? 1 : 0;
  ------------------
  |  Branch (717:21): [True: 828k, False: 10.9M]
  ------------------
  718|       |
  719|  11.7M|        gt1_ctxt = 1;
  720|       |        /* Instead of initializing n to 15, set it to 31-CLZ(sig coeff map) */
  721|  11.7M|        {
  722|  11.7M|            UWORD32 u4_sig_coeff_map_shift;
  723|  11.7M|            UWORD32 clz;
  724|  11.7M|            clz = CLZ(u4_sig_coeff_map);
  725|  11.7M|            n = 31 - clz;
  726|  11.7M|            u4_sig_coeff_map_shift = u4_sig_coeff_map << clz;
  727|       |            /* For loop for n changed to do while to break early if sig_coeff_map_shift becomes zero */
  728|  11.7M|            do
  729|  42.7M|            {
  730|       |                //WORD32 coeff_pos;
  731|  42.7M|                WORD32 ctxt_idx;
  732|       |
  733|       |                //TODO: Scan lookup will be removed later and instead u4_sig_coeff_map will be used
  734|       |                //coeff_pos = pu1_scan_coeff[n];
  735|       |
  736|  42.7M|                if((u4_sig_coeff_map_shift >> 31) & 1)
  ------------------
  |  Branch (736:20): [True: 42.7M, False: 0]
  ------------------
  737|  42.7M|                {
  738|       |
  739|       |                    /* abs_level_greater1_flag is sent for only first 8 non-zero levels in a subblock */
  740|  42.7M|                    if(num_greater1_flag < 8)
  ------------------
  |  Branch (740:24): [True: 40.6M, False: 2.06M]
  ------------------
  741|  40.6M|                    {
  742|  40.6M|                        WORD32 coeff_abs_level_greater1_flag;
  743|       |
  744|  40.6M|                        ctxt_idx = (ctxt_set * 4) + abs_gt1_base_ctxt + gt1_ctxt;
  745|       |
  746|  40.6M|                        TRACE_CABAC_CTXT("coeff_abs_level_greater1_flag", ps_cabac->u4_range, ctxt_idx);
  747|  40.6M|                        IHEVCD_CABAC_DECODE_BIN(coeff_abs_level_greater1_flag, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  40.6M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  40.6M|{                                                                               \
  |  |   61|  40.6M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  40.6M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  40.6M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  40.6M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  40.6M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  40.6M|    WORD32 clz;                                                                 \
  |  |   67|  40.6M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  40.6M|                                                                                \
  |  |   69|  40.6M|    /* Sanity checks */                                                         \
  |  |   70|  40.6M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  40.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  40.6M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  40.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  40.6M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  40.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  40.6M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  40.6M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  40.6M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  40.6M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  40.6M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  40.6M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  40.6M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  40.6M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  40.6M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  40.6M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  40.6M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  40.6M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  40.6M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  40.6M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  40.6M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  40.6M|                                                                                \
  |  |   83|  40.6M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  40.6M|                                                                                \
  |  |   85|  40.6M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 3.42M, False: 37.2M]
  |  |  ------------------
  |  |   86|  40.6M|    {                                                                           \
  |  |   87|  3.42M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  3.42M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  3.42M|        u4_range = u4_rlps;                                                     \
  |  |   90|  3.42M|    }                                                                           \
  |  |   91|  40.6M|                                                                                \
  |  |   92|  40.6M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  40.6M|                                                                                \
  |  |   94|  40.6M|    /*****************************************************************/         \
  |  |   95|  40.6M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  40.6M|    /*****************************************************************/         \
  |  |   97|  40.6M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 478k, False: 40.2M]
  |  |  ------------------
  |  |   98|  40.6M|    {                                                                           \
  |  |   99|   478k|        UWORD32 u4_bits;                                                        \
  |  |  100|   478k|        WORD32 numbits;                                                         \
  |  |  101|   478k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   478k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   478k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   478k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   478k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   478k|{                                                               \
  |  |  |  |  152|   478k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   478k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   478k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   478k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   478k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   957k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 335k, False: 143k]
  |  |  |  |  ------------------
  |  |  |  |  156|   478k|    {                                                           \
  |  |  |  |  157|   335k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   335k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 335k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   335k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   335k|    }                                                           \
  |  |  |  |  160|   478k|                                                                \
  |  |  |  |  161|   478k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   957k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 350k, False: 128k]
  |  |  |  |  ------------------
  |  |  |  |  162|   478k|    {                                                           \
  |  |  |  |  163|   350k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   350k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   350k|        /* Getting the next word */                             \
  |  |  |  |  166|   350k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   350k|                                                                \
  |  |  |  |  168|   350k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   350k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   350k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   350k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   350k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   350k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   350k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   350k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   350k|    }                                                           \
  |  |  |  |  172|   478k|}
  |  |  ------------------
  |  |  104|   478k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   478k|                                                                                \
  |  |  106|   478k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   478k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   478k|        u4_range <<= numbits;                                                   \
  |  |  109|   478k|                                                                                \
  |  |  110|   478k|    }                                                                           \
  |  |  111|  40.6M|    /* Update the cabac context */                                              \
  |  |  112|  40.6M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  40.6M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  40.6M|                                                                                \
  |  |  115|  40.6M|}
  ------------------
  748|  40.6M|                        AEV_TRACE("coeff_abs_level_greater1_flag", coeff_abs_level_greater1_flag, ps_cabac->u4_range);
  749|       |
  750|  40.6M|                        u4_coeff_abs_level_greater1_map |= coeff_abs_level_greater1_flag << n;
  751|  40.6M|                        num_greater1_flag++;
  752|       |
  753|       |                        /* first_greater1_scan_pos is obtained using CLZ on u4_coeff_abs_level_greater1_map*/
  754|       |                        /*  outside the loop instead of the following check inside the loop                */
  755|       |                        /* if( coeff_abs_level_greater1_flag && first_greater1_scan_pos == -1) */
  756|       |                        /*    first_greater1_scan_pos = n;                                     */
  757|       |
  758|  40.6M|                        if(coeff_abs_level_greater1_flag)
  ------------------
  |  Branch (758:28): [True: 8.88M, False: 31.8M]
  ------------------
  759|  8.88M|                        {
  760|  8.88M|                            gt1_ctxt = 0;
  761|  8.88M|                        }
  762|  31.8M|                        else if(gt1_ctxt && (gt1_ctxt < 3))
  ------------------
  |  Branch (762:33): [True: 28.5M, False: 3.27M]
  |  Branch (762:45): [True: 14.4M, False: 14.0M]
  ------------------
  763|  14.4M|                        {
  764|  14.4M|                            gt1_ctxt++;
  765|  14.4M|                        }
  766|       |
  767|  40.6M|                    }
  768|  2.06M|                    else
  769|  2.06M|                        break;
  770|       |
  771|       |                    /* instead of computing last and first significan scan position using checks below */
  772|       |                    /* They are computed outside the loop using CLZ and CTZ on sig_coeff_map */
  773|       |                    /* if(last_sig_scan_pos == -1)                          */
  774|       |                    /*    last_sig_scan_pos = n;                            */
  775|       |                    /*  first_sig_scan_pos = n;                             */
  776|  42.7M|                }
  777|  40.6M|                u4_sig_coeff_map_shift <<= 1;
  778|  40.6M|                n--;
  779|       |                /* If there are zero coeffs, then shift by as many zero coeffs and decrement n */
  780|  40.6M|                clz = CLZ(u4_sig_coeff_map_shift);
  781|  40.6M|                u4_sig_coeff_map_shift <<= clz;
  782|  40.6M|                n -= (WORD32)clz;
  783|  40.6M|            }while(u4_sig_coeff_map_shift);
  ------------------
  |  Branch (783:20): [True: 31.0M, False: 9.68M]
  ------------------
  784|  11.7M|        }
  785|       |        /* At this level u4_sig_coeff_map is non-zero i.e. has atleast one non-zero coeff */
  786|  11.7M|        last_sig_scan_pos = (31 - CLZ(u4_sig_coeff_map));
  787|  11.7M|        first_sig_scan_pos = CTZ(u4_sig_coeff_map);
  788|       |
  789|  11.7M|        if(ps_codec->s_parse.s_cu.i4_cu_transquant_bypass
  ------------------
  |  Branch (789:12): [True: 725k, False: 11.0M]
  ------------------
  790|  11.0M|#ifdef ENABLE_MAIN_REXT_PROFILE
  791|  11.0M|                        || explicit_rdpcm_flag
  ------------------
  |  Branch (791:28): [True: 448, False: 11.0M]
  ------------------
  792|  11.0M|#endif
  793|  11.0M|                        || (PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode
  ------------------
  |  Branch (793:29): [True: 10.6M, False: 374k]
  ------------------
  794|  10.6M|#ifdef ENABLE_MAIN_REXT_PROFILE
  795|  10.6M|                                        && ps_sps->i1_implicit_rdpcm_enabled_flag
  ------------------
  |  Branch (795:44): [True: 85.8k, False: 10.5M]
  ------------------
  796|       |#else
  797|       |                                        && 0
  798|       |#endif
  799|  85.8k|                                        && transform_skip_flag
  ------------------
  |  Branch (799:44): [True: 19.5k, False: 66.2k]
  ------------------
  800|  19.5k|                                        && (intra_pred_mode == 10 || intra_pred_mode == 26)))
  ------------------
  |  Branch (800:45): [True: 1.07k, False: 18.4k]
  |  Branch (800:70): [True: 2.36k, False: 16.1k]
  ------------------
  801|   728k|        {
  802|   728k|            sign_hidden = 0;
  803|   728k|        }
  804|  11.0M|        else
  805|  11.0M|        {
  806|  11.0M|            sign_hidden = ((last_sig_scan_pos - first_sig_scan_pos) > 3);
  807|  11.0M|        }
  808|       |
  809|  11.7M|        u4_coeff_abs_level_greater2_map = 0;
  810|       |
  811|  11.7M|        if(u4_coeff_abs_level_greater1_map)
  ------------------
  |  Branch (811:12): [True: 3.55M, False: 8.19M]
  ------------------
  812|  3.55M|        {
  813|       |            /* Check if the first level > 1 is greater than 2 */
  814|  3.55M|            WORD32 ctxt_idx;
  815|  3.55M|            first_greater1_scan_pos = (31 - CLZ(u4_coeff_abs_level_greater1_map));
  816|       |
  817|       |
  818|  3.55M|            ctxt_idx = IHEVC_CAB_COEFABS_GRTR2_FLAG;
  819|       |
  820|  3.55M|            ctxt_idx += (!c_idx) ? ctxt_set : (ctxt_set + 4);
  ------------------
  |  Branch (820:25): [True: 2.10M, False: 1.45M]
  ------------------
  821|  3.55M|            TRACE_CABAC_CTXT("coeff_abs_level_greater2_flag", ps_cabac->u4_range, ctxt_idx);
  822|  3.55M|            IHEVCD_CABAC_DECODE_BIN(coeff_abs_level_greater2_flag, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  3.55M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  3.55M|{                                                                               \
  |  |   61|  3.55M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  3.55M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  3.55M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  3.55M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  3.55M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  3.55M|    WORD32 clz;                                                                 \
  |  |   67|  3.55M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  3.55M|                                                                                \
  |  |   69|  3.55M|    /* Sanity checks */                                                         \
  |  |   70|  3.55M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  3.55M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   71|  3.55M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  3.55M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   72|  3.55M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  3.55M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   73|  3.55M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  3.55M|#define ASSERT(x) {}
  |  |  ------------------
  |  |   74|  3.55M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  3.55M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  3.55M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  3.55M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  3.55M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  3.55M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  3.55M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  3.55M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  3.55M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  3.55M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  3.55M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  3.55M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  3.55M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  3.55M|                                                                                \
  |  |   83|  3.55M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  3.55M|                                                                                \
  |  |   85|  3.55M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 575k, False: 2.97M]
  |  |  ------------------
  |  |   86|  3.55M|    {                                                                           \
  |  |   87|   575k|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|   575k|        u4_ofst -= u4_range;                                                    \
  |  |   89|   575k|        u4_range = u4_rlps;                                                     \
  |  |   90|   575k|    }                                                                           \
  |  |   91|  3.55M|                                                                                \
  |  |   92|  3.55M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  3.55M|                                                                                \
  |  |   94|  3.55M|    /*****************************************************************/         \
  |  |   95|  3.55M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  3.55M|    /*****************************************************************/         \
  |  |   97|  3.55M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 72.2k, False: 3.48M]
  |  |  ------------------
  |  |   98|  3.55M|    {                                                                           \
  |  |   99|  72.2k|        UWORD32 u4_bits;                                                        \
  |  |  100|  72.2k|        WORD32 numbits;                                                         \
  |  |  101|  72.2k|        numbits = CLZ(u4_range);                                                \
  |  |  102|  72.2k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  72.2k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  72.2k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  72.2k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  72.2k|{                                                               \
  |  |  |  |  152|  72.2k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  72.2k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  72.2k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  72.2k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  72.2k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   144k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 51.0k, False: 21.2k]
  |  |  |  |  ------------------
  |  |  |  |  156|  72.2k|    {                                                           \
  |  |  |  |  157|  51.0k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  51.0k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 51.0k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  51.0k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  51.0k|    }                                                           \
  |  |  |  |  160|  72.2k|                                                                \
  |  |  |  |  161|  72.2k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   144k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 53.6k, False: 18.5k]
  |  |  |  |  ------------------
  |  |  |  |  162|  72.2k|    {                                                           \
  |  |  |  |  163|  53.6k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  53.6k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  53.6k|        /* Getting the next word */                             \
  |  |  |  |  166|  53.6k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  53.6k|                                                                \
  |  |  |  |  168|  53.6k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  53.6k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  53.6k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  53.6k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  53.6k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  53.6k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  53.6k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  53.6k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  53.6k|    }                                                           \
  |  |  |  |  172|  72.2k|}
  |  |  ------------------
  |  |  104|  72.2k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  72.2k|                                                                                \
  |  |  106|  72.2k|        u4_ofst <<= numbits;                                                    \
  |  |  107|  72.2k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  72.2k|        u4_range <<= numbits;                                                   \
  |  |  109|  72.2k|                                                                                \
  |  |  110|  72.2k|    }                                                                           \
  |  |  111|  3.55M|    /* Update the cabac context */                                              \
  |  |  112|  3.55M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  3.55M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  3.55M|                                                                                \
  |  |  115|  3.55M|}
  ------------------
  823|  3.55M|            AEV_TRACE("coeff_abs_level_greater2_flag", coeff_abs_level_greater2_flag, ps_cabac->u4_range);
  824|  3.55M|            u4_coeff_abs_level_greater2_map = coeff_abs_level_greater2_flag << first_greater1_scan_pos;
  825|  3.55M|        }
  826|       |
  827|       |
  828|  11.7M|        u4_coeff_sign_map = 0;
  829|       |
  830|       |        /* Parse sign flags */
  831|  11.7M|        if(!sign_data_hiding_flag || !sign_hidden)
  ------------------
  |  Branch (831:12): [True: 4.26M, False: 7.48M]
  |  Branch (831:38): [True: 3.78M, False: 3.70M]
  ------------------
  832|  8.04M|        {
  833|  8.04M|            IHEVCD_CABAC_DECODE_BYPASS_BINS(value, ps_cabac, ps_bitstrm, num_coeff);
  ------------------
  |  |  156|  8.04M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  8.04M|{                                                                               \
  |  |  158|  8.04M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  8.04M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  8.04M|    UWORD32 u4_bits;                                                            \
  |  |  161|  8.04M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  8.04M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|  8.04M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  8.04M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|  8.04M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  8.04M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|  8.04M|    {                                                                           \
  |  |  165|  8.04M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  8.04M|        /* Sanity checks */                                                     \
  |  |  167|  8.04M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  8.04M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|  8.04M|                                                                                \
  |  |  169|  8.04M|        u4_bins = 0;                                                            \
  |  |  170|  8.04M|                                                                                \
  |  |  171|  8.04M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  8.04M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  8.04M|{                                                               \
  |  |  |  |  152|  8.04M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  8.04M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  8.04M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  8.04M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  8.04M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  16.0M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 440k, False: 7.60M]
  |  |  |  |  ------------------
  |  |  |  |  156|  8.04M|    {                                                           \
  |  |  |  |  157|   440k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   440k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 440k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   440k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   440k|    }                                                           \
  |  |  |  |  160|  8.04M|                                                                \
  |  |  |  |  161|  8.04M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  16.0M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 699k, False: 7.34M]
  |  |  |  |  ------------------
  |  |  |  |  162|  8.04M|    {                                                           \
  |  |  |  |  163|   699k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   699k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   699k|        /* Getting the next word */                             \
  |  |  |  |  166|   699k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   699k|                                                                \
  |  |  |  |  168|   699k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   699k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   699k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   699k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   699k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   699k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   699k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   699k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   699k|    }                                                           \
  |  |  |  |  172|  8.04M|}
  |  |  ------------------
  |  |  172|  8.04M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  8.04M|        do                                                                      \
  |  |  174|  22.3M|        {                                                                       \
  |  |  175|  22.3M|            UWORD32 u4_bit;                                                     \
  |  |  176|  22.3M|            numbins_tmp--;                                                      \
  |  |  177|  22.3M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  22.3M|            u4_ofst <<= 1;                                                      \
  |  |  179|  22.3M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  22.3M|                                                                                \
  |  |  181|  22.3M|            u4_bins <<= 1;                                                      \
  |  |  182|  22.3M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 4.55M, False: 17.8M]
  |  |  ------------------
  |  |  183|  22.3M|            {                                                                   \
  |  |  184|  4.55M|                u4_bins += 1;                                                   \
  |  |  185|  4.55M|                u4_ofst -= u4_range;                                            \
  |  |  186|  4.55M|            }                                                                   \
  |  |  187|  22.3M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 14.3M, False: 8.04M]
  |  |  ------------------
  |  |  188|  8.04M|                                                                                \
  |  |  189|  8.04M|        /* Update the cabac context */                                          \
  |  |  190|  8.04M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  8.04M|    }                                                                           \
  |  |  192|  8.04M|}
  ------------------
  834|  8.04M|            AEV_TRACE("sign_flags", value, ps_cabac->u4_range);
  835|  8.04M|            u4_coeff_sign_map = (UWORD32)value << (32 - num_coeff);
  836|  8.04M|        }
  837|  3.70M|        else
  838|  3.70M|        {
  839|  3.70M|            IHEVCD_CABAC_DECODE_BYPASS_BINS(value, ps_cabac, ps_bitstrm, (num_coeff - 1));
  ------------------
  |  |  156|  3.70M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  3.70M|{                                                                               \
  |  |  158|  3.70M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  3.70M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  3.70M|    UWORD32 u4_bits;                                                            \
  |  |  161|  3.70M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  3.70M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|  3.70M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  3.70M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|  3.70M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  3.70M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|  3.70M|    {                                                                           \
  |  |  165|  3.70M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  3.70M|        /* Sanity checks */                                                     \
  |  |  167|  3.70M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  3.70M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|  3.70M|                                                                                \
  |  |  169|  3.70M|        u4_bins = 0;                                                            \
  |  |  170|  3.70M|                                                                                \
  |  |  171|  3.70M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  3.70M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  3.70M|{                                                               \
  |  |  |  |  152|  3.70M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  3.70M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.70M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  3.70M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  3.70M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.41M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 703k, False: 3.00M]
  |  |  |  |  ------------------
  |  |  |  |  156|  3.70M|    {                                                           \
  |  |  |  |  157|   703k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   703k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 703k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   703k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   703k|    }                                                           \
  |  |  |  |  160|  3.70M|                                                                \
  |  |  |  |  161|  3.70M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.41M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 822k, False: 2.88M]
  |  |  |  |  ------------------
  |  |  |  |  162|  3.70M|    {                                                           \
  |  |  |  |  163|   822k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   822k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   822k|        /* Getting the next word */                             \
  |  |  |  |  166|   822k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   822k|                                                                \
  |  |  |  |  168|   822k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   822k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   822k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   822k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   822k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   822k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   822k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   822k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   822k|    }                                                           \
  |  |  |  |  172|  3.70M|}
  |  |  ------------------
  |  |  172|  3.70M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  3.70M|        do                                                                      \
  |  |  174|  26.1M|        {                                                                       \
  |  |  175|  26.1M|            UWORD32 u4_bit;                                                     \
  |  |  176|  26.1M|            numbins_tmp--;                                                      \
  |  |  177|  26.1M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  26.1M|            u4_ofst <<= 1;                                                      \
  |  |  179|  26.1M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  26.1M|                                                                                \
  |  |  181|  26.1M|            u4_bins <<= 1;                                                      \
  |  |  182|  26.1M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 4.60M, False: 21.5M]
  |  |  ------------------
  |  |  183|  26.1M|            {                                                                   \
  |  |  184|  4.60M|                u4_bins += 1;                                                   \
  |  |  185|  4.60M|                u4_ofst -= u4_range;                                            \
  |  |  186|  4.60M|            }                                                                   \
  |  |  187|  26.1M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 22.4M, False: 3.70M]
  |  |  ------------------
  |  |  188|  3.70M|                                                                                \
  |  |  189|  3.70M|        /* Update the cabac context */                                          \
  |  |  190|  3.70M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  3.70M|    }                                                                           \
  |  |  192|  3.70M|}
  ------------------
  840|  3.70M|            AEV_TRACE("sign_flags", value, ps_cabac->u4_range);
  841|  3.70M|            u4_coeff_sign_map = (UWORD32)value << (32 - (num_coeff - 1));
  842|  3.70M|        }
  843|       |
  844|  11.7M|        num_sig_coeff = 0;
  845|  11.7M|        sum_abs_level = 0;
  846|       |
  847|  11.7M|#ifdef ENABLE_MAIN_REXT_PROFILE
  848|  11.7M|        WORD32 sb_type = 2 * (c_idx == 0 ? 1 : 0);
  ------------------
  |  Branch (848:31): [True: 7.71M, False: 4.03M]
  ------------------
  849|  11.7M|        if(ps_sps->i1_persistent_rice_adaptation_enabled_flag)
  ------------------
  |  Branch (849:12): [True: 102k, False: 11.6M]
  ------------------
  850|   102k|        {
  851|   102k|            if(!(transform_skip_flag == 0 && ps_codec->s_parse.s_cu.i4_cu_transquant_bypass == 0))
  ------------------
  |  Branch (851:18): [True: 82.2k, False: 19.9k]
  |  Branch (851:46): [True: 71.5k, False: 10.7k]
  ------------------
  852|  30.7k|            {
  853|  30.7k|                sb_type += 1;
  854|  30.7k|            }
  855|   102k|            rice_param = ps_cabac->ai4_rice_stat_coeff[sb_type] / 4;
  856|   102k|        }
  857|  11.6M|        else
  858|  11.6M|#endif
  859|  11.6M|        {
  860|  11.6M|            rice_param = 0;
  861|  11.6M|        }
  862|  11.7M|        {
  863|  11.7M|            UWORD32 clz;
  864|  11.7M|            UWORD32 u4_sig_coeff_map_shift;
  865|  11.7M|            clz = CLZ(u4_sig_coeff_map);
  866|  11.7M|            n = 31 - clz;
  867|  11.7M|            u4_sig_coeff_map_shift = u4_sig_coeff_map << clz;
  868|       |            /* For loop for n changed to do while to break early if sig_coeff_map_shift becomes zero */
  869|  11.7M|            do
  870|  52.2M|            {
  871|       |
  872|  52.2M|                if((u4_sig_coeff_map_shift >> 31) & 1)
  ------------------
  |  Branch (872:20): [True: 52.2M, False: 0]
  ------------------
  873|  52.2M|                {
  874|  52.2M|                    WORD32 base_lvl;
  875|  52.2M|                    WORD32 coeff_abs_level_remaining;
  876|  52.2M|                    WORD32 level;
  877|  52.2M|                    base_lvl = 1;
  878|       |
  879|       |                    /* Update base_lvl if it is greater than 1 */
  880|  52.2M|                    if((u4_coeff_abs_level_greater1_map >> n) & 1)
  ------------------
  |  Branch (880:24): [True: 8.88M, False: 43.3M]
  ------------------
  881|  8.88M|                        base_lvl++;
  882|       |
  883|       |                    /* Update base_lvl if it is greater than 2 */
  884|  52.2M|                    if((u4_coeff_abs_level_greater2_map >> n) & 1)
  ------------------
  |  Branch (884:24): [True: 1.04M, False: 51.1M]
  ------------------
  885|  1.04M|                        base_lvl++;
  886|       |
  887|       |                    /* If level is greater than 3/2/1 based on the greater1 and greater2 maps,
  888|       |                     * decode remaining level (level - base_lvl) will be signalled as bypass bins
  889|       |                     */
  890|  52.2M|                    coeff_abs_level_remaining = 0;
  891|  52.2M|                    if(base_lvl == ((num_sig_coeff < 8) ? ((n == first_greater1_scan_pos) ? 3 : 2) : 1))
  ------------------
  |  Branch (891:24): [True: 17.9M, False: 34.3M]
  |  Branch (891:37): [True: 40.6M, False: 11.5M]
  |  Branch (891:60): [True: 3.55M, False: 37.1M]
  ------------------
  892|  17.9M|                    {
  893|  17.9M|                        UWORD32 u4_prefix;
  894|  17.9M|                        WORD32 bin;
  895|       |
  896|  17.9M|                        u4_prefix = 0;
  897|       |
  898|  17.9M|                        do
  899|  25.9M|                        {
  900|  25.9M|                            IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
  ------------------
  |  |  122|  25.9M|#define IHEVCD_CABAC_DECODE_BYPASS_BIN(u4_bin, ps_cabac, ps_bitstrm)            \
  |  |  123|  25.9M|{                                                                               \
  |  |  124|  25.9M|                                                                                \
  |  |  125|  25.9M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  126|  25.9M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  127|  25.9M|    UWORD32 u4_bits;                                                            \
  |  |  128|  25.9M|                                                                                \
  |  |  129|  25.9M|    /* Sanity checks */                                                         \
  |  |  130|  25.9M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  25.9M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  131|  25.9M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  25.9M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  132|  25.9M|                                                                                \
  |  |  133|  25.9M|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,              \
  |  |  ------------------
  |  |  |  |  182|  25.9M|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  |  |  183|  25.9M|{                                                               \
  |  |  |  |  184|  25.9M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  185|  25.9M|                             >> (WORD_SIZE_MINUS1);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  25.9M|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  25.9M|#define WORD_SIZE         32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  186|  25.9M|    m_u4_bit_ofst++;                                            \
  |  |  |  |  187|  25.9M|                                                                \
  |  |  |  |  188|  25.9M|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  51.9M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (188:8): [True: 805k, False: 25.1M]
  |  |  |  |  ------------------
  |  |  |  |  189|  25.9M|    {                                                           \
  |  |  |  |  190|   805k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  191|   805k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  192|   805k|        /* Getting the next word */                             \
  |  |  |  |  193|   805k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  |  |  194|   805k|                                                                \
  |  |  |  |  195|   805k|        m_u4_bit_ofst = 0;                                      \
  |  |  |  |  196|   805k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  197|   805k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   805k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   805k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   805k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   805k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  198|   805k|    }                                                           \
  |  |  |  |  199|  25.9M|}
  |  |  ------------------
  |  |  134|  25.9M|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);                  \
  |  |  135|  25.9M|                                                                                \
  |  |  136|  25.9M|    u4_ofst <<= 1;                                                              \
  |  |  137|  25.9M|    u4_ofst |= u4_bits;                                                         \
  |  |  138|  25.9M|                                                                                \
  |  |  139|  25.9M|    u4_bin = 0;                                                                 \
  |  |  140|  25.9M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 8.22M, False: 17.7M]
  |  |  ------------------
  |  |  141|  25.9M|    {                                                                           \
  |  |  142|  8.22M|        u4_bin = 1;                                                             \
  |  |  143|  8.22M|        u4_ofst -= u4_range;                                                    \
  |  |  144|  8.22M|    }                                                                           \
  |  |  145|  25.9M|                                                                                \
  |  |  146|  25.9M|    /* Update the cabac context */                                              \
  |  |  147|  25.9M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  148|  25.9M|}
  ------------------
  901|  25.9M|                            u4_prefix++;
  902|       |
  903|  25.9M|                            if((WORD32)u4_prefix == 19 - rice_param)
  ------------------
  |  Branch (903:32): [True: 177k, False: 25.7M]
  ------------------
  904|   177k|                            {
  905|   177k|                                bin = 1;
  906|   177k|                                break;
  907|   177k|                            }
  908|       |
  909|  25.9M|                        }while(bin);
  ------------------
  |  Branch (909:32): [True: 8.05M, False: 17.7M]
  ------------------
  910|       |
  911|  17.9M|                        u4_prefix = u4_prefix - 1;
  912|  17.9M|                        if(u4_prefix < 3)
  ------------------
  |  Branch (912:28): [True: 17.0M, False: 826k]
  ------------------
  913|  17.0M|                        {
  914|  17.0M|                            UWORD32 u4_suffix;
  915|       |
  916|  17.0M|                            coeff_abs_level_remaining = (u4_prefix << rice_param);
  917|  17.0M|                            if(rice_param)
  ------------------
  |  Branch (917:32): [True: 1.66M, False: 15.4M]
  ------------------
  918|  1.66M|                            {
  919|  1.66M|                                IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, rice_param);
  ------------------
  |  |  156|  1.66M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  1.66M|{                                                                               \
  |  |  158|  1.66M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  1.66M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  1.66M|    UWORD32 u4_bits;                                                            \
  |  |  161|  1.66M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  1.66M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|  1.66M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  1.66M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|  1.66M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  1.66M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|  1.66M|    {                                                                           \
  |  |  165|  1.66M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  1.66M|        /* Sanity checks */                                                     \
  |  |  167|  1.66M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  1.66M|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|  1.66M|                                                                                \
  |  |  169|  1.66M|        u4_bins = 0;                                                            \
  |  |  170|  1.66M|                                                                                \
  |  |  171|  1.66M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  1.66M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  1.66M|{                                                               \
  |  |  |  |  152|  1.66M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  1.66M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.66M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  1.66M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  1.66M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.33M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 20.0k, False: 1.64M]
  |  |  |  |  ------------------
  |  |  |  |  156|  1.66M|    {                                                           \
  |  |  |  |  157|  20.0k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  20.0k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 20.0k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  20.0k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  20.0k|    }                                                           \
  |  |  |  |  160|  1.66M|                                                                \
  |  |  |  |  161|  1.66M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.33M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 72.3k, False: 1.59M]
  |  |  |  |  ------------------
  |  |  |  |  162|  1.66M|    {                                                           \
  |  |  |  |  163|  72.3k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  72.3k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  72.3k|        /* Getting the next word */                             \
  |  |  |  |  166|  72.3k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  72.3k|                                                                \
  |  |  |  |  168|  72.3k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  72.3k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  72.3k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  72.3k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  72.3k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  72.3k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  72.3k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  72.3k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  72.3k|    }                                                           \
  |  |  |  |  172|  1.66M|}
  |  |  ------------------
  |  |  172|  1.66M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  1.66M|        do                                                                      \
  |  |  174|  2.33M|        {                                                                       \
  |  |  175|  2.33M|            UWORD32 u4_bit;                                                     \
  |  |  176|  2.33M|            numbins_tmp--;                                                      \
  |  |  177|  2.33M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  2.33M|            u4_ofst <<= 1;                                                      \
  |  |  179|  2.33M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  2.33M|                                                                                \
  |  |  181|  2.33M|            u4_bins <<= 1;                                                      \
  |  |  182|  2.33M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 1.16M, False: 1.16M]
  |  |  ------------------
  |  |  183|  2.33M|            {                                                                   \
  |  |  184|  1.16M|                u4_bins += 1;                                                   \
  |  |  185|  1.16M|                u4_ofst -= u4_range;                                            \
  |  |  186|  1.16M|            }                                                                   \
  |  |  187|  2.33M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 661k, False: 1.66M]
  |  |  ------------------
  |  |  188|  1.66M|                                                                                \
  |  |  189|  1.66M|        /* Update the cabac context */                                          \
  |  |  190|  1.66M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  1.66M|    }                                                                           \
  |  |  192|  1.66M|}
  ------------------
  920|       |
  921|  1.66M|                                coeff_abs_level_remaining |= u4_suffix;
  922|  1.66M|                            }
  923|  17.0M|                        }
  924|   826k|                        else
  925|   826k|                        {
  926|   826k|                            UWORD32 u4_suffix;
  927|   826k|                            UWORD32 u4_numbins;
  928|       |
  929|       |                            //u4_prefix = CLIP3(u4_prefix, 0, 19 - rice_param);
  930|       |
  931|   826k|                            u4_numbins = (u4_prefix - 3 + rice_param);
  932|   826k|                            coeff_abs_level_remaining = (((1 << (u4_prefix - 3)) + 3 - 1) << rice_param);
  933|   826k|                            if(u4_numbins)
  ------------------
  |  Branch (933:32): [True: 630k, False: 195k]
  ------------------
  934|   630k|                            {
  935|   630k|                                IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, u4_numbins);
  ------------------
  |  |  156|   630k|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|   630k|{                                                                               \
  |  |  158|   630k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|   630k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|   630k|    UWORD32 u4_bits;                                                            \
  |  |  161|   630k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   630k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  162|   630k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   630k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  163|   630k|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|   630k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  164|   630k|    {                                                                           \
  |  |  165|   630k|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|   630k|        /* Sanity checks */                                                     \
  |  |  167|   630k|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|   630k|#define ASSERT(x) {}
  |  |  ------------------
  |  |  168|   630k|                                                                                \
  |  |  169|   630k|        u4_bins = 0;                                                            \
  |  |  170|   630k|                                                                                \
  |  |  171|   630k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   630k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   630k|{                                                               \
  |  |  |  |  152|   630k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   630k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   630k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   630k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   630k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.26M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 99.3k, False: 530k]
  |  |  |  |  ------------------
  |  |  |  |  156|   630k|    {                                                           \
  |  |  |  |  157|  99.3k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  99.3k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 99.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  99.3k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  99.3k|    }                                                           \
  |  |  |  |  160|   630k|                                                                \
  |  |  |  |  161|   630k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.26M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 120k, False: 510k]
  |  |  |  |  ------------------
  |  |  |  |  162|   630k|    {                                                           \
  |  |  |  |  163|   120k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   120k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   120k|        /* Getting the next word */                             \
  |  |  |  |  166|   120k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   120k|                                                                \
  |  |  |  |  168|   120k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   120k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   120k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   120k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   120k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   120k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   120k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   120k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   120k|    }                                                           \
  |  |  |  |  172|   630k|}
  |  |  ------------------
  |  |  172|   630k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|   630k|        do                                                                      \
  |  |  174|  3.72M|        {                                                                       \
  |  |  175|  3.72M|            UWORD32 u4_bit;                                                     \
  |  |  176|  3.72M|            numbins_tmp--;                                                      \
  |  |  177|  3.72M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  3.72M|            u4_ofst <<= 1;                                                      \
  |  |  179|  3.72M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  3.72M|                                                                                \
  |  |  181|  3.72M|            u4_bins <<= 1;                                                      \
  |  |  182|  3.72M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 3.14M, False: 580k]
  |  |  ------------------
  |  |  183|  3.72M|            {                                                                   \
  |  |  184|  3.14M|                u4_bins += 1;                                                   \
  |  |  185|  3.14M|                u4_ofst -= u4_range;                                            \
  |  |  186|  3.14M|            }                                                                   \
  |  |  187|  3.72M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 3.09M, False: 630k]
  |  |  ------------------
  |  |  188|   630k|                                                                                \
  |  |  189|   630k|        /* Update the cabac context */                                          \
  |  |  190|   630k|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|   630k|    }                                                                           \
  |  |  192|   630k|}
  ------------------
  936|   630k|                                coeff_abs_level_remaining += u4_suffix;
  937|   630k|                            }
  938|   826k|                        }
  939|       |
  940|       |
  941|  17.9M|                        AEV_TRACE("coeff_abs_level_remaining", coeff_abs_level_remaining, ps_cabac->u4_range);
  942|  17.9M|                        base_lvl += coeff_abs_level_remaining;
  943|       |
  944|  17.9M|#ifdef ENABLE_MAIN_REXT_PROFILE
  945|  17.9M|                        if(i1_update_stats)
  ------------------
  |  Branch (945:28): [True: 54.4k, False: 17.8M]
  ------------------
  946|  54.4k|                        {
  947|  54.4k|                            if(coeff_abs_level_remaining
  ------------------
  |  Branch (947:32): [True: 1.54k, False: 52.9k]
  ------------------
  948|  54.4k|                                            >= (3 << (ps_cabac->ai4_rice_stat_coeff[sb_type] / 4)))
  949|  1.54k|                            {
  950|  1.54k|                                ps_cabac->ai4_rice_stat_coeff[sb_type]++;
  951|  1.54k|                            }
  952|  52.9k|                            else if((2 * coeff_abs_level_remaining
  ------------------
  |  Branch (952:37): [True: 48.5k, False: 4.35k]
  ------------------
  953|  52.9k|                                            < (1 << (ps_cabac->ai4_rice_stat_coeff[sb_type] / 4)))
  954|  48.5k|                                            && ps_cabac->ai4_rice_stat_coeff[sb_type] > 0)
  ------------------
  |  Branch (954:48): [True: 1.24k, False: 47.3k]
  ------------------
  955|  1.24k|                            {
  956|  1.24k|                                ps_cabac->ai4_rice_stat_coeff[sb_type]--;
  957|  1.24k|                            }
  958|  54.4k|                            i1_update_stats = 0;
  959|  54.4k|                        }
  960|  17.9M|#endif
  961|  17.9M|                    }
  962|       |
  963|       |                    /* update the rice param based on coeff level */
  964|  52.2M|                    if(base_lvl > (3 << rice_param))
  ------------------
  |  Branch (964:24): [True: 1.34M, False: 50.8M]
  ------------------
  965|  1.34M|                    {
  966|  1.34M|#ifdef ENABLE_MAIN_REXT_PROFILE
  967|  1.34M|                        if(ps_sps->i1_persistent_rice_adaptation_enabled_flag)
  ------------------
  |  Branch (967:28): [True: 9.77k, False: 1.33M]
  ------------------
  968|  9.77k|                        {
  969|  9.77k|                            rice_param += 1;
  970|  9.77k|                        }
  971|  1.33M|                        else
  972|  1.33M|#endif
  973|  1.33M|                        {
  974|  1.33M|                            rice_param = MIN((rice_param + 1), 4);
  ------------------
  |  |   43|  1.33M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.24M, False: 94.8k]
  |  |  ------------------
  ------------------
  975|  1.33M|                        }
  976|  1.34M|                    }
  977|       |
  978|       |                    /* Compute absolute level */
  979|  52.2M|                    level = base_lvl;
  980|       |
  981|       |                    /* Update level with the sign */
  982|  52.2M|                    if((u4_coeff_sign_map >> 31) & 1)
  ------------------
  |  Branch (982:24): [True: 9.15M, False: 43.0M]
  ------------------
  983|  9.15M|                        level = -level;
  984|       |
  985|  52.2M|                    u4_coeff_sign_map <<= 1;
  986|       |                    /* Update sign in case sign is hidden */
  987|  52.2M|                    if(sign_data_hiding_flag && sign_hidden)
  ------------------
  |  Branch (987:24): [True: 36.9M, False: 15.2M]
  |  Branch (987:49): [True: 29.8M, False: 7.09M]
  ------------------
  988|  29.8M|                    {
  989|  29.8M|                        sum_abs_level += base_lvl;
  990|       |
  991|  29.8M|                        if(n == first_sig_scan_pos && ((sum_abs_level % 2) == 1))
  ------------------
  |  Branch (991:28): [True: 3.70M, False: 26.1M]
  |  Branch (991:55): [True: 1.44M, False: 2.25M]
  ------------------
  992|  1.44M|                            level = -level;
  993|  29.8M|                    }
  994|       |
  995|       |                    /* Store the resulting level in non-zero level array */
  996|  52.2M|                    ps_tu_sblk_coeff_data->ai2_level[num_sig_coeff++] = level;
  997|       |                    //AEV_TRACE("level", level, 0);
  998|  52.2M|                }
  999|  52.2M|                u4_sig_coeff_map_shift <<= 1;
 1000|  52.2M|                n--;
 1001|       |                /* If there are zero coeffs, then shift by as many zero coeffs and decrement n */
 1002|  52.2M|                clz = CLZ(u4_sig_coeff_map_shift);
 1003|  52.2M|                u4_sig_coeff_map_shift <<= clz;
 1004|  52.2M|                n -= (WORD32)clz;
 1005|       |
 1006|       |
 1007|  52.2M|            }while(u4_sig_coeff_map_shift);
  ------------------
  |  Branch (1007:20): [True: 40.4M, False: 11.7M]
  ------------------
 1008|  11.7M|        }
 1009|       |
 1010|       |        /* Increment the pv_tu_sblk_coeff_data */
 1011|  11.7M|        {
 1012|  11.7M|            UWORD8 *pu1_buf = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
 1013|  11.7M|            pu1_buf += sizeof(tu_sblk_coeff_data_t) - SUBBLK_COEFF_CNT * sizeof(WORD16);
  ------------------
  |  |  422|  11.7M|#define SUBBLK_COEFF_CNT    16
  ------------------
 1014|  11.7M|            pu1_buf += num_coeff * sizeof(WORD16);
 1015|  11.7M|            ps_codec->s_parse.pv_tu_coeff_data = pu1_buf;
 1016|       |
 1017|  11.7M|        }
 1018|       |
 1019|  11.7M|    }
 1020|       |    /* Set number of coded sub blocks in the current TU */
 1021|  8.25M|    *pi1_num_coded_subblks = num_subblks;
 1022|       |
 1023|  8.25M|    return ret;
 1024|  8.25M|}

ihevcd_parse_transform_tree:
  125|  10.3M|{
  126|  10.3M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  127|  10.3M|    sps_t *ps_sps;
  128|  10.3M|    pps_t *ps_pps;
  129|  10.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  130|  10.3M|    slice_header_t *ps_slice_hdr;
  131|  10.3M|#endif
  132|  10.3M|    WORD32 value;
  133|  10.3M|    WORD32 x1, y1;
  134|  10.3M|    WORD32 max_trafo_depth;
  135|       |
  136|  10.3M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  137|  10.3M|    WORD32 intra_split_flag;
  138|  10.3M|    WORD32 split_transform_flag;
  139|  10.3M|    WORD32 ctxt_idx;
  140|  10.3M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  141|       |
  142|  10.3M|    max_trafo_depth = ps_codec->s_parse.s_cu.i4_max_trafo_depth;
  143|  10.3M|    ps_sps = ps_codec->s_parse.ps_sps;
  144|  10.3M|    ps_pps = ps_codec->s_parse.ps_pps;
  145|  10.3M|#ifdef ENABLE_MAIN_REXT_PROFILE
  146|  10.3M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  147|  10.3M|#endif
  148|  10.3M|    intra_split_flag = ps_codec->s_parse.s_cu.i4_intra_split_flag;
  149|       |
  150|  10.3M|    {
  151|  10.3M|        split_transform_flag = 0;
  152|  10.3M|        if((log2_trafo_size <= ps_sps->i1_log2_max_transform_block_size) &&
  ------------------
  |  Branch (152:12): [True: 9.39M, False: 906k]
  ------------------
  153|  9.39M|                        (log2_trafo_size > ps_sps->i1_log2_min_transform_block_size) &&
  ------------------
  |  Branch (153:25): [True: 5.02M, False: 4.37M]
  ------------------
  154|  5.02M|                        (trafo_depth < max_trafo_depth) &&
  ------------------
  |  Branch (154:25): [True: 1.28M, False: 3.73M]
  ------------------
  155|  1.28M|                        !(intra_split_flag && (trafo_depth == 0)))
  ------------------
  |  Branch (155:27): [True: 589k, False: 697k]
  |  Branch (155:47): [True: 584k, False: 4.84k]
  ------------------
  156|   702k|        {
  157|       |            /* encode the split transform flag, context derived as per Table9-37 */
  158|   702k|            ctxt_idx = IHEVC_CAB_SPLIT_TFM + (5 - log2_trafo_size);
  159|       |
  160|   702k|            TRACE_CABAC_CTXT("split_transform_flag", ps_cabac->u4_range, ctxt_idx);
  161|   702k|            split_transform_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  162|   702k|            AEV_TRACE("split_transform_flag", split_transform_flag,
  163|   702k|                      ps_cabac->u4_range);
  164|       |
  165|   702k|        }
  166|  9.60M|        else
  167|  9.60M|        {
  168|  9.60M|            WORD32 inter_split_flag = 0;
  169|       |
  170|  9.60M|            if((0 == ps_sps->i1_max_transform_hierarchy_depth_inter) &&
  ------------------
  |  Branch (170:16): [True: 3.30M, False: 6.30M]
  ------------------
  171|  3.30M|                            (PRED_MODE_INTER == ps_codec->s_parse.s_cu.i4_pred_mode) &&
  ------------------
  |  Branch (171:29): [True: 336k, False: 2.96M]
  ------------------
  172|   336k|                            (PART_2Nx2N != ps_codec->s_parse.s_cu.i4_part_mode) &&
  ------------------
  |  Branch (172:29): [True: 75.2k, False: 260k]
  ------------------
  173|  75.2k|                            (0 == trafo_depth))
  ------------------
  |  Branch (173:29): [True: 9.97k, False: 65.2k]
  ------------------
  174|  9.97k|            {
  175|  9.97k|                inter_split_flag = 1;
  176|  9.97k|            }
  177|       |
  178|  9.60M|            if((log2_trafo_size > ps_sps->i1_log2_max_transform_block_size) ||
  ------------------
  |  Branch (178:16): [True: 906k, False: 8.69M]
  ------------------
  179|  8.69M|                            ((1 == intra_split_flag) && (0 == trafo_depth)) ||
  ------------------
  |  Branch (179:30): [True: 3.04M, False: 5.64M]
  |  Branch (179:57): [True: 584k, False: 2.46M]
  ------------------
  180|  8.11M|                            (1 == inter_split_flag))
  ------------------
  |  Branch (180:29): [True: 4.03k, False: 8.10M]
  ------------------
  181|  1.49M|            {
  182|  1.49M|                split_transform_flag = 1;
  183|  1.49M|            }
  184|  9.60M|        }
  185|       |
  186|  10.3M|        if(0 == trafo_depth)
  ------------------
  |  Branch (186:12): [True: 3.38M, False: 6.92M]
  ------------------
  187|  3.38M|        {
  188|  3.38M|            ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = 0;
  189|  3.38M|            ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = 0;
  190|  3.38M|#ifdef ENABLE_MAIN_REXT_PROFILE
  191|  3.38M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (191:16): [True: 838k, False: 2.54M]
  ------------------
  192|   838k|            {
  193|   838k|                ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = 0;
  194|   838k|                ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = 0;
  195|   838k|            }
  196|  3.38M|#endif
  197|  3.38M|        }
  198|  6.92M|        else
  199|  6.92M|        {
  200|  6.92M|            ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth - 1];
  201|  6.92M|            ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1];
  202|  6.92M|#ifdef ENABLE_MAIN_REXT_PROFILE
  203|  6.92M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (203:16): [True: 1.28M, False: 5.64M]
  ------------------
  204|  1.28M|            {
  205|  1.28M|                ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] =
  206|  1.28M|                                ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth - 1];
  207|  1.28M|                ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] =
  208|  1.28M|                                ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth - 1];
  209|  1.28M|            }
  210|  6.92M|#endif
  211|  6.92M|        }
  212|  10.3M|        if ((CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && log2_trafo_size > 2) ||
  ------------------
  |  Branch (212:14): [True: 10.1M, False: 175k]
  |  Branch (212:75): [True: 5.94M, False: 4.18M]
  ------------------
  213|  4.36M|            ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (213:13): [True: 0, False: 4.36M]
  ------------------
  214|  5.94M|        {
  215|  5.94M|            ctxt_idx = IHEVC_CAB_CBCR_IDX + trafo_depth;
  216|       |            /* CBF for Cb/Cr is sent only if the parent CBF for Cb/Cr is non-zero */
  217|  5.94M|            if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth - 1])
  ------------------
  |  Branch (217:16): [True: 3.35M, False: 2.58M]
  |  Branch (217:38): [True: 775k, False: 1.80M]
  ------------------
  218|  4.13M|            {
  219|  4.13M|                TRACE_CABAC_CTXT("cbf_cb", ps_cabac->u4_range, ctxt_idx);
  220|  4.13M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  221|  4.13M|                AEV_TRACE("cbf_cb", value, ps_cabac->u4_range);
  222|  4.13M|                ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = value;
  223|  4.13M|#ifdef ENABLE_MAIN_REXT_PROFILE
  224|  4.13M|                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422
  ------------------
  |  Branch (224:20): [True: 902k, False: 3.23M]
  ------------------
  225|   902k|                                && (!split_transform_flag || log2_trafo_size == 3))
  ------------------
  |  Branch (225:37): [True: 615k, False: 286k]
  |  Branch (225:62): [True: 206k, False: 79.6k]
  ------------------
  226|   822k|                {
  227|   822k|                    TRACE_CABAC_CTXT("cbf_cb", ps_cabac->u4_range, ctxt_idx);
  228|   822k|                    value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  229|   822k|                    AEV_TRACE("cbf_cb", value, ps_cabac->u4_range);
  230|   822k|                    ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = value;
  231|   822k|                }
  232|  4.13M|#endif
  233|  4.13M|            }
  234|       |
  235|  5.94M|            if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1])
  ------------------
  |  Branch (235:16): [True: 3.35M, False: 2.58M]
  |  Branch (235:38): [True: 820k, False: 1.76M]
  ------------------
  236|  4.17M|            {
  237|  4.17M|                TRACE_CABAC_CTXT("cbf_cr", ps_cabac->u4_range, ctxt_idx);
  238|  4.17M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  239|  4.17M|                AEV_TRACE("cbf_cr", value, ps_cabac->u4_range);
  240|  4.17M|                ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = value;
  241|  4.17M|#ifdef ENABLE_MAIN_REXT_PROFILE
  242|  4.17M|                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422
  ------------------
  |  Branch (242:20): [True: 913k, False: 3.26M]
  ------------------
  243|   913k|                                && (!split_transform_flag || log2_trafo_size == 3))
  ------------------
  |  Branch (243:37): [True: 626k, False: 286k]
  |  Branch (243:62): [True: 207k, False: 79.8k]
  ------------------
  244|   833k|                {
  245|   833k|                    TRACE_CABAC_CTXT("cbf_cr", ps_cabac->u4_range, ctxt_idx);
  246|   833k|                    value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  247|   833k|                    AEV_TRACE("cbf_cr", value, ps_cabac->u4_range);
  248|   833k|                    ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = value;
  249|   833k|                }
  250|  4.17M|#endif
  251|  4.17M|            }
  252|  5.94M|        }
  253|  10.3M|        if(split_transform_flag)
  ------------------
  |  Branch (253:12): [True: 1.73M, False: 8.57M]
  ------------------
  254|  1.73M|        {
  255|  1.73M|            WORD32 intra_pred_mode_tmp;
  256|  1.73M|            WORD32 chroma_intra_pred_mode_tmp_idx = ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0];
  257|  1.73M|            x1 = x0 + ((1 << log2_trafo_size) >> 1);
  258|  1.73M|            y1 = y0 + ((1 << log2_trafo_size) >> 1);
  259|       |
  260|       |            /* For transform depth of zero, intra pred mode as decoded at CU */
  261|       |            /* level is sent to the transform tree nodes */
  262|       |            /* When depth is non-zero intra pred mode of parent node is sent */
  263|       |            /* This takes care of passing correct mode to all the child nodes */
  264|  1.73M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
  ------------------
  |  Branch (264:35): [True: 474k, False: 1.25M]
  ------------------
  265|  1.73M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (265:17): [True: 0, False: 1.73M]
  ------------------
  266|      0|                chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0];
  ------------------
  |  Branch (266:50): [True: 0, False: 0]
  ------------------
  267|  1.73M|            ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 0, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx);
  268|  1.73M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.73M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.04k, False: 1.73M]
  |  |  ------------------
  ------------------
  269|       |
  270|  1.73M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[1];
  ------------------
  |  Branch (270:35): [True: 473k, False: 1.25M]
  ------------------
  271|  1.73M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (271:17): [True: 0, False: 1.73M]
  ------------------
  272|      0|                chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[1];
  ------------------
  |  Branch (272:50): [True: 0, False: 0]
  ------------------
  273|  1.73M|            ret = ihevcd_parse_transform_tree(ps_codec, x1, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 1, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx);
  274|  1.73M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.73M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 220, False: 1.73M]
  |  |  ------------------
  ------------------
  275|       |
  276|  1.73M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[2];
  ------------------
  |  Branch (276:35): [True: 473k, False: 1.25M]
  ------------------
  277|  1.73M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (277:17): [True: 0, False: 1.73M]
  ------------------
  278|      0|                chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[2];
  ------------------
  |  Branch (278:50): [True: 0, False: 0]
  ------------------
  279|  1.73M|            ret = ihevcd_parse_transform_tree(ps_codec, x0, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 2, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx);
  280|  1.73M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.73M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 235, False: 1.73M]
  |  |  ------------------
  ------------------
  281|       |
  282|  1.73M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[3];
  ------------------
  |  Branch (282:35): [True: 473k, False: 1.25M]
  ------------------
  283|  1.73M|            if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (283:17): [True: 0, False: 1.73M]
  ------------------
  284|      0|                chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[3];
  ------------------
  |  Branch (284:50): [True: 0, False: 0]
  ------------------
  285|  1.73M|            ret = ihevcd_parse_transform_tree(ps_codec, x1, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 3, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx);
  286|  1.73M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.73M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 76, False: 1.73M]
  |  |  ------------------
  ------------------
  287|       |
  288|  1.73M|        }
  289|  8.57M|        else
  290|  8.57M|        {
  291|  8.57M|            WORD32 ctb_x_base;
  292|  8.57M|            WORD32 ctb_y_base;
  293|  8.57M|            WORD32 cu_qp_delta_abs;
  294|  8.57M|            WORD32 cbf_chroma;
  295|       |
  296|       |
  297|       |
  298|  8.57M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  299|  8.57M|            cu_qp_delta_abs = 0;
  300|  8.57M|            ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
  301|  8.57M|            ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
  302|  8.57M|            cbf_chroma = ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth]
  ------------------
  |  Branch (302:26): [True: 2.42M, False: 6.14M]
  ------------------
  303|  6.14M|                            || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth];
  ------------------
  |  Branch (303:32): [True: 466k, False: 5.68M]
  ------------------
  304|  8.57M|#ifdef ENABLE_MAIN_REXT_PROFILE
  305|  8.57M|            if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (305:16): [True: 1.79M, False: 6.77M]
  ------------------
  306|  1.79M|            {
  307|  1.79M|                cbf_chroma |= ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth]
  ------------------
  |  Branch (307:31): [True: 595k, False: 1.20M]
  ------------------
  308|  1.20M|                                || ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth];
  ------------------
  |  Branch (308:36): [True: 97.0k, False: 1.10M]
  ------------------
  309|  1.79M|            }
  310|  8.57M|#endif
  311|       |
  312|  8.57M|            if((ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTRA) ||
  ------------------
  |  Branch (312:16): [True: 7.33M, False: 1.24M]
  ------------------
  313|  1.24M|                            (trafo_depth != 0) ||
  ------------------
  |  Branch (313:29): [True: 1.16M, False: 76.5k]
  ------------------
  314|  76.5k|                            (cbf_chroma))
  ------------------
  |  Branch (314:29): [True: 11.6k, False: 64.9k]
  ------------------
  315|  8.50M|            {
  316|  8.50M|                ctxt_idx = IHEVC_CAB_CBF_LUMA_IDX;
  317|  8.50M|                ctxt_idx += (trafo_depth == 0) ? 1 : 0;
  ------------------
  |  Branch (317:29): [True: 2.05M, False: 6.45M]
  ------------------
  318|       |
  319|  8.50M|                TRACE_CABAC_CTXT("cbf_luma", ps_cabac->u4_range, ctxt_idx);
  320|  8.50M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  321|  8.50M|                AEV_TRACE("cbf_luma", value, ps_cabac->u4_range);
  322|       |
  323|  8.50M|                ps_codec->s_parse.s_cu.i1_cbf_luma = value;
  324|  8.50M|            }
  325|  64.9k|            else
  326|  64.9k|            {
  327|  64.9k|                ps_codec->s_parse.s_cu.i1_cbf_luma = 1;
  328|  64.9k|            }
  329|       |
  330|       |            /* Initialize ps_tu to default values */
  331|       |            /* If required change this to WORD32 packed write */
  332|  8.57M|            ps_tu->b1_cb_cbf = 0;
  333|  8.57M|#ifdef ENABLE_MAIN_REXT_PROFILE
  334|  8.57M|            ps_tu->b1_cb_cbf_subtu1 = 0;
  335|  8.57M|#endif
  336|  8.57M|            ps_tu->b1_cr_cbf = 0;
  337|  8.57M|#ifdef ENABLE_MAIN_REXT_PROFILE
  338|  8.57M|            ps_tu->b1_cr_cbf_subtu1 = 0;
  339|  8.57M|#endif
  340|  8.57M|            ps_tu->b1_y_cbf = 0;
  341|  8.57M|            ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
  342|  8.57M|            ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
  343|  8.57M|            ps_tu->b1_transquant_bypass = ps_codec->s_parse.s_cu.i4_cu_transquant_bypass;
  344|  8.57M|            ps_tu->b3_size = (log2_trafo_size - 2);
  345|  8.57M|            ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
  346|  8.57M|#ifdef ENABLE_MAIN_REXT_PROFILE
  347|  8.57M|            ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
  348|  8.57M|            ps_tu->b1_cb_log2_res_sign = 0;
  349|  8.57M|            ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
  350|  8.57M|            ps_tu->b1_cr_log2_res_sign = 0;
  351|  8.57M|            ps_tu->b1_cu_chroma_qp_offset_flag = 0;
  352|  8.57M|            ps_tu->b3_cu_chroma_qp_offset_idx = 0;
  353|  8.57M|#endif
  354|       |
  355|  8.57M|            ps_tu->b6_luma_intra_mode = intra_pred_mode;
  356|  8.57M|            ps_tu->b3_chroma_intra_mode_idx = chroma_intra_pred_mode_idx;
  357|       |
  358|       |            /* Section:7.3.12  Transform unit syntax inlined here */
  359|  8.57M|            if(ps_codec->s_parse.s_cu.i1_cbf_luma || cbf_chroma)
  ------------------
  |  Branch (359:16): [True: 4.93M, False: 3.63M]
  |  Branch (359:54): [True: 975k, False: 2.66M]
  ------------------
  360|  5.91M|            {
  361|  5.91M|                WORD32 intra_pred_mode_chroma;
  362|  5.91M|                if(ps_pps->i1_cu_qp_delta_enabled_flag && !ps_codec->s_parse.i4_is_cu_qp_delta_coded)
  ------------------
  |  Branch (362:20): [True: 2.58M, False: 3.32M]
  |  Branch (362:59): [True: 227k, False: 2.35M]
  ------------------
  363|   227k|                {
  364|       |
  365|       |
  366|   227k|                    WORD32 c_max        = TU_MAX_QP_DELTA_ABS;
  ------------------
  |  |  160|   227k|#define TU_MAX_QP_DELTA_ABS     5
  ------------------
  367|   227k|                    WORD32 ctxt_inc     = IHEVC_CAB_QP_DELTA_ABS;
  368|   227k|                    WORD32 ctxt_inc_max = CTXT_MAX_QP_DELTA_ABS;
  ------------------
  |  |  163|   227k|#define CTXT_MAX_QP_DELTA_ABS   1
  ------------------
  369|       |
  370|   227k|                    TRACE_CABAC_CTXT("cu_qp_delta_abs", ps_cabac->u4_range, ctxt_inc);
  371|       |                    /* qp_delta_abs is coded as combination of tunary and eg0 code  */
  372|       |                    /* See Table 9-32 and Table 9-37 for details on cu_qp_delta_abs */
  373|   227k|                    cu_qp_delta_abs = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  374|   227k|                                                                      ps_bitstrm,
  375|   227k|                                                                      c_max,
  376|   227k|                                                                      ctxt_inc,
  377|   227k|                                                                      0,
  378|   227k|                                                                      ctxt_inc_max);
  379|   227k|                    if(cu_qp_delta_abs >= c_max)
  ------------------
  |  Branch (379:24): [True: 79.3k, False: 148k]
  ------------------
  380|  79.3k|                    {
  381|  79.3k|                        value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 0);
  382|  79.3k|                        cu_qp_delta_abs += value;
  383|  79.3k|                    }
  384|   227k|                    AEV_TRACE("cu_qp_delta_abs", cu_qp_delta_abs, ps_cabac->u4_range);
  385|       |
  386|   227k|                    ps_codec->s_parse.i4_is_cu_qp_delta_coded = 1;
  387|       |
  388|       |
  389|   227k|                    if(cu_qp_delta_abs)
  ------------------
  |  Branch (389:24): [True: 154k, False: 73.3k]
  ------------------
  390|   154k|                    {
  391|   154k|                        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  392|   154k|                        AEV_TRACE("cu_qp_delta_sign", value, ps_cabac->u4_range);
  393|       |
  394|   154k|                        if(value)
  ------------------
  |  Branch (394:28): [True: 30.5k, False: 123k]
  ------------------
  395|  30.5k|                            cu_qp_delta_abs = -cu_qp_delta_abs;
  396|       |
  397|   154k|                    }
  398|       |
  399|   227k|                    if (cu_qp_delta_abs < MIN_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8)
  ------------------
  |  |   85|   455k|#define MIN_CU_QP_DELTA_ABS(x) (-26 + ((x) * 6) / 2)
  ------------------
  |  Branch (399:25): [True: 463, False: 227k]
  ------------------
  400|   227k|                                    || cu_qp_delta_abs > MAX_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8))
  ------------------
  |  |   86|   227k|#define MAX_CU_QP_DELTA_ABS(x) (25 + ((x) * 6) / 2)
  ------------------
  |  Branch (400:40): [True: 663, False: 226k]
  ------------------
  401|  1.12k|                    {
  402|  1.12k|                        return IHEVCD_INVALID_PARAMETER;
  403|  1.12k|                    }
  404|       |
  405|   226k|                    ps_codec->s_parse.s_cu.i4_cu_qp_delta = cu_qp_delta_abs;
  406|       |
  407|   226k|                }
  408|       |
  409|  5.91M|#ifdef ENABLE_MAIN_REXT_PROFILE
  410|  5.91M|                if(ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag
  ------------------
  |  Branch (410:20): [True: 123k, False: 5.78M]
  ------------------
  411|   123k|                    && !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass)
  ------------------
  |  Branch (411:24): [True: 121k, False: 1.39k]
  ------------------
  412|   121k|                {
  413|   121k|                    if(!ps_codec->s_parse.i4_is_cu_chroma_qp_offset_coded
  ------------------
  |  Branch (413:24): [True: 77.0k, False: 44.8k]
  ------------------
  414|  77.0k|                        && cbf_chroma)
  ------------------
  |  Branch (414:28): [True: 5.05k, False: 72.0k]
  ------------------
  415|  5.05k|                    {
  416|  5.05k|                        ctxt_idx = IHEVC_CAB_CHROMA_QP_OFF_FLAG;
  417|  5.05k|                        TRACE_CABAC_CTXT("cu_chroma_qp_offset_flag", ps_cabac->u4_range, ctxt_idx);
  418|  5.05k|                        value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  419|  5.05k|                        AEV_TRACE("cu_chroma_qp_offset_flag", value, ps_cabac->u4_range);
  420|  5.05k|                        ps_codec->s_parse.i4_cu_chroma_qp_offset_flag = value;
  421|       |
  422|  5.05k|                        ps_codec->s_parse.i4_cu_chroma_qp_offset_idx = 0;
  423|  5.05k|                        if(ps_codec->s_parse.i4_cu_chroma_qp_offset_flag &&
  ------------------
  |  Branch (423:28): [True: 2.48k, False: 2.57k]
  ------------------
  424|  2.48k|                           ps_pps->i4_chroma_qp_offset_list_len_minus1 > 0)
  ------------------
  |  Branch (424:28): [True: 702, False: 1.77k]
  ------------------
  425|    702|                        {
  426|    702|                            ctxt_idx = IHEVC_CAB_CHROMA_QP_OFF_IDX;
  427|    702|                            TRACE_CABAC_CTXT("cu_chroma_qp_offset_idx", ps_cabac->u4_range, ctxt_idx);
  428|    702|                            value = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  429|    702|                                                                    ps_bitstrm,
  430|    702|                                                                    ps_pps->i4_chroma_qp_offset_list_len_minus1,
  431|    702|                                                                    ctxt_idx,
  432|    702|                                                                    0,
  433|    702|                                                                    0);
  434|    702|                            AEV_TRACE("cu_chroma_qp_offset_idx", value, ps_cabac->u4_range);
  435|    702|                            ps_codec->s_parse.i4_cu_chroma_qp_offset_idx = value;
  436|    702|                        }
  437|       |
  438|  5.05k|                        ps_codec->s_parse.i4_is_cu_chroma_qp_offset_coded = 1;
  439|  5.05k|                    }
  440|   121k|                    ps_tu->b1_cu_chroma_qp_offset_flag =
  441|   121k|                            ps_codec->s_parse.i4_cu_chroma_qp_offset_flag;
  442|   121k|                    ps_tu->b3_cu_chroma_qp_offset_idx =
  443|   121k|                            ps_codec->s_parse.i4_cu_chroma_qp_offset_idx;
  444|   121k|                }
  445|  5.91M|#endif
  446|       |
  447|  5.91M|                if(ps_codec->s_parse.s_cu.i1_cbf_luma)
  ------------------
  |  Branch (447:20): [True: 4.93M, False: 975k]
  ------------------
  448|  4.93M|                {
  449|  4.93M|                    ps_tu->b1_y_cbf = 1;
  450|  4.93M|                    ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 0, intra_pred_mode);
  451|  4.93M|                }
  452|       |
  453|  5.91M|                WORD32 chroma_blk_luma_intra_pred_mode =
  454|  5.91M|                                ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ?
  ------------------
  |  Branch (454:33): [True: 0, False: 5.91M]
  ------------------
  455|      0|                                                intra_pred_mode :
  456|  5.91M|                                                ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
  457|  5.91M|                if(4 == chroma_intra_pred_mode_idx)
  ------------------
  |  Branch (457:20): [True: 4.69M, False: 1.21M]
  ------------------
  458|  4.69M|                    intra_pred_mode_chroma = chroma_blk_luma_intra_pred_mode;
  459|  1.21M|                else
  460|  1.21M|                {
  461|  1.21M|                    intra_pred_mode_chroma = gau1_intra_pred_chroma_modes[chroma_intra_pred_mode_idx];
  462|       |
  463|  1.21M|                    if(intra_pred_mode_chroma == chroma_blk_luma_intra_pred_mode)
  ------------------
  |  Branch (463:24): [True: 272k, False: 945k]
  ------------------
  464|   272k|                    {
  465|   272k|                        intra_pred_mode_chroma = INTRA_ANGULAR(34);
  ------------------
  |  |  517|   272k|#define INTRA_ANGULAR(x) (x)
  ------------------
  466|   272k|                    }
  467|  1.21M|                }
  468|  5.91M|                if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (468:20): [True: 1.41M, False: 4.49M]
  ------------------
  469|  1.41M|                {
  470|  1.41M|                    intra_pred_mode_chroma = gau1_intra_pred_chroma_modes_422[intra_pred_mode_chroma];
  471|  1.41M|                }
  472|  5.91M|                if(log2_trafo_size > 2 || ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (472:20): [True: 3.05M, False: 2.85M]
  |  Branch (472:43): [True: 0, False: 2.85M]
  ------------------
  473|  3.05M|                {
  474|  3.05M|                    WORD32 trafo_offset = (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 0 : 1);
  ------------------
  |  Branch (474:44): [True: 0, False: 3.05M]
  ------------------
  475|  3.05M|                    WORD32 log2_trafo_size_c = MAX(2, log2_trafo_size - trafo_offset);
  ------------------
  |  |   42|  3.05M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 3.05M]
  |  |  ------------------
  ------------------
  476|       |
  477|  3.05M|#ifdef ENABLE_MAIN_REXT_PROFILE
  478|  3.05M|                    if(ps_pps->i1_cross_component_prediction_enabled_flag
  ------------------
  |  Branch (478:24): [True: 126k, False: 2.92M]
  ------------------
  479|   126k|                                    && ps_codec->s_parse.s_cu.i1_cbf_luma
  ------------------
  |  Branch (479:40): [True: 122k, False: 3.78k]
  ------------------
  480|   122k|                                    && (ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTER
  ------------------
  |  Branch (480:41): [True: 521, False: 122k]
  ------------------
  481|   122k|                                                    || chroma_intra_pred_mode_idx == 4))
  ------------------
  |  Branch (481:56): [True: 114k, False: 8.08k]
  ------------------
  482|   114k|                    {
  483|   114k|                        ctxt_idx = IHEVC_CAB_CCP_LOG2_RES_ABS;
  484|   114k|                        TRACE_CABAC_CTXT("log2_res_scale_abs_plus1", ps_cabac->u4_range, ctxt_idx);
  485|   114k|                        value = ihevcd_cabac_decode_bins_tunary(ps_cabac, ps_bitstrm, 4, ctxt_idx,
  486|   114k|                                                                0, 3);
  487|   114k|                        AEV_TRACE("log2_res_scale_abs_plus1", value, ps_cabac->u4_range);
  488|       |
  489|   114k|                        if(value != 0)
  ------------------
  |  Branch (489:28): [True: 74.3k, False: 40.2k]
  ------------------
  490|  74.3k|                        {
  491|  74.3k|                            ctxt_idx = IHEVC_CAB_CCP_RES_SIGN_FLAG;
  492|  74.3k|                            TRACE_CABAC_CTXT("res_scale_sign_flag", ps_cabac->u4_range, ctxt_idx);
  493|  74.3k|                            ps_tu->b1_cb_log2_res_sign = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  494|  74.3k|                            AEV_TRACE("res_scale_sign_flag", value, ps_cabac->u4_range);
  495|  74.3k|                            ps_tu->b3_cb_log2_res_scale_abs_plus1 = value;
  496|  74.3k|                        }
  497|   114k|                    }
  498|  3.05M|#endif
  499|  3.05M|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth])
  ------------------
  |  Branch (499:24): [True: 1.01M, False: 2.04M]
  ------------------
  500|  1.01M|                    {
  501|  1.01M|                        ps_tu->b1_cb_cbf = 1;
  502|  1.01M|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size_c, 1, intra_pred_mode_chroma);
  503|  1.01M|                    }
  504|  3.05M|#ifdef ENABLE_MAIN_REXT_PROFILE
  505|  3.05M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth])
  ------------------
  |  Branch (505:24): [True: 693k, False: 2.35M]
  |  Branch (505:81): [True: 176k, False: 516k]
  ------------------
  506|   176k|                    {
  507|   176k|                        ps_tu->b1_cb_cbf_subtu1 = 1;
  508|   176k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0 + (1 << log2_trafo_size_c), log2_trafo_size_c, 1, intra_pred_mode_chroma);
  509|   176k|                    }
  510|  3.05M|#endif
  511|  3.05M|#ifdef ENABLE_MAIN_REXT_PROFILE
  512|  3.05M|                    if(ps_pps->i1_cross_component_prediction_enabled_flag
  ------------------
  |  Branch (512:24): [True: 126k, False: 2.92M]
  ------------------
  513|   126k|                                    && ps_codec->s_parse.s_cu.i1_cbf_luma
  ------------------
  |  Branch (513:40): [True: 122k, False: 3.78k]
  ------------------
  514|   122k|                                    && (ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTER
  ------------------
  |  Branch (514:41): [True: 521, False: 122k]
  ------------------
  515|   122k|                                                    || chroma_intra_pred_mode_idx == 4))
  ------------------
  |  Branch (515:56): [True: 114k, False: 8.08k]
  ------------------
  516|   114k|                    {
  517|   114k|                        ctxt_idx = IHEVC_CAB_CCP_LOG2_RES_ABS + 4;
  518|   114k|                        TRACE_CABAC_CTXT("log2_res_scale_abs_plus1", ps_cabac->u4_range, ctxt_idx);
  519|   114k|                        value = ihevcd_cabac_decode_bins_tunary(ps_cabac, ps_bitstrm, 4, ctxt_idx,
  520|   114k|                                                                0, 3);
  521|   114k|                        AEV_TRACE("log2_res_scale_abs_plus1", value, ps_cabac->u4_range);
  522|       |
  523|   114k|                        if(value != 0)
  ------------------
  |  Branch (523:28): [True: 63.2k, False: 51.3k]
  ------------------
  524|  63.2k|                        {
  525|  63.2k|                            ctxt_idx = IHEVC_CAB_CCP_RES_SIGN_FLAG + 1;
  526|  63.2k|                            TRACE_CABAC_CTXT("res_scale_sign_flag", ps_cabac->u4_range, ctxt_idx);
  527|  63.2k|                            ps_tu->b1_cr_log2_res_sign = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  528|  63.2k|                            AEV_TRACE("res_scale_sign_flag", value, ps_cabac->u4_range);
  529|  63.2k|                            ps_tu->b3_cr_log2_res_scale_abs_plus1 = value;
  530|  63.2k|                        }
  531|   114k|                    }
  532|  3.05M|#endif
  533|  3.05M|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (533:24): [True: 1.03M, False: 2.02M]
  ------------------
  534|  1.03M|                    {
  535|  1.03M|                        ps_tu->b1_cr_cbf = 1;
  536|  1.03M|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size_c, 2, intra_pred_mode_chroma);
  537|  1.03M|                    }
  538|  3.05M|#ifdef ENABLE_MAIN_REXT_PROFILE
  539|  3.05M|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth])
  ------------------
  |  Branch (539:24): [True: 693k, False: 2.35M]
  |  Branch (539:81): [True: 182k, False: 511k]
  ------------------
  540|   182k|                    {
  541|   182k|                        ps_tu->b1_cr_cbf_subtu1 = 1;
  542|   182k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0 + (1 << log2_trafo_size_c), log2_trafo_size_c, 2, intra_pred_mode_chroma);
  543|   182k|                    }
  544|  3.05M|#endif
  545|  3.05M|                }
  546|  2.85M|                else if(blk_idx == 3)
  ------------------
  |  Branch (546:25): [True: 707k, False: 2.15M]
  ------------------
  547|   707k|                {
  548|   707k|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth])
  ------------------
  |  Branch (548:24): [True: 353k, False: 353k]
  ------------------
  549|   353k|                    {
  550|   353k|                        ps_tu->b1_cb_cbf = 1;
  551|   353k|                        ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 1, intra_pred_mode_chroma);
  552|   353k|                    }
  553|   707k|#ifdef ENABLE_MAIN_REXT_PROFILE
  554|   707k|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth])
  ------------------
  |  Branch (554:24): [True: 180k, False: 526k]
  |  Branch (554:81): [True: 104k, False: 75.8k]
  ------------------
  555|   104k|                    {
  556|   104k|                        ps_tu->b1_cb_cbf_subtu1 = 1;
  557|   104k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 1, intra_pred_mode_chroma);
  558|   104k|                    }
  559|   707k|#endif
  560|       |
  561|   707k|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (561:24): [True: 363k, False: 343k]
  ------------------
  562|   363k|                    {
  563|   363k|                        ps_tu->b1_cr_cbf = 1;
  564|   363k|                        ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 2, intra_pred_mode_chroma);
  565|   363k|                    }
  566|   707k|#ifdef ENABLE_MAIN_REXT_PROFILE
  567|   707k|                    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth])
  ------------------
  |  Branch (567:24): [True: 180k, False: 526k]
  |  Branch (567:81): [True: 103k, False: 77.3k]
  ------------------
  568|   103k|                    {
  569|   103k|                        ps_tu->b1_cr_cbf_subtu1 = 1;
  570|   103k|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 2, intra_pred_mode_chroma);
  571|   103k|                    }
  572|   707k|#endif
  573|   707k|                }
  574|  2.15M|                else
  575|  2.15M|                {
  576|       |                    //ps_tu->b1_chroma_present = 0;
  577|  2.15M|                    ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  2.15M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
  578|  2.15M|                }
  579|  5.91M|            }
  580|  2.66M|            else
  581|  2.66M|            {
  582|  2.66M|                if((3 != blk_idx) && (2 == log2_trafo_size && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444))
  ------------------
  |  Branch (582:20): [True: 2.08M, False: 577k]
  |  Branch (582:39): [True: 1.08M, False: 1.00M]
  |  Branch (582:63): [True: 1.08M, False: 0]
  ------------------
  583|  1.08M|                {
  584|  1.08M|                    ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  1.08M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
  585|  1.08M|                }
  586|  2.66M|            }
  587|       |
  588|       |            /* Set the first TU in CU flag */
  589|  8.57M|            {
  590|  8.57M|                if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (590:20): [True: 4.78M, False: 3.78M]
  ------------------
  591|  4.78M|                                (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (591:33): [True: 3.37M, False: 1.41M]
  ------------------
  592|  3.37M|                {
  593|  3.37M|                    ps_tu->b1_first_tu_in_cu = 1;
  594|  3.37M|                }
  595|  5.19M|                else
  596|  5.19M|                {
  597|  5.19M|                    ps_tu->b1_first_tu_in_cu = 0;
  598|  5.19M|                }
  599|  8.57M|            }
  600|  8.57M|            ps_codec->s_parse.ps_tu++;
  601|  8.57M|            ps_codec->s_parse.s_cu.i4_tu_cnt++;
  602|  8.57M|            ps_codec->s_parse.i4_pic_tu_idx++;
  603|  8.57M|        }
  604|  10.3M|    }
  605|  10.3M|    return ret;
  606|  10.3M|}
ihevcd_parse_mvd:
  627|   804k|{
  628|   804k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  629|   804k|    WORD32 value;
  630|   804k|    WORD32 abs_mvd;
  631|   804k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  632|   804k|    WORD32 abs_mvd_greater0_flag[2];
  633|   804k|    WORD32 abs_mvd_greater1_flag[2];
  634|   804k|    WORD32 ctxt_idx;
  635|   804k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  636|       |
  637|       |
  638|   804k|    ctxt_idx  = IHEVC_CAB_MVD_GRT0;
  639|       |    /* encode absmvd_x > 0 */
  640|   804k|    TRACE_CABAC_CTXT("abs_mvd_greater0_flag[0]", ps_cabac->u4_range, ctxt_idx);
  641|   804k|    abs_mvd_greater0_flag[0] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  642|   804k|    AEV_TRACE("abs_mvd_greater0_flag[0]", abs_mvd_greater0_flag[0], ps_cabac->u4_range);
  643|       |
  644|       |    /* encode absmvd_y > 0 */
  645|   804k|    TRACE_CABAC_CTXT("abs_mvd_greater0_flag[1]", ps_cabac->u4_range, ctxt_idx);
  646|   804k|    abs_mvd_greater0_flag[1] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  647|   804k|    AEV_TRACE("abs_mvd_greater0_flag[1]", abs_mvd_greater0_flag[1], ps_cabac->u4_range);
  648|       |
  649|   804k|    ctxt_idx  = IHEVC_CAB_MVD_GRT1;
  650|   804k|    abs_mvd_greater1_flag[0] = 0;
  651|   804k|    abs_mvd_greater1_flag[1] = 0;
  652|       |
  653|   804k|    if(abs_mvd_greater0_flag[0])
  ------------------
  |  Branch (653:8): [True: 347k, False: 456k]
  ------------------
  654|   347k|    {
  655|   347k|        TRACE_CABAC_CTXT("abs_mvd_greater1_flag[0]", ps_cabac->u4_range, ctxt_idx);
  656|   347k|        abs_mvd_greater1_flag[0] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  657|   347k|        AEV_TRACE("abs_mvd_greater1_flag[0]", abs_mvd_greater1_flag[0], ps_cabac->u4_range);
  658|   347k|    }
  659|   804k|    if(abs_mvd_greater0_flag[1])
  ------------------
  |  Branch (659:8): [True: 353k, False: 450k]
  ------------------
  660|   353k|    {
  661|   353k|        TRACE_CABAC_CTXT("abs_mvd_greater1_flag[1]", ps_cabac->u4_range, ctxt_idx);
  662|   353k|        abs_mvd_greater1_flag[1] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  663|   353k|        AEV_TRACE("abs_mvd_greater1_flag[1]", abs_mvd_greater1_flag[1], ps_cabac->u4_range);
  664|   353k|    }
  665|   804k|    abs_mvd = 0;
  666|   804k|    if(abs_mvd_greater0_flag[0])
  ------------------
  |  Branch (666:8): [True: 347k, False: 456k]
  ------------------
  667|   347k|    {
  668|   347k|        abs_mvd = 1;
  669|   347k|        if(abs_mvd_greater1_flag[0])
  ------------------
  |  Branch (669:12): [True: 142k, False: 205k]
  ------------------
  670|   142k|        {
  671|   142k|            value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 1);
  672|   142k|            AEV_TRACE("abs_mvd_minus2[0]", value, ps_cabac->u4_range);
  673|   142k|            abs_mvd = value + 2;
  674|   142k|        }
  675|   347k|        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  676|   347k|        AEV_TRACE("mvd_sign_flag[0]", value, ps_cabac->u4_range);
  677|   347k|        if(value)
  ------------------
  |  Branch (677:12): [True: 168k, False: 179k]
  ------------------
  678|   168k|        {
  679|   168k|            abs_mvd = -abs_mvd;
  680|   168k|        }
  681|       |
  682|   347k|    }
  683|   804k|    ps_mv->i2_mvx = abs_mvd;
  684|   804k|    abs_mvd = 0;
  685|   804k|    if(abs_mvd_greater0_flag[1])
  ------------------
  |  Branch (685:8): [True: 353k, False: 450k]
  ------------------
  686|   353k|    {
  687|   353k|        abs_mvd = 1;
  688|   353k|        if(abs_mvd_greater1_flag[1])
  ------------------
  |  Branch (688:12): [True: 147k, False: 206k]
  ------------------
  689|   147k|        {
  690|   147k|            value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 1);
  691|   147k|            AEV_TRACE("abs_mvd_minus2[1]", value, ps_cabac->u4_range);
  692|   147k|            abs_mvd = value + 2;
  693|       |
  694|   147k|        }
  695|   353k|        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  696|   353k|        AEV_TRACE("mvd_sign_flag[1]", value, ps_cabac->u4_range);
  697|       |
  698|   353k|        if(value)
  ------------------
  |  Branch (698:12): [True: 171k, False: 182k]
  ------------------
  699|   171k|        {
  700|   171k|            abs_mvd = -abs_mvd;
  701|   171k|        }
  702|   353k|    }
  703|   804k|    ps_mv->i2_mvy = abs_mvd;
  704|       |
  705|   804k|    return ret;
  706|   804k|}
ihevcd_parse_pcm_sample:
  733|  2.56k|{
  734|  2.56k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  735|  2.56k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  736|  2.56k|    sps_t *ps_sps;
  737|       |
  738|  2.56k|    WORD32 value;
  739|  2.56k|    WORD32 i;
  740|       |
  741|  2.56k|    WORD32 num_bits;
  742|  2.56k|    UWORD32 u4_sig_coeff_map;
  743|  2.56k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  744|  2.56k|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  745|  2.56k|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  746|  2.56k|    UWORD8 *pu1_coeff_data;
  747|  2.56k|    WORD32 bit_depth;
  748|  2.56k|    ps_sps = ps_codec->s_parse.ps_sps;
  749|       |
  750|  2.56k|    UNUSED(value);
  ------------------
  |  |   38|  2.56k|#define UNUSED(x) ((void)(x))
  ------------------
  751|  2.56k|    UNUSED(ps_tu);
  ------------------
  |  |   38|  2.56k|#define UNUSED(x) ((void)(x))
  ------------------
  752|  2.56k|    UNUSED(ps_cabac);
  ------------------
  |  |   38|  2.56k|#define UNUSED(x) ((void)(x))
  ------------------
  753|  2.56k|    UNUSED(x0);
  ------------------
  |  |   38|  2.56k|#define UNUSED(x) ((void)(x))
  ------------------
  754|  2.56k|    UNUSED(y0);
  ------------------
  |  |   38|  2.56k|#define UNUSED(x) ((void)(x))
  ------------------
  755|       |
  756|  2.56k|    {
  757|  2.56k|        WORD8 *pi1_scan_idx;
  758|  2.56k|        WORD8 *pi1_buf = (WORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  759|  2.56k|        WORD8 *pi1_num_coded_subblks;
  760|       |
  761|       |        /* First WORD8 gives number of coded subblocks */
  762|  2.56k|        pi1_num_coded_subblks = pi1_buf++;
  763|       |
  764|       |        /* Set number of coded subblocks in the current TU to zero */
  765|       |        /* For PCM there will be only one subblock which is the same size as CU */
  766|  2.56k|        *pi1_num_coded_subblks = 1;
  767|       |
  768|       |        /* Second WORD8 gives (scan idx << 1) | trans_skip */
  769|  2.56k|        pi1_scan_idx = pi1_buf++;
  770|  2.56k|        *pi1_scan_idx = (0 << 1) | 1;
  771|       |
  772|       |        /* Store the incremented pointer in pv_tu_coeff_data */
  773|  2.56k|        ps_codec->s_parse.pv_tu_coeff_data = pi1_buf;
  774|       |
  775|  2.56k|    }
  776|       |
  777|  2.56k|    u4_sig_coeff_map = 0xFFFFFFFF;
  778|  2.56k|    ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)ps_codec->s_parse.pv_tu_coeff_data;
  779|  2.56k|    ps_tu_sblk_coeff_data->u2_sig_coeff_map = u4_sig_coeff_map;
  780|  2.56k|    ps_tu_sblk_coeff_data->u2_subblk_pos = 0;
  781|       |
  782|  2.56k|    pu1_coeff_data = (UWORD8 *)&ps_tu_sblk_coeff_data->ai2_level[0];
  783|       |
  784|  2.56k|    num_bits = ps_sps->i1_pcm_sample_bit_depth_luma;
  785|  2.56k|    bit_depth = ps_codec->i4_bit_depth_luma;
  786|       |
  787|  2.56k|    WORD32 luma_samples = 1 << (log2_cb_size << 1);
  788|   396k|    for(i = 0; i < luma_samples; i++)
  ------------------
  |  Branch (788:16): [True: 393k, False: 2.56k]
  ------------------
  789|   393k|    {
  790|   393k|        TRACE_CABAC_CTXT("pcm_sample_luma", ps_cabac->u4_range, 0);
  791|   393k|        BITS_PARSE("pcm_sample_luma", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|   393k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  792|       |
  793|       |        //ps_pcmsample_t->i1_pcm_sample_luma[i] = value;
  794|   393k|        if (bit_depth > 8)
  ------------------
  |  Branch (794:13): [True: 6.52k, False: 387k]
  ------------------
  795|  6.52k|        {
  796|  6.52k|            *(UWORD16 *)pu1_coeff_data = value << (bit_depth - num_bits);
  797|  6.52k|            pu1_coeff_data += 2;
  798|  6.52k|        }
  799|   387k|        else
  800|   387k|        {
  801|   387k|            *pu1_coeff_data++ = value << (bit_depth - num_bits);
  802|   387k|        }
  803|   393k|    }
  804|       |
  805|  2.56k|    if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (805:8): [True: 2.49k, False: 72]
  ------------------
  806|  2.49k|    {
  807|  2.49k|        WORD32 chroma_samples = 0;
  808|  2.49k|        bit_depth = ps_codec->i4_bit_depth_chroma;
  809|       |
  810|  2.49k|        if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (810:12): [True: 0, False: 2.49k]
  ------------------
  811|      0|            chroma_samples = luma_samples << 1;
  812|  2.49k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (812:17): [True: 71, False: 2.42k]
  ------------------
  813|     71|            chroma_samples = luma_samples;
  814|  2.42k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (814:17): [True: 2.42k, False: 0]
  ------------------
  815|  2.42k|            chroma_samples = luma_samples >> 1;
  816|  2.49k|        num_bits = ps_sps->i1_pcm_sample_bit_depth_chroma;
  817|   198k|        for(i = 0; i < chroma_samples; i++)
  ------------------
  |  Branch (817:20): [True: 196k, False: 2.49k]
  ------------------
  818|   196k|        {
  819|   196k|            TRACE_CABAC_CTXT("pcm_sample_chroma", ps_cabac->u4_range, 0);
  820|   196k|            BITS_PARSE("pcm_sample_chroma", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|   196k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  821|   196k|            if (bit_depth > 8)
  ------------------
  |  Branch (821:17): [True: 6.30k, False: 189k]
  ------------------
  822|  6.30k|            {
  823|  6.30k|                *(UWORD16 *)pu1_coeff_data = value << (bit_depth - num_bits);
  824|  6.30k|                pu1_coeff_data += 2;
  825|  6.30k|            }
  826|   189k|            else
  827|   189k|            {
  828|   189k|                *pu1_coeff_data++ = value << (bit_depth - num_bits);
  829|   189k|            }
  830|   196k|        }
  831|  2.49k|    }
  832|       |
  833|  2.56k|    ps_codec->s_parse.pv_tu_coeff_data = pu1_coeff_data;
  834|       |
  835|  2.56k|    return ret;
  836|  2.56k|}
ihevcd_parse_pu_mvp:
  858|   717k|{
  859|   717k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  860|   717k|    WORD32 value;
  861|   717k|    slice_header_t *ps_slice_hdr;
  862|   717k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  863|   717k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  864|   717k|    WORD32 inter_pred_idc;
  865|       |
  866|   717k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  867|       |
  868|   717k|    if(ps_slice_hdr->i1_slice_type == BSLICE)
  ------------------
  |  Branch (868:8): [True: 714k, False: 3.41k]
  ------------------
  869|   714k|    {
  870|   714k|        WORD32 pu_w_plus_pu_h;
  871|   714k|        WORD32 ctxt_idx;
  872|       |        /* required to check if w+h==12 case */
  873|   714k|        pu_w_plus_pu_h = ((ps_pu->b4_wd + 1) << 2) + ((ps_pu->b4_ht + 1) << 2);
  874|   714k|        if(12 == pu_w_plus_pu_h)
  ------------------
  |  Branch (874:12): [True: 415k, False: 299k]
  ------------------
  875|   415k|        {
  876|   415k|            ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + 4;
  877|   415k|            TRACE_CABAC_CTXT("inter_pred_idc", ps_cabac->u4_range, ctxt_idx);
  878|   415k|            inter_pred_idc = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
  879|   415k|                                                     ctxt_idx);
  880|   415k|        }
  881|   299k|        else
  882|   299k|        {
  883|       |            /* larger PUs can be encoded as bi_pred/l0/l1 inter_pred_idc */
  884|   299k|            WORD32 is_bipred;
  885|       |
  886|   299k|            ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + ps_codec->s_parse.i4_ct_depth;
  887|   299k|            TRACE_CABAC_CTXT("inter_pred_idc", ps_cabac->u4_range, ctxt_idx);
  888|   299k|            is_bipred = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  889|   299k|            inter_pred_idc = PRED_BI;
  890|   299k|            if(!is_bipred)
  ------------------
  |  Branch (890:16): [True: 189k, False: 109k]
  ------------------
  891|   189k|            {
  892|   189k|                ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + 4;
  893|   189k|                inter_pred_idc = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
  894|   189k|                                                         ctxt_idx);
  895|   189k|            }
  896|   299k|        }
  897|       |
  898|   714k|        AEV_TRACE("inter_pred_idc", inter_pred_idc, ps_cabac->u4_range);
  899|   714k|    }
  900|  3.41k|    else
  901|  3.41k|        inter_pred_idc = PRED_L0;
  902|   717k|    ps_pu->mv.i1_l0_ref_idx = 0;
  903|   717k|    ps_pu->mv.i1_l1_ref_idx = 0;
  904|       |    /* Decode MVD for L0 for PRED_L0 or PRED_BI */
  905|   717k|    if(inter_pred_idc != PRED_L1)
  ------------------
  |  Branch (905:8): [True: 587k, False: 130k]
  ------------------
  906|   587k|    {
  907|   587k|        WORD32 active_refs = ps_slice_hdr->i1_num_ref_idx_l0_active;
  908|   587k|        WORD32 ref_idx = 0;
  909|   587k|        WORD32 ctxt_idx;
  910|       |
  911|   587k|        if(active_refs > 1)
  ------------------
  |  Branch (911:12): [True: 508k, False: 79.1k]
  ------------------
  912|   508k|        {
  913|   508k|            ctxt_idx = IHEVC_CAB_INTER_REF_IDX;
  914|       |            /* encode the context modelled first bin */
  915|   508k|            TRACE_CABAC_CTXT("ref_idx", ps_cabac->u4_range, ctxt_idx);
  916|   508k|            ref_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  917|       |
  918|   508k|            if((active_refs > 2) && ref_idx)
  ------------------
  |  Branch (918:16): [True: 185k, False: 322k]
  |  Branch (918:37): [True: 60.4k, False: 125k]
  ------------------
  919|  60.4k|            {
  920|  60.4k|                WORD32 value;
  921|       |                /* encode the context modelled second bin */
  922|  60.4k|                ctxt_idx++;
  923|  60.4k|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  924|  60.4k|                ref_idx += value;
  925|  60.4k|                if((active_refs > 3) && value)
  ------------------
  |  Branch (925:20): [True: 59.0k, False: 1.40k]
  |  Branch (925:41): [True: 13.1k, False: 45.8k]
  ------------------
  926|  13.1k|                {
  927|       |                    /* encode remaining bypass bins */
  928|  13.1k|                    ref_idx = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac,
  929|  13.1k|                                                                     ps_bitstrm,
  930|  13.1k|                                                                     (active_refs - 3)
  931|  13.1k|                    );
  932|  13.1k|                    ref_idx += 2;
  933|  13.1k|                }
  934|  60.4k|            }
  935|   508k|            AEV_TRACE("ref_idx", ref_idx, ps_cabac->u4_range);
  936|   508k|        }
  937|       |
  938|   587k|        ref_idx = CLIP3(ref_idx, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|   587k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 587k]
  |  |  |  Branch (40:53): [True: 0, False: 587k]
  |  |  ------------------
  ------------------
  939|   587k|        ps_pu->mv.i1_l0_ref_idx = ref_idx;
  940|       |
  941|   587k|        ihevcd_parse_mvd(ps_codec, &ps_pu->mv.s_l0_mv);
  942|       |
  943|   587k|        ctxt_idx = IHEVC_CAB_MVP_L0L1;
  944|   587k|        value = ihevcd_cabac_decode_bin(ps_cabac,
  945|   587k|                                        ps_bitstrm,
  946|   587k|                                        ctxt_idx);
  947|       |
  948|   587k|        AEV_TRACE("mvp_l0/l1_flag", value, ps_cabac->u4_range);
  949|       |
  950|   587k|        ps_pu->b1_l0_mvp_idx = value;
  951|       |
  952|   587k|    }
  953|       |    /* Decode MVD for L1 for PRED_L1 or PRED_BI */
  954|   717k|    if(inter_pred_idc != PRED_L0)
  ------------------
  |  Branch (954:8): [True: 240k, False: 477k]
  ------------------
  955|   240k|    {
  956|   240k|        WORD32 active_refs = ps_slice_hdr->i1_num_ref_idx_l1_active;
  957|   240k|        WORD32 ref_idx = 0;
  958|   240k|        WORD32 ctxt_idx;
  959|       |
  960|   240k|        if(active_refs > 1)
  ------------------
  |  Branch (960:12): [True: 210k, False: 30.0k]
  ------------------
  961|   210k|        {
  962|       |
  963|   210k|            ctxt_idx = IHEVC_CAB_INTER_REF_IDX;
  964|   210k|            TRACE_CABAC_CTXT("ref_idx", ps_cabac->u4_range, ctxt_idx);
  965|       |            /* encode the context modelled first bin */
  966|   210k|            ref_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  967|       |
  968|   210k|            if((active_refs > 2) && ref_idx)
  ------------------
  |  Branch (968:16): [True: 76.2k, False: 134k]
  |  Branch (968:37): [True: 29.2k, False: 47.0k]
  ------------------
  969|  29.2k|            {
  970|  29.2k|                WORD32 value;
  971|       |                /* encode the context modelled second bin */
  972|  29.2k|                ctxt_idx++;
  973|  29.2k|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  974|  29.2k|                ref_idx += value;
  975|  29.2k|                if((active_refs > 3) && value)
  ------------------
  |  Branch (975:20): [True: 26.2k, False: 2.93k]
  |  Branch (975:41): [True: 5.09k, False: 21.1k]
  ------------------
  976|  5.09k|                {
  977|       |                    /* encode remaining bypass bins */
  978|  5.09k|                    ref_idx = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac,
  979|  5.09k|                                                                     ps_bitstrm,
  980|  5.09k|                                                                     (active_refs - 3)
  981|  5.09k|                    );
  982|  5.09k|                    ref_idx += 2;
  983|  5.09k|                }
  984|  29.2k|            }
  985|       |
  986|   210k|            AEV_TRACE("ref_idx", ref_idx, ps_cabac->u4_range);
  987|   210k|        }
  988|       |
  989|   240k|        ref_idx = CLIP3(ref_idx, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|   240k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 240k]
  |  |  |  Branch (40:53): [True: 0, False: 240k]
  |  |  ------------------
  ------------------
  990|   240k|        ps_pu->mv.i1_l1_ref_idx = ref_idx;
  991|       |
  992|   240k|        if(ps_slice_hdr->i1_mvd_l1_zero_flag && inter_pred_idc == PRED_BI)
  ------------------
  |  Branch (992:12): [True: 45.0k, False: 195k]
  |  Branch (992:49): [True: 23.4k, False: 21.6k]
  ------------------
  993|  23.4k|        {
  994|  23.4k|            ps_pu->mv.s_l1_mv.i2_mvx = 0;
  995|  23.4k|            ps_pu->mv.s_l1_mv.i2_mvy = 0;
  996|  23.4k|        }
  997|   217k|        else
  998|   217k|        {
  999|   217k|            ihevcd_parse_mvd(ps_codec, &ps_pu->mv.s_l1_mv);
 1000|   217k|        }
 1001|       |
 1002|   240k|        ctxt_idx = IHEVC_CAB_MVP_L0L1;
 1003|   240k|        value = ihevcd_cabac_decode_bin(ps_cabac,
 1004|   240k|                                        ps_bitstrm,
 1005|   240k|                                        ctxt_idx);
 1006|       |
 1007|   240k|        AEV_TRACE("mvp_l0/l1_flag", value, ps_cabac->u4_range);
 1008|   240k|        ps_pu->b1_l1_mvp_idx = value;
 1009|       |
 1010|   240k|    }
 1011|       |
 1012|   717k|    ps_pu->b2_pred_mode = inter_pred_idc;
 1013|   717k|    return ret;
 1014|   717k|}
ihevcd_parse_prediction_unit:
 1040|  2.43M|{
 1041|  2.43M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1042|  2.43M|    slice_header_t *ps_slice_hdr;
 1043|  2.43M|    sps_t *ps_sps;
 1044|  2.43M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1045|  2.43M|    WORD32 ctb_x_base;
 1046|  2.43M|    WORD32 ctb_y_base;
 1047|       |
 1048|  2.43M|    pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1049|  2.43M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1050|       |
 1051|  2.43M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1052|       |
 1053|       |    /* Set PU structure to default values */
 1054|  2.43M|    memset(ps_pu, 0, sizeof(pu_t));
 1055|       |
 1056|  2.43M|    ps_sps = ps_codec->s_parse.ps_sps;
 1057|  2.43M|    ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1058|  2.43M|    ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1059|       |
 1060|  2.43M|    ps_pu->b4_pos_x = (x0 - ctb_x_base) >> 2;
 1061|  2.43M|    ps_pu->b4_pos_y = (y0 - ctb_y_base) >> 2;
 1062|  2.43M|    ps_pu->b4_wd = (wd >> 2) - 1;
 1063|  2.43M|    ps_pu->b4_ht = (ht >> 2) - 1;
 1064|       |
 1065|  2.43M|    ps_pu->b1_intra_flag = 0;
 1066|  2.43M|    ps_pu->b3_part_mode = ps_codec->s_parse.s_cu.i4_part_mode;
 1067|       |
 1068|  2.43M|    if(PRED_MODE_SKIP == ps_codec->s_parse.s_cu.i4_pred_mode)
  ------------------
  |  Branch (1068:8): [True: 1.20M, False: 1.22M]
  ------------------
 1069|  1.20M|    {
 1070|  1.20M|        WORD32 merge_idx = 0;
 1071|  1.20M|        if(ps_slice_hdr->i1_max_num_merge_cand > 1)
  ------------------
  |  Branch (1071:12): [True: 1.20M, False: 1.96k]
  ------------------
 1072|  1.20M|        {
 1073|  1.20M|            WORD32 ctxt_idx = IHEVC_CAB_MERGE_IDX_EXT;
 1074|  1.20M|            WORD32 bin;
 1075|       |
 1076|  1.20M|            TRACE_CABAC_CTXT("merge_idx", ps_cabac->u4_range, ctxt_idx);
 1077|  1.20M|            bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1078|  1.20M|            if(bin)
  ------------------
  |  Branch (1078:16): [True: 351k, False: 855k]
  ------------------
 1079|   351k|            {
 1080|   351k|                if(ps_slice_hdr->i1_max_num_merge_cand > 2)
  ------------------
  |  Branch (1080:20): [True: 347k, False: 4.01k]
  ------------------
 1081|   347k|                {
 1082|   347k|                    merge_idx = ihevcd_cabac_decode_bypass_bins_tunary(
 1083|   347k|                                    ps_cabac, ps_bitstrm,
 1084|   347k|                                    (ps_slice_hdr->i1_max_num_merge_cand - 2));
 1085|   347k|                }
 1086|   351k|                merge_idx++;
 1087|   351k|            }
 1088|  1.20M|            AEV_TRACE("merge_idx", merge_idx, ps_cabac->u4_range);
 1089|  1.20M|        }
 1090|  1.20M|        ps_pu->b1_merge_flag = 1;
 1091|  1.20M|        ps_pu->b3_merge_idx = merge_idx;
 1092|       |
 1093|  1.20M|    }
 1094|  1.22M|    else
 1095|  1.22M|    {
 1096|       |        /* MODE_INTER */
 1097|  1.22M|        WORD32 merge_flag;
 1098|  1.22M|        WORD32 ctxt_idx = IHEVC_CAB_MERGE_FLAG_EXT;
 1099|  1.22M|        TRACE_CABAC_CTXT("merge_flag", ps_cabac->u4_range, ctxt_idx);
 1100|  1.22M|        merge_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1101|  1.22M|        AEV_TRACE("merge_flag", merge_flag, ps_cabac->u4_range);
 1102|       |
 1103|  1.22M|        ps_pu->b1_merge_flag = merge_flag;
 1104|       |
 1105|  1.22M|        if(merge_flag)
  ------------------
  |  Branch (1105:12): [True: 507k, False: 717k]
  ------------------
 1106|   507k|        {
 1107|   507k|            WORD32 merge_idx = 0;
 1108|   507k|            if(ps_slice_hdr->i1_max_num_merge_cand > 1)
  ------------------
  |  Branch (1108:16): [True: 502k, False: 4.81k]
  ------------------
 1109|   502k|            {
 1110|   502k|                WORD32 ctxt_idx = IHEVC_CAB_MERGE_IDX_EXT;
 1111|   502k|                WORD32 bin;
 1112|   502k|                TRACE_CABAC_CTXT("merge_idx", ps_cabac->u4_range, ctxt_idx);
 1113|   502k|                bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1114|   502k|                if(bin)
  ------------------
  |  Branch (1114:20): [True: 169k, False: 332k]
  ------------------
 1115|   169k|                {
 1116|   169k|                    if(ps_slice_hdr->i1_max_num_merge_cand > 2)
  ------------------
  |  Branch (1116:24): [True: 151k, False: 18.2k]
  ------------------
 1117|   151k|                    {
 1118|   151k|                        merge_idx = ihevcd_cabac_decode_bypass_bins_tunary(
 1119|   151k|                                        ps_cabac, ps_bitstrm,
 1120|   151k|                                        (ps_slice_hdr->i1_max_num_merge_cand - 2));
 1121|   151k|                    }
 1122|   169k|                    merge_idx++;
 1123|   169k|                }
 1124|   502k|                AEV_TRACE("merge_idx", merge_idx, ps_cabac->u4_range);
 1125|   502k|            }
 1126|       |
 1127|   507k|            ps_pu->b3_merge_idx = merge_idx;
 1128|   507k|        }
 1129|   717k|        else
 1130|   717k|        {
 1131|   717k|            ihevcd_parse_pu_mvp(ps_codec, ps_pu);
 1132|   717k|        }
 1133|       |
 1134|  1.22M|    }
 1135|  2.43M|    STATS_UPDATE_PU_SIZE(ps_pu);
  ------------------
  |  |  145|  2.43M|#define STATS_UPDATE_PU_SIZE(ps_pu) ;
  ------------------
 1136|       |    /* Increment PU pointer */
 1137|  2.43M|    ps_codec->s_parse.ps_pu++;
 1138|  2.43M|    ps_codec->s_parse.i4_pic_pu_idx++;
 1139|  2.43M|    return ret;
 1140|  2.43M|}
ihevcd_parse_part_mode_amp:
 1144|   169k|{
 1145|   169k|    WORD32 ctxt_idx = IHEVC_CAB_PART_MODE;
 1146|   169k|    WORD32 part_mode_idx;
 1147|   169k|    WORD32 part_mode;
 1148|   169k|    WORD32 bin;
 1149|       |
 1150|   169k|    part_mode = 0;
 1151|   169k|    TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, ctxt_idx);
 1152|   169k|    bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx++);
 1153|       |
 1154|   169k|    if(!bin)
  ------------------
  |  Branch (1154:8): [True: 111k, False: 58.0k]
  ------------------
 1155|   111k|    {
 1156|   111k|        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx++);
 1157|   111k|        part_mode_idx = bin;
 1158|   111k|        part_mode_idx <<= 1;
 1159|       |
 1160|       |        /* Following takes of handling context increment for 3rd bin in part_mode */
 1161|       |        /* When AMP is enabled and the current is not min CB */
 1162|       |        /* Context for 3rd bin is 3 and not 2 */
 1163|   111k|        ctxt_idx += 1;
 1164|       |
 1165|   111k|        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1166|   111k|        part_mode_idx |= bin;
 1167|       |
 1168|   111k|        part_mode_idx <<= 1;
 1169|   111k|        if(!bin)
  ------------------
  |  Branch (1169:12): [True: 68.4k, False: 42.9k]
  ------------------
 1170|  68.4k|        {
 1171|       |
 1172|  68.4k|            bin = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 1173|  68.4k|            part_mode_idx |= bin;
 1174|  68.4k|        }
 1175|   111k|        part_mode = gau1_part_mode_amp[part_mode_idx];
 1176|   111k|    }
 1177|   169k|    return part_mode;
 1178|   169k|}
ihevcd_parse_coding_unit_intra:
 1183|  3.15M|{
 1184|  3.15M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1185|  3.15M|    sps_t *ps_sps;
 1186|  3.15M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1187|  3.15M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1188|  3.15M|    WORD32 pcm_flag;
 1189|  3.15M|    WORD32 value;
 1190|  3.15M|    WORD32 cb_size = 1 << log2_cb_size;
 1191|  3.15M|    WORD32 part_mode =  ps_codec->s_parse.s_cu.i4_part_mode;
 1192|  3.15M|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 1193|  3.15M|    pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1194|  3.15M|    WORD32 ctb_x_base;
 1195|  3.15M|    WORD32 ctb_y_base;
 1196|  3.15M|    ps_sps = ps_codec->s_parse.ps_sps;
 1197|  3.15M|    ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1198|  3.15M|    ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1199|       |
 1200|  3.15M|    memset(ps_pu, 0, sizeof(pu_t));
 1201|  3.15M|    ps_pu->b1_intra_flag = 1;
 1202|  3.15M|    ps_pu->b4_wd = (cb_size >> 2) - 1;
 1203|  3.15M|    ps_pu->b4_ht = (cb_size >> 2) - 1;
 1204|  3.15M|    ps_pu->b4_pos_x = (x0 - ctb_x_base) >> 2;
 1205|  3.15M|    ps_pu->b4_pos_y = (y0 - ctb_y_base) >> 2;
 1206|       |
 1207|  3.15M|    pcm_flag = 0;
 1208|  3.15M|    if((PART_2Nx2N == part_mode) && (ps_sps->i1_pcm_enabled_flag)
  ------------------
  |  Branch (1208:8): [True: 2.54M, False: 615k]
  |  Branch (1208:37): [True: 32.7k, False: 2.50M]
  ------------------
 1209|  32.7k|                    && (log2_cb_size
  ------------------
  |  Branch (1209:24): [True: 31.8k, False: 936]
  ------------------
 1210|  32.7k|                                    >= ps_sps->i1_log2_min_pcm_coding_block_size)
 1211|  31.8k|                    && (log2_cb_size
  ------------------
  |  Branch (1211:24): [True: 29.4k, False: 2.37k]
  ------------------
 1212|  31.8k|                                    <= (ps_sps->i1_log2_min_pcm_coding_block_size + ps_sps->i1_log2_diff_max_min_pcm_coding_block_size)))
 1213|  29.4k|    {
 1214|  29.4k|        TRACE_CABAC_CTXT("pcm_flag", ps_cabac->u4_range, 0);
 1215|  29.4k|        pcm_flag = ihevcd_cabac_decode_terminate(ps_cabac, ps_bitstrm);
 1216|  29.4k|        AEV_TRACE("pcm_flag", pcm_flag, ps_cabac->u4_range);
 1217|  29.4k|    }
 1218|       |
 1219|  3.15M|    ps_codec->s_parse.i4_cu_pcm_flag = pcm_flag;
 1220|  3.15M|    if(pcm_flag)
  ------------------
  |  Branch (1220:8): [True: 2.56k, False: 3.15M]
  ------------------
 1221|  2.56k|    {
 1222|  2.56k|        UWORD8 *pu1_luma_intra_pred_mode_top, *pu1_luma_intra_pred_mode_left;
 1223|  2.56k|        WORD32 i,  num_pred_blocks;
 1224|       |
 1225|  2.56k|        if(ps_codec->s_parse.s_bitstrm.u4_bit_ofst % 8)
  ------------------
  |  Branch (1225:12): [True: 2.43k, False: 133]
  ------------------
 1226|  2.43k|        {
 1227|  2.43k|            TRACE_CABAC_CTXT("pcm_alignment_zero_bit", ps_cabac->u4_range, 0);
 1228|  2.43k|            ihevcd_bits_flush_to_byte_boundary(&ps_codec->s_parse.s_bitstrm);
 1229|  2.43k|            AEV_TRACE("pcm_alignment_zero_bit", 0, ps_cabac->u4_range);
 1230|  2.43k|        }
 1231|       |
 1232|  2.56k|        ihevcd_parse_pcm_sample(ps_codec, x0, y0, log2_cb_size);
 1233|       |
 1234|  2.56k|        ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac,
 1235|  2.56k|                           &ps_codec->s_parse.s_bitstrm);
 1236|       |
 1237|  2.56k|        ps_tu = ps_codec->s_parse.ps_tu;
 1238|  2.56k|        ps_tu->b1_cb_cbf = 1;
 1239|  2.56k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1240|  2.56k|        ps_tu->b1_cb_cbf_subtu1 = 1;
 1241|  2.56k|#endif
 1242|  2.56k|        ps_tu->b1_cr_cbf = 1;
 1243|  2.56k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1244|  2.56k|        ps_tu->b1_cr_cbf_subtu1 = 1;
 1245|  2.56k|#endif
 1246|  2.56k|        ps_tu->b1_y_cbf = 1;
 1247|  2.56k|        ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1248|  2.56k|        ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1249|  2.56k|        ps_tu->b1_transquant_bypass = 1;
 1250|  2.56k|        ps_tu->b3_size = (log2_cb_size - 2);
 1251|  2.56k|        ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1252|  2.56k|        ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  2.56k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1253|  2.56k|        ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  521|  2.56k|#define INTRA_PRED_NONE  63
  ------------------
 1254|  2.56k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1255|  2.56k|        ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 1256|  2.56k|        ps_tu->b1_cb_log2_res_sign = 0;
 1257|  2.56k|        ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 1258|  2.56k|        ps_tu->b1_cr_log2_res_sign = 0;
 1259|  2.56k|#endif
 1260|       |
 1261|       |        /* Set the first TU in CU flag */
 1262|  2.56k|        {
 1263|  2.56k|            if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1263:16): [True: 2.56k, False: 0]
  ------------------
 1264|  2.56k|                            (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1264:29): [True: 2.56k, False: 0]
  ------------------
 1265|  2.56k|            {
 1266|  2.56k|                ps_tu->b1_first_tu_in_cu = 1;
 1267|  2.56k|            }
 1268|      0|            else
 1269|      0|            {
 1270|      0|                ps_tu->b1_first_tu_in_cu = 0;
 1271|      0|            }
 1272|  2.56k|        }
 1273|       |
 1274|       |        /* Update the intra pred mode for PCM to INTRA_DC(default mode) */
 1275|  2.56k|        pu1_luma_intra_pred_mode_top = ps_codec->s_parse.pu1_luma_intra_pred_mode_top
 1276|  2.56k|                        + (ps_codec->s_parse.s_cu.i4_pos_x * 2);
 1277|       |
 1278|  2.56k|        pu1_luma_intra_pred_mode_left = ps_codec->s_parse.pu1_luma_intra_pred_mode_left
 1279|  2.56k|                        + (ps_codec->s_parse.s_cu.i4_pos_y * 2);
 1280|       |
 1281|  2.56k|        num_pred_blocks = 1; /* Because PCM part mode will be 2Nx2N */
 1282|       |
 1283|  2.56k|        memset(pu1_luma_intra_pred_mode_left, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  514|  2.56k|#define INTRA_DC                 1
  ------------------
                      memset(pu1_luma_intra_pred_mode_left, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  367|  2.56k|#define MIN_PU_SIZE         4
  ------------------
 1284|  2.56k|        memset(pu1_luma_intra_pred_mode_top, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  514|  2.56k|#define INTRA_DC                 1
  ------------------
                      memset(pu1_luma_intra_pred_mode_top, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  367|  2.56k|#define MIN_PU_SIZE         4
  ------------------
 1285|       |
 1286|       |
 1287|       |        /* Set no_loop_filter appropriately */
 1288|  2.56k|        if(1 == ps_sps->i1_pcm_loop_filter_disable_flag)
  ------------------
  |  Branch (1288:12): [True: 2.06k, False: 499]
  ------------------
 1289|  2.06k|        {
 1290|  2.06k|            UWORD8 *pu1_pic_no_loop_filter_flag;
 1291|  2.06k|            WORD32 numbytes_row;
 1292|  2.06k|            UWORD32 u4_mask;
 1293|       |
 1294|  2.06k|            pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1295|  2.06k|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1296|  2.06k|            pu1_pic_no_loop_filter_flag += (y0 / 8) * numbytes_row;
 1297|  2.06k|            pu1_pic_no_loop_filter_flag += (x0 / 64);
 1298|       |            /* Generate (cb_size / 8) number of 1s */
 1299|       |            /* i.e (log2_cb_size - 2) number of 1s */
 1300|  2.06k|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|  2.06k|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1301|  5.21k|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1301:24): [True: 3.15k, False: 2.06k]
  ------------------
 1302|  3.15k|            {
 1303|  3.15k|                *pu1_pic_no_loop_filter_flag |= (u4_mask << (((x0) / 8) % 8));
 1304|  3.15k|                pu1_pic_no_loop_filter_flag += numbytes_row;
 1305|  3.15k|            }
 1306|  2.06k|        }
 1307|       |        /* Increment ps_tu and tu_idx */
 1308|  2.56k|        ps_codec->s_parse.ps_tu++;
 1309|  2.56k|        ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1310|  2.56k|        ps_codec->s_parse.i4_pic_tu_idx++;
 1311|       |
 1312|  2.56k|    }
 1313|  3.15M|    else
 1314|  3.15M|    {
 1315|  3.15M|        WORD32 cnt = 0;
 1316|  3.15M|        WORD32 i;
 1317|  3.15M|        WORD32 part_cnt;
 1318|       |
 1319|  3.15M|        part_cnt = (part_mode == PART_NxN) ? 4 : 1;
  ------------------
  |  Branch (1319:20): [True: 615k, False: 2.53M]
  ------------------
 1320|       |
 1321|  8.15M|        for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1321:20): [True: 5.00M, False: 3.15M]
  ------------------
 1322|  5.00M|        {
 1323|  5.00M|            TRACE_CABAC_CTXT("prev_intra_pred_luma_flag", ps_cabac->u4_range, IHEVC_CAB_INTRA_LUMA_PRED_FLAG);
 1324|  5.00M|            value = ihevcd_cabac_decode_bin(ps_cabac,
 1325|  5.00M|                                            ps_bitstrm,
 1326|  5.00M|                                            IHEVC_CAB_INTRA_LUMA_PRED_FLAG);
 1327|       |
 1328|  5.00M|            ps_codec->s_parse.s_cu.ai4_prev_intra_luma_pred_flag[i] =
 1329|  5.00M|                            value;
 1330|  5.00M|            AEV_TRACE("prev_intra_pred_luma_flag", value, ps_cabac->u4_range);
 1331|  5.00M|        }
 1332|       |
 1333|  8.15M|        for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1333:20): [True: 5.00M, False: 3.15M]
  ------------------
 1334|  5.00M|        {
 1335|  5.00M|            if(ps_codec->s_parse.s_cu.ai4_prev_intra_luma_pred_flag[cnt])
  ------------------
  |  Branch (1335:16): [True: 2.80M, False: 2.19M]
  ------------------
 1336|  2.80M|            {
 1337|  2.80M|                value = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac, ps_bitstrm, 2);
 1338|  2.80M|                AEV_TRACE("mpm_idx", value, ps_cabac->u4_range);
 1339|  2.80M|                ps_codec->s_parse.s_cu.ai4_mpm_idx[cnt] = value;
 1340|  2.80M|            }
 1341|  2.19M|            else
 1342|  2.19M|            {
 1343|  2.19M|                value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 5);
 1344|  2.19M|                AEV_TRACE("rem_intra_luma_pred_mode", value,
 1345|  2.19M|                          ps_cabac->u4_range);
 1346|  2.19M|                ps_codec->s_parse.s_cu.ai4_rem_intra_luma_pred_mode[cnt] =
 1347|  2.19M|                                value;
 1348|  2.19M|            }
 1349|  5.00M|            cnt++;
 1350|  5.00M|        }
 1351|  3.15M|        if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1351:12): [True: 0, False: 3.15M]
  ------------------
 1352|      0|        {
 1353|      0|            for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1353:24): [True: 0, False: 0]
  ------------------
 1354|      0|            {
 1355|      0|                TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE);
 1356|      0|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1357|      0|                                                IHEVC_CAB_CHROMA_PRED_MODE);
 1358|      0|                ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[i] = 4;
 1359|      0|                if(value)
  ------------------
  |  Branch (1359:20): [True: 0, False: 0]
  ------------------
 1360|      0|                {
 1361|      0|                    ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[i] =
 1362|      0|                                    ihevcd_cabac_decode_bypass_bins(ps_cabac,
 1363|      0|                                                                    ps_bitstrm,
 1364|      0|                                                                    2);
 1365|      0|                }
 1366|      0|                AEV_TRACE("intra_chroma_pred_mode",
 1367|      0|                        ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[i],
 1368|      0|                        ps_cabac->u4_range);
 1369|      0|            }
 1370|      0|        }
 1371|  3.15M|        else if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1371:17): [True: 3.13M, False: 22.3k]
  ------------------
 1372|  3.13M|        {
 1373|  3.13M|            TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE);
 1374|  3.13M|            value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1375|  3.13M|                    IHEVC_CAB_CHROMA_PRED_MODE);
 1376|  3.13M|            ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0] = 4;
 1377|  3.13M|            if (value) {
  ------------------
  |  Branch (1377:17): [True: 347k, False: 2.78M]
  ------------------
 1378|   347k|                ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0] =
 1379|   347k|                        ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm,
 1380|   347k|                                2);
 1381|   347k|            }
 1382|  3.13M|            AEV_TRACE("intra_chroma_pred_mode",
 1383|  3.13M|                    ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0],
 1384|  3.13M|                    ps_cabac->u4_range);
 1385|       |
 1386|  3.13M|        }
 1387|  3.15M|        ihevcd_intra_pred_mode_prediction(ps_codec, log2_cb_size, x0, y0);
 1388|       |
 1389|  3.15M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && part_mode != PART_NxN)
  ------------------
  |  Branch (1389:12): [True: 3.13M, False: 22.3k]
  |  Branch (1389:73): [True: 2.52M, False: 609k]
  ------------------
 1390|  2.52M|        {
 1391|       |            // Only required for YUV444, but done for all formats to simplify calling arguments for ihevcd_parse_transform_tree
 1392|  2.52M|            parse_cu_t *ps_cu = &ps_codec->s_parse.s_cu;
 1393|  2.52M|            ps_cu->ai4_intra_chroma_pred_mode_idx[1] = ps_cu->ai4_intra_chroma_pred_mode_idx[0];
 1394|  2.52M|            ps_cu->ai4_intra_chroma_pred_mode_idx[2] = ps_cu->ai4_intra_chroma_pred_mode_idx[0];
 1395|  2.52M|            ps_cu->ai4_intra_chroma_pred_mode_idx[3] = ps_cu->ai4_intra_chroma_pred_mode_idx[0];
 1396|  2.52M|        }
 1397|  3.15M|    }
 1398|  3.15M|    STATS_UPDATE_PU_SIZE(ps_pu);
  ------------------
  |  |  145|  3.15M|#define STATS_UPDATE_PU_SIZE(ps_pu) ;
  ------------------
 1399|       |    /* Increment PU pointer */
 1400|  3.15M|    ps_codec->s_parse.ps_pu++;
 1401|  3.15M|    ps_codec->s_parse.i4_pic_pu_idx++;
 1402|       |
 1403|  3.15M|    return ret;
 1404|  3.15M|}
ihevcd_parse_coding_unit:
 1429|  5.11M|{
 1430|  5.11M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1431|  5.11M|    sps_t *ps_sps;
 1432|  5.11M|    pps_t *ps_pps;
 1433|  5.11M|    WORD32 cb_size;
 1434|  5.11M|    slice_header_t *ps_slice_hdr;
 1435|  5.11M|    WORD32 skip_flag;
 1436|  5.11M|    WORD32 pcm_flag;
 1437|  5.11M|    UWORD32 *pu4_skip_top = ps_codec->s_parse.pu4_skip_cu_top;
 1438|  5.11M|    UWORD32 u4_skip_left = ps_codec->s_parse.u4_skip_cu_left;
 1439|  5.11M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1440|  5.11M|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 1441|       |
 1442|  5.11M|    WORD32 cu_pos_x;
 1443|  5.11M|    WORD32 cu_pos_y;
 1444|  5.11M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1445|       |
 1446|  5.11M|    ASSERT(0 == (x0 % 8));
  ------------------
  |  |   55|  5.11M|#define ASSERT(x) {}
  ------------------
 1447|  5.11M|    ASSERT(0 == (y0 % 8));
  ------------------
  |  |   55|  5.11M|#define ASSERT(x) {}
  ------------------
 1448|       |
 1449|  5.11M|    ps_codec->s_parse.s_cu.i4_tu_cnt = 0;
 1450|  5.11M|    ps_sps = ps_codec->s_parse.ps_sps;
 1451|  5.11M|    ps_pps = ps_codec->s_parse.ps_pps;
 1452|       |
 1453|  5.11M|    cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x;
 1454|  5.11M|    cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y;
 1455|       |
 1456|       |
 1457|       |
 1458|  5.11M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1459|       |
 1460|       |
 1461|  5.11M|    cb_size = 1 << log2_cb_size;
 1462|       |
 1463|  5.11M|    ps_codec->s_parse.s_cu.i4_cu_transquant_bypass = 0;
 1464|       |
 1465|  5.11M|    if(ps_pps->i1_transquant_bypass_enable_flag)
  ------------------
  |  Branch (1465:8): [True: 574k, False: 4.53M]
  ------------------
 1466|   574k|    {
 1467|   574k|        TRACE_CABAC_CTXT("cu_transquant_bypass_flag", ps_cabac->u4_range, IHEVC_CAB_CU_TQ_BYPASS_FLAG);
 1468|   574k|        ps_codec->s_parse.s_cu.i4_cu_transquant_bypass =
 1469|   574k|                        ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1470|   574k|                                                IHEVC_CAB_CU_TQ_BYPASS_FLAG);
 1471|       |        /* Update transquant_bypass in ps_tu */
 1472|       |
 1473|   574k|        AEV_TRACE("cu_transquant_bypass_flag", ps_codec->s_parse.s_cu.i4_cu_transquant_bypass,
 1474|   574k|                  ps_cabac->u4_range);
 1475|       |
 1476|   574k|        if(ps_codec->s_parse.s_cu.i4_cu_transquant_bypass)
  ------------------
  |  Branch (1476:12): [True: 211k, False: 363k]
  ------------------
 1477|   211k|        {
 1478|   211k|            UWORD8 *pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1479|   211k|            UWORD32 u4_mask;
 1480|   211k|            WORD32 i;
 1481|   211k|            WORD32 numbytes_row;
 1482|   211k|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1483|   211k|            pu1_pic_no_loop_filter_flag += (y0 / 8) * numbytes_row;
 1484|   211k|            pu1_pic_no_loop_filter_flag += (x0 / 64);
 1485|       |
 1486|       |            /* Generate (cb_size / 8) number of 1s */
 1487|       |            /* i.e (log2_cb_size - 2) number of 1s */
 1488|   211k|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|   211k|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1489|   636k|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1489:24): [True: 425k, False: 211k]
  ------------------
 1490|   425k|            {
 1491|   425k|                *pu1_pic_no_loop_filter_flag |= (u4_mask << (((x0) / 8) % 8));
 1492|   425k|                pu1_pic_no_loop_filter_flag += numbytes_row;
 1493|   425k|            }
 1494|   211k|        }
 1495|   574k|    }
 1496|       |
 1497|  5.11M|    {
 1498|  5.11M|        UWORD32 u4_skip_top = 0;
 1499|  5.11M|        UWORD32 u4_mask;
 1500|  5.11M|        UWORD32 u4_top_mask, u4_left_mask;
 1501|  5.11M|        UWORD32 u4_min_cu_x = x0 / 8;
 1502|  5.11M|        UWORD32 u4_min_cu_y = y0 / 8;
 1503|       |
 1504|  5.11M|        pu4_skip_top += (u4_min_cu_x / 32);
 1505|       |
 1506|       |
 1507|  5.11M|        if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1507:12): [True: 2.04M, False: 3.07M]
  ------------------
 1508|  2.04M|        {
 1509|  2.04M|            WORD32 ctx_idx_inc;
 1510|  2.04M|            ctx_idx_inc = 0;
 1511|       |
 1512|  2.04M|            if((0 != cu_pos_y) ||
  ------------------
  |  Branch (1512:16): [True: 1.33M, False: 703k]
  ------------------
 1513|   703k|                            ((0 != ps_codec->s_parse.i4_ctb_slice_y) &&
  ------------------
  |  Branch (1513:30): [True: 543k, False: 160k]
  ------------------
 1514|   543k|                                            (0 != ps_codec->s_parse.i4_ctb_tile_y)))
  ------------------
  |  Branch (1514:45): [True: 519k, False: 23.5k]
  ------------------
 1515|  1.85M|            {
 1516|  1.85M|                u4_skip_top = *pu4_skip_top;
 1517|  1.85M|                u4_skip_top >>= (u4_min_cu_x % 32);
 1518|  1.85M|                if(u4_skip_top & 1)
  ------------------
  |  Branch (1518:20): [True: 1.08M, False: 769k]
  ------------------
 1519|  1.08M|                    ctx_idx_inc++;
 1520|  1.85M|            }
 1521|       |
 1522|       |            /*****************************************************************/
 1523|       |            /* If cu_pos_x is non-zero then left is available                */
 1524|       |            /* If cu_pos_x is zero then ensure both the following are true   */
 1525|       |            /*    Current CTB is not the first CTB in a tile row             */
 1526|       |            /*    Current CTB is not the first CTB in a slice                */
 1527|       |            /*****************************************************************/
 1528|  2.04M|            if((0 != cu_pos_x) ||
  ------------------
  |  Branch (1528:16): [True: 1.27M, False: 770k]
  ------------------
 1529|   770k|                            (((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (1529:31): [True: 652k, False: 118k]
  |  Branch (1529:74): [True: 87.1k, False: 31.1k]
  ------------------
 1530|   739k|                                            (0 != ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (1530:45): [True: 643k, False: 96.3k]
  ------------------
 1531|  1.91M|            {
 1532|  1.91M|                u4_skip_left >>= (u4_min_cu_y % 32);
 1533|  1.91M|                if(u4_skip_left & 1)
  ------------------
  |  Branch (1533:20): [True: 1.12M, False: 789k]
  ------------------
 1534|  1.12M|                    ctx_idx_inc++;
 1535|  1.91M|            }
 1536|  2.04M|            TRACE_CABAC_CTXT("cu_skip_flag", ps_cabac->u4_range, (IHEVC_CAB_SKIP_FLAG + ctx_idx_inc));
 1537|  2.04M|            skip_flag = ihevcd_cabac_decode_bin(ps_cabac,
 1538|  2.04M|                                                ps_bitstrm,
 1539|  2.04M|                                                (IHEVC_CAB_SKIP_FLAG + ctx_idx_inc));
 1540|       |
 1541|  2.04M|            AEV_TRACE("cu_skip_flag", skip_flag, ps_cabac->u4_range);
 1542|  2.04M|        }
 1543|  3.07M|        else
 1544|  3.07M|            skip_flag = 0;
 1545|       |
 1546|       |        /* Update top skip_flag */
 1547|  5.11M|        u4_skip_top = *pu4_skip_top;
 1548|       |        /* Since Max cb_size is 64, maximum of 8 bits will be set or reset */
 1549|       |        /* Also since Coding block will be within 64x64 grid, only 8bits within a WORD32
 1550|       |         * need to be updated. These 8 bits will not cross 8 bit boundaries
 1551|       |         */
 1552|  5.11M|        u4_mask = LSB_ONES(cb_size / 8);
  ------------------
  |  |   72|  5.11M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1553|  5.11M|        u4_top_mask = u4_mask << (u4_min_cu_x % 32);
 1554|       |
 1555|       |
 1556|  5.11M|        if(skip_flag)
  ------------------
  |  Branch (1556:12): [True: 1.20M, False: 3.90M]
  ------------------
 1557|  1.20M|        {
 1558|  1.20M|            u4_skip_top |= u4_top_mask;
 1559|  1.20M|        }
 1560|  3.90M|        else
 1561|  3.90M|        {
 1562|  3.90M|            u4_skip_top &= ~u4_top_mask;
 1563|  3.90M|        }
 1564|  5.11M|        *pu4_skip_top = u4_skip_top;
 1565|       |
 1566|       |        /* Update left skip_flag */
 1567|  5.11M|        u4_skip_left = ps_codec->s_parse.u4_skip_cu_left;
 1568|  5.11M|        u4_mask = LSB_ONES(cb_size / 8);
  ------------------
  |  |   72|  5.11M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1569|  5.11M|        u4_left_mask = u4_mask << (u4_min_cu_y % 32);
 1570|       |
 1571|  5.11M|        if(skip_flag)
  ------------------
  |  Branch (1571:12): [True: 1.20M, False: 3.90M]
  ------------------
 1572|  1.20M|        {
 1573|  1.20M|            u4_skip_left |= u4_left_mask;
 1574|  1.20M|        }
 1575|  3.90M|        else
 1576|  3.90M|        {
 1577|  3.90M|            u4_skip_left &= ~u4_left_mask;
 1578|  3.90M|        }
 1579|  5.11M|        ps_codec->s_parse.u4_skip_cu_left = u4_skip_left;
 1580|  5.11M|    }
 1581|  5.11M|    ps_codec->s_parse.i4_cu_pcm_flag = 0;
 1582|       |
 1583|  5.11M|    if(skip_flag)
  ------------------
  |  Branch (1583:8): [True: 1.20M, False: 3.90M]
  ------------------
 1584|  1.20M|    {
 1585|  1.20M|        WORD32 ctb_x_base;
 1586|  1.20M|        WORD32 ctb_y_base;
 1587|       |
 1588|  1.20M|        ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1589|  1.20M|        ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1590|       |
 1591|  1.20M|        ps_tu->b1_cb_cbf = 0;
 1592|  1.20M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1593|  1.20M|        ps_tu->b1_cb_cbf_subtu1 = 0;
 1594|  1.20M|#endif
 1595|  1.20M|        ps_tu->b1_cr_cbf = 0;
 1596|  1.20M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1597|  1.20M|        ps_tu->b1_cr_cbf_subtu1 = 0;
 1598|  1.20M|#endif
 1599|  1.20M|        ps_tu->b1_y_cbf = 0;
 1600|  1.20M|        ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1601|  1.20M|        ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1602|  1.20M|        ps_tu->b1_transquant_bypass = 0;
 1603|  1.20M|        ps_tu->b3_size = (log2_cb_size - 2);
 1604|  1.20M|        ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1605|  1.20M|        ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|  1.20M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1606|  1.20M|        ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  521|  1.20M|#define INTRA_PRED_NONE  63
  ------------------
 1607|  1.20M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1608|  1.20M|        ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 1609|  1.20M|        ps_tu->b1_cb_log2_res_sign = 0;
 1610|  1.20M|        ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 1611|  1.20M|        ps_tu->b1_cr_log2_res_sign = 0;
 1612|  1.20M|#endif
 1613|       |
 1614|       |        /* Set the first TU in CU flag */
 1615|  1.20M|        {
 1616|  1.20M|            if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1616:16): [True: 1.20M, False: 0]
  ------------------
 1617|  1.20M|                            (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1617:29): [True: 1.20M, False: 0]
  ------------------
 1618|  1.20M|            {
 1619|  1.20M|                ps_tu->b1_first_tu_in_cu = 1;
 1620|  1.20M|            }
 1621|      0|            else
 1622|      0|            {
 1623|      0|                ps_tu->b1_first_tu_in_cu = 0;
 1624|      0|            }
 1625|  1.20M|        }
 1626|       |
 1627|  1.20M|        ps_codec->s_parse.ps_tu++;
 1628|  1.20M|        ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1629|  1.20M|        ps_codec->s_parse.i4_pic_tu_idx++;
 1630|       |
 1631|  1.20M|        ps_codec->s_parse.s_cu.i4_pred_mode = PRED_MODE_SKIP;
 1632|  1.20M|        ps_codec->s_parse.s_cu.i4_part_mode = PART_2Nx2N;
 1633|  1.20M|        {
 1634|  1.20M|            pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1635|  1.20M|            ps_pu->b2_part_idx = 0;
 1636|  1.20M|            ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size);
 1637|  1.20M|            STATS_UPDATE_PU_SKIP_SIZE(ps_pu);
  ------------------
  |  |  146|  1.20M|#define STATS_UPDATE_PU_SKIP_SIZE(ps_pu) ;
  ------------------
 1638|  1.20M|        }
 1639|  1.20M|    }
 1640|  3.90M|    else
 1641|  3.90M|    {
 1642|  3.90M|        WORD32 pred_mode;
 1643|  3.90M|        WORD32 part_mode;
 1644|  3.90M|        WORD32 intra_split_flag;
 1645|  3.90M|        WORD32 is_mincb;
 1646|  3.90M|        cb_size = (1 << log2_cb_size);
 1647|  3.90M|        is_mincb = (cb_size == (1 << ps_sps->i1_log2_min_coding_block_size));
 1648|  3.90M|        pcm_flag = 0;
 1649|  3.90M|        if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1649:12): [True: 832k, False: 3.07M]
  ------------------
 1650|   832k|        {
 1651|   832k|            TRACE_CABAC_CTXT("pred_mode_flag", ps_cabac->u4_range, IHEVC_CAB_PRED_MODE);
 1652|   832k|            pred_mode = ihevcd_cabac_decode_bin(ps_cabac,
 1653|   832k|                                                ps_bitstrm,
 1654|   832k|                                                IHEVC_CAB_PRED_MODE);
 1655|       |
 1656|   832k|            AEV_TRACE("pred_mode_flag", pred_mode, ps_cabac->u4_range);
 1657|   832k|        }
 1658|  3.07M|        else
 1659|  3.07M|        {
 1660|  3.07M|            pred_mode = PRED_MODE_INTRA;
 1661|  3.07M|        }
 1662|       |
 1663|       |        /* If current CU is intra then set corresponging bit in picture level intra map */
 1664|  3.90M|        if(PRED_MODE_INTRA == pred_mode)
  ------------------
  |  Branch (1664:12): [True: 3.15M, False: 747k]
  ------------------
 1665|  3.15M|        {
 1666|  3.15M|            UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 1667|  3.15M|            UWORD32 u4_mask;
 1668|  3.15M|            WORD32 i;
 1669|  3.15M|            WORD32 numbytes_row;
 1670|  3.15M|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1671|  3.15M|            pu1_pic_intra_flag += (y0 / 8) * numbytes_row;
 1672|  3.15M|            pu1_pic_intra_flag += (x0 / 64);
 1673|       |
 1674|       |            /* Generate (cb_size / 8) number of 1s */
 1675|       |            /* i.e (log2_cb_size - 2) number of 1s */
 1676|  3.15M|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|  3.15M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1677|  10.7M|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1677:24): [True: 7.62M, False: 3.15M]
  ------------------
 1678|  7.62M|            {
 1679|  7.62M|                *pu1_pic_intra_flag |= (u4_mask << (((x0) / 8) % 8));
 1680|  7.62M|                pu1_pic_intra_flag += numbytes_row;
 1681|  7.62M|            }
 1682|  3.15M|        }
 1683|       |
 1684|  3.90M|        ps_codec->s_parse.s_cu.i4_pred_mode = pred_mode;
 1685|  3.90M|        intra_split_flag = 0;
 1686|  3.90M|        if((PRED_MODE_INTRA != pred_mode) ||
  ------------------
  |  Branch (1686:12): [True: 747k, False: 3.15M]
  ------------------
 1687|  3.15M|                        is_mincb)
  ------------------
  |  Branch (1687:25): [True: 2.27M, False: 881k]
  ------------------
 1688|  3.02M|        {
 1689|  3.02M|            UWORD32 bin;
 1690|  3.02M|            if(PRED_MODE_INTRA == pred_mode)
  ------------------
  |  Branch (1690:16): [True: 2.27M, False: 747k]
  ------------------
 1691|  2.27M|            {
 1692|  2.27M|                TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, IHEVC_CAB_PART_MODE);
 1693|  2.27M|                bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, IHEVC_CAB_PART_MODE);
 1694|  2.27M|                part_mode = (bin) ? PART_2Nx2N : PART_NxN;
  ------------------
  |  Branch (1694:29): [True: 1.65M, False: 615k]
  ------------------
 1695|  2.27M|            }
 1696|   747k|            else
 1697|   747k|            {
 1698|   747k|                WORD32 amp_enabled = ps_sps->i1_amp_enabled_flag;
 1699|       |
 1700|   747k|                UWORD32 u4_max_bin_cnt = 0;
 1701|       |
 1702|       |
 1703|       |
 1704|   747k|                if(amp_enabled && !is_mincb)
  ------------------
  |  Branch (1704:20): [True: 677k, False: 70.0k]
  |  Branch (1704:35): [True: 169k, False: 507k]
  ------------------
 1705|   169k|                {
 1706|   169k|                    part_mode = ihevcd_parse_part_mode_amp(ps_cabac, ps_bitstrm);
 1707|   169k|                }
 1708|   577k|                else
 1709|   577k|                {
 1710|   577k|                    WORD32 ctxt_inc = IHEVC_CAB_PART_MODE;
 1711|       |
 1712|   577k|                    u4_max_bin_cnt = 2;
 1713|   577k|                    if((is_mincb) && (cb_size > 8))
  ------------------
  |  Branch (1713:24): [True: 554k, False: 23.4k]
  |  Branch (1713:38): [True: 10.7k, False: 543k]
  ------------------
 1714|  10.7k|                    {
 1715|  10.7k|                        u4_max_bin_cnt++;
 1716|  10.7k|                    }
 1717|       |
 1718|   577k|                    part_mode = -1;
 1719|   577k|                    TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, IHEVC_CAB_PART_MODE);
 1720|   577k|                    do
 1721|   943k|                    {
 1722|   943k|                        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1723|   943k|                                                      ctxt_inc++);
 1724|   943k|                        part_mode++;
 1725|   943k|                    }while(--u4_max_bin_cnt && !bin);
  ------------------
  |  Branch (1725:28): [True: 583k, False: 359k]
  |  Branch (1725:48): [True: 365k, False: 218k]
  ------------------
 1726|       |
 1727|       |                    /* If the last bin was zero, then increment part mode by 1 */
 1728|   577k|                    if(!bin)
  ------------------
  |  Branch (1728:24): [True: 208k, False: 369k]
  ------------------
 1729|   208k|                        part_mode++;
 1730|   577k|                }
 1731|       |
 1732|       |
 1733|   747k|            }
 1734|       |
 1735|  3.02M|            AEV_TRACE("part_mode", part_mode, ps_cabac->u4_range);
 1736|       |
 1737|  3.02M|        }
 1738|   881k|        else
 1739|   881k|        {
 1740|   881k|            part_mode = 0;
 1741|   881k|            intra_split_flag = 0;
 1742|   881k|        }
 1743|  3.90M|        ps_codec->s_parse.s_cu.i4_part_mode = part_mode;
 1744|       |
 1745|  3.90M|        if((PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode) &&
  ------------------
  |  Branch (1745:12): [True: 3.15M, False: 747k]
  ------------------
 1746|  3.15M|                        (PART_NxN == ps_codec->s_parse.s_cu.i4_part_mode))
  ------------------
  |  Branch (1746:25): [True: 615k, False: 2.54M]
  ------------------
 1747|   615k|        {
 1748|   615k|            intra_split_flag = 1;
 1749|   615k|        }
 1750|  3.90M|        ps_codec->s_parse.s_cu.i4_part_mode = part_mode;
 1751|  3.90M|        ps_codec->s_parse.s_cu.i4_intra_split_flag = intra_split_flag;
 1752|  3.90M|        if(pred_mode == PRED_MODE_INTRA)
  ------------------
  |  Branch (1752:12): [True: 3.15M, False: 747k]
  ------------------
 1753|  3.15M|        {
 1754|  3.15M|            ps_codec->s_parse.i4_cu_pcm_flag = 0;
 1755|  3.15M|            ihevcd_parse_coding_unit_intra(ps_codec, x0, y0, log2_cb_size);
 1756|  3.15M|            pcm_flag = ps_codec->s_parse.i4_cu_pcm_flag;
 1757|       |
 1758|  3.15M|        }
 1759|   747k|        else
 1760|   747k|        {
 1761|   747k|            if(part_mode == PART_2Nx2N)
  ------------------
  |  Branch (1761:16): [True: 273k, False: 473k]
  ------------------
 1762|   273k|            {
 1763|   273k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1764|   273k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size);
 1765|   273k|                ps_pu->b2_part_idx = 0;
 1766|   273k|            }
 1767|   473k|            else if(part_mode == PART_2NxN)
  ------------------
  |  Branch (1767:21): [True: 170k, False: 302k]
  ------------------
 1768|   170k|            {
 1769|   170k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1770|       |
 1771|   170k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size / 2);
 1772|   170k|                ps_pu->b2_part_idx = 0;
 1773|       |
 1774|   170k|                ps_pu = ps_codec->s_parse.ps_pu;
 1775|   170k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 2), cb_size, cb_size / 2);
 1776|       |
 1777|   170k|                ps_pu->b2_part_idx = 1;
 1778|   170k|            }
 1779|   302k|            else if(part_mode == PART_Nx2N)
  ------------------
  |  Branch (1779:21): [True: 231k, False: 70.7k]
  ------------------
 1780|   231k|            {
 1781|   231k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1782|   231k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 2, cb_size);
 1783|   231k|                ps_pu->b2_part_idx = 0;
 1784|   231k|                ps_pu = ps_codec->s_parse.ps_pu;
 1785|   231k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0, cb_size / 2, cb_size);
 1786|       |
 1787|   231k|                ps_pu->b2_part_idx = 1;
 1788|   231k|            }
 1789|  70.7k|            else if(part_mode == PART_2NxnU)
  ------------------
  |  Branch (1789:21): [True: 12.6k, False: 58.1k]
  ------------------
 1790|  12.6k|            {
 1791|  12.6k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1792|  12.6k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size / 4);
 1793|  12.6k|                ps_pu->b2_part_idx = 0;
 1794|  12.6k|                ps_pu = ps_codec->s_parse.ps_pu;
 1795|  12.6k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 4), cb_size, cb_size * 3 / 4);
 1796|       |
 1797|  12.6k|                ps_pu->b2_part_idx = 1;
 1798|  12.6k|            }
 1799|  58.1k|            else if(part_mode == PART_2NxnD)
  ------------------
  |  Branch (1799:21): [True: 10.3k, False: 47.8k]
  ------------------
 1800|  10.3k|            {
 1801|  10.3k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1802|  10.3k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size * 3 / 4);
 1803|  10.3k|                ps_pu->b2_part_idx = 0;
 1804|  10.3k|                ps_pu = ps_codec->s_parse.ps_pu;
 1805|  10.3k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size * 3 / 4), cb_size, cb_size / 4);
 1806|       |
 1807|  10.3k|                ps_pu->b2_part_idx = 1;
 1808|  10.3k|            }
 1809|  47.8k|            else if(part_mode == PART_nLx2N)
  ------------------
  |  Branch (1809:21): [True: 32.5k, False: 15.2k]
  ------------------
 1810|  32.5k|            {
 1811|  32.5k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1812|  32.5k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 4, cb_size);
 1813|  32.5k|                ps_pu->b2_part_idx = 0;
 1814|  32.5k|                ps_pu = ps_codec->s_parse.ps_pu;
 1815|  32.5k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 4), y0, cb_size * 3 / 4, cb_size);
 1816|       |
 1817|  32.5k|                ps_pu->b2_part_idx = 1;
 1818|  32.5k|            }
 1819|  15.2k|            else if(part_mode == PART_nRx2N)
  ------------------
  |  Branch (1819:21): [True: 12.9k, False: 2.33k]
  ------------------
 1820|  12.9k|            {
 1821|  12.9k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1822|  12.9k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size * 3 / 4, cb_size);
 1823|  12.9k|                ps_pu->b2_part_idx = 0;
 1824|  12.9k|                ps_pu = ps_codec->s_parse.ps_pu;
 1825|  12.9k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size * 3 / 4), y0, cb_size / 4, cb_size);
 1826|  12.9k|                ps_pu->b2_part_idx = 1;
 1827|  12.9k|            }
 1828|  2.33k|            else
 1829|  2.33k|            { /* PART_NxN */
 1830|  2.33k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1831|       |
 1832|  2.33k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 2, cb_size / 2);
 1833|  2.33k|                ps_pu->b2_part_idx = 0;
 1834|  2.33k|                ps_pu = ps_codec->s_parse.ps_pu;
 1835|  2.33k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0, cb_size / 2, cb_size / 2);
 1836|       |
 1837|  2.33k|                ps_pu->b2_part_idx = 1;
 1838|  2.33k|                ps_pu = ps_codec->s_parse.ps_pu;
 1839|  2.33k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 2), cb_size / 2, cb_size / 2);
 1840|       |
 1841|  2.33k|                ps_pu->b2_part_idx = 2;
 1842|  2.33k|                ps_pu = ps_codec->s_parse.ps_pu;
 1843|  2.33k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0 + (cb_size / 2), cb_size / 2, cb_size / 2);
 1844|       |
 1845|  2.33k|                ps_pu->b2_part_idx = 3;
 1846|  2.33k|            }
 1847|   747k|        }
 1848|       |
 1849|  3.90M|        if(!pcm_flag)
  ------------------
  |  Branch (1849:12): [True: 3.90M, False: 2.56k]
  ------------------
 1850|  3.90M|        {
 1851|  3.90M|            WORD32 no_residual_syntax_flag = 0;
 1852|  3.90M|            pu_t *ps_pu;
 1853|       |            /* Since ps_pu is incremented for each PU parsed, decrement by 1 to
 1854|       |             *  access last decoded PU
 1855|       |             */
 1856|  3.90M|            ps_pu = ps_codec->s_parse.ps_pu - 1;
 1857|  3.90M|            if((PRED_MODE_INTRA != pred_mode) &&
  ------------------
  |  Branch (1857:16): [True: 747k, False: 3.15M]
  ------------------
 1858|   747k|                            (!((part_mode == PART_2Nx2N) && ps_pu->b1_merge_flag)))
  ------------------
  |  Branch (1858:32): [True: 273k, False: 473k]
  |  Branch (1858:61): [True: 104k, False: 169k]
  ------------------
 1859|   642k|            {
 1860|       |
 1861|   642k|                TRACE_CABAC_CTXT("rqt_root_cbf", ps_cabac->u4_range, IHEVC_CAB_NORES_IDX);
 1862|   642k|                no_residual_syntax_flag = ihevcd_cabac_decode_bin(ps_cabac,
 1863|   642k|                                                                  ps_bitstrm,
 1864|   642k|                                                                  IHEVC_CAB_NORES_IDX);
 1865|       |
 1866|   642k|                AEV_TRACE("rqt_root_cbf", no_residual_syntax_flag,
 1867|   642k|                          ps_cabac->u4_range);
 1868|       |                /* TODO: HACK FOR COMPLIANCE WITH HM REFERENCE DECODER */
 1869|       |                /*********************************************************/
 1870|       |                /* currently the HM decoder expects qtroot cbf instead of */
 1871|       |                /* no_residue_flag which has opposite meaning             */
 1872|       |                /* This will be fixed once the software / spec is fixed   */
 1873|       |                /*********************************************************/
 1874|   642k|                no_residual_syntax_flag = 1 - no_residual_syntax_flag;
 1875|   642k|            }
 1876|       |
 1877|  3.90M|            if(!no_residual_syntax_flag)
  ------------------
  |  Branch (1877:16): [True: 3.38M, False: 521k]
  ------------------
 1878|  3.38M|            {
 1879|       |
 1880|  3.38M|                ps_codec->s_parse.s_cu.i4_max_trafo_depth = (pred_mode == PRED_MODE_INTRA) ?
  ------------------
  |  Branch (1880:61): [True: 3.15M, False: 225k]
  ------------------
 1881|  3.15M|                                (ps_sps->i1_max_transform_hierarchy_depth_intra + intra_split_flag) :
 1882|  3.38M|                                (ps_sps->i1_max_transform_hierarchy_depth_inter);
 1883|  3.38M|                ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0,
 1884|  3.38M|                                                  log2_cb_size, 0, 0,
 1885|  3.38M|                                                  ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0],
 1886|  3.38M|                                                  ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0]);
 1887|  3.38M|                RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  3.38M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.12k, False: 3.37M]
  |  |  ------------------
  ------------------
 1888|  3.37M|            }
 1889|   521k|            else
 1890|   521k|            {
 1891|   521k|                WORD32 ctb_x_base;
 1892|   521k|                WORD32 ctb_y_base;
 1893|       |
 1894|   521k|                ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1895|   521k|                ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1896|       |
 1897|   521k|                ps_tu = ps_codec->s_parse.ps_tu;
 1898|   521k|                ps_tu->b1_cb_cbf = 0;
 1899|   521k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1900|   521k|                ps_tu->b1_cb_cbf_subtu1 = 0;
 1901|   521k|#endif
 1902|   521k|                ps_tu->b1_cr_cbf = 0;
 1903|   521k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1904|   521k|                ps_tu->b1_cr_cbf_subtu1 = 0;
 1905|   521k|#endif
 1906|   521k|                ps_tu->b1_y_cbf = 0;
 1907|   521k|                ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1908|   521k|                ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1909|   521k|                ps_tu->b1_transquant_bypass = 0;
 1910|   521k|                ps_tu->b3_size = (log2_cb_size - 2);
 1911|   521k|                ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1912|   521k|                ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|   521k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1913|   521k|                ps_tu->b6_luma_intra_mode   = ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
 1914|   521k|#ifdef ENABLE_MAIN_REXT_PROFILE
 1915|   521k|                ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 1916|   521k|                ps_tu->b1_cb_log2_res_sign = 0;
 1917|   521k|                ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 1918|   521k|                ps_tu->b1_cr_log2_res_sign = 0;
 1919|   521k|#endif
 1920|       |
 1921|       |                /* Set the first TU in CU flag */
 1922|   521k|                {
 1923|   521k|                    if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1923:24): [True: 521k, False: 0]
  ------------------
 1924|   521k|                                    (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1924:37): [True: 521k, False: 0]
  ------------------
 1925|   521k|                    {
 1926|   521k|                        ps_tu->b1_first_tu_in_cu = 1;
 1927|   521k|                    }
 1928|      0|                    else
 1929|      0|                    {
 1930|      0|                        ps_tu->b1_first_tu_in_cu = 0;
 1931|      0|                    }
 1932|   521k|                }
 1933|   521k|                ps_codec->s_parse.ps_tu++;
 1934|   521k|                ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1935|   521k|                ps_codec->s_parse.i4_pic_tu_idx++;
 1936|       |
 1937|   521k|            }
 1938|  3.90M|        }
 1939|       |
 1940|  3.90M|    }
 1941|       |
 1942|       |
 1943|       |
 1944|       |
 1945|  5.11M|    return ret;
 1946|  5.11M|}
ihevcd_parse_coding_quadtree:
 1975|  6.66M|{
 1976|  6.66M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1977|  6.66M|    sps_t *ps_sps;
 1978|  6.66M|    pps_t *ps_pps;
 1979|  6.66M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1980|  6.66M|    slice_header_t *ps_slice_hdr;
 1981|  6.66M|#endif
 1982|  6.66M|    WORD32 split_cu_flag;
 1983|  6.66M|    WORD32 x1, y1;
 1984|  6.66M|    WORD32 cu_pos_x;
 1985|  6.66M|    WORD32 cu_pos_y;
 1986|  6.66M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1987|  6.66M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1988|  6.66M|    WORD32 cb_size = 1 << log2_cb_size;
 1989|  6.66M|    ps_sps = ps_codec->s_parse.ps_sps;
 1990|  6.66M|    ps_pps = ps_codec->s_parse.ps_pps;
 1991|  6.66M|#ifdef ENABLE_MAIN_REXT_PROFILE
 1992|  6.66M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1993|  6.66M|#endif
 1994|       |
 1995|       |    /* Compute CU position with respect to current CTB in (8x8) units */
 1996|  6.66M|    cu_pos_x = (x0 - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size)) >> 3;
 1997|  6.66M|    cu_pos_y = (y0 - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size)) >> 3;
 1998|       |
 1999|  6.66M|    ps_codec->s_parse.s_cu.i4_pos_x = cu_pos_x;
 2000|  6.66M|    ps_codec->s_parse.s_cu.i4_pos_y = cu_pos_y;
 2001|       |
 2002|  6.66M|    ps_codec->s_parse.s_cu.i4_log2_cb_size = log2_cb_size;
 2003|       |
 2004|  6.66M|    ps_codec->s_parse.i4_ct_depth = ct_depth;
 2005|  6.66M|    {
 2006|  6.66M|        UWORD32 *pu4_ct_depth_top = ps_codec->s_parse.pu4_ct_depth_top;
 2007|  6.66M|        UWORD32 u4_ct_depth_left = ps_codec->s_parse.u4_ct_depth_left;
 2008|  6.66M|        UWORD32 u4_ct_depth_top = 0;
 2009|  6.66M|        UWORD32 u4_mask;
 2010|  6.66M|        UWORD32 u4_top_mask, u4_left_mask;
 2011|  6.66M|        WORD32  ctxt_idx;
 2012|  6.66M|        UWORD32 u4_min_cu_x = x0 / 8;
 2013|  6.66M|        UWORD32 u4_min_cu_y = y0 / 8;
 2014|       |
 2015|  6.66M|        pu4_ct_depth_top += (u4_min_cu_x / 16);
 2016|       |
 2017|       |
 2018|       |
 2019|       |
 2020|  6.66M|        if(((x0 + (1 << log2_cb_size)) <= ps_sps->i2_pic_width_in_luma_samples) &&
  ------------------
  |  Branch (2020:12): [True: 6.46M, False: 199k]
  ------------------
 2021|  6.46M|                        ((y0 + (1 << log2_cb_size)) <= ps_sps->i2_pic_height_in_luma_samples) &&
  ------------------
  |  Branch (2021:25): [True: 6.35M, False: 111k]
  ------------------
 2022|  6.35M|                        (log2_cb_size > ps_sps->i1_log2_min_coding_block_size))
  ------------------
  |  Branch (2022:25): [True: 2.73M, False: 3.61M]
  ------------------
 2023|  2.73M|        {
 2024|       |
 2025|  2.73M|            ctxt_idx = IHEVC_CAB_SPLIT_CU_FLAG;
 2026|       |            /* Split cu context increment is decided based on left and top Coding tree
 2027|       |             * depth which is stored at frame level
 2028|       |             */
 2029|       |            /* Check if the CTB is in first row in the current slice or tile */
 2030|  2.73M|            if((0 != cu_pos_y) ||
  ------------------
  |  Branch (2030:16): [True: 1.08M, False: 1.65M]
  ------------------
 2031|  1.65M|                            ((0 != ps_codec->s_parse.i4_ctb_slice_y) &&
  ------------------
  |  Branch (2031:30): [True: 1.12M, False: 523k]
  ------------------
 2032|  1.12M|                                            (0 != ps_codec->s_parse.i4_ctb_tile_y)))
  ------------------
  |  Branch (2032:45): [True: 1.10M, False: 22.7k]
  ------------------
 2033|  2.19M|            {
 2034|  2.19M|                u4_ct_depth_top = *pu4_ct_depth_top;
 2035|  2.19M|                u4_ct_depth_top >>= ((u4_min_cu_x % 16) * 2);
 2036|  2.19M|                u4_ct_depth_top &= 3;
 2037|       |
 2038|  2.19M|                if((WORD32)u4_ct_depth_top > ct_depth)
  ------------------
  |  Branch (2038:20): [True: 878k, False: 1.31M]
  ------------------
 2039|   878k|                    ctxt_idx++;
 2040|  2.19M|            }
 2041|       |
 2042|       |            /* Check if the CTB is in first column in the current slice or tile */
 2043|       |            /*****************************************************************/
 2044|       |            /* If cu_pos_x is non-zero then left is available                */
 2045|       |            /* If cu_pos_x is zero then ensure both the following are true   */
 2046|       |            /*    Current CTB is not the first CTB in a tile row             */
 2047|       |            /*    Current CTB is not the first CTB in a slice                */
 2048|       |            /*****************************************************************/
 2049|  2.73M|            if((0 != cu_pos_x) ||
  ------------------
  |  Branch (2049:16): [True: 1.11M, False: 1.62M]
  ------------------
 2050|  1.62M|                            (((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (2050:31): [True: 1.34M, False: 277k]
  |  Branch (2050:74): [True: 134k, False: 143k]
  ------------------
 2051|  1.48M|                                            (0 != ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (2051:45): [True: 1.33M, False: 146k]
  ------------------
 2052|  2.45M|            {
 2053|  2.45M|                u4_ct_depth_left >>= ((u4_min_cu_y % 16) * 2);
 2054|  2.45M|                u4_ct_depth_left &= 3;
 2055|  2.45M|                if((WORD32)u4_ct_depth_left > ct_depth)
  ------------------
  |  Branch (2055:20): [True: 993k, False: 1.45M]
  ------------------
 2056|   993k|                    ctxt_idx++;
 2057|  2.45M|            }
 2058|  2.73M|            TRACE_CABAC_CTXT("split_cu_flag", ps_cabac->u4_range, ctxt_idx);
 2059|  2.73M|            split_cu_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2060|  2.73M|            AEV_TRACE("split_cu_flag", split_cu_flag, ps_cabac->u4_range);
 2061|  2.73M|        }
 2062|  3.92M|        else
 2063|  3.92M|        {
 2064|  3.92M|            if(log2_cb_size > ps_sps->i1_log2_min_coding_block_size)
  ------------------
  |  Branch (2064:16): [True: 311k, False: 3.61M]
  ------------------
 2065|   311k|                split_cu_flag = 1;
 2066|  3.61M|            else
 2067|  3.61M|                split_cu_flag = 0;
 2068|  3.92M|        }
 2069|       |
 2070|  6.66M|        if(0 == split_cu_flag)
  ------------------
  |  Branch (2070:12): [True: 5.11M, False: 1.54M]
  ------------------
 2071|  5.11M|        {
 2072|       |            /* Update top ct_depth */
 2073|  5.11M|            u4_ct_depth_top = *pu4_ct_depth_top;
 2074|       |            /* Since Max cb_size is 64, maximum of 8 bits will be set or reset */
 2075|       |            /* Also since Coding block will be within 64x64 grid, only 8bits within a WORD32
 2076|       |             * need to be updated. These 8 bits will not cross 8 bit boundaries
 2077|       |             */
 2078|  5.11M|            u4_mask = DUP_LSB_11(cb_size / 8);
  ------------------
  |  |   81|  5.11M|#define DUP_LSB_11(x) ((UWORD32)0xFFFFFFFF >> (32 - ((x) * 2)))
  ------------------
 2079|       |
 2080|  5.11M|            u4_top_mask = u4_mask << ((u4_min_cu_x % 16) * 2);
 2081|  5.11M|            u4_ct_depth_top &= ~u4_top_mask;
 2082|       |
 2083|  5.11M|            if(ct_depth)
  ------------------
  |  Branch (2083:16): [True: 4.44M, False: 669k]
  ------------------
 2084|  4.44M|            {
 2085|  4.44M|                u4_top_mask = gau4_ct_depth_mask[ct_depth] & u4_mask;
 2086|       |
 2087|  4.44M|                u4_top_mask = u4_top_mask << ((u4_min_cu_x % 16) * 2);
 2088|  4.44M|                u4_ct_depth_top |= u4_top_mask;
 2089|  4.44M|            }
 2090|       |
 2091|  5.11M|            *pu4_ct_depth_top = u4_ct_depth_top;
 2092|       |
 2093|       |            /* Update left ct_depth */
 2094|  5.11M|            u4_ct_depth_left = ps_codec->s_parse.u4_ct_depth_left;
 2095|       |
 2096|  5.11M|            u4_left_mask = u4_mask << ((u4_min_cu_y % 16) * 2);
 2097|       |
 2098|  5.11M|            u4_ct_depth_left &= ~u4_left_mask;
 2099|  5.11M|            if(ct_depth)
  ------------------
  |  Branch (2099:16): [True: 4.44M, False: 669k]
  ------------------
 2100|  4.44M|            {
 2101|  4.44M|                u4_left_mask = gau4_ct_depth_mask[ct_depth] & u4_mask;
 2102|       |
 2103|  4.44M|                u4_left_mask = u4_left_mask << ((u4_min_cu_y % 16) * 2);
 2104|  4.44M|                u4_ct_depth_left |= u4_left_mask;
 2105|  4.44M|            }
 2106|       |
 2107|  5.11M|            ps_codec->s_parse.u4_ct_depth_left = u4_ct_depth_left;
 2108|  5.11M|        }
 2109|  6.66M|    }
 2110|  6.66M|    if((ps_pps->i1_cu_qp_delta_enabled_flag) &&
  ------------------
  |  Branch (2110:8): [True: 3.13M, False: 3.52M]
  ------------------
 2111|  3.13M|                    (log2_cb_size >= ps_pps->i1_log2_min_cu_qp_delta_size))
  ------------------
  |  Branch (2111:21): [True: 963k, False: 2.17M]
  ------------------
 2112|   963k|    {
 2113|   963k|        ps_codec->s_parse.i4_is_cu_qp_delta_coded = 0;
 2114|   963k|        ps_codec->s_parse.i4_cu_qp_delta = 0;
 2115|   963k|    }
 2116|  6.66M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2117|  6.66M|    if(ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag
  ------------------
  |  Branch (2117:8): [True: 44.4k, False: 6.61M]
  ------------------
 2118|  44.4k|        && log2_cb_size >= (ps_sps->i1_log2_ctb_size
  ------------------
  |  Branch (2118:12): [True: 16.1k, False: 28.3k]
  ------------------
 2119|  44.4k|                        - ps_pps->i4_diff_cu_chroma_qp_offset_depth))
 2120|  16.1k|    {
 2121|  16.1k|        ps_codec->s_parse.i4_is_cu_chroma_qp_offset_coded = 0;
 2122|  16.1k|        ps_codec->s_parse.i4_cu_chroma_qp_offset_flag = 0;
 2123|  16.1k|        ps_codec->s_parse.i4_cu_chroma_qp_offset_idx = 0;
 2124|  16.1k|    }
 2125|  6.66M|#endif
 2126|  6.66M|    if(split_cu_flag)
  ------------------
  |  Branch (2126:8): [True: 1.54M, False: 5.11M]
  ------------------
 2127|  1.54M|    {
 2128|  1.54M|        x1 = x0 + ((1 << log2_cb_size) >> 1);
 2129|  1.54M|        y1 = y0 + ((1 << log2_cb_size) >> 1);
 2130|       |
 2131|  1.54M|        ret = ihevcd_parse_coding_quadtree(ps_codec, x0, y0, log2_cb_size - 1, ct_depth + 1);
 2132|  1.54M|        RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.54M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 827, False: 1.54M]
  |  |  ------------------
  ------------------
 2133|       |
 2134|       |        /* At frame boundaries coding quadtree nodes are sent only if they fall within the frame */
 2135|  1.54M|        if(x1 < ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (2135:12): [True: 1.35M, False: 191k]
  ------------------
 2136|  1.35M|        {
 2137|  1.35M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x1, y0, log2_cb_size - 1, ct_depth + 1);
 2138|  1.35M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.35M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 455, False: 1.35M]
  |  |  ------------------
  ------------------
 2139|  1.35M|        }
 2140|       |
 2141|  1.54M|        if(y1 < ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (2141:12): [True: 1.43M, False: 108k]
  ------------------
 2142|  1.43M|        {
 2143|  1.43M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x0, y1, log2_cb_size - 1, ct_depth + 1);
 2144|  1.43M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.43M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 771, False: 1.43M]
  |  |  ------------------
  ------------------
 2145|  1.43M|        }
 2146|       |
 2147|  1.54M|        if((x1 < ps_sps->i2_pic_width_in_luma_samples) &&
  ------------------
  |  Branch (2147:12): [True: 1.35M, False: 191k]
  ------------------
 2148|  1.35M|                        (y1 < ps_sps->i2_pic_height_in_luma_samples))
  ------------------
  |  Branch (2148:25): [True: 1.25M, False: 96.3k]
  ------------------
 2149|  1.25M|        {
 2150|  1.25M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x1, y1, log2_cb_size - 1, ct_depth + 1);
 2151|  1.25M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.25M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 422, False: 1.25M]
  |  |  ------------------
  ------------------
 2152|  1.25M|        }
 2153|  1.54M|    }
 2154|  5.11M|    else
 2155|  5.11M|    {
 2156|  5.11M|        WORD32 qp = ps_codec->s_parse.u4_qp;
 2157|       |        /* Set current group QP if current CU is aligned with the group */
 2158|  5.11M|        {
 2159|  5.11M|            WORD32 cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x << 3;
 2160|  5.11M|            WORD32 cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y << 3;
 2161|       |
 2162|  5.11M|            WORD32 qpg_x = (cu_pos_x - (cu_pos_x & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1)));
 2163|  5.11M|            WORD32 qpg_y = (cu_pos_y - (cu_pos_y & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1)));
 2164|       |
 2165|  5.11M|            if((cu_pos_x == qpg_x) &&
  ------------------
  |  Branch (2165:16): [True: 2.17M, False: 2.94M]
  ------------------
 2166|  2.17M|                            (cu_pos_y == qpg_y))
  ------------------
  |  Branch (2166:29): [True: 1.45M, False: 721k]
  ------------------
 2167|  1.45M|            {
 2168|  1.45M|                ps_codec->s_parse.u4_qpg = ps_codec->s_parse.u4_qp;
 2169|       |
 2170|  1.45M|                ps_codec->s_parse.s_cu.i4_cu_qp_delta = 0;
 2171|       |
 2172|  1.45M|            }
 2173|  5.11M|        }
 2174|       |
 2175|  5.11M|        ret = ihevcd_parse_coding_unit(ps_codec, x0, y0, log2_cb_size);
 2176|  5.11M|        RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  5.11M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.12k, False: 5.11M]
  |  |  ------------------
  ------------------
 2177|       |
 2178|  5.11M|        if(ps_pps->i1_cu_qp_delta_enabled_flag)
  ------------------
  |  Branch (2178:12): [True: 2.38M, False: 2.72M]
  ------------------
 2179|  2.38M|        {
 2180|  2.38M|            WORD32 qp_pred, qp_left, qp_top;
 2181|  2.38M|            WORD32 cu_pos_x;
 2182|  2.38M|            WORD32 cu_pos_y;
 2183|  2.38M|            WORD32 qpg_x;
 2184|  2.38M|            WORD32 qpg_y;
 2185|  2.38M|            WORD32 i, j;
 2186|  2.38M|            WORD32 cur_cu_offset;
 2187|  2.38M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 2188|  2.38M|            WORD32 cb_size = 1 << ps_codec->s_parse.s_cu.i4_log2_cb_size;
 2189|  2.38M|            WORD32 i4_qp_bd_offset_y = ps_codec->i4_qp_bd_offset_y;
 2190|       |
 2191|  2.38M|            cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x << 3;
 2192|  2.38M|            cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y << 3;
 2193|       |
 2194|  2.38M|            qpg_x = (cu_pos_x - (cu_pos_x & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1))) >> 3;
 2195|  2.38M|            qpg_y = (cu_pos_y - (cu_pos_y & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1))) >> 3;
 2196|       |
 2197|       |            /*previous coded Qp*/
 2198|  2.38M|            qp_left = ps_codec->s_parse.u4_qpg;
 2199|  2.38M|            qp_top = ps_codec->s_parse.u4_qpg;
 2200|       |
 2201|  2.38M|            if(qpg_x > 0)
  ------------------
  |  Branch (2201:16): [True: 365k, False: 2.01M]
  ------------------
 2202|   365k|            {
 2203|   365k|                qp_left = ps_codec->s_parse.ai1_8x8_cu_qp[qpg_x - 1 + (qpg_y * 8)];
 2204|   365k|            }
 2205|  2.38M|            if(qpg_y > 0)
  ------------------
  |  Branch (2205:16): [True: 405k, False: 1.97M]
  ------------------
 2206|   405k|            {
 2207|   405k|                qp_top = ps_codec->s_parse.ai1_8x8_cu_qp[qpg_x + ((qpg_y - 1) * 8)];
 2208|   405k|            }
 2209|       |
 2210|  2.38M|            qp_pred = (qp_left + qp_top + 1) >> 1;
 2211|       |            /* Since qp_pred + ps_codec->s_parse.s_cu.i4_cu_qp_delta can be negative,
 2212|       |            52 is added before taking modulo 52 */
 2213|  2.38M|            qp = ((qp_pred + ps_codec->s_parse.s_cu.i4_cu_qp_delta + 52 + 2 * i4_qp_bd_offset_y) % (52 + i4_qp_bd_offset_y)) -
 2214|  2.38M|                        i4_qp_bd_offset_y;
 2215|       |
 2216|  2.38M|            cur_cu_offset = (cu_pos_x >> 3) + cu_pos_y;
 2217|  6.52M|            for(i = 0; i < (cb_size >> 3); i++)
  ------------------
  |  Branch (2217:24): [True: 4.13M, False: 2.38M]
  ------------------
 2218|  4.13M|            {
 2219|  17.3M|                for(j = 0; j < (cb_size >> 3); j++)
  ------------------
  |  Branch (2219:28): [True: 13.2M, False: 4.13M]
  ------------------
 2220|  13.2M|                {
 2221|  13.2M|                    ps_codec->s_parse.ai1_8x8_cu_qp[cur_cu_offset + (i * 8) + j] = qp;
 2222|  13.2M|                }
 2223|  4.13M|            }
 2224|       |
 2225|  2.38M|            ps_codec->s_parse.u4_qp = qp;
 2226|  2.38M|            ps_codec->s_parse.s_cu.i4_qp = qp;
 2227|       |
 2228|       |
 2229|       |            /* When change in QP is signaled, update the QP in TUs that are already parsed in the CU */
 2230|  2.38M|            {
 2231|  2.38M|                tu_t *ps_tu_tmp;
 2232|  2.38M|                ps_tu_tmp = ps_tu - ps_codec->s_parse.s_cu.i4_tu_cnt;
 2233|  2.38M|                ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 2234|  7.56M|                while(ps_tu_tmp != ps_tu)
  ------------------
  |  Branch (2234:23): [True: 5.17M, False: 2.38M]
  ------------------
 2235|  5.17M|                {
 2236|  5.17M|                    ps_tu_tmp->b7_qp = ps_codec->s_parse.u4_qp;
 2237|       |
 2238|  5.17M|                    ps_tu_tmp++;
 2239|  5.17M|                }
 2240|  2.38M|            }
 2241|  2.38M|            if(ps_codec->s_parse.s_cu.i4_cu_qp_delta)
  ------------------
  |  Branch (2241:16): [True: 692k, False: 1.69M]
  ------------------
 2242|   692k|            {
 2243|   692k|                WORD32 ctb_indx;
 2244|   692k|                ctb_indx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 2245|   692k|                ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb[ctb_indx >> 3] &= (~(1 << (ctb_indx & 7)));
 2246|   692k|            }
 2247|       |
 2248|  2.38M|        }
 2249|       |        /* Populate CU_info maps for current CU*/
 2250|  5.11M|        if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2250:12): [True: 0, False: 5.11M]
  ------------------
 2251|      0|        {
 2252|      0|            WORD32 cu_info_map_stride = ALIGN64(ps_codec->i4_wd) >> 3;
  ------------------
  |  |   50|      0|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2253|      0|            UWORD8 num_8x8_blks = 1 << (log2_cb_size - 3);
 2254|      0|            WORD32 vert_8x8, horz_8x8;
 2255|      0|            UWORD8 *pu1_cur_cu_type_map =
 2256|      0|                ps_codec->as_buf_id_info_map[ps_codec->as_process[0].
 2257|      0|                    i4_cur_pic_buf_id].pu1_cu_type_map;
 2258|      0|            UWORD8 *pu1_cur_qp_map =
 2259|      0|                ps_codec->as_buf_id_info_map[ps_codec->as_process[0].i4_cur_pic_buf_id].pu1_qp_map;
 2260|      0|            UWORD8 *pu1_cur_type_cu = pu1_cur_cu_type_map + (x0 >> 3) +
 2261|      0|                (y0 >> 3) * cu_info_map_stride;
 2262|      0|            UWORD8 *pu1_cur_qp_cu = pu1_cur_qp_map + (x0 >> 3) +
 2263|      0|                (y0 >> 3) * cu_info_map_stride;
 2264|      0|            for(vert_8x8 = 0; vert_8x8 < num_8x8_blks; vert_8x8++)
  ------------------
  |  Branch (2264:31): [True: 0, False: 0]
  ------------------
 2265|      0|            {
 2266|      0|                for(horz_8x8 = 0; horz_8x8 < num_8x8_blks; horz_8x8++)
  ------------------
  |  Branch (2266:35): [True: 0, False: 0]
  ------------------
 2267|      0|                {
 2268|      0|                    pu1_cur_qp_cu[horz_8x8] = qp;
 2269|      0|                    pu1_cur_type_cu[horz_8x8] = ps_codec->s_parse.s_cu.i4_pred_mode;
 2270|      0|                }
 2271|      0|                pu1_cur_qp_cu += cu_info_map_stride;
 2272|      0|                pu1_cur_type_cu += cu_info_map_stride;
 2273|      0|            }
 2274|      0|        }
 2275|       |
 2276|  5.11M|    }
 2277|       |
 2278|       |
 2279|       |
 2280|       |
 2281|  6.65M|    return ret;
 2282|  6.66M|}
ihevcd_parse_sao:
 2305|   492k|{
 2306|   492k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2307|   492k|    sps_t *ps_sps;
 2308|   492k|    sao_t *ps_sao;
 2309|   492k|    WORD32 rx;
 2310|   492k|    WORD32 ry;
 2311|   492k|    WORD32 value;
 2312|   492k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 2313|   492k|    WORD32 sao_merge_left_flag;
 2314|   492k|    WORD32 sao_merge_up_flag;
 2315|   492k|    slice_header_t *ps_slice_hdr;
 2316|   492k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 2317|   492k|    WORD32 ctxt_idx;
 2318|   492k|    WORD32 bit_depth = ps_codec->i4_bit_depth_luma;
 2319|       |
 2320|   492k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base;
 2321|   492k|    ps_slice_hdr += (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|   492k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   492k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2322|       |
 2323|   492k|    ps_sps = (ps_codec->s_parse.ps_sps);
 2324|   492k|    rx = ps_codec->s_parse.i4_ctb_x;
 2325|   492k|    ry = ps_codec->s_parse.i4_ctb_y;
 2326|       |
 2327|   492k|    ps_sao = ps_codec->s_parse.ps_pic_sao + rx + ry * ps_sps->i2_pic_wd_in_ctb;
 2328|       |
 2329|       |    /* Default values */
 2330|   492k|    ps_sao->b3_y_type_idx = 0;
 2331|   492k|    ps_sao->b3_cb_type_idx = 0;
 2332|   492k|    ps_sao->b3_cr_type_idx = 0;
 2333|       |
 2334|   492k|    UNUSED(value);
  ------------------
  |  |   38|   492k|#define UNUSED(x) ((void)(x))
  ------------------
 2335|   492k|    ctxt_idx = IHEVC_CAB_SAO_MERGE;
 2336|   492k|    sao_merge_left_flag = 0;
 2337|   492k|    sao_merge_up_flag = 0;
 2338|   492k|    if(rx > 0)
  ------------------
  |  Branch (2338:8): [True: 392k, False: 100k]
  ------------------
 2339|   392k|    {
 2340|       |        /*TODO:Implemented only for slice. condition for tile is not tested*/
 2341|   392k|        if(((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (2341:13): [True: 390k, False: 1.74k]
  |  Branch (2341:56): [True: 559, False: 1.18k]
  ------------------
 2342|   391k|                        (0 != ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (2342:25): [True: 386k, False: 4.34k]
  ------------------
 2343|   386k|        {
 2344|       |
 2345|   386k|            TRACE_CABAC_CTXT("sao_merge_flag", ps_cabac->u4_range, ctxt_idx);
 2346|   386k|            sao_merge_left_flag = ihevcd_cabac_decode_bin(ps_cabac,
 2347|   386k|                                                          ps_bitstrm,
 2348|   386k|                                                          ctxt_idx);
 2349|   386k|            AEV_TRACE("sao_merge_flag", sao_merge_left_flag, ps_cabac->u4_range);
 2350|   386k|        }
 2351|       |
 2352|   392k|    }
 2353|   492k|    if(ry > 0 && !sao_merge_left_flag)
  ------------------
  |  Branch (2353:8): [True: 370k, False: 121k]
  |  Branch (2353:18): [True: 219k, False: 150k]
  ------------------
 2354|   219k|    {
 2355|   219k|        if((ps_codec->s_parse.i4_ctb_slice_y > 0) && (ps_codec->s_parse.i4_ctb_tile_y > 0))
  ------------------
  |  Branch (2355:12): [True: 215k, False: 4.66k]
  |  Branch (2355:54): [True: 203k, False: 11.5k]
  ------------------
 2356|   203k|        {
 2357|   203k|            TRACE_CABAC_CTXT("sao_merge_flag", ps_cabac->u4_range, ctxt_idx);
 2358|   203k|            sao_merge_up_flag = ihevcd_cabac_decode_bin(ps_cabac,
 2359|   203k|                                                        ps_bitstrm,
 2360|   203k|                                                        ctxt_idx);
 2361|   203k|            AEV_TRACE("sao_merge_flag", sao_merge_up_flag, ps_cabac->u4_range);
 2362|   203k|        }
 2363|   219k|    }
 2364|   492k|    ctxt_idx = IHEVC_CAB_SAO_TYPE;
 2365|       |
 2366|   492k|    if(sao_merge_left_flag)
  ------------------
  |  Branch (2366:8): [True: 187k, False: 304k]
  ------------------
 2367|   187k|    {
 2368|   187k|        *ps_sao = *(ps_sao - 1);
 2369|   187k|    }
 2370|   304k|    else if(sao_merge_up_flag)
  ------------------
  |  Branch (2370:13): [True: 63.2k, False: 241k]
  ------------------
 2371|  63.2k|    {
 2372|  63.2k|        *ps_sao = *(ps_sao - ps_sps->i2_pic_wd_in_ctb);
 2373|  63.2k|    }
 2374|   241k|    else // if(!sao_merge_up_flag && !sao_merge_left_flag)
 2375|   241k|    {
 2376|   241k|        WORD32 c_idx;
 2377|   241k|        WORD32 sao_type_idx = 0;
 2378|   964k|        for(c_idx = 0; c_idx < (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc ? 3 : 1); c_idx++)
  ------------------
  |  Branch (2378:24): [True: 723k, False: 241k]
  |  Branch (2378:33): [True: 963k, False: 1.13k]
  ------------------
 2379|   723k|        {
 2380|   723k|            if((ps_slice_hdr->i1_slice_sao_luma_flag && c_idx == 0) || (ps_slice_hdr->i1_slice_sao_chroma_flag && c_idx > 0))
  ------------------
  |  Branch (2380:17): [True: 655k, False: 67.8k]
  |  Branch (2380:57): [True: 218k, False: 436k]
  |  Branch (2380:73): [True: 449k, False: 54.7k]
  |  Branch (2380:115): [True: 426k, False: 22.6k]
  ------------------
 2381|   645k|            {
 2382|       |
 2383|       |
 2384|       |                /* sao_type_idx will be same for c_idx == 1 and c_idx == 2 - hence not initialized to zero for c_idx == 2*/
 2385|       |
 2386|   645k|                if(c_idx == 0)
  ------------------
  |  Branch (2386:20): [True: 218k, False: 426k]
  ------------------
 2387|   218k|                {
 2388|   218k|                    sao_type_idx = 0;
 2389|   218k|                    TRACE_CABAC_CTXT("sao_type_idx", ps_cabac->u4_range, ctxt_idx);
 2390|   218k|                    sao_type_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2391|       |
 2392|   218k|                    if(sao_type_idx)
  ------------------
  |  Branch (2392:24): [True: 141k, False: 77.5k]
  ------------------
 2393|   141k|                    {
 2394|   141k|                        sao_type_idx += ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2395|   141k|                    }
 2396|   218k|                    AEV_TRACE("sao_type_idx", sao_type_idx,  ps_cabac->u4_range);
 2397|       |
 2398|   218k|                    ps_sao->b3_y_type_idx = sao_type_idx;
 2399|   218k|                }
 2400|   645k|                if(c_idx == 1)
  ------------------
  |  Branch (2400:20): [True: 213k, False: 432k]
  ------------------
 2401|   213k|                {
 2402|   213k|                    sao_type_idx = 0;
 2403|   213k|                    TRACE_CABAC_CTXT("sao_type_idx", ps_cabac->u4_range, ctxt_idx);
 2404|   213k|                    sao_type_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2405|   213k|                    if(sao_type_idx)
  ------------------
  |  Branch (2405:24): [True: 138k, False: 75.1k]
  ------------------
 2406|   138k|                    {
 2407|   138k|                        sao_type_idx += ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2408|   138k|                    }
 2409|       |
 2410|   213k|                    AEV_TRACE("sao_type_idx", sao_type_idx,  ps_cabac->u4_range);
 2411|       |
 2412|   213k|                    ps_sao->b3_cb_type_idx = sao_type_idx;
 2413|   213k|                    ps_sao->b3_cr_type_idx = sao_type_idx;
 2414|   213k|                }
 2415|       |
 2416|   645k|                if(sao_type_idx != 0)
  ------------------
  |  Branch (2416:20): [True: 417k, False: 227k]
  ------------------
 2417|   417k|                {
 2418|   417k|                    WORD32 i;
 2419|   417k|                    WORD32 sao_offset[4];
 2420|   417k|                    WORD32 sao_band_position = 0;
 2421|   417k|                    WORD32 c_max =  (1 << (MIN(bit_depth, 10) - 5)) - 1;
  ------------------
  |  |   43|   417k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 190k, False: 226k]
  |  |  ------------------
  ------------------
 2422|  2.08M|                    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2422:32): [True: 1.67M, False: 417k]
  ------------------
 2423|  1.67M|                    {
 2424|  1.67M|                        sao_offset[i] = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac, ps_bitstrm, c_max);
 2425|  1.67M|                        AEV_TRACE("sao_offset_abs", sao_offset[i], ps_cabac->u4_range);
 2426|       |
 2427|  1.67M|                        if((2 == sao_type_idx) && (i > 1))
  ------------------
  |  Branch (2427:28): [True: 789k, False: 881k]
  |  Branch (2427:51): [True: 394k, False: 394k]
  ------------------
 2428|   394k|                        {
 2429|   394k|                            sao_offset[i] = -sao_offset[i];
 2430|   394k|                        }
 2431|  1.67M|                    }
 2432|       |
 2433|   417k|                    if(sao_type_idx == 1)
  ------------------
  |  Branch (2433:24): [True: 220k, False: 197k]
  ------------------
 2434|   220k|                    {
 2435|  1.10M|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2435:36): [True: 881k, False: 220k]
  ------------------
 2436|   881k|                        {
 2437|   881k|                            if(sao_offset[i] != 0)
  ------------------
  |  Branch (2437:32): [True: 324k, False: 557k]
  ------------------
 2438|   324k|                            {
 2439|   324k|                                value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2440|   324k|                                AEV_TRACE("sao_offset_sign", value, ps_cabac->u4_range);
 2441|       |
 2442|   324k|                                if(value)
  ------------------
  |  Branch (2442:36): [True: 160k, False: 163k]
  ------------------
 2443|   160k|                                {
 2444|   160k|                                    sao_offset[i] = -sao_offset[i];
 2445|   160k|                                }
 2446|   324k|                            }
 2447|   881k|                        }
 2448|   220k|                        value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 5);
 2449|   220k|                        AEV_TRACE("sao_band_position", value, ps_cabac->u4_range);
 2450|       |
 2451|   220k|                        sao_band_position = value;
 2452|   220k|                    }
 2453|   197k|                    else
 2454|   197k|                    {
 2455|   197k|                        if(c_idx == 0)
  ------------------
  |  Branch (2455:28): [True: 61.5k, False: 135k]
  ------------------
 2456|  61.5k|                        {
 2457|  61.5k|                            value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 2);
 2458|  61.5k|                            AEV_TRACE("sao_eo_class", value, ps_cabac->u4_range);
 2459|       |
 2460|  61.5k|                            ps_sao->b3_y_type_idx += value;
 2461|  61.5k|                        }
 2462|       |
 2463|   197k|                        if(c_idx == 1)
  ------------------
  |  Branch (2463:28): [True: 67.8k, False: 129k]
  ------------------
 2464|  67.8k|                        {
 2465|  67.8k|                            value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 2);
 2466|  67.8k|                            AEV_TRACE("sao_eo_class", value, ps_cabac->u4_range);
 2467|       |
 2468|  67.8k|                            ps_sao->b3_cb_type_idx += value;
 2469|  67.8k|                            ps_sao->b3_cr_type_idx += value;
 2470|  67.8k|                        }
 2471|   197k|                    }
 2472|       |
 2473|   417k|                    if(0 == c_idx)
  ------------------
  |  Branch (2473:24): [True: 141k, False: 276k]
  ------------------
 2474|   141k|                    {
 2475|   141k|                        ps_sao->b8_y_offset_1 = sao_offset[0];
 2476|   141k|                        ps_sao->b8_y_offset_2 = sao_offset[1];
 2477|   141k|                        ps_sao->b8_y_offset_3 = sao_offset[2];
 2478|   141k|                        ps_sao->b8_y_offset_4 = sao_offset[3];
 2479|       |
 2480|   141k|                        ps_sao->b5_y_band_pos = sao_band_position;
 2481|   141k|                    }
 2482|   276k|                    else if(1 == c_idx)
  ------------------
  |  Branch (2482:29): [True: 138k, False: 138k]
  ------------------
 2483|   138k|                    {
 2484|   138k|                        ps_sao->b8_cb_offset_1 = sao_offset[0];
 2485|   138k|                        ps_sao->b8_cb_offset_2 = sao_offset[1];
 2486|   138k|                        ps_sao->b8_cb_offset_3 = sao_offset[2];
 2487|   138k|                        ps_sao->b8_cb_offset_4 = sao_offset[3];
 2488|       |
 2489|   138k|                        ps_sao->b5_cb_band_pos = sao_band_position;
 2490|   138k|                    }
 2491|   138k|                    else // 2 == c_idx
 2492|   138k|                    {
 2493|   138k|                        ps_sao->b8_cr_offset_1 = sao_offset[0];
 2494|   138k|                        ps_sao->b8_cr_offset_2 = sao_offset[1];
 2495|   138k|                        ps_sao->b8_cr_offset_3 = sao_offset[2];
 2496|   138k|                        ps_sao->b8_cr_offset_4 = sao_offset[3];
 2497|       |
 2498|   138k|                        ps_sao->b5_cr_band_pos = sao_band_position;
 2499|   138k|                    }
 2500|   417k|                }
 2501|   645k|            }
 2502|       |
 2503|   723k|            bit_depth = ps_codec->i4_bit_depth_chroma;
 2504|   723k|        }
 2505|   241k|    }
 2506|       |
 2507|   492k|    return ret;
 2508|   492k|}
ihevcd_set_ctb_skip:
 2529|  18.4M|{
 2530|  18.4M|    tu_t *ps_tu;
 2531|  18.4M|    pu_t *ps_pu;
 2532|  18.4M|    sps_t *ps_sps = ps_codec->s_parse.ps_sps;
 2533|  18.4M|    WORD32 ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 2534|  18.4M|    WORD32 ctb_skip_wd, ctb_skip_ht;
 2535|  18.4M|    WORD32 rows_remaining, cols_remaining;
 2536|  18.4M|    WORD32 tu_abs_x, tu_abs_y;
 2537|  18.4M|    WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 2538|  18.4M|    UWORD8 *pu1_pic_intra_flag;
 2539|  18.4M|    UWORD32 u4_mask;
 2540|  18.4M|    WORD32 pu_x,pu_y;
 2541|       |
 2542|       |    /* Set pu wd and ht based on whether the ctb is complete or not */
 2543|  18.4M|    rows_remaining = ps_sps->i2_pic_height_in_luma_samples
 2544|  18.4M|                    - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size);
 2545|  18.4M|    ctb_skip_ht = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  18.4M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 17.7M, False: 706k]
  |  |  ------------------
  ------------------
 2546|       |
 2547|  18.4M|    cols_remaining = ps_sps->i2_pic_width_in_luma_samples
 2548|  18.4M|                    - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size);
 2549|  18.4M|    ctb_skip_wd = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  18.4M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 17.5M, False: 919k]
  |  |  ------------------
  ------------------
 2550|       |
 2551|  18.4M|    ps_codec->s_parse.s_cu.i4_pred_mode = PRED_MODE_SKIP;
 2552|  18.4M|    ps_codec->s_parse.s_cu.i4_part_mode = PART_2Nx2N;
 2553|       |
 2554|  80.6M|    for (pu_y = 0; pu_y < ctb_skip_ht ; pu_y += MIN_CU_SIZE)
  ------------------
  |  |  373|  62.1M|#define MIN_CU_SIZE         8
  ------------------
  |  Branch (2554:20): [True: 62.1M, False: 18.4M]
  ------------------
 2555|  62.1M|    {
 2556|   352M|        for (pu_x = 0; pu_x < ctb_skip_wd ; pu_x += MIN_CU_SIZE)
  ------------------
  |  |  373|   289M|#define MIN_CU_SIZE         8
  ------------------
  |  Branch (2556:24): [True: 289M, False: 62.1M]
  ------------------
 2557|   289M|        {
 2558|   289M|            ps_tu = ps_codec->s_parse.ps_tu;
 2559|   289M|            ps_tu->b1_cb_cbf = 0;
 2560|   289M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2561|   289M|            ps_tu->b1_cb_cbf_subtu1 = 0;
 2562|   289M|#endif
 2563|   289M|            ps_tu->b1_cr_cbf = 0;
 2564|   289M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2565|   289M|            ps_tu->b1_cr_cbf_subtu1 = 0;
 2566|   289M|#endif
 2567|   289M|            ps_tu->b1_y_cbf = 0;
 2568|   289M|            ps_tu->b4_pos_x = pu_x >> 2;
 2569|   289M|            ps_tu->b4_pos_y = pu_y >> 2;
 2570|   289M|            ps_tu->b1_transquant_bypass = 0;
 2571|   289M|            ps_tu->b3_size = 1;
 2572|   289M|            ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 2573|   289M|            ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  528|   289M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 2574|   289M|            ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  521|   289M|#define INTRA_PRED_NONE  63
  ------------------
 2575|   289M|#ifdef ENABLE_MAIN_REXT_PROFILE
 2576|   289M|            ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0;
 2577|   289M|            ps_tu->b1_cb_log2_res_sign = 0;
 2578|   289M|            ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0;
 2579|   289M|            ps_tu->b1_cr_log2_res_sign = 0;
 2580|   289M|#endif
 2581|   289M|            ps_tu->b1_first_tu_in_cu = 1;
 2582|       |
 2583|   289M|            ps_codec->s_parse.ps_tu++;
 2584|   289M|            ps_codec->s_parse.s_cu.i4_tu_cnt++;
 2585|   289M|            ps_codec->s_parse.i4_pic_tu_idx++;
 2586|       |
 2587|   289M|            tu_abs_x = (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size) + pu_x;
 2588|   289M|            tu_abs_y = (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size) + pu_y;
 2589|   289M|            pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 2590|   289M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
 2591|   289M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
 2592|   289M|            u4_mask = (LSB_ONES((MIN_CU_SIZE >> 3)) << (((tu_abs_x) / 8) % 8));
  ------------------
  |  |   72|   289M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 2593|   289M|            u4_mask = ~u4_mask;
 2594|   289M|            *pu1_pic_intra_flag &= u4_mask;
 2595|       |
 2596|   289M|            ps_pu = ps_codec->s_parse.ps_pu;
 2597|   289M|            ps_pu->b2_part_idx = 0;
 2598|   289M|            ps_pu->b4_pos_x = pu_x >> 2;
 2599|   289M|            ps_pu->b4_pos_y = pu_y >> 2;
 2600|   289M|            ps_pu->b4_wd = 1;
 2601|   289M|            ps_pu->b4_ht = 1;
 2602|   289M|            ps_pu->b1_intra_flag = 0;
 2603|   289M|            ps_pu->b3_part_mode = ps_codec->s_parse.s_cu.i4_part_mode;
 2604|   289M|            ps_pu->b1_merge_flag = 1;
 2605|   289M|            ps_pu->b3_merge_idx = 0;
 2606|       |
 2607|   289M|            ps_codec->s_parse.ps_pu++;
 2608|   289M|            ps_codec->s_parse.i4_pic_pu_idx++;
 2609|   289M|        }
 2610|  62.1M|    }
 2611|  18.4M|}
ihevcd_parse_slice_data:
 2633|   138k|{
 2634|       |
 2635|   138k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2636|   138k|    WORD32 end_of_slice_flag = 0;
 2637|   138k|    sps_t *ps_sps;
 2638|   138k|    pps_t *ps_pps;
 2639|   138k|    slice_header_t *ps_slice_hdr;
 2640|   138k|    WORD32 end_of_pic;
 2641|   138k|    tile_t *ps_tile, *ps_tile_prev;
 2642|   138k|    WORD32 i;
 2643|   138k|    WORD32 ctb_addr;
 2644|   138k|    WORD32 tile_idx;
 2645|   138k|    WORD32 cabac_init_idc;
 2646|   138k|    WORD32 cabac_init_qp;
 2647|   138k|    WORD32 ctb_size;
 2648|   138k|    WORD32 num_ctb_in_row;
 2649|   138k|    WORD32 num_min4x4_in_ctb;
 2650|   138k|    WORD32 slice_qp;
 2651|   138k|    WORD32 slice_start_ctb_idx;
 2652|   138k|    WORD32 tile_start_ctb_idx;
 2653|       |
 2654|       |
 2655|   138k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base;
 2656|   138k|    ps_pps = ps_codec->s_parse.ps_pps_base;
 2657|   138k|    ps_sps = ps_codec->s_parse.ps_sps_base;
 2658|       |
 2659|       |    /* Get current slice header, pps and sps */
 2660|   138k|    ps_slice_hdr += (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|   138k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   138k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2661|   138k|    ps_pps  += ps_slice_hdr->i1_pps_id;
 2662|   138k|    ps_sps  += ps_pps->i1_sps_id;
 2663|       |
 2664|   138k|    if(0 != ps_codec->s_parse.i4_cur_slice_idx)
  ------------------
  |  Branch (2664:8): [True: 16.2k, False: 122k]
  ------------------
 2665|  16.2k|    {
 2666|  16.2k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2666:12): [True: 6.14k, False: 10.1k]
  ------------------
 2667|  6.14k|        {
 2668|  6.14k|            ps_codec->s_parse.i4_cur_independent_slice_idx =
 2669|  6.14k|                    ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1);
  ------------------
  |  |  153|  6.14k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.14k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2670|  6.14k|        }
 2671|  16.2k|    }
 2672|       |
 2673|       |
 2674|   138k|    ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 2675|   138k|    num_min4x4_in_ctb = (ctb_size / 4) * (ctb_size / 4);
 2676|   138k|    num_ctb_in_row = ps_sps->i2_pic_wd_in_ctb;
 2677|       |
 2678|       |    /* Update the parse context */
 2679|   138k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2679:8): [True: 76.4k, False: 62.3k]
  ------------------
 2680|  76.4k|    {
 2681|  76.4k|        ps_codec->s_parse.i4_ctb_x = ps_slice_hdr->i2_ctb_x;
 2682|  76.4k|        ps_codec->s_parse.i4_ctb_y = ps_slice_hdr->i2_ctb_y;
 2683|  76.4k|    }
 2684|   138k|    ps_codec->s_parse.ps_pps = ps_pps;
 2685|   138k|    ps_codec->s_parse.ps_sps = ps_sps;
 2686|   138k|    ps_codec->s_parse.ps_slice_hdr = ps_slice_hdr;
 2687|       |
 2688|       |    /* Derive Tile positions for the current CTB */
 2689|       |    /* Change this to lookup if required */
 2690|   138k|    ihevcd_get_tile_pos(ps_pps, ps_sps, ps_codec->s_parse.i4_ctb_x,
 2691|   138k|                        ps_codec->s_parse.i4_ctb_y,
 2692|   138k|                        &ps_codec->s_parse.i4_ctb_tile_x,
 2693|   138k|                        &ps_codec->s_parse.i4_ctb_tile_y,
 2694|   138k|                        &tile_idx);
 2695|   138k|    ps_codec->s_parse.ps_tile = ps_pps->ps_tile + tile_idx;
 2696|   138k|    ps_codec->s_parse.i4_cur_tile_idx = tile_idx;
 2697|   138k|    ps_tile = ps_codec->s_parse.ps_tile;
 2698|   138k|    if(tile_idx)
  ------------------
  |  Branch (2698:8): [True: 7.08k, False: 131k]
  ------------------
 2699|  7.08k|        ps_tile_prev = ps_tile - 1;
 2700|   131k|    else
 2701|   131k|        ps_tile_prev = ps_tile;
 2702|       |
 2703|       |    /* If the present slice is dependent, then store the previous
 2704|       |     * independent slices' ctb x and y values for decoding process */
 2705|   138k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2705:8): [True: 76.4k, False: 62.3k]
  ------------------
 2706|  76.4k|    {
 2707|  76.4k|        if(1 == ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2707:12): [True: 6.76k, False: 69.6k]
  ------------------
 2708|  6.76k|        {
 2709|       |            /*If slice is present at the start of a new tile*/
 2710|  6.76k|            if((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (2710:16): [True: 2.92k, False: 3.84k]
  |  Branch (2710:58): [True: 1.35k, False: 1.56k]
  ------------------
 2711|  1.35k|            {
 2712|  1.35k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 2713|  1.35k|                ps_codec->s_parse.i4_ctb_slice_y = 0;
 2714|  1.35k|            }
 2715|  6.76k|        }
 2716|       |
 2717|  76.4k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2717:12): [True: 69.6k, False: 6.76k]
  ------------------
 2718|  69.6k|        {
 2719|  69.6k|            ps_codec->s_parse.i4_ctb_slice_x = 0;
 2720|  69.6k|            ps_codec->s_parse.i4_ctb_slice_y = 0;
 2721|  69.6k|        }
 2722|  76.4k|    }
 2723|       |
 2724|       |    /* Frame level initializations */
 2725|   138k|    if((0 == ps_codec->s_parse.i4_ctb_y) &&
  ------------------
  |  Branch (2725:8): [True: 98.4k, False: 40.2k]
  ------------------
 2726|  98.4k|                    (0 == ps_codec->s_parse.i4_ctb_x))
  ------------------
  |  Branch (2726:21): [True: 71.0k, False: 27.4k]
  ------------------
 2727|  71.0k|    {
 2728|  71.0k|        ret = ihevcd_parse_pic_init(ps_codec);
 2729|  71.0k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  71.0k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 1.15k, False: 69.8k]
  |  |  ------------------
  ------------------
 2730|       |
 2731|  69.8k|        ps_codec->s_parse.pu4_pic_tu_idx[0] = 0;
 2732|  69.8k|        ps_codec->s_parse.pu4_pic_pu_idx[0] = 0;
 2733|  69.8k|        ps_codec->s_parse.i4_cur_independent_slice_idx = 0;
 2734|  69.8k|        ps_codec->s_parse.i4_ctb_tile_x = 0;
 2735|  69.8k|        ps_codec->s_parse.i4_ctb_tile_y = 0;
 2736|  69.8k|    }
 2737|       |
 2738|   137k|    {
 2739|       |        /* Updating the poc list of current slice to ps_mv_buf */
 2740|   137k|        mv_buf_t *ps_mv_buf = ps_codec->s_parse.ps_cur_mv_buf;
 2741|       |
 2742|   137k|        if(ps_slice_hdr->i1_num_ref_idx_l1_active != 0)
  ------------------
  |  Branch (2742:12): [True: 30.3k, False: 107k]
  ------------------
 2743|  30.3k|        {
 2744|  96.1k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (2744:24): [True: 65.7k, False: 30.3k]
  ------------------
 2745|  65.7k|            {
 2746|  65.7k|                ps_mv_buf->ai4_l1_collocated_poc[(ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1))][i] = ((pic_buf_t *)ps_slice_hdr->as_ref_pic_list1[i].pv_pic_buf)->i4_abs_poc;
  ------------------
  |  |  153|  65.7k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  65.7k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2747|  65.7k|                ps_mv_buf->ai1_l1_collocated_poc_lt[(ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1))][i] = ((pic_buf_t *)ps_slice_hdr->as_ref_pic_list1[i].pv_pic_buf)->u1_used_as_ref;
  ------------------
  |  |  153|  65.7k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  65.7k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2748|  65.7k|            }
 2749|  30.3k|        }
 2750|       |
 2751|   137k|        if(ps_slice_hdr->i1_num_ref_idx_l0_active != 0)
  ------------------
  |  Branch (2751:12): [True: 31.7k, False: 105k]
  ------------------
 2752|  31.7k|        {
 2753|  98.4k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (2753:24): [True: 66.6k, False: 31.7k]
  ------------------
 2754|  66.6k|            {
 2755|  66.6k|                ps_mv_buf->ai4_l0_collocated_poc[(ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1))][i] = ((pic_buf_t *)ps_slice_hdr->as_ref_pic_list0[i].pv_pic_buf)->i4_abs_poc;
  ------------------
  |  |  153|  66.6k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  66.6k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2756|  66.6k|                ps_mv_buf->ai1_l0_collocated_poc_lt[(ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1))][i] = ((pic_buf_t *)ps_slice_hdr->as_ref_pic_list0[i].pv_pic_buf)->u1_used_as_ref;
  ------------------
  |  |  153|  66.6k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  66.6k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2757|  66.6k|            }
 2758|  31.7k|        }
 2759|   137k|    }
 2760|       |
 2761|       |    /*Initialize the low delay flag at the beginning of every slice*/
 2762|   137k|    if((0 == ps_codec->s_parse.i4_ctb_slice_x) || (0 == ps_codec->s_parse.i4_ctb_slice_y))
  ------------------
  |  Branch (2762:8): [True: 95.9k, False: 41.6k]
  |  Branch (2762:51): [True: 28.2k, False: 13.4k]
  ------------------
 2763|   124k|    {
 2764|       |        /* Lowdelay flag */
 2765|   124k|        WORD32 cur_poc, ref_list_poc, flag = 1;
 2766|   124k|        cur_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
 2767|   167k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (2767:20): [True: 49.1k, False: 118k]
  ------------------
 2768|  49.1k|        {
 2769|  49.1k|            ref_list_poc = ((mv_buf_t *)ps_slice_hdr->as_ref_pic_list0[i].pv_mv_buf)->i4_abs_poc;
 2770|  49.1k|            if(ref_list_poc > cur_poc)
  ------------------
  |  Branch (2770:16): [True: 5.46k, False: 43.7k]
  ------------------
 2771|  5.46k|            {
 2772|  5.46k|                flag = 0;
 2773|  5.46k|                break;
 2774|  5.46k|            }
 2775|  49.1k|        }
 2776|   124k|        if(flag && (ps_slice_hdr->i1_slice_type == BSLICE))
  ------------------
  |  Branch (2776:12): [True: 118k, False: 5.46k]
  |  Branch (2776:20): [True: 19.5k, False: 99.1k]
  ------------------
 2777|  19.5k|        {
 2778|  54.0k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (2778:24): [True: 36.6k, False: 17.3k]
  ------------------
 2779|  36.6k|            {
 2780|  36.6k|                ref_list_poc = ((mv_buf_t *)ps_slice_hdr->as_ref_pic_list1[i].pv_mv_buf)->i4_abs_poc;
 2781|  36.6k|                if(ref_list_poc > cur_poc)
  ------------------
  |  Branch (2781:20): [True: 2.11k, False: 34.5k]
  ------------------
 2782|  2.11k|                {
 2783|  2.11k|                    flag = 0;
 2784|  2.11k|                    break;
 2785|  2.11k|                }
 2786|  36.6k|            }
 2787|  19.5k|        }
 2788|   124k|        ps_slice_hdr->i1_low_delay_flag = flag;
 2789|   124k|    }
 2790|       |
 2791|       |    /* initialize the cabac init idc based on slice type */
 2792|   137k|    if(ps_slice_hdr->i1_slice_type == ISLICE)
  ------------------
  |  Branch (2792:8): [True: 105k, False: 31.7k]
  ------------------
 2793|   105k|    {
 2794|   105k|        cabac_init_idc = 0;
 2795|   105k|    }
 2796|  31.7k|    else if(ps_slice_hdr->i1_slice_type == PSLICE)
  ------------------
  |  Branch (2796:13): [True: 1.37k, False: 30.3k]
  ------------------
 2797|  1.37k|    {
 2798|  1.37k|        cabac_init_idc = ps_slice_hdr->i1_cabac_init_flag ? 2 : 1;
  ------------------
  |  Branch (2798:26): [True: 597, False: 778]
  ------------------
 2799|  1.37k|    }
 2800|  30.3k|    else
 2801|  30.3k|    {
 2802|  30.3k|        cabac_init_idc = ps_slice_hdr->i1_cabac_init_flag ? 1 : 2;
  ------------------
  |  Branch (2802:26): [True: 9.99k, False: 20.3k]
  ------------------
 2803|  30.3k|    }
 2804|       |
 2805|   137k|    slice_qp = ps_slice_hdr->i1_slice_qp_delta + ps_pps->i1_pic_init_qp;
 2806|   137k|    slice_qp = CLIP3(slice_qp, -(ps_codec->i4_qp_bd_offset_y), 51);
  ------------------
  |  |   40|   137k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 137k]
  |  |  |  Branch (40:53): [True: 0, False: 137k]
  |  |  ------------------
  ------------------
 2807|       |
 2808|       |    /*Update QP value for every indepndent slice or for every dependent slice that begins at the start of a new tile*/
 2809|   137k|    if((0 == ps_slice_hdr->i1_dependent_slice_flag) ||
  ------------------
  |  Branch (2809:8): [True: 127k, False: 10.1k]
  ------------------
 2810|  10.1k|                    ((1 == ps_slice_hdr->i1_dependent_slice_flag) && ((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))))
  ------------------
  |  Branch (2810:22): [True: 10.1k, False: 0]
  |  Branch (2810:71): [True: 4.63k, False: 5.50k]
  |  Branch (2810:113): [True: 1.97k, False: 2.66k]
  ------------------
 2811|   129k|    {
 2812|   129k|        ps_codec->s_parse.u4_qp = slice_qp;
 2813|   129k|    }
 2814|       |
 2815|       |    /*Cabac init at the beginning of a slice*/
 2816|       |    //If the slice is a dependent slice, not present at the start of a tile
 2817|   137k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2817:8): [True: 75.4k, False: 62.1k]
  ------------------
 2818|  75.4k|    {
 2819|  75.4k|        if((1 == ps_slice_hdr->i1_dependent_slice_flag) && (!((ps_codec->s_parse.i4_ctb_tile_x == 0) && (ps_codec->s_parse.i4_ctb_tile_y == 0))))
  ------------------
  |  Branch (2819:12): [True: 6.76k, False: 68.6k]
  |  Branch (2819:63): [True: 2.92k, False: 3.84k]
  |  Branch (2819:105): [True: 1.35k, False: 1.56k]
  ------------------
 2820|  5.40k|        {
 2821|  5.40k|            if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x)))
  ------------------
  |  Branch (2821:16): [True: 4.44k, False: 964]
  |  Branch (2821:71): [True: 964, False: 0]
  |  Branch (2821:118): [True: 481, False: 483]
  ------------------
 2822|  4.92k|            {
 2823|  4.92k|                ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac,
 2824|  4.92k|                                   &ps_codec->s_parse.s_bitstrm);
 2825|  4.92k|            }
 2826|  5.40k|        }
 2827|  70.0k|        else if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x)))
  ------------------
  |  Branch (2827:17): [True: 61.3k, False: 8.65k]
  |  Branch (2827:72): [True: 8.65k, False: 0]
  |  Branch (2827:119): [True: 669, False: 7.99k]
  ------------------
 2828|  62.0k|        {
 2829|  62.0k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2830|  62.0k|            WORD32 ai4_stats[4] = {0};
 2831|  62.0k|#endif
 2832|  62.0k|            cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  62.0k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 62.0k]
  |  |  |  Branch (40:53): [True: 812, False: 61.2k]
  |  |  ------------------
  ------------------
 2833|  62.0k|            ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2834|  62.0k|                                    &ps_codec->s_parse.s_bitstrm,
 2835|  62.0k|                                    cabac_init_qp,
 2836|  62.0k|                                    cabac_init_idc,
 2837|  62.0k|                                    &gau1_ihevc_cab_ctxts[cabac_init_idc][cabac_init_qp][0]
 2838|  62.0k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2839|  62.0k|                                    ,
 2840|  62.0k|                                    ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL
  ------------------
  |  Branch (2840:37): [True: 745, False: 61.2k]
  ------------------
 2841|  62.0k|#endif
 2842|  62.0k|                                    );
 2843|  62.0k|            if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2843:16): [True: 871, False: 61.1k]
  ------------------
 2844|    871|            {
 2845|    871|                ps_codec->i4_slice_error = 1;
 2846|    871|                end_of_slice_flag = 1;
 2847|    871|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2848|    871|            }
 2849|  62.0k|        }
 2850|  75.4k|    }
 2851|       |
 2852|       |
 2853|   137k|    do
 2854|  19.5M|    {
 2855|       |
 2856|  19.5M|        {
 2857|  19.5M|            WORD32 cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 2858|  19.5M|                            + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 2859|  19.5M|            if(1 == ps_codec->i4_num_cores && 0 == cur_ctb_idx % RESET_TU_BUF_NCTB)
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  8.14M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2859:16): [True: 8.14M, False: 11.4M]
  |  Branch (2859:47): [True: 21.7k, False: 8.12M]
  ------------------
 2860|  21.7k|            {
 2861|  21.7k|                ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu;
 2862|  21.7k|                ps_codec->s_parse.i4_pic_tu_idx = 0;
 2863|  21.7k|            }
 2864|  19.5M|        }
 2865|       |
 2866|  19.5M|        end_of_pic = 0;
 2867|       |        /* Section:7.3.7 Coding tree unit syntax */
 2868|       |        /* coding_tree_unit() inlined here */
 2869|       |        /* If number of cores is greater than 1, then add job to the queue */
 2870|       |        //TODO: Dual core implementation might need a different algo for better load balancing
 2871|       |        /* At the start of ctb row parsing in a tile, queue a job for processing the current tile row */
 2872|  19.5M|        ps_codec->s_parse.i4_ctb_num_pcm_blks = 0;
 2873|       |
 2874|       |
 2875|       |        /*At the beginning of each tile-which is not the beginning of a slice, cabac context must be initialized.
 2876|       |         * Hence, check for the tile beginning here */
 2877|  19.5M|        if(((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (2877:13): [True: 1.49M, False: 18.0M]
  |  Branch (2877:55): [True: 125k, False: 1.36M]
  ------------------
 2878|   125k|                        && (!((ps_tile->u1_pos_x == 0) && (ps_tile->u1_pos_y == 0)))
  ------------------
  |  Branch (2878:31): [True: 88.7k, False: 36.5k]
  |  Branch (2878:59): [True: 69.8k, False: 18.8k]
  ------------------
 2879|  55.4k|                        && (!((0 == ps_codec->s_parse.i4_ctb_slice_x) && (0 == ps_codec->s_parse.i4_ctb_slice_y))))
  ------------------
  |  Branch (2879:31): [True: 20.0k, False: 35.3k]
  |  Branch (2879:74): [True: 2.06k, False: 18.0k]
  ------------------
 2880|  53.3k|        {
 2881|  53.3k|            slice_qp = ps_slice_hdr->i1_slice_qp_delta + ps_pps->i1_pic_init_qp;
 2882|  53.3k|            slice_qp = CLIP3(slice_qp, -(ps_codec->i4_qp_bd_offset_y), 51);
  ------------------
  |  |   40|  53.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 53.3k]
  |  |  |  Branch (40:53): [True: 0, False: 53.3k]
  |  |  ------------------
  ------------------
 2883|  53.3k|            ps_codec->s_parse.u4_qp = slice_qp;
 2884|       |
 2885|  53.3k|            ihevcd_get_tile_pos(ps_pps, ps_sps, ps_codec->s_parse.i4_ctb_x,
 2886|  53.3k|                                ps_codec->s_parse.i4_ctb_y,
 2887|  53.3k|                                &ps_codec->s_parse.i4_ctb_tile_x,
 2888|  53.3k|                                &ps_codec->s_parse.i4_ctb_tile_y,
 2889|  53.3k|                                &tile_idx);
 2890|       |
 2891|  53.3k|            ps_codec->s_parse.ps_tile = ps_pps->ps_tile + tile_idx;
 2892|  53.3k|            ps_codec->s_parse.i4_cur_tile_idx = tile_idx;
 2893|  53.3k|            ps_tile_prev = ps_tile - 1;
 2894|       |
 2895|  53.3k|            tile_start_ctb_idx = ps_tile->u1_pos_x
 2896|  53.3k|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 2897|       |
 2898|  53.3k|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 2899|  53.3k|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 2900|       |
 2901|       |            /*For slices that span across multiple tiles*/
 2902|  53.3k|            if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (2902:16): [True: 52.5k, False: 761]
  ------------------
 2903|  52.5k|            {       /* 2 Cases
 2904|       |             * 1 - slice spans across frame-width- but does not start from 1st column
 2905|       |             * 2 - Slice spans across multiple tiles anywhere is a frame
 2906|       |             */
 2907|  52.5k|                ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y - ps_slice_hdr->i2_ctb_y;
 2908|  52.5k|                if(!(((ps_slice_hdr->i2_ctb_x + ps_tile_prev->u2_wd) % ps_sps->i2_pic_wd_in_ctb) == ps_tile->u1_pos_x)) //Case 2
  ------------------
  |  Branch (2908:20): [True: 31.2k, False: 21.3k]
  ------------------
 2909|  31.2k|                {
 2910|  31.2k|                    if(ps_slice_hdr->i2_ctb_y <= ps_tile->u1_pos_y)
  ------------------
  |  Branch (2910:24): [True: 31.2k, False: 0]
  ------------------
 2911|  31.2k|                    {
 2912|       |                        //Check if ctb x is before or after
 2913|  31.2k|                        if(ps_slice_hdr->i2_ctb_x > ps_tile->u1_pos_x)
  ------------------
  |  Branch (2913:28): [True: 881, False: 30.3k]
  ------------------
 2914|    881|                        {
 2915|    881|                            ps_codec->s_parse.i4_ctb_slice_y -= 1;
 2916|    881|                        }
 2917|  31.2k|                    }
 2918|  31.2k|                }
 2919|       |                /*ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y - ps_slice_hdr->i2_ctb_y;
 2920|       |                if (ps_slice_hdr->i2_ctb_y <= ps_tile->u1_pos_y)
 2921|       |                {
 2922|       |                    //Check if ctb x is before or after
 2923|       |                    if (ps_slice_hdr->i2_ctb_x > ps_tile->u1_pos_x )
 2924|       |                    {
 2925|       |                        ps_codec->s_parse.i4_ctb_slice_y -= 1 ;
 2926|       |                    }
 2927|       |                }*/
 2928|  52.5k|            }
 2929|       |
 2930|       |            /* Cabac init is done unconditionally at the start of the tile irrespective
 2931|       |             * of whether it is a dependent or an independent slice */
 2932|  53.3k|            if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2932:16): [True: 4.64k, False: 48.7k]
  ------------------
 2933|  4.64k|            {
 2934|  4.64k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2935|  4.64k|            WORD32 ai4_stats[4] = {0};
 2936|  4.64k|#endif
 2937|  4.64k|                cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  4.64k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 4.64k]
  |  |  |  Branch (40:53): [True: 8, False: 4.64k]
  |  |  ------------------
  ------------------
 2938|  4.64k|                ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2939|  4.64k|                                        &ps_codec->s_parse.s_bitstrm,
 2940|  4.64k|                                        cabac_init_qp,
 2941|  4.64k|                                        cabac_init_idc,
 2942|  4.64k|                                        &gau1_ihevc_cab_ctxts[cabac_init_idc][cabac_init_qp][0]
 2943|  4.64k|#ifdef ENABLE_MAIN_REXT_PROFILE
 2944|  4.64k|                                        ,
 2945|  4.64k|                                        ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL
  ------------------
  |  Branch (2945:41): [True: 222, False: 4.42k]
  ------------------
 2946|  4.64k|#endif
 2947|  4.64k|                                        );
 2948|  4.64k|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2948:20): [True: 140, False: 4.50k]
  ------------------
 2949|    140|                {
 2950|    140|                    ps_codec->i4_slice_error = 1;
 2951|    140|                    end_of_slice_flag = 1;
 2952|    140|                    ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2953|    140|                }
 2954|       |
 2955|  4.64k|            }
 2956|  53.3k|        }
 2957|       |        /* If number of cores is greater than 1, then add job to the queue */
 2958|       |        //TODO: Dual core implementation might need a different algo for better load balancing
 2959|       |        /* At the start of ctb row parsing in a tile, queue a job for processing the current tile row */
 2960|       |
 2961|  19.5M|        if(0 == ps_codec->s_parse.i4_ctb_tile_x)
  ------------------
  |  Branch (2961:12): [True: 1.49M, False: 18.0M]
  ------------------
 2962|  1.49M|        {
 2963|       |
 2964|  1.49M|            if(1 < ps_codec->i4_num_cores)
  ------------------
  |  Branch (2964:16): [True: 898k, False: 594k]
  ------------------
 2965|   898k|            {
 2966|   898k|                proc_job_t s_job;
 2967|   898k|                IHEVCD_ERROR_T ret;
 2968|   898k|                s_job.i4_cmd    = CMD_PROCESS;
 2969|   898k|                s_job.i2_ctb_cnt = (WORD16)ps_tile->u2_wd;
 2970|   898k|                s_job.i2_ctb_x = (WORD16)ps_codec->s_parse.i4_ctb_x;
 2971|   898k|                s_job.i2_ctb_y = (WORD16)ps_codec->s_parse.i4_ctb_y;
 2972|   898k|                s_job.i2_slice_idx = (WORD16)ps_codec->s_parse.i4_cur_slice_idx;
 2973|   898k|                s_job.i4_tu_coeff_data_ofst = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data -
 2974|   898k|                                (UWORD8 *)ps_codec->s_parse.pv_pic_tu_coeff_data;
 2975|   898k|                ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq, &s_job, sizeof(proc_job_t), 1);
 2976|       |
 2977|   898k|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2977:20): [True: 0, False: 898k]
  ------------------
 2978|      0|                    return ret;
 2979|   898k|            }
 2980|   594k|            else
 2981|   594k|            {
 2982|   594k|                process_ctxt_t *ps_proc = &ps_codec->as_process[0];
 2983|   594k|                WORD32 tu_coeff_data_ofst = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data -
 2984|   594k|                                (UWORD8 *)ps_codec->s_parse.pv_pic_tu_coeff_data;
 2985|       |
 2986|       |                /* If the codec is running in single core mode,
 2987|       |                 * initialize zeroth process context
 2988|       |                 * TODO: Dual core mode might need a different implementation instead of jobq
 2989|       |                 */
 2990|       |
 2991|   594k|                ps_proc->i4_ctb_cnt = ps_tile->u2_wd;
 2992|   594k|                ps_proc->i4_ctb_x   = ps_codec->s_parse.i4_ctb_x;
 2993|   594k|                ps_proc->i4_ctb_y   = ps_codec->s_parse.i4_ctb_y;
 2994|   594k|                ps_proc->i4_cur_slice_idx = ps_codec->s_parse.i4_cur_slice_idx;
 2995|       |
 2996|   594k|                ihevcd_init_proc_ctxt(ps_proc, tu_coeff_data_ofst);
 2997|   594k|            }
 2998|  1.49M|        }
 2999|       |
 3000|       |
 3001|       |        /* Restore cabac context model from top right CTB if entropy sync is enabled */
 3002|  19.5M|        if(ps_pps->i1_entropy_coding_sync_enabled_flag)
  ------------------
  |  Branch (3002:12): [True: 2.16M, False: 17.3M]
  ------------------
 3003|  2.16M|        {
 3004|       |            /*TODO Handle single CTB and top-right belonging to a different slice */
 3005|  2.16M|            if(0 == ps_codec->s_parse.i4_ctb_x && 0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3005:16): [True: 55.9k, False: 2.10M]
  |  Branch (3005:51): [True: 11.9k, False: 44.0k]
  ------------------
 3006|  11.9k|            {
 3007|       |                //WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models);
 3008|  11.9k|                WORD32 default_ctxt = 0;
 3009|       |
 3010|  11.9k|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) && (!ps_slice_hdr->i1_dependent_slice_flag))
  ------------------
  |  Branch (3010:20): [True: 8.00k, False: 3.93k]
  |  Branch (3010:63): [True: 7.43k, False: 563]
  ------------------
 3011|  7.43k|                    default_ctxt = 1;
 3012|  11.9k|                if(1 == ps_sps->i2_pic_wd_in_ctb)
  ------------------
  |  Branch (3012:20): [True: 5.64k, False: 6.28k]
  ------------------
 3013|  5.64k|                    default_ctxt = 1;
 3014|       |
 3015|  11.9k|                ps_codec->s_parse.u4_qp = slice_qp;
 3016|  11.9k|                if(default_ctxt)
  ------------------
  |  Branch (3016:20): [True: 9.27k, False: 2.65k]
  ------------------
 3017|  9.27k|                {
 3018|  9.27k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3019|  9.27k|                    WORD32 ai4_stats[4] = {0};
 3020|  9.27k|#endif
 3021|       |                    //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0], size);
 3022|  9.27k|                    cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  9.27k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 9.27k]
  |  |  |  Branch (40:53): [True: 87, False: 9.18k]
  |  |  ------------------
  ------------------
 3023|  9.27k|                    ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 3024|  9.27k|                                            &ps_codec->s_parse.s_bitstrm,
 3025|  9.27k|                                            cabac_init_qp,
 3026|  9.27k|                                            cabac_init_idc,
 3027|  9.27k|                                            &gau1_ihevc_cab_ctxts[cabac_init_idc][cabac_init_qp][0]
 3028|  9.27k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3029|  9.27k|                                            ,
 3030|  9.27k|                                            ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL
  ------------------
  |  Branch (3030:45): [True: 306, False: 8.96k]
  ------------------
 3031|  9.27k|#endif
 3032|  9.27k|                                            );
 3033|       |
 3034|  9.27k|                    if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (3034:24): [True: 446, False: 8.82k]
  ------------------
 3035|    446|                    {
 3036|    446|                        ps_codec->i4_slice_error = 1;
 3037|    446|                        end_of_slice_flag = 1;
 3038|    446|                        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3039|    446|                    }
 3040|  9.27k|                }
 3041|  2.65k|                else
 3042|  2.65k|                {
 3043|       |                    //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, size);
 3044|  2.65k|                    cabac_init_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  2.65k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 2.65k]
  |  |  |  Branch (40:53): [True: 10, False: 2.64k]
  |  |  ------------------
  ------------------
 3045|  2.65k|                    ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 3046|  2.65k|                                            &ps_codec->s_parse.s_bitstrm,
 3047|  2.65k|                                            cabac_init_qp,
 3048|  2.65k|                                            cabac_init_idc,
 3049|  2.65k|                                            (const UWORD8 *)&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync
 3050|  2.65k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3051|  2.65k|                                            ,
 3052|  2.65k|                                            ps_sps->i1_persistent_rice_adaptation_enabled_flag ?
  ------------------
  |  Branch (3052:45): [True: 340, False: 2.31k]
  ------------------
 3053|    340|                                                            ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync :
 3054|  2.65k|                                                            NULL
 3055|  2.65k|#endif
 3056|  2.65k|                                            );
 3057|       |
 3058|  2.65k|                    if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (3058:24): [True: 122, False: 2.53k]
  ------------------
 3059|    122|                    {
 3060|    122|                        ps_codec->i4_slice_error = 1;
 3061|    122|                        end_of_slice_flag = 1;
 3062|    122|                        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3063|    122|                    }
 3064|  2.65k|                }
 3065|  11.9k|            }
 3066|  2.16M|        }
 3067|       |
 3068|       |
 3069|       |
 3070|  19.5M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3070:12): [True: 1.05M, False: 18.4M]
  ------------------
 3071|  1.05M|        {
 3072|  1.05M|            if(ps_slice_hdr->i1_slice_sao_luma_flag || ps_slice_hdr->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (3072:16): [True: 458k, False: 599k]
  |  Branch (3072:56): [True: 33.7k, False: 566k]
  ------------------
 3073|   492k|                ihevcd_parse_sao(ps_codec);
 3074|  1.05M|        }
 3075|  18.4M|        else
 3076|  18.4M|        {
 3077|  18.4M|            sao_t *ps_sao = ps_codec->s_parse.ps_pic_sao +
 3078|  18.4M|                            ps_codec->s_parse.i4_ctb_x +
 3079|  18.4M|                            ps_codec->s_parse.i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3080|       |
 3081|       |            /* Default values */
 3082|  18.4M|            ps_sao->b3_y_type_idx = 0;
 3083|  18.4M|            ps_sao->b3_cb_type_idx = 0;
 3084|  18.4M|            ps_sao->b3_cr_type_idx = 0;
 3085|  18.4M|        }
 3086|       |
 3087|       |        //AEV_TRACE("CTB x", ps_codec->s_parse.i4_ctb_x, 0);
 3088|       |        //AEV_TRACE("CTB y", ps_codec->s_parse.i4_ctb_y, 0);
 3089|       |
 3090|  19.5M|        {
 3091|  19.5M|            WORD32 ctb_indx;
 3092|  19.5M|            ctb_indx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 3093|  19.5M|            ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb[ctb_indx >> 3] |= (1 << (ctb_indx & 7));
 3094|  19.5M|            {
 3095|  19.5M|                UWORD16 *pu1_slice_idx = ps_codec->s_parse.pu1_slice_idx;
 3096|  19.5M|                pu1_slice_idx[ctb_indx] = ps_codec->s_parse.i4_cur_independent_slice_idx;
 3097|  19.5M|            }
 3098|  19.5M|        }
 3099|       |
 3100|  19.5M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3100:12): [True: 1.05M, False: 18.4M]
  ------------------
 3101|  1.05M|        {
 3102|  1.05M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 3103|  1.05M|            WORD32 i4_tu_cnt = ps_codec->s_parse.s_cu.i4_tu_cnt;
 3104|  1.05M|            WORD32 i4_pic_tu_idx = ps_codec->s_parse.i4_pic_tu_idx;
 3105|       |
 3106|  1.05M|            pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 3107|  1.05M|            WORD32 i4_pic_pu_idx = ps_codec->s_parse.i4_pic_pu_idx;
 3108|       |
 3109|  1.05M|            UWORD8 *pu1_tu_coeff_data = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
 3110|       |
 3111|  1.05M|            ret = ihevcd_parse_coding_quadtree(ps_codec,
 3112|  1.05M|                                               (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size),
 3113|  1.05M|                                               (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size),
 3114|  1.05M|                                               ps_sps->i1_log2_ctb_size,
 3115|  1.05M|                                               0);
 3116|       |            /* Check for error */
 3117|  1.05M|            if (ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (3117:17): [True: 1.12k, False: 1.05M]
  ------------------
 3118|  1.12k|            {
 3119|       |                /* Reset tu and pu parameters, and signal current ctb as skip */
 3120|  1.12k|                WORD32 tu_coeff_data_reset_size;
 3121|       |
 3122|  1.12k|                ps_codec->s_parse.ps_tu = ps_tu;
 3123|  1.12k|                ps_codec->s_parse.s_cu.i4_tu_cnt = i4_tu_cnt;
 3124|  1.12k|                ps_codec->s_parse.i4_pic_tu_idx = i4_pic_tu_idx;
 3125|       |
 3126|  1.12k|                ps_codec->s_parse.ps_pu = ps_pu;
 3127|  1.12k|                ps_codec->s_parse.i4_pic_pu_idx = i4_pic_pu_idx;
 3128|       |
 3129|  1.12k|                tu_coeff_data_reset_size = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data - pu1_tu_coeff_data;
 3130|  1.12k|                memset(pu1_tu_coeff_data, 0, tu_coeff_data_reset_size);
 3131|  1.12k|                ps_codec->s_parse.pv_tu_coeff_data = (void *)pu1_tu_coeff_data;
 3132|       |
 3133|  1.12k|                ihevcd_set_ctb_skip(ps_codec);
 3134|       |
 3135|       |                /* Set slice error to suppress further parsing and
 3136|       |                 * signal end of slice.
 3137|       |                 */
 3138|  1.12k|                ps_codec->i4_slice_error = 1;
 3139|  1.12k|                end_of_slice_flag = 1;
 3140|  1.12k|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3141|  1.12k|            }
 3142|  1.05M|        }
 3143|  18.4M|        else
 3144|  18.4M|        {
 3145|  18.4M|            ihevcd_set_ctb_skip(ps_codec);
 3146|  18.4M|        }
 3147|       |
 3148|  19.5M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3148:12): [True: 1.05M, False: 18.4M]
  ------------------
 3149|  1.05M|            end_of_slice_flag = ihevcd_cabac_decode_terminate(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm);
 3150|       |
 3151|  19.5M|        AEV_TRACE("end_of_slice_flag", end_of_slice_flag, ps_codec->s_parse.s_cabac.u4_range);
 3152|       |
 3153|       |
 3154|       |        /* In case of tiles or entropy sync, terminate cabac and copy cabac context backed up at the end of top-right CTB */
 3155|  19.5M|        if(ps_pps->i1_tiles_enabled_flag || ps_pps->i1_entropy_coding_sync_enabled_flag)
  ------------------
  |  Branch (3155:12): [True: 6.07M, False: 13.4M]
  |  Branch (3155:45): [True: 165k, False: 13.3M]
  ------------------
 3156|  6.23M|        {
 3157|  6.23M|            WORD32 end_of_tile = 0;
 3158|  6.23M|            WORD32 end_of_tile_row = 0;
 3159|       |
 3160|       |            /* Take a back up of cabac context models if entropy sync is enabled */
 3161|  6.23M|            if(ps_pps->i1_entropy_coding_sync_enabled_flag || ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3161:16): [True: 2.16M, False: 4.07M]
  |  Branch (3161:63): [True: 4.07M, False: 0]
  ------------------
 3162|  6.23M|            {
 3163|  6.23M|                if(1 == ps_codec->s_parse.i4_ctb_x)
  ------------------
  |  Branch (3163:20): [True: 136k, False: 6.10M]
  ------------------
 3164|   136k|                {
 3165|   136k|                    WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models);
 3166|   136k|                    memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, &ps_codec->s_parse.s_cabac.au1_ctxt_models, size);
 3167|       |
 3168|   136k|#ifdef ENABLE_MAIN_REXT_PROFILE
 3169|   136k|                    size = sizeof(ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync);
 3170|   136k|                    memcpy(&ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync, &ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff, size);
 3171|   136k|#endif
 3172|   136k|                }
 3173|  6.23M|            }
 3174|       |
 3175|       |            /* Since tiles and entropy sync are not enabled simultaneously, the following will not result in any problems */
 3176|  6.23M|            if((ps_codec->s_parse.i4_ctb_tile_x + 1) == (ps_tile->u2_wd))
  ------------------
  |  Branch (3176:16): [True: 605k, False: 5.63M]
  ------------------
 3177|   605k|            {
 3178|   605k|                end_of_tile_row = 1;
 3179|   605k|                if((ps_codec->s_parse.i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (3179:20): [True: 67.7k, False: 537k]
  ------------------
 3180|  67.7k|                    end_of_tile = 1;
 3181|   605k|            }
 3182|  6.23M|            if((0 == end_of_slice_flag) && (0 == ps_codec->i4_slice_error) &&
  ------------------
  |  Branch (3182:16): [True: 6.23M, False: 4.86k]
  |  Branch (3182:44): [True: 272k, False: 5.96M]
  ------------------
 3183|   272k|                            ((ps_pps->i1_tiles_enabled_flag && end_of_tile) ||
  ------------------
  |  Branch (3183:31): [True: 264k, False: 7.80k]
  |  Branch (3183:64): [True: 6.88k, False: 257k]
  ------------------
 3184|   265k|                                            (ps_pps->i1_entropy_coding_sync_enabled_flag && end_of_tile_row)))
  ------------------
  |  Branch (3184:46): [True: 23.8k, False: 241k]
  |  Branch (3184:93): [True: 8.25k, False: 15.6k]
  ------------------
 3185|  15.1k|            {
 3186|  15.1k|                WORD32 end_of_sub_stream_one_bit;
 3187|  15.1k|                end_of_sub_stream_one_bit = ihevcd_cabac_decode_terminate(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm);
 3188|  15.1k|                AEV_TRACE("end_of_sub_stream_one_bit", end_of_sub_stream_one_bit, ps_codec->s_parse.s_cabac.u4_range);
 3189|       |
 3190|       |                /* TODO: Remove the check for offset when HM is updated to include a byte unconditionally even for aligned location */
 3191|       |                /* For Ittiam streams this check should not be there, for HM9.1 streams this should be there */
 3192|  15.1k|                if(ps_codec->s_parse.s_bitstrm.u4_bit_ofst % 8)
  ------------------
  |  Branch (3192:20): [True: 11.6k, False: 3.53k]
  ------------------
 3193|  11.6k|                    ihevcd_bits_flush_to_byte_boundary(&ps_codec->s_parse.s_bitstrm);
 3194|       |
 3195|  15.1k|                UNUSED(end_of_sub_stream_one_bit);
  ------------------
  |  |   38|  15.1k|#define UNUSED(x) ((void)(x))
  ------------------
 3196|  15.1k|            }
 3197|  6.23M|        }
 3198|  19.5M|        {
 3199|  19.5M|            WORD32 ctb_indx;
 3200|       |
 3201|  19.5M|            ctb_addr = ps_codec->s_parse.i4_ctb_y * num_ctb_in_row + ps_codec->s_parse.i4_ctb_x;
 3202|       |
 3203|  19.5M|            ctb_indx = ++ctb_addr;
 3204|       |
 3205|       |            /* Store pu_idx for next CTB in frame level pu_idx array */
 3206|       |
 3207|       |            //In case of multiple tiles, if end-of-tile row is reached
 3208|  19.5M|            if((ps_tile->u2_wd == (ps_codec->s_parse.i4_ctb_tile_x + 1)) && (ps_tile->u2_wd != ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (3208:16): [True: 1.49M, False: 18.0M]
  |  Branch (3208:77): [True: 523k, False: 970k]
  ------------------
 3209|   523k|            {
 3210|   523k|                ctb_indx = (ps_sps->i2_pic_wd_in_ctb * (ps_codec->s_parse.i4_ctb_tile_y + 1 + ps_tile->u1_pos_y)) + ps_tile->u1_pos_x; //idx is the beginning of next row in current tile.
 3211|   523k|                if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (3211:20): [True: 44.7k, False: 478k]
  ------------------
 3212|  44.7k|                {
 3213|       |                    //If the current ctb is the last tile's last ctb
 3214|  44.7k|                    if((ps_tile->u2_wd + ps_tile->u1_pos_x == ps_sps->i2_pic_wd_in_ctb) && ((ps_tile->u2_ht + ps_tile->u1_pos_y == ps_sps->i2_pic_ht_in_ctb)))
  ------------------
  |  Branch (3214:24): [True: 8.15k, False: 36.5k]
  |  Branch (3214:92): [True: 3.80k, False: 4.35k]
  ------------------
 3215|  3.80k|                    {
 3216|  3.80k|                        ctb_indx = ctb_addr; //Next continuous ctb address
 3217|  3.80k|                    }
 3218|  40.9k|                    else //Not last tile's end , but a tile end
 3219|  40.9k|                    {
 3220|  40.9k|                        tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 3221|  40.9k|                        ctb_indx = ps_next_tile->u1_pos_x + (ps_next_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb); //idx is the beginning of first row in next tile.
 3222|  40.9k|                    }
 3223|  44.7k|                }
 3224|   523k|            }
 3225|       |
 3226|  19.5M|            ps_codec->s_parse.pu4_pic_pu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_pu_idx;
 3227|  19.5M|            ps_codec->s_parse.i4_next_pu_ctb_cnt = ctb_indx;
 3228|       |
 3229|  19.5M|            ps_codec->s_parse.pu1_pu_map += num_min4x4_in_ctb;
 3230|       |
 3231|       |            /* Store tu_idx for next CTB in frame level tu_idx array */
 3232|  19.5M|            if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (3232:16): [True: 8.14M, False: 11.4M]
  ------------------
 3233|  8.14M|            {
 3234|  8.14M|                ctb_indx = (0 == ctb_addr % RESET_TU_BUF_NCTB) ?
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  8.14M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3234:28): [True: 0, False: 8.14M]
  ------------------
 3235|  8.14M|                                RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  175|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|      0|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                              RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  16.2M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3236|       |
 3237|       |                //In case of multiple tiles, if end-of-tile row is reached
 3238|  8.14M|                if((ps_tile->u2_wd == (ps_codec->s_parse.i4_ctb_tile_x + 1)) && (ps_tile->u2_wd != ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (3238:20): [True: 594k, False: 7.54M]
  |  Branch (3238:81): [True: 277k, False: 317k]
  ------------------
 3239|   277k|                {
 3240|   277k|                    ctb_indx = (ps_sps->i2_pic_wd_in_ctb * (ps_codec->s_parse.i4_ctb_tile_y + 1 + ps_tile->u1_pos_y)) + ps_tile->u1_pos_x; //idx is the beginning of next row in current tile.
 3241|   277k|                    if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (3241:24): [True: 23.4k, False: 253k]
  ------------------
 3242|  23.4k|                    {
 3243|       |                        //If the current ctb is the last tile's last ctb
 3244|  23.4k|                        if((ps_tile->u2_wd + ps_tile->u1_pos_x == ps_sps->i2_pic_wd_in_ctb) && ((ps_tile->u2_ht + ps_tile->u1_pos_y == ps_sps->i2_pic_ht_in_ctb)))
  ------------------
  |  Branch (3244:28): [True: 3.14k, False: 20.3k]
  |  Branch (3244:96): [True: 1.44k, False: 1.69k]
  ------------------
 3245|  1.44k|                        {
 3246|  1.44k|                            ctb_indx = (0 == ctb_addr % RESET_TU_BUF_NCTB) ?
  ------------------
  |  |  175|  1.44k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  1.44k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  1.44k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  1.44k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.44k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.44k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3246:40): [True: 0, False: 1.44k]
  ------------------
 3247|  1.44k|                                            RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  175|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|      0|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                                          RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  175|  1.44k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  2.89k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  1.44k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  1.44k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.44k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  1.44k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3248|  1.44k|                        }
 3249|  22.0k|                        else  //Not last tile's end , but a tile end
 3250|  22.0k|                        {
 3251|  22.0k|                            tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 3252|  22.0k|                            ctb_indx =  ps_next_tile->u1_pos_x + (ps_next_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb); //idx is the beginning of first row in next tile.
 3253|  22.0k|                        }
 3254|  23.4k|                    }
 3255|   277k|                }
 3256|  8.14M|                ps_codec->s_parse.i4_next_tu_ctb_cnt = ctb_indx;
 3257|  8.14M|                ps_codec->s_parse.pu4_pic_tu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_tu_idx;
 3258|  8.14M|            }
 3259|  11.4M|            else
 3260|  11.4M|            {
 3261|  11.4M|                ctb_indx = ctb_addr;
 3262|  11.4M|                if((ps_tile->u2_wd == (ps_codec->s_parse.i4_ctb_tile_x + 1)) && (ps_tile->u2_wd != ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (3262:20): [True: 898k, False: 10.5M]
  |  Branch (3262:81): [True: 245k, False: 652k]
  ------------------
 3263|   245k|                {
 3264|   245k|                    ctb_indx = (ps_sps->i2_pic_wd_in_ctb * (ps_codec->s_parse.i4_ctb_tile_y + 1 + ps_tile->u1_pos_y)) + ps_tile->u1_pos_x; //idx is the beginning of next row in current tile.
 3265|   245k|                    if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (3265:24): [True: 21.2k, False: 224k]
  ------------------
 3266|  21.2k|                    {
 3267|       |                        //If the current ctb is the last tile's last ctb
 3268|  21.2k|                        if((ps_tile->u2_wd + ps_tile->u1_pos_x == ps_sps->i2_pic_wd_in_ctb) && ((ps_tile->u2_ht + ps_tile->u1_pos_y == ps_sps->i2_pic_ht_in_ctb)))
  ------------------
  |  Branch (3268:28): [True: 5.01k, False: 16.2k]
  |  Branch (3268:96): [True: 2.35k, False: 2.66k]
  ------------------
 3269|  2.35k|                        {
 3270|  2.35k|                            ctb_indx = ctb_addr;
 3271|  2.35k|                        }
 3272|  18.9k|                        else  //Not last tile's end , but a tile end
 3273|  18.9k|                        {
 3274|  18.9k|                            tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 3275|  18.9k|                            ctb_indx =  ps_next_tile->u1_pos_x + (ps_next_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb); //idx is the beginning of first row in next tile.
 3276|  18.9k|                        }
 3277|  21.2k|                    }
 3278|   245k|                }
 3279|  11.4M|                ps_codec->s_parse.i4_next_tu_ctb_cnt = ctb_indx;
 3280|  11.4M|                ps_codec->s_parse.pu4_pic_tu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_tu_idx;
 3281|  11.4M|            }
 3282|  19.5M|            ps_codec->s_parse.pu1_tu_map += num_min4x4_in_ctb;
 3283|  19.5M|        }
 3284|       |
 3285|       |        /* QP array population has to be done if deblocking is enabled in the picture
 3286|       |         * but some of the slices in the pic have it disabled */
 3287|  19.5M|        if((0 != ps_codec->i4_disable_deblk_pic) &&
  ------------------
  |  Branch (3287:12): [True: 0, False: 19.5M]
  ------------------
 3288|      0|                (1 == ps_slice_hdr->i1_slice_disable_deblocking_filter_flag))
  ------------------
  |  Branch (3288:17): [True: 0, False: 0]
  ------------------
 3289|      0|        {
 3290|      0|            bs_ctxt_t *ps_bs_ctxt = &ps_codec->s_parse.s_bs_ctxt;
 3291|      0|            WORD32 log2_ctb_size = ps_sps->i1_log2_ctb_size;
 3292|      0|            WORD8 *pi1_qp;
 3293|      0|            WORD32 qp_strd;
 3294|      0|            WORD32 u4_qp_const_in_ctb;
 3295|      0|            WORD32 cur_ctb_idx;
 3296|      0|            WORD32 next_ctb_idx;
 3297|      0|            WORD32 cur_tu_idx;
 3298|      0|            WORD32 i4_ctb_tu_cnt;
 3299|      0|            tu_t *ps_tu;
 3300|       |
 3301|      0|            cur_ctb_idx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 3302|       |            /* ctb_size/8 elements per CTB */
 3303|      0|            qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
 3304|      0|            pi1_qp = ps_bs_ctxt->pi1_pic_qp + ((ps_codec->s_parse.i4_ctb_x + ps_codec->s_parse.i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
 3305|       |
 3306|      0|            u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[cur_ctb_idx >> 3] & (1 << (cur_ctb_idx & 7));
 3307|       |
 3308|      0|            next_ctb_idx = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3309|      0|            if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (3309:16): [True: 0, False: 0]
  ------------------
 3310|      0|            {
 3311|      0|                i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3312|      0|                                ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|      0|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3313|       |
 3314|      0|                cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|      0|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|      0|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|      0|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3315|      0|            }
 3316|      0|            else
 3317|      0|            {
 3318|      0|                i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3319|      0|                                ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3320|       |
 3321|      0|                cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3322|      0|            }
 3323|       |
 3324|      0|            ps_tu = &ps_codec->s_parse.ps_pic_tu[cur_tu_idx];
 3325|       |
 3326|      0|            if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (3326:16): [True: 0, False: 0]
  ------------------
 3327|      0|            {
 3328|      0|                pi1_qp[0] = ps_tu->b7_qp;
 3329|      0|            }
 3330|      0|            else
 3331|      0|            {
 3332|      0|                for(i = 0; i < i4_ctb_tu_cnt; i++, ps_tu++)
  ------------------
  |  Branch (3332:28): [True: 0, False: 0]
  ------------------
 3333|      0|                {
 3334|      0|                    WORD32 start_pos_x;
 3335|      0|                    WORD32 start_pos_y;
 3336|      0|                    WORD32 tu_size;
 3337|       |
 3338|       |                    /* start_pos_x and start_pos_y are in units of min TU size (4x4) */
 3339|      0|                    start_pos_x = ps_tu->b4_pos_x;
 3340|      0|                    start_pos_y = ps_tu->b4_pos_y;
 3341|       |
 3342|      0|                    tu_size = 1 << (ps_tu->b3_size + 2);
 3343|      0|                    tu_size >>= 2; /* TU size divided by 4 */
 3344|       |
 3345|      0|                    if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (3345:24): [True: 0, False: 0]
  |  Branch (3345:50): [True: 0, False: 0]
  ------------------
 3346|      0|                    {
 3347|      0|                        WORD32 row, col;
 3348|      0|                        for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (3348:48): [True: 0, False: 0]
  ------------------
 3349|      0|                        {
 3350|      0|                            for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (3350:52): [True: 0, False: 0]
  ------------------
 3351|      0|                            {
 3352|      0|                                pi1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
 3353|      0|                            }
 3354|      0|                        }
 3355|      0|                    }
 3356|      0|                }
 3357|      0|            }
 3358|      0|        }
 3359|       |
 3360|  19.5M|        if(ps_codec->i4_num_cores <= MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  19.5M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (3360:12): [True: 11.7M, False: 7.77M]
  ------------------
 3361|  11.7M|        {
 3362|       |            /*************************************************/
 3363|       |            /****************   MV pred **********************/
 3364|       |            /*************************************************/
 3365|  11.7M|            WORD8 u1_top_ctb_avail = 1;
 3366|  11.7M|            WORD8 u1_left_ctb_avail = 1;
 3367|  11.7M|            WORD8 u1_top_lt_ctb_avail = 1;
 3368|  11.7M|            WORD8 u1_top_rt_ctb_avail = 1;
 3369|  11.7M|            WORD16 i2_wd_in_ctb;
 3370|       |
 3371|  11.7M|            tile_start_ctb_idx = ps_tile->u1_pos_x
 3372|  11.7M|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 3373|       |
 3374|  11.7M|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 3375|  11.7M|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3376|       |
 3377|  11.7M|            if((slice_start_ctb_idx < tile_start_ctb_idx))
  ------------------
  |  Branch (3377:16): [True: 1.72M, False: 10.0M]
  ------------------
 3378|  1.72M|            {
 3379|       |                //Slices span across multiple tiles.
 3380|  1.72M|                i2_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
 3381|  1.72M|            }
 3382|  10.0M|            else
 3383|  10.0M|            {
 3384|  10.0M|                i2_wd_in_ctb = ps_tile->u2_wd;
 3385|  10.0M|            }
 3386|       |            /* slice and tile boundaries */
 3387|  11.7M|            if((0 == ps_codec->s_parse.i4_ctb_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3387:16): [True: 404k, False: 11.3M]
  |  Branch (3387:53): [True: 128k, False: 11.2M]
  ------------------
 3388|   533k|            {
 3389|   533k|                u1_top_ctb_avail = 0;
 3390|   533k|                u1_top_lt_ctb_avail = 0;
 3391|   533k|                u1_top_rt_ctb_avail = 0;
 3392|   533k|            }
 3393|       |
 3394|  11.7M|            if((0 == ps_codec->s_parse.i4_ctb_x) || (0 == ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (3394:16): [True: 689k, False: 11.0M]
  |  Branch (3394:53): [True: 293k, False: 10.7M]
  ------------------
 3395|   982k|            {
 3396|   982k|                u1_left_ctb_avail = 0;
 3397|   982k|                u1_top_lt_ctb_avail = 0;
 3398|   982k|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3398:20): [True: 66.9k, False: 915k]
  |  Branch (3398:63): [True: 32.0k, False: 883k]
  ------------------
 3399|  99.0k|                {
 3400|  99.0k|                    u1_top_ctb_avail = 0;
 3401|  99.0k|                    if((i2_wd_in_ctb - 1) != ps_codec->s_parse.i4_ctb_slice_x) //TODO: For tile, not implemented
  ------------------
  |  Branch (3401:24): [True: 76.4k, False: 22.6k]
  ------------------
 3402|  76.4k|                    {
 3403|  76.4k|                        u1_top_rt_ctb_avail = 0;
 3404|  76.4k|                    }
 3405|  99.0k|                }
 3406|   982k|            }
 3407|       |            /*For slices not beginning at start of a ctb row*/
 3408|  10.7M|            else if(ps_codec->s_parse.i4_ctb_x > 0)
  ------------------
  |  Branch (3408:21): [True: 10.7M, False: 0]
  ------------------
 3409|  10.7M|            {
 3410|  10.7M|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3410:20): [True: 2.54M, False: 8.24M]
  |  Branch (3410:63): [True: 124k, False: 8.12M]
  ------------------
 3411|  2.66M|                {
 3412|  2.66M|                    u1_top_ctb_avail = 0;
 3413|  2.66M|                    u1_top_lt_ctb_avail = 0;
 3414|  2.66M|                    if(0 == ps_codec->s_parse.i4_ctb_slice_x)
  ------------------
  |  Branch (3414:24): [True: 4.71k, False: 2.66M]
  ------------------
 3415|  4.71k|                    {
 3416|  4.71k|                        u1_left_ctb_avail = 0;
 3417|  4.71k|                    }
 3418|  2.66M|                    if((i2_wd_in_ctb - 1) != ps_codec->s_parse.i4_ctb_slice_x)
  ------------------
  |  Branch (3418:24): [True: 2.62M, False: 36.7k]
  ------------------
 3419|  2.62M|                    {
 3420|  2.62M|                        u1_top_rt_ctb_avail = 0;
 3421|  2.62M|                    }
 3422|  2.66M|                }
 3423|  8.12M|                else if((1 == ps_codec->s_parse.i4_ctb_slice_y) && (0 == ps_codec->s_parse.i4_ctb_slice_x))
  ------------------
  |  Branch (3423:25): [True: 297k, False: 7.82M]
  |  Branch (3423:68): [True: 349, False: 297k]
  ------------------
 3424|    349|                {
 3425|    349|                    u1_top_lt_ctb_avail = 0;
 3426|    349|                }
 3427|  10.7M|            }
 3428|       |
 3429|  11.7M|            if(((ps_sps->i2_pic_wd_in_ctb - 1) == ps_codec->s_parse.i4_ctb_x) || ((ps_tile->u2_wd - 1) == ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (3429:16): [True: 689k, False: 11.0M]
  |  Branch (3429:82): [True: 293k, False: 10.7M]
  ------------------
 3430|   982k|            {
 3431|   982k|                u1_top_rt_ctb_avail = 0;
 3432|   982k|            }
 3433|       |
 3434|  11.7M|            if(PSLICE == ps_slice_hdr->i1_slice_type
  ------------------
  |  Branch (3434:16): [True: 11.4k, False: 11.7M]
  ------------------
 3435|  11.7M|                            || BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (3435:32): [True: 2.54M, False: 9.21M]
  ------------------
 3436|  2.56M|            {
 3437|  2.56M|                mv_ctxt_t s_mv_ctxt;
 3438|  2.56M|                process_ctxt_t *ps_proc;
 3439|  2.56M|                UWORD32 *pu4_ctb_top_pu_idx;
 3440|  2.56M|                UWORD32 *pu4_ctb_left_pu_idx;
 3441|  2.56M|                UWORD32 *pu4_ctb_top_left_pu_idx;
 3442|  2.56M|                WORD32 i4_ctb_pu_cnt;
 3443|  2.56M|                WORD32 cur_ctb_idx;
 3444|  2.56M|                WORD32 next_ctb_idx;
 3445|  2.56M|                WORD32 cur_pu_idx;
 3446|  2.56M|                ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3446:49): [True: 1.55M, False: 1.00M]
  ------------------
 3447|  2.56M|                cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3448|  2.56M|                                + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3449|  2.56M|                next_ctb_idx = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3450|  2.56M|                i4_ctb_pu_cnt = ps_codec->s_parse.pu4_pic_pu_idx[next_ctb_idx]
 3451|  2.56M|                                - ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3452|       |
 3453|  2.56M|                cur_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3454|       |
 3455|  2.56M|                pu4_ctb_top_pu_idx = ps_proc->pu4_pic_pu_idx_top
 3456|  2.56M|                                + (ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  2.56M|#define MIN_PU_SIZE         4
  ------------------
 3457|  2.56M|                pu4_ctb_left_pu_idx = ps_proc->pu4_pic_pu_idx_left;
 3458|  2.56M|                pu4_ctb_top_left_pu_idx = &ps_proc->u4_ctb_top_left_pu_idx;
 3459|       |
 3460|       |                /* Initializing s_mv_ctxt */
 3461|  2.56M|                {
 3462|  2.56M|                    s_mv_ctxt.ps_pps = ps_pps;
 3463|  2.56M|                    s_mv_ctxt.ps_sps = ps_sps;
 3464|  2.56M|                    s_mv_ctxt.ps_slice_hdr = ps_slice_hdr;
 3465|  2.56M|                    s_mv_ctxt.i4_ctb_x = ps_codec->s_parse.i4_ctb_x;
 3466|  2.56M|                    s_mv_ctxt.i4_ctb_y = ps_codec->s_parse.i4_ctb_y;
 3467|  2.56M|                    s_mv_ctxt.ps_pu = &ps_codec->s_parse.ps_pic_pu[cur_pu_idx];
 3468|  2.56M|                    s_mv_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 3469|  2.56M|                    s_mv_ctxt.ps_tile = ps_tile;
 3470|  2.56M|                    s_mv_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
 3471|  2.56M|                    s_mv_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 3472|  2.56M|                    s_mv_ctxt.pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 3473|  2.56M|                    s_mv_ctxt.i4_ctb_pu_cnt = i4_ctb_pu_cnt;
 3474|  2.56M|                    s_mv_ctxt.i4_ctb_start_pu_idx = cur_pu_idx;
 3475|  2.56M|                    s_mv_ctxt.u1_top_ctb_avail = u1_top_ctb_avail;
 3476|  2.56M|                    s_mv_ctxt.u1_top_rt_ctb_avail = u1_top_rt_ctb_avail;
 3477|  2.56M|                    s_mv_ctxt.u1_top_lt_ctb_avail = u1_top_lt_ctb_avail;
 3478|  2.56M|                    s_mv_ctxt.u1_left_ctb_avail = u1_left_ctb_avail;
 3479|  2.56M|                }
 3480|       |
 3481|  2.56M|                ihevcd_get_mv_ctb(&s_mv_ctxt, pu4_ctb_top_pu_idx,
 3482|  2.56M|                                  pu4_ctb_left_pu_idx, pu4_ctb_top_left_pu_idx);
 3483|       |
 3484|  2.56M|            }
 3485|  9.21M|            else
 3486|  9.21M|            {
 3487|  9.21M|                WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  9.21M|#define MIN_PU_SIZE         4
  ------------------
                              WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  9.21M|#define MIN_PU_SIZE         4
  ------------------
 3488|  9.21M|                UWORD8 *pu1_pic_pu_map_ctb = ps_codec->s_parse.pu1_pic_pu_map +
 3489|  9.21M|                                (ps_codec->s_parse.i4_ctb_x + ps_codec->s_parse.i4_ctb_y * ps_sps->i2_pic_wd_in_ctb) * num_minpu_in_ctb;
 3490|  9.21M|                process_ctxt_t *ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3490:65): [True: 6.58M, False: 2.62M]
  ------------------
 3491|  9.21M|                WORD32 row, col;
 3492|  9.21M|                WORD32 pu_cnt;
 3493|  9.21M|                WORD32 num_pu_per_ctb;
 3494|  9.21M|                WORD32 cur_ctb_idx;
 3495|  9.21M|                WORD32 next_ctb_idx;
 3496|  9.21M|                WORD32 ctb_start_pu_idx;
 3497|  9.21M|                UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map;
 3498|  9.21M|                WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  9.21M|#define MAX_CTB_SIZE        64
  ------------------
                              WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  9.21M|#define MIN_PU_SIZE         4
  ------------------
 3499|  9.21M|                pu_t *ps_pu;
 3500|  9.21M|                WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  9.21M|#define MIN_PU_SIZE         4
  ------------------
 3501|       |
 3502|       |                /* Neighbor PU idx update inside CTB */
 3503|       |                /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */
 3504|       |
 3505|  9.21M|                cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3506|  9.21M|                                + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3507|  9.21M|                next_ctb_idx = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3508|  9.21M|                num_pu_per_ctb = ps_codec->s_parse.pu4_pic_pu_idx[next_ctb_idx]
 3509|  9.21M|                                - ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3510|  9.21M|                ctb_start_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3511|  9.21M|                ps_pu = &ps_codec->s_parse.ps_pic_pu[ctb_start_pu_idx];
 3512|       |
 3513|   108M|                for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (3513:33): [True: 99.3M, False: 9.21M]
  ------------------
 3514|  99.3M|                {
 3515|  99.3M|                    UWORD32 cur_pu_idx;
 3516|  99.3M|                    WORD32 pu_ht = (ps_pu->b4_ht + 1) << 2;
 3517|  99.3M|                    WORD32 pu_wd = (ps_pu->b4_wd + 1) << 2;
 3518|       |
 3519|  99.3M|                    cur_pu_idx = ctb_start_pu_idx + pu_cnt;
 3520|       |
 3521|   301M|                    for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  367|   301M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3521:34): [True: 201M, False: 99.3M]
  ------------------
 3522|   638M|                        for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  367|   638M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3522:38): [True: 436M, False: 201M]
  ------------------
 3523|   436M|                            pu4_nbr_pu_idx[(1 + ps_pu->b4_pos_x + col)
 3524|   436M|                                            + (1 + ps_pu->b4_pos_y + row)
 3525|   436M|                                            * nbr_pu_idx_strd] =
 3526|   436M|                                            cur_pu_idx;
 3527|  99.3M|                }
 3528|       |
 3529|       |                /* Updating Top and Left pointers */
 3530|  9.21M|                {
 3531|  9.21M|                    WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
 3532|  9.21M|                                    - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size);
 3533|  9.21M|                    WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  9.21M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 8.89M, False: 314k]
  |  |  ------------------
  ------------------
 3534|       |
 3535|       |                    /* Top Left */
 3536|       |                    /* saving top left before updating top ptr, as updating top ptr will overwrite the top left for the next ctb */
 3537|  9.21M|                    ps_proc->u4_ctb_top_left_pu_idx = ps_proc->pu4_pic_pu_idx_top[(ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE) + ctb_size / MIN_PU_SIZE - 1];
  ------------------
  |  |  367|  9.21M|#define MIN_PU_SIZE         4
  ------------------
                                  ps_proc->u4_ctb_top_left_pu_idx = ps_proc->pu4_pic_pu_idx_top[(ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE) + ctb_size / MIN_PU_SIZE - 1];
  ------------------
  |  |  367|  9.21M|#define MIN_PU_SIZE         4
  ------------------
 3538|  64.2M|                    for(i = 0; i < ctb_size / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|  64.2M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3538:32): [True: 55.0M, False: 9.21M]
  ------------------
 3539|  55.0M|                    {
 3540|       |                        /* Left */
 3541|       |                        /* Last column of au4_nbr_pu_idx */
 3542|  55.0M|                        ps_proc->pu4_pic_pu_idx_left[i] = pu4_nbr_pu_idx[(ctb_size / MIN_PU_SIZE)
  ------------------
  |  |  367|  55.0M|#define MIN_PU_SIZE         4
  ------------------
 3543|  55.0M|                                        + (i + 1) * nbr_pu_idx_strd];
 3544|       |                        /* Top */
 3545|       |                        /* Last row of au4_nbr_pu_idx */
 3546|  55.0M|                        ps_proc->pu4_pic_pu_idx_top[(ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE) + i] =
  ------------------
  |  |  367|  55.0M|#define MIN_PU_SIZE         4
  ------------------
 3547|  55.0M|                                        pu4_nbr_pu_idx[(ctb_size_left / MIN_PU_SIZE) * nbr_pu_idx_strd + i + 1];
  ------------------
  |  |  367|  55.0M|#define MIN_PU_SIZE         4
  ------------------
 3548|       |
 3549|  55.0M|                    }
 3550|  9.21M|                }
 3551|       |
 3552|       |                /* Updating the CTB level PU idx (Used for collocated MV pred)*/
 3553|  9.21M|                {
 3554|  9.21M|                    WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
 3555|  9.21M|                    WORD32 first_pu_of_ctb;
 3556|  9.21M|                    first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
 3557|  9.21M|                    UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  9.21M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 278k, False: 8.93M]
  |  |  ------------------
  ------------------
 3558|  9.21M|                            - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
 3559|  9.21M|                    UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  9.21M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 305k, False: 8.90M]
  |  |  ------------------
  ------------------
 3560|  9.21M|                                - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
 3561|       |
 3562|  9.21M|                    index_pic_map = 0 * ctb_size_in_min_pu + 0;
 3563|  9.21M|                    index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
 3564|       |
 3565|  62.7M|                    for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (3565:38): [True: 53.4M, False: 9.21M]
  ------------------
 3566|  53.4M|                    {
 3567|   490M|                        for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (3567:42): [True: 436M, False: 53.4M]
  ------------------
 3568|   436M|                        {
 3569|   436M|                            pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
 3570|   436M|                                            - first_pu_of_ctb;
 3571|   436M|                        }
 3572|  53.4M|                        index_pic_map += ctb_size_in_min_pu;
 3573|  53.4M|                        index_nbr_map += nbr_pu_idx_strd;
 3574|  53.4M|                    }
 3575|  9.21M|                }
 3576|  9.21M|            }
 3577|       |
 3578|       |            /*************************************************/
 3579|       |            /******************  BS, QP  *********************/
 3580|       |            /*************************************************/
 3581|       |            /* Check if deblock is disabled for the current slice or if it is disabled for the current picture
 3582|       |             * because of disable deblock api
 3583|       |             */
 3584|  11.7M|            if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (3584:16): [True: 11.7M, False: 0]
  ------------------
 3585|  11.7M|            {
 3586|       |                /* Boundary strength calculation is done irrespective of whether deblocking is disabled
 3587|       |                 * in the slice or not, to handle deblocking slice boundaries */
 3588|  11.7M|                if((0 == ps_codec->i4_slice_error))
  ------------------
  |  Branch (3588:20): [True: 557k, False: 11.2M]
  ------------------
 3589|   557k|                {
 3590|   557k|                    WORD32 i4_ctb_tu_cnt;
 3591|   557k|                    WORD32 cur_ctb_idx, next_ctb_idx;
 3592|   557k|                    WORD32 cur_pu_idx;
 3593|   557k|                    WORD32 cur_tu_idx;
 3594|   557k|                    process_ctxt_t *ps_proc;
 3595|       |
 3596|   557k|                    ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3596:53): [True: 268k, False: 288k]
  ------------------
 3597|   557k|                    cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3598|   557k|                                    + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3599|       |
 3600|   557k|                    cur_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3601|   557k|                    next_ctb_idx = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3602|   557k|                    if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (3602:24): [True: 268k, False: 288k]
  ------------------
 3603|   268k|                    {
 3604|   268k|                        i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3605|   268k|                                        ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   268k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   268k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   268k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   268k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   268k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   268k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3606|       |
 3607|   268k|                        cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   268k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   268k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   268k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   268k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   268k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   268k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3608|   268k|                    }
 3609|   288k|                    else
 3610|   288k|                    {
 3611|   288k|                        i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3612|   288k|                                        ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3613|       |
 3614|   288k|                        cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3615|   288k|                    }
 3616|       |
 3617|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_pps = ps_codec->s_parse.ps_pps;
 3618|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_sps = ps_codec->s_parse.ps_sps;
 3619|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_codec = ps_codec;
 3620|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tu_cnt = i4_ctb_tu_cnt;
 3621|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_x = ps_codec->s_parse.i4_ctb_x;
 3622|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_y = ps_codec->s_parse.i4_ctb_y;
 3623|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tile_x = ps_codec->s_parse.i4_ctb_tile_x;
 3624|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tile_y = ps_codec->s_parse.i4_ctb_tile_y;
 3625|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_slice_x = ps_codec->s_parse.i4_ctb_slice_x;
 3626|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_slice_y = ps_codec->s_parse.i4_ctb_slice_y;
 3627|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_tu = &ps_codec->s_parse.ps_pic_tu[cur_tu_idx];
 3628|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_pu = &ps_codec->s_parse.ps_pic_pu[cur_pu_idx];
 3629|   557k|                    ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
 3630|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_next_pu_ctb_cnt = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3631|   557k|                    ps_codec->s_parse.s_bs_ctxt.i4_next_tu_ctb_cnt = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3632|   557k|                    ps_codec->s_parse.s_bs_ctxt.pu1_slice_idx = ps_codec->s_parse.pu1_slice_idx;
 3633|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 3634|   557k|                    ps_codec->s_parse.s_bs_ctxt.ps_tile = ps_codec->s_parse.ps_tile;
 3635|       |
 3636|   557k|                    if(ISLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (3636:24): [True: 250k, False: 306k]
  ------------------
 3637|   250k|                    {
 3638|   250k|                        ihevcd_ctb_boundary_strength_islice(&ps_codec->s_parse.s_bs_ctxt);
 3639|   250k|                    }
 3640|   306k|                    else
 3641|   306k|                    {
 3642|   306k|                        ihevcd_ctb_boundary_strength_pbslice(&ps_codec->s_parse.s_bs_ctxt);
 3643|   306k|                    }
 3644|   557k|                }
 3645|       |
 3646|       |                /* Boundary strength is set to zero if deblocking is disabled for the current slice */
 3647|  11.7M|                if(0 != ps_slice_hdr->i1_slice_disable_deblocking_filter_flag)
  ------------------
  |  Branch (3647:20): [True: 593k, False: 11.1M]
  ------------------
 3648|   593k|                {
 3649|   593k|                    WORD32 bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) * (ctb_size * ctb_size / 8 / 16);
 3650|       |
 3651|   593k|                    UWORD32 *pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_codec->s_parse.s_bs_ctxt.pu4_pic_vert_bs +
 3652|   593k|                                    ps_codec->s_parse.i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
 3653|   593k|                                    ps_codec->s_parse.i4_ctb_y * bs_strd);
 3654|   593k|                    UWORD32 *pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_codec->s_parse.s_bs_ctxt.pu4_pic_horz_bs +
 3655|   593k|                                    ps_codec->s_parse.i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
 3656|   593k|                                    ps_codec->s_parse.i4_ctb_y * bs_strd);
 3657|       |
 3658|   593k|                    memset(pu4_vert_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
 3659|   593k|                    memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
 3660|   593k|                }
 3661|  11.7M|            }
 3662|       |
 3663|  11.7M|        }
 3664|       |
 3665|  19.5M|        DATA_SYNC();
  ------------------
  |  |  100|  19.5M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 3666|       |
 3667|       |        /* Update the parse status map */
 3668|  19.5M|        {
 3669|  19.5M|            sps_t *ps_sps = ps_codec->s_parse.ps_sps;
 3670|  19.5M|            UWORD8 *pu1_buf;
 3671|  19.5M|            WORD32 idx;
 3672|  19.5M|            idx = (ps_codec->s_parse.i4_ctb_x);
 3673|  19.5M|            idx += ((ps_codec->s_parse.i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb);
 3674|  19.5M|            pu1_buf = (ps_codec->pu1_parse_map + idx);
 3675|  19.5M|            *pu1_buf = 1;
 3676|  19.5M|        }
 3677|       |
 3678|       |        /* Increment CTB x and y positions */
 3679|  19.5M|        ps_codec->s_parse.i4_ctb_tile_x++;
 3680|  19.5M|        ps_codec->s_parse.i4_ctb_x++;
 3681|  19.5M|        ps_codec->s_parse.i4_ctb_slice_x++;
 3682|       |
 3683|       |        /*If tiles are enabled, handle the slice counters differently*/
 3684|  19.5M|        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3684:12): [True: 6.07M, False: 13.4M]
  ------------------
 3685|  6.07M|        {
 3686|       |            //Indicates multiple tiles in a slice case
 3687|  6.07M|            tile_start_ctb_idx = ps_tile->u1_pos_x
 3688|  6.07M|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 3689|       |
 3690|  6.07M|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 3691|  6.07M|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3692|       |
 3693|  6.07M|            if((slice_start_ctb_idx < tile_start_ctb_idx))
  ------------------
  |  Branch (3693:16): [True: 4.93M, False: 1.13M]
  ------------------
 3694|  4.93M|            {
 3695|  4.93M|                if(ps_codec->s_parse.i4_ctb_slice_x == (ps_tile->u1_pos_x + ps_tile->u2_wd))
  ------------------
  |  Branch (3695:20): [True: 509k, False: 4.42M]
  ------------------
 3696|   509k|                {
 3697|       |                    /* Reached end of slice row within a tile /frame */
 3698|   509k|                    ps_codec->s_parse.i4_ctb_slice_y++;
 3699|   509k|                    ps_codec->s_parse.i4_ctb_slice_x = ps_tile->u1_pos_x; //todo:Check
 3700|   509k|                }
 3701|  4.93M|            }
 3702|       |            //Indicates multiple slices in a tile case - hence, reset slice_x
 3703|  1.13M|            else if(ps_codec->s_parse.i4_ctb_slice_x == (ps_tile->u2_wd))
  ------------------
  |  Branch (3703:21): [True: 63.6k, False: 1.07M]
  ------------------
 3704|  63.6k|            {
 3705|  63.6k|                ps_codec->s_parse.i4_ctb_slice_y++;
 3706|  63.6k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 3707|  63.6k|            }
 3708|  6.07M|        }
 3709|  13.4M|        else
 3710|  13.4M|        {
 3711|  13.4M|            if(ps_codec->s_parse.i4_ctb_slice_x == ps_tile->u2_wd)
  ------------------
  |  Branch (3711:16): [True: 895k, False: 12.5M]
  ------------------
 3712|   895k|            {
 3713|       |                /* Reached end of slice row within a tile /frame */
 3714|   895k|                ps_codec->s_parse.i4_ctb_slice_y++;
 3715|   895k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 3716|   895k|            }
 3717|  13.4M|        }
 3718|       |
 3719|       |
 3720|  19.5M|        if(ps_codec->s_parse.i4_ctb_tile_x == (ps_tile->u2_wd))
  ------------------
  |  Branch (3720:12): [True: 1.49M, False: 18.0M]
  ------------------
 3721|  1.49M|        {
 3722|       |            /* Reached end of tile row */
 3723|  1.49M|            ps_codec->s_parse.i4_ctb_tile_x = 0;
 3724|  1.49M|            ps_codec->s_parse.i4_ctb_x = ps_tile->u1_pos_x;
 3725|       |
 3726|  1.49M|            ps_codec->s_parse.i4_ctb_tile_y++;
 3727|  1.49M|            ps_codec->s_parse.i4_ctb_y++;
 3728|       |
 3729|  1.49M|            if(ps_codec->s_parse.i4_ctb_tile_y == (ps_tile->u2_ht))
  ------------------
  |  Branch (3729:16): [True: 125k, False: 1.36M]
  ------------------
 3730|   125k|            {
 3731|       |                /* Reached End of Tile */
 3732|   125k|                ps_codec->s_parse.i4_ctb_tile_y = 0;
 3733|   125k|                ps_codec->s_parse.i4_ctb_tile_x = 0;
 3734|   125k|                ps_codec->s_parse.ps_tile++;
 3735|       |
 3736|   125k|                if((ps_tile->u2_ht + ps_tile->u1_pos_y  ==  ps_sps->i2_pic_ht_in_ctb) && (ps_tile->u2_wd + ps_tile->u1_pos_x  ==  ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (3736:20): [True: 80.1k, False: 45.1k]
  |  Branch (3736:90): [True: 69.8k, False: 10.2k]
  ------------------
 3737|  69.8k|                {
 3738|       |                    /* Reached end of frame */
 3739|  69.8k|                    end_of_pic = 1;
 3740|  69.8k|                    ps_codec->s_parse.i4_ctb_x = 0;
 3741|  69.8k|                    ps_codec->s_parse.i4_ctb_y = ps_sps->i2_pic_ht_in_ctb;
 3742|  69.8k|                }
 3743|  55.4k|                else
 3744|  55.4k|                {
 3745|       |                    /* Initialize ctb_x and ctb_y to start of next tile */
 3746|  55.4k|                    ps_tile = ps_codec->s_parse.ps_tile;
 3747|  55.4k|                    ps_codec->s_parse.i4_ctb_x = ps_tile->u1_pos_x;
 3748|  55.4k|                    ps_codec->s_parse.i4_ctb_y = ps_tile->u1_pos_y;
 3749|  55.4k|                    ps_codec->s_parse.i4_ctb_tile_y = 0;
 3750|  55.4k|                    ps_codec->s_parse.i4_ctb_tile_x = 0;
 3751|  55.4k|                    ps_codec->s_parse.i4_ctb_slice_x = ps_tile->u1_pos_x;
 3752|  55.4k|                    ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y;
 3753|       |
 3754|  55.4k|                }
 3755|   125k|            }
 3756|       |
 3757|  1.49M|        }
 3758|       |
 3759|  19.5M|        ps_codec->s_parse.i4_next_ctb_indx = ps_codec->s_parse.i4_ctb_x +
 3760|  19.5M|                        ps_codec->s_parse.i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3761|       |
 3762|       |        /* If the current slice is in error, check if the next slice's address
 3763|       |         * is reached and mark the end_of_slice flag */
 3764|  19.5M|        if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (3764:12): [True: 18.4M, False: 1.05M]
  ------------------
 3765|  18.4M|        {
 3766|  18.4M|            slice_header_t *ps_slice_hdr_next = ps_slice_hdr + 1;
 3767|  18.4M|            WORD32 next_slice_addr = ps_slice_hdr_next->i2_ctb_x +
 3768|  18.4M|                            ps_slice_hdr_next->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3769|       |
 3770|  18.4M|            if(ps_codec->s_parse.i4_next_ctb_indx == next_slice_addr)
  ------------------
  |  Branch (3770:16): [True: 44.5k, False: 18.4M]
  ------------------
 3771|  44.5k|                end_of_slice_flag = 1;
 3772|  18.4M|        }
 3773|       |
 3774|       |        /* If the codec is running in single core mode
 3775|       |         * then call process function for current CTB
 3776|       |         */
 3777|  19.5M|        if((1 == ps_codec->i4_num_cores) && (ps_codec->s_parse.i4_ctb_tile_x == 0))
  ------------------
  |  Branch (3777:12): [True: 8.14M, False: 11.4M]
  |  Branch (3777:45): [True: 594k, False: 7.54M]
  ------------------
 3778|   594k|        {
 3779|   594k|            process_ctxt_t *ps_proc = &ps_codec->as_process[0];
 3780|       |//          ps_proc->i4_ctb_cnt = ihevcd_nctb_cnt(ps_codec, ps_sps);
 3781|   594k|            ps_proc->i4_ctb_cnt = ps_proc->ps_tile->u2_wd;
 3782|   594k|            ihevcd_process(ps_proc);
 3783|   594k|        }
 3784|       |
 3785|       |        /* If the bytes for the current slice are exhausted
 3786|       |         * set end_of_slice flag to 1
 3787|       |         * This slice will be treated as incomplete */
 3788|  19.5M|        if((UWORD8 *)ps_codec->s_parse.s_bitstrm.pu1_buf_max + BITSTRM_OFF_THRS <
  ------------------
  |  |   83|  19.5M|#define BITSTRM_OFF_THRS 8
  ------------------
  |  Branch (3788:12): [True: 1.95M, False: 17.6M]
  ------------------
 3789|  19.5M|                                        ((UWORD8 *)ps_codec->s_parse.s_bitstrm.pu4_buf + (ps_codec->s_parse.s_bitstrm.u4_bit_ofst / 8)))
 3790|  1.95M|        {
 3791|       |            // end_of_slice_flag = ps_codec->i4_slice_error ? 0 : 1;
 3792|       |
 3793|  1.95M|            if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3793:16): [True: 60.7k, False: 1.89M]
  ------------------
 3794|  60.7k|                end_of_slice_flag = 1;
 3795|  1.95M|        }
 3796|       |
 3797|       |
 3798|  19.5M|        if(end_of_pic)
  ------------------
  |  Branch (3798:12): [True: 69.8k, False: 19.4M]
  ------------------
 3799|  69.8k|            break;
 3800|  19.5M|    } while(!end_of_slice_flag);
  ------------------
  |  Branch (3800:13): [True: 19.4M, False: 67.7k]
  ------------------
 3801|       |
 3802|       |    /* Reset slice error */
 3803|   137k|    ps_codec->i4_slice_error = 0;
 3804|       |
 3805|       |    /* Increment the slice index for parsing next slice */
 3806|   137k|    if(0 == end_of_pic)
  ------------------
  |  Branch (3806:8): [True: 67.7k, False: 69.8k]
  ------------------
 3807|  67.7k|    {
 3808|  67.7k|        while(1)
  ------------------
  |  Branch (3808:15): [True: 67.7k, Folded]
  ------------------
 3809|  67.7k|        {
 3810|       |
 3811|  67.7k|            WORD32 parse_slice_idx;
 3812|  67.7k|            parse_slice_idx = ps_codec->s_parse.i4_cur_slice_idx;
 3813|  67.7k|            parse_slice_idx++;
 3814|       |
 3815|  67.7k|            {
 3816|       |                /* If the next slice header is not initialized, update cur_slice_idx and break */
 3817|  67.7k|                if((1 == ps_codec->i4_num_cores) || (0 != (parse_slice_idx & (MAX_SLICE_HDR_CNT - 1))))
  ------------------
  |  |  153|  44.2k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  44.2k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (3817:20): [True: 23.4k, False: 44.2k]
  |  Branch (3817:53): [True: 44.2k, False: 0]
  ------------------
 3818|  67.7k|                {
 3819|  67.7k|                    ps_codec->s_parse.i4_cur_slice_idx = parse_slice_idx;
 3820|  67.7k|                    break;
 3821|  67.7k|                }
 3822|       |
 3823|       |                /* If the next slice header is initialised, wait for the parsed slices to be processed */
 3824|      0|                else
 3825|      0|                {
 3826|      0|                    WORD32 ctb_indx = 0;
 3827|       |
 3828|      0|                    while(ctb_indx != ps_sps->i4_pic_size_in_ctb)
  ------------------
  |  Branch (3828:27): [True: 0, False: 0]
  ------------------
 3829|      0|                    {
 3830|      0|                        WORD32 parse_status = *(ps_codec->pu1_parse_map + ctb_indx);
 3831|      0|                        volatile WORD32 proc_status = *(ps_codec->pu1_proc_map + ctb_indx) & 1;
 3832|       |
 3833|      0|                        if(parse_status == proc_status)
  ------------------
  |  Branch (3833:28): [True: 0, False: 0]
  ------------------
 3834|      0|                            ctb_indx++;
 3835|      0|                    }
 3836|      0|                    ps_codec->s_parse.i4_cur_slice_idx = parse_slice_idx;
 3837|      0|                    break;
 3838|      0|                }
 3839|       |
 3840|  67.7k|            }
 3841|  67.7k|        }
 3842|       |
 3843|  67.7k|    }
 3844|  69.8k|    else
 3845|  69.8k|    {
 3846|       |
 3847|  69.8k|        ps_codec->s_parse.i4_end_of_frame = 1;
 3848|  69.8k|    }
 3849|   137k|    return ret;
 3850|   137k|}

ihevcd_ref_pic_list_modification:
  143|  9.40k|{
  144|  9.40k|    WORD32 ret = IHEVCD_SUCCESS;
  145|  9.40k|    WORD32 value;
  146|  9.40k|    WORD32 i;
  147|  9.40k|    rplm_t *ps_rplm;
  148|  9.40k|    WORD32 num_bits_list_entry;
  149|       |
  150|  9.40k|    ps_rplm = &(ps_slice_hdr->s_rplm);
  151|       |
  152|       |    /* Calculate Ceil(Log2(num_poc_total_curr)) */
  153|  9.40k|    {
  154|  9.40k|        num_bits_list_entry = 32 - CLZ(num_poc_total_curr);
  155|       |        /* Check if num_poc_total_curr is power of 2 */
  156|  9.40k|        if(0 == (num_poc_total_curr & (num_poc_total_curr - 1)))
  ------------------
  |  Branch (156:12): [True: 5.22k, False: 4.17k]
  ------------------
  157|  5.22k|        {
  158|  5.22k|            num_bits_list_entry--;
  159|  5.22k|        }
  160|  9.40k|    }
  161|       |
  162|  9.40k|    if(ps_slice_hdr->i1_slice_type  == PSLICE || ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (162:8): [True: 577, False: 8.82k]
  |  Branch (162:50): [True: 8.82k, False: 0]
  ------------------
  163|  9.40k|    {
  164|  9.40k|        BITS_PARSE("ref_pic_list_modification_flag_l0", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  9.40k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  165|  9.40k|        ps_rplm->i1_ref_pic_list_modification_flag_l0 = value;
  166|       |
  167|  9.40k|        if(ps_rplm->i1_ref_pic_list_modification_flag_l0)
  ------------------
  |  Branch (167:12): [True: 4.76k, False: 4.63k]
  ------------------
  168|  17.0k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (168:24): [True: 12.3k, False: 4.76k]
  ------------------
  169|  12.3k|            {
  170|  12.3k|                BITS_PARSE("list_entry_l0", value, ps_bitstrm, num_bits_list_entry);
  ------------------
  |  |  148|  12.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  171|  12.3k|                ps_rplm->i1_list_entry_l0[i] = value;
  172|       |
  173|  12.3k|                ps_rplm->i1_list_entry_l0[i] = CLIP3(ps_rplm->i1_list_entry_l0[i], 0, num_poc_total_curr - 1);
  ------------------
  |  |   40|  12.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.15k, False: 9.17k]
  |  |  |  Branch (40:53): [True: 0, False: 9.17k]
  |  |  ------------------
  ------------------
  174|  12.3k|            }
  175|  9.40k|    }
  176|       |
  177|  9.40k|    if(ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (177:8): [True: 8.82k, False: 577]
  ------------------
  178|  8.82k|    {
  179|  8.82k|        BITS_PARSE("ref_pic_list_modification_flag_l1", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.82k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  180|  8.82k|        ps_rplm->i1_ref_pic_list_modification_flag_l1 = value;
  181|       |
  182|  8.82k|        if(ps_rplm->i1_ref_pic_list_modification_flag_l1)
  ------------------
  |  Branch (182:12): [True: 5.82k, False: 3.00k]
  ------------------
  183|  17.1k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (183:24): [True: 11.3k, False: 5.82k]
  ------------------
  184|  11.3k|            {
  185|  11.3k|                BITS_PARSE("list_entry_l1", value, ps_bitstrm, num_bits_list_entry);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  186|  11.3k|                ps_rplm->i1_list_entry_l1[i] = value;
  187|       |
  188|  11.3k|                ps_rplm->i1_list_entry_l1[i] = CLIP3(ps_rplm->i1_list_entry_l1[i], 0, num_poc_total_curr - 1);
  ------------------
  |  |   40|  11.3k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.03k, False: 8.30k]
  |  |  |  Branch (40:53): [True: 0, False: 8.30k]
  |  |  ------------------
  ------------------
  189|  11.3k|            }
  190|       |
  191|  8.82k|    }
  192|       |
  193|  9.40k|    return ret;
  194|  9.40k|}
ihevcd_parse_slice_header:
  219|   209k|{
  220|   209k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  221|   209k|    UWORD32 value;
  222|   209k|    WORD32 i4_value;
  223|   209k|    WORD32 i, j;
  224|   209k|    WORD32 sps_id;
  225|       |
  226|   209k|    pps_t *ps_pps;
  227|   209k|    sps_t *ps_sps;
  228|   209k|    slice_header_t *ps_slice_hdr;
  229|   209k|    WORD32 disable_deblocking_filter_flag;
  230|   209k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  231|   209k|    WORD32 idr_pic_flag;
  232|   209k|    WORD32 pps_id;
  233|   209k|    WORD32 first_slice_in_pic_flag;
  234|   209k|    WORD32 no_output_of_prior_pics_flag = 0;
  235|   209k|    WORD8 i1_nal_unit_type = ps_nal->i1_nal_unit_type;
  236|   209k|    WORD32 num_poc_total_curr = 0;
  237|   209k|    UWORD32 slice_address;
  238|   209k|    WORD32 prev_slice_incomplete_flag = 0;
  239|       |
  240|   209k|    if(ps_codec->i4_slice_error == 1)
  ------------------
  |  Branch (240:8): [True: 30.3k, False: 179k]
  ------------------
  241|  30.3k|        return ret;
  242|       |
  243|   179k|    idr_pic_flag = (NAL_IDR_W_LP == i1_nal_unit_type) ||
  ------------------
  |  Branch (243:20): [True: 19.8k, False: 159k]
  ------------------
  244|   159k|                    (NAL_IDR_N_LP == i1_nal_unit_type);
  ------------------
  |  Branch (244:21): [True: 47.7k, False: 111k]
  ------------------
  245|       |
  246|       |
  247|   179k|    BITS_PARSE("first_slice_in_pic_flag", first_slice_in_pic_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|   179k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  248|   179k|    if((NAL_BLA_W_LP <= i1_nal_unit_type) &&
  ------------------
  |  Branch (248:8): [True: 87.1k, False: 92.1k]
  ------------------
  249|  87.1k|       (NAL_RSV_RAP_VCL23          >= i1_nal_unit_type))
  ------------------
  |  Branch (249:8): [True: 87.1k, False: 0]
  ------------------
  250|  87.1k|    {
  251|  87.1k|        BITS_PARSE("no_output_of_prior_pics_flag", no_output_of_prior_pics_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  87.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  252|  87.1k|    }
  253|   179k|    UEV_PARSE("pic_parameter_set_id", pps_id, ps_bitstrm);
  ------------------
  |  |  155|   179k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  254|   179k|    if(pps_id < 0 || pps_id > MAX_PPS_CNT - 2)
  ------------------
  |  |  344|   174k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (254:8): [True: 4.89k, False: 174k]
  |  Branch (254:22): [True: 23.2k, False: 151k]
  ------------------
  255|  28.1k|    {
  256|  28.1k|        return IHEVCD_INVALID_PARAMETER;
  257|  28.1k|    }
  258|       |
  259|       |    /* Get the current PPS structure */
  260|   151k|    ps_pps = ps_codec->s_parse.ps_pps_base + pps_id;
  261|   151k|    if(0 == ps_pps->i1_pps_valid)
  ------------------
  |  Branch (261:8): [True: 15.2k, False: 135k]
  ------------------
  262|  15.2k|    {
  263|  15.2k|        pps_t *ps_pps_ref = ps_codec->ps_pps_base;
  264|  35.8k|        while(0 == ps_pps_ref->i1_pps_valid)
  ------------------
  |  Branch (264:15): [True: 20.6k, False: 15.1k]
  ------------------
  265|  20.6k|        {
  266|  20.6k|            ps_pps_ref++;
  267|  20.6k|            if((ps_pps_ref - ps_codec->ps_pps_base >= MAX_PPS_CNT - 1))
  ------------------
  |  |  344|  20.6k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (267:16): [True: 66, False: 20.6k]
  ------------------
  268|     66|                return IHEVCD_INVALID_HEADER;
  269|  20.6k|        }
  270|       |
  271|  15.1k|        ihevcd_copy_pps(ps_codec, pps_id, ps_pps_ref->i1_pps_id);
  272|  15.1k|    }
  273|       |
  274|       |    /* Get SPS id for the current PPS */
  275|   151k|    sps_id = ps_pps->i1_sps_id;
  276|       |
  277|       |    /* Get the current SPS structure */
  278|   151k|    ps_sps = ps_codec->s_parse.ps_sps_base + sps_id;
  279|       |
  280|       |    /* When the current slice is the first in a pic,
  281|       |     *  check whether the previous frame is complete
  282|       |     *  If the previous frame is incomplete -
  283|       |     *  treat the remaining CTBs as skip */
  284|   151k|    if((0 != ps_codec->u4_pic_cnt || ps_codec->i4_pic_present) &&
  ------------------
  |  Branch (284:9): [True: 108k, False: 42.3k]
  |  Branch (284:38): [True: 5.95k, False: 36.4k]
  ------------------
  285|   114k|                    first_slice_in_pic_flag)
  ------------------
  |  Branch (285:21): [True: 79.4k, False: 35.1k]
  ------------------
  286|  79.4k|    {
  287|  79.4k|        if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (287:12): [True: 8.50k, False: 70.9k]
  ------------------
  288|  8.50k|        {
  289|  8.50k|            slice_header_t *ps_slice_hdr_next;
  290|  8.50k|            ps_codec->i4_slice_error = 1;
  291|  8.50k|            ps_codec->s_parse.i4_cur_slice_idx--;
  292|  8.50k|            if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (292:16): [True: 0, False: 8.50k]
  ------------------
  293|      0|                ps_codec->s_parse.i4_cur_slice_idx = 0;
  294|       |
  295|  8.50k|            ps_slice_hdr_next = ps_codec->s_parse.ps_slice_hdr_base + ((ps_codec->s_parse.i4_cur_slice_idx + 1) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  8.50k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  8.50k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  296|  8.50k|            ps_slice_hdr_next->i2_ctb_x = 0;
  297|  8.50k|            ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  298|  8.50k|            return ret;
  299|  8.50k|        }
  300|  70.9k|        else
  301|  70.9k|        {
  302|  70.9k|            ps_codec->i4_slice_error = 0;
  303|  70.9k|        }
  304|  79.4k|    }
  305|       |
  306|   142k|    if(first_slice_in_pic_flag)
  ------------------
  |  Branch (306:8): [True: 103k, False: 39.4k]
  ------------------
  307|   103k|    {
  308|   103k|        ps_codec->s_parse.i4_cur_slice_idx = 0;
  309|   103k|    }
  310|  39.4k|    else
  311|  39.4k|    {
  312|       |        /* If the current slice is not the first slice in the pic,
  313|       |         * but the first one to be parsed, set the current slice indx to 1
  314|       |         * Treat the first slice to be missing and copy the current slice header
  315|       |         * to the first one */
  316|  39.4k|        if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (316:12): [True: 18.1k, False: 21.3k]
  ------------------
  317|  18.1k|            ps_codec->s_parse.i4_cur_slice_idx = 1;
  318|  39.4k|    }
  319|       |
  320|   142k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base + (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|   142k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   142k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  321|   142k|    memset(ps_slice_hdr, 0, sizeof(*ps_slice_hdr));
  322|   142k|    ps_slice_hdr->i2_ctb_x = -1;
  323|   142k|    ps_slice_hdr->i2_ctb_y = -1;
  324|       |
  325|   142k|    if((ps_pps->i1_dependent_slice_enabled_flag) &&
  ------------------
  |  Branch (325:8): [True: 97.1k, False: 45.3k]
  ------------------
  326|  97.1k|       (!first_slice_in_pic_flag))
  ------------------
  |  Branch (326:8): [True: 28.4k, False: 68.7k]
  ------------------
  327|  28.4k|    {
  328|  28.4k|        BITS_PARSE("dependent_slice_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  28.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  329|       |
  330|       |        /* First slice to be decoded in the current picture can't be dependent slice */
  331|  28.4k|        if (value && 0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (331:13): [True: 15.3k, False: 13.1k]
  |  Branch (331:22): [True: 3.83k, False: 11.5k]
  ------------------
  332|  3.83k|        {
  333|  3.83k|             return IHEVCD_IGNORE_SLICE;
  334|  3.83k|        }
  335|       |
  336|       |        /* If dependendent slice, copy slice header from previous slice */
  337|  24.6k|        if(value && (ps_codec->s_parse.i4_cur_slice_idx > 0))
  ------------------
  |  Branch (337:12): [True: 11.5k, False: 13.1k]
  |  Branch (337:21): [True: 11.5k, False: 0]
  ------------------
  338|  11.5k|        {
  339|  11.5k|            ihevcd_copy_slice_hdr(ps_codec,
  340|  11.5k|                                  (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1)),
  ------------------
  |  |  153|  11.5k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  11.5k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  341|  11.5k|                                  ((ps_codec->s_parse.i4_cur_slice_idx - 1) & (MAX_SLICE_HDR_CNT - 1)));
  ------------------
  |  |  153|  11.5k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  11.5k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  342|  11.5k|        }
  343|  24.6k|        ps_slice_hdr->i1_dependent_slice_flag = value;
  344|  24.6k|    }
  345|   114k|    else
  346|   114k|    {
  347|   114k|        ps_slice_hdr->i1_dependent_slice_flag = 0;
  348|   114k|    }
  349|   138k|    ps_slice_hdr->i1_nal_unit_type = i1_nal_unit_type;
  350|   138k|    ps_slice_hdr->i1_pps_id = pps_id;
  351|   138k|    ps_slice_hdr->i1_first_slice_in_pic_flag = first_slice_in_pic_flag;
  352|       |
  353|   138k|    ps_slice_hdr->i1_no_output_of_prior_pics_flag = 1;
  354|   138k|    if((NAL_BLA_W_LP <= i1_nal_unit_type) &&
  ------------------
  |  Branch (354:8): [True: 78.8k, False: 59.9k]
  ------------------
  355|  78.8k|                    (NAL_RSV_RAP_VCL23          >= i1_nal_unit_type))
  ------------------
  |  Branch (355:21): [True: 78.8k, False: 0]
  ------------------
  356|  78.8k|    {
  357|  78.8k|        ps_slice_hdr->i1_no_output_of_prior_pics_flag = no_output_of_prior_pics_flag;
  358|  78.8k|    }
  359|   138k|    ps_slice_hdr->i1_pps_id = pps_id;
  360|       |
  361|   138k|    if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (361:8): [True: 35.6k, False: 103k]
  ------------------
  362|  35.6k|    {
  363|  35.6k|        WORD32 num_bits;
  364|       |
  365|       |        /* Use CLZ to compute Ceil( Log2( PicSizeInCtbsY ) ) */
  366|  35.6k|        num_bits = 32 - CLZ(ps_sps->i4_pic_size_in_ctb - 1);
  367|  35.6k|        BITS_PARSE("slice_address", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|  35.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  368|       |
  369|  35.6k|        slice_address = value;
  370|       |        /* If slice address is greater than the number of CTBs in a picture,
  371|       |         * ignore the slice */
  372|  35.6k|        if(value >= ps_sps->i4_pic_size_in_ctb || value == 0)
  ------------------
  |  Branch (372:12): [True: 1.21k, False: 34.4k]
  |  Branch (372:51): [True: 2.59k, False: 31.8k]
  ------------------
  373|  3.81k|            return IHEVCD_IGNORE_SLICE;
  374|  35.6k|    }
  375|   103k|    else
  376|   103k|    {
  377|   103k|        slice_address = 0;
  378|   103k|    }
  379|       |
  380|   134k|    if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (380:8): [True: 123k, False: 11.3k]
  ------------------
  381|   123k|    {
  382|   123k|        ps_slice_hdr->i1_pic_output_flag = 1;
  383|   123k|        ps_slice_hdr->i4_pic_order_cnt_lsb = 0;
  384|   123k|        ps_slice_hdr->i1_num_long_term_sps = 0;
  385|   123k|        ps_slice_hdr->i1_num_long_term_pics = 0;
  386|       |
  387|   299k|        for(i = 0; i < ps_pps->i1_num_extra_slice_header_bits; i++)
  ------------------
  |  Branch (387:20): [True: 175k, False: 123k]
  ------------------
  388|   175k|        {
  389|   175k|            BITS_PARSE("slice_reserved_undetermined_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   175k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  390|       |            //slice_reserved_undetermined_flag[ i ]
  391|   175k|        }
  392|   123k|        UEV_PARSE("slice_type", value, ps_bitstrm);
  ------------------
  |  |  155|   123k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  393|   123k|        if(value > 2)
  ------------------
  |  Branch (393:12): [True: 3.00k, False: 120k]
  ------------------
  394|  3.00k|        {
  395|  3.00k|            return IHEVCD_INVALID_PARAMETER;
  396|  3.00k|        }
  397|   120k|        ps_slice_hdr->i1_slice_type = value;
  398|       |
  399|       |        /* If the picture is IRAP, slice type must be equal to ISLICE */
  400|   120k|        if((ps_slice_hdr->i1_nal_unit_type >= NAL_BLA_W_LP) &&
  ------------------
  |  Branch (400:12): [True: 75.3k, False: 45.2k]
  ------------------
  401|  75.3k|                        (ps_slice_hdr->i1_nal_unit_type <= NAL_RSV_RAP_VCL23))
  ------------------
  |  Branch (401:25): [True: 75.3k, False: 0]
  ------------------
  402|  75.3k|            ps_slice_hdr->i1_slice_type = ISLICE;
  403|       |
  404|   120k|        if((ps_slice_hdr->i1_slice_type < 0) ||
  ------------------
  |  Branch (404:12): [True: 0, False: 120k]
  ------------------
  405|   120k|                        (ps_slice_hdr->i1_slice_type > 2))
  ------------------
  |  Branch (405:25): [True: 0, False: 120k]
  ------------------
  406|      0|            return IHEVCD_IGNORE_SLICE;
  407|       |
  408|       |
  409|   120k|        if(ps_pps->i1_output_flag_present_flag)
  ------------------
  |  Branch (409:12): [True: 20.3k, False: 100k]
  ------------------
  410|  20.3k|        {
  411|  20.3k|            BITS_PARSE("pic_output_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  20.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  412|  20.3k|            ps_slice_hdr->i1_pic_output_flag = value;
  413|  20.3k|        }
  414|   120k|        ps_slice_hdr->i1_colour_plane_id = 0;
  415|   120k|        if(1 == ps_sps->i1_separate_colour_plane_flag)
  ------------------
  |  Branch (415:12): [True: 0, False: 120k]
  ------------------
  416|      0|        {
  417|      0|            BITS_PARSE("colour_plane_id", value, ps_bitstrm, 2);
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  418|      0|            ps_slice_hdr->i1_colour_plane_id = value;
  419|      0|        }
  420|   120k|        ps_slice_hdr->i1_slice_temporal_mvp_enable_flag = 0;
  421|       |
  422|   120k|        if(!idr_pic_flag)
  ------------------
  |  Branch (422:12): [True: 63.0k, False: 57.5k]
  ------------------
  423|  63.0k|        {
  424|       |
  425|  63.0k|            WORD32 st_rps_idx;
  426|  63.0k|            WORD32 num_neg_pics;
  427|  63.0k|            WORD32 num_pos_pics;
  428|  63.0k|            WORD8 *pi1_used;
  429|       |
  430|  63.0k|            BITS_PARSE("pic_order_cnt_lsb", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|  63.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  431|       |            //value = ihevcd_extend_sign_bit(value, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  432|  63.0k|            ps_slice_hdr->i4_pic_order_cnt_lsb = value;
  433|       |
  434|  63.0k|            BITS_PARSE("short_term_ref_pic_set_sps_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  63.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  435|  63.0k|            ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag = value;
  436|       |
  437|  63.0k|            if(1 == ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag)
  ------------------
  |  Branch (437:16): [True: 49.6k, False: 13.3k]
  ------------------
  438|  49.6k|            {
  439|  49.6k|                WORD32 numbits;
  440|       |
  441|  49.6k|                ps_slice_hdr->i1_short_term_ref_pic_set_idx = 0;
  442|  49.6k|                if(ps_sps->i1_num_short_term_ref_pic_sets > 1)
  ------------------
  |  Branch (442:20): [True: 10.5k, False: 39.1k]
  ------------------
  443|  10.5k|                {
  444|  10.5k|                    numbits = 32 - CLZ(ps_sps->i1_num_short_term_ref_pic_sets - 1);
  445|  10.5k|                    BITS_PARSE("short_term_ref_pic_set_idx", value, ps_bitstrm, numbits);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  446|  10.5k|                    if (value >= ps_sps->i1_num_short_term_ref_pic_sets) {
  ------------------
  |  Branch (446:25): [True: 361, False: 10.1k]
  ------------------
  447|    361|                        return IHEVCD_INVALID_PARAMETER;
  448|    361|                    }
  449|  10.1k|                    ps_slice_hdr->i1_short_term_ref_pic_set_idx = value;
  450|  10.1k|                }
  451|       |
  452|  49.2k|                st_rps_idx = ps_slice_hdr->i1_short_term_ref_pic_set_idx;
  453|  49.2k|                num_neg_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_neg_pics;
  454|  49.2k|                num_pos_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_pos_pics;
  455|  49.2k|                pi1_used = ps_sps->as_stref_picset[st_rps_idx].ai1_used;
  456|  49.2k|            }
  457|  13.3k|            else
  458|  13.3k|            {
  459|  13.3k|                ret = ihevcd_short_term_ref_pic_set(ps_bitstrm,
  460|  13.3k|                                                    &ps_sps->as_stref_picset[0],
  461|  13.3k|                                                    ps_sps->i1_num_short_term_ref_pic_sets,
  462|  13.3k|                                                    ps_sps->i1_num_short_term_ref_pic_sets,
  463|  13.3k|                                                    &ps_slice_hdr->s_stref_picset);
  464|  13.3k|                if (ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (464:21): [True: 1.48k, False: 11.9k]
  ------------------
  465|  1.48k|                {
  466|  1.48k|                    return ret;
  467|  1.48k|                }
  468|  11.9k|                st_rps_idx = ps_sps->i1_num_short_term_ref_pic_sets;
  469|  11.9k|                num_neg_pics = ps_slice_hdr->s_stref_picset.i1_num_neg_pics;
  470|  11.9k|                num_pos_pics = ps_slice_hdr->s_stref_picset.i1_num_pos_pics;
  471|  11.9k|                pi1_used = ps_slice_hdr->s_stref_picset.ai1_used;
  472|  11.9k|            }
  473|       |
  474|  61.2k|            if(ps_sps->i1_long_term_ref_pics_present_flag)
  ------------------
  |  Branch (474:16): [True: 19.2k, False: 41.9k]
  ------------------
  475|  19.2k|            {
  476|  19.2k|                if(ps_sps->i1_num_long_term_ref_pics_sps > 0)
  ------------------
  |  Branch (476:20): [True: 9.42k, False: 9.82k]
  ------------------
  477|  9.42k|                {
  478|  9.42k|                    UEV_PARSE("num_long_term_sps", value, ps_bitstrm);
  ------------------
  |  |  155|  9.42k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  479|  9.42k|                    if(value > ps_sps->i1_num_long_term_ref_pics_sps)
  ------------------
  |  Branch (479:24): [True: 177, False: 9.25k]
  ------------------
  480|    177|                    {
  481|    177|                        return IHEVCD_INVALID_PARAMETER;
  482|    177|                    }
  483|  9.25k|                    ps_slice_hdr->i1_num_long_term_sps = value;
  484|  9.25k|                }
  485|  19.0k|                UEV_PARSE("num_long_term_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  19.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  486|  19.0k|                if(((ULWORD64)value + ps_slice_hdr->i1_num_long_term_sps + num_neg_pics +
  ------------------
  |  Branch (486:20): [True: 161, False: 18.9k]
  ------------------
  487|  19.0k|                    num_pos_pics) > (MAX_DPB_SIZE - 1))
  ------------------
  |  |  291|  19.0k|#define MAX_DPB_SIZE 16
  ------------------
  488|    161|                {
  489|    161|                    return IHEVCD_INVALID_PARAMETER;
  490|    161|                }
  491|  18.9k|                ps_slice_hdr->i1_num_long_term_pics = value;
  492|       |
  493|   138k|                for(i = 0; i < (ps_slice_hdr->i1_num_long_term_sps +
  ------------------
  |  Branch (493:28): [True: 119k, False: 18.7k]
  ------------------
  494|   138k|                                ps_slice_hdr->i1_num_long_term_pics); i++)
  495|   119k|                {
  496|   119k|                    if(i < ps_slice_hdr->i1_num_long_term_sps)
  ------------------
  |  Branch (496:24): [True: 937, False: 118k]
  ------------------
  497|    937|                    {
  498|       |                        /* Use CLZ to compute Ceil( Log2( num_long_term_ref_pics_sps ) ) */
  499|    937|                        if (ps_sps->i1_num_long_term_ref_pics_sps > 1)
  ------------------
  |  Branch (499:29): [True: 687, False: 250]
  ------------------
  500|    687|                        {
  501|    687|                            WORD32 num_bits = 32 - CLZ(ps_sps->i1_num_long_term_ref_pics_sps - 1);
  502|    687|                            BITS_PARSE("lt_idx_sps[ i ]", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|    687|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  503|    687|                            if(value >= ps_sps->i1_num_long_term_ref_pics_sps)
  ------------------
  |  Branch (503:32): [True: 126, False: 561]
  ------------------
  504|    126|                            {
  505|    126|                                return IHEVCD_INVALID_PARAMETER;
  506|    126|                            }
  507|    687|                        }
  508|    250|                        else
  509|    250|                        {
  510|    250|                            value = 0;
  511|    250|                        }
  512|    811|                        ps_slice_hdr->ai4_poc_lsb_lt[i] = ps_sps->au2_lt_ref_pic_poc_lsb_sps[value];
  513|    811|                        ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i] = ps_sps->ai1_used_by_curr_pic_lt_sps_flag[value];
  514|       |
  515|    811|                    }
  516|   118k|                    else
  517|   118k|                    {
  518|   118k|                        BITS_PARSE("poc_lsb_lt[ i ]", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|   118k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  519|   118k|                        ps_slice_hdr->ai4_poc_lsb_lt[i] = value;
  520|       |
  521|   118k|                        BITS_PARSE("used_by_curr_pic_lt_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   118k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  522|   118k|                        ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i] = value;
  523|       |
  524|   118k|                    }
  525|   119k|                    BITS_PARSE("delta_poc_msb_present_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   119k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  526|   119k|                    ps_slice_hdr->ai1_delta_poc_msb_present_flag[i] = value;
  527|       |
  528|       |
  529|   119k|                    ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] = 0;
  530|   119k|                    if(ps_slice_hdr->ai1_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (530:24): [True: 15.2k, False: 104k]
  ------------------
  531|  15.2k|                    {
  532|       |
  533|  15.2k|                        UEV_PARSE("delata_poc_msb_cycle_lt[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|  15.2k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  534|  15.2k|                        ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] = value;
  535|  15.2k|                    }
  536|       |
  537|   119k|                    if((i != 0) && (i != ps_slice_hdr->i1_num_long_term_sps))
  ------------------
  |  Branch (537:24): [True: 107k, False: 11.8k]
  |  Branch (537:36): [True: 107k, False: 238]
  ------------------
  538|   107k|                    {
  539|   107k|                        ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] += ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i - 1];
  540|   107k|                    }
  541|       |
  542|   119k|                }
  543|  18.9k|            }
  544|       |
  545|   199k|            for(i = 0; i < num_neg_pics + num_pos_pics; i++)
  ------------------
  |  Branch (545:24): [True: 138k, False: 60.7k]
  ------------------
  546|   138k|            {
  547|   138k|                if(pi1_used[i])
  ------------------
  |  Branch (547:20): [True: 115k, False: 23.9k]
  ------------------
  548|   115k|                {
  549|   115k|                    num_poc_total_curr++;
  550|   115k|                }
  551|   138k|            }
  552|   180k|            for(i = 0; i < ps_slice_hdr->i1_num_long_term_sps + ps_slice_hdr->i1_num_long_term_pics; i++)
  ------------------
  |  Branch (552:24): [True: 119k, False: 60.7k]
  ------------------
  553|   119k|            {
  554|   119k|                if(ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i])
  ------------------
  |  Branch (554:20): [True: 22.5k, False: 97.2k]
  ------------------
  555|  22.5k|                {
  556|  22.5k|                    num_poc_total_curr++;
  557|  22.5k|                }
  558|   119k|            }
  559|       |
  560|       |
  561|  60.7k|            if(ps_sps->i1_sps_temporal_mvp_enable_flag)
  ------------------
  |  Branch (561:16): [True: 28.2k, False: 32.4k]
  ------------------
  562|  28.2k|            {
  563|  28.2k|                BITS_PARSE("enable_temporal_mvp_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  28.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  564|  28.2k|                ps_slice_hdr->i1_slice_temporal_mvp_enable_flag = value;
  565|  28.2k|            }
  566|       |
  567|  60.7k|        }
  568|   118k|        ps_slice_hdr->i1_slice_sao_luma_flag = 0;
  569|   118k|        ps_slice_hdr->i1_slice_sao_chroma_flag = 0;
  570|   118k|        if(ps_sps->i1_sample_adaptive_offset_enabled_flag)
  ------------------
  |  Branch (570:12): [True: 86.5k, False: 31.6k]
  ------------------
  571|  86.5k|        {
  572|  86.5k|            BITS_PARSE("slice_sao_luma_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  86.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  573|  86.5k|            ps_slice_hdr->i1_slice_sao_luma_flag = value;
  574|       |
  575|  86.5k|            if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) {
  ------------------
  |  Branch (575:17): [True: 85.1k, False: 1.42k]
  ------------------
  576|  85.1k|                BITS_PARSE("slice_sao_chroma_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  85.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  577|  85.1k|                ps_slice_hdr->i1_slice_sao_chroma_flag = value;
  578|  85.1k|            }
  579|       |
  580|  86.5k|        }
  581|       |
  582|   118k|        ps_slice_hdr->i1_max_num_merge_cand = 1;
  583|   118k|        ps_slice_hdr->i1_cabac_init_flag = 0;
  584|       |
  585|   118k|        ps_slice_hdr->i1_num_ref_idx_l0_active = 0;
  586|   118k|        ps_slice_hdr->i1_num_ref_idx_l1_active = 0;
  587|   118k|        ps_slice_hdr->i1_slice_cb_qp_offset = 0;
  588|   118k|        ps_slice_hdr->i1_slice_cr_qp_offset = 0;
  589|   118k|        if((PSLICE == ps_slice_hdr->i1_slice_type) ||
  ------------------
  |  Branch (589:12): [True: 2.58k, False: 115k]
  ------------------
  590|   115k|           (BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (590:12): [True: 37.9k, False: 77.7k]
  ------------------
  591|  40.5k|        {
  592|  40.5k|            BITS_PARSE("num_ref_idx_active_override_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  40.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  593|  40.5k|            ps_slice_hdr->i1_num_ref_idx_active_override_flag = value;
  594|       |
  595|  40.5k|            if(ps_slice_hdr->i1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (595:16): [True: 19.6k, False: 20.8k]
  ------------------
  596|  19.6k|            {
  597|  19.6k|                UEV_PARSE("num_ref_idx_l0_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  19.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  598|  19.6k|                if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  291|  19.6k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (598:20): [True: 152, False: 19.5k]
  ------------------
  599|    152|                {
  600|    152|                    return IHEVCD_INVALID_PARAMETER;
  601|    152|                }
  602|  19.5k|                ps_slice_hdr->i1_num_ref_idx_l0_active = value + 1;
  603|       |
  604|  19.5k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (604:20): [True: 18.4k, False: 1.09k]
  ------------------
  605|  18.4k|                {
  606|  18.4k|                    UEV_PARSE("num_ref_idx_l1_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  18.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  607|  18.4k|                    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  291|  18.4k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (607:24): [True: 182, False: 18.2k]
  ------------------
  608|    182|                    {
  609|    182|                        return IHEVCD_INVALID_PARAMETER;
  610|    182|                    }
  611|  18.2k|                    ps_slice_hdr->i1_num_ref_idx_l1_active = value + 1;
  612|  18.2k|                }
  613|       |
  614|  19.5k|            }
  615|  20.8k|            else
  616|  20.8k|            {
  617|  20.8k|                ps_slice_hdr->i1_num_ref_idx_l0_active = ps_pps->i1_num_ref_idx_l0_default_active;
  618|  20.8k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (618:20): [True: 19.3k, False: 1.47k]
  ------------------
  619|  19.3k|                {
  620|  19.3k|                    ps_slice_hdr->i1_num_ref_idx_l1_active = ps_pps->i1_num_ref_idx_l1_default_active;
  621|  19.3k|                }
  622|  20.8k|            }
  623|       |
  624|  40.1k|            if(0 == num_poc_total_curr)
  ------------------
  |  Branch (624:16): [True: 2.40k, False: 37.7k]
  ------------------
  625|  2.40k|                return IHEVCD_IGNORE_SLICE;
  626|  37.7k|            if((ps_pps->i1_lists_modification_present_flag) && (num_poc_total_curr > 1))
  ------------------
  |  Branch (626:16): [True: 22.5k, False: 15.2k]
  |  Branch (626:64): [True: 9.40k, False: 13.1k]
  ------------------
  627|  9.40k|            {
  628|  9.40k|                ihevcd_ref_pic_list_modification(ps_bitstrm,
  629|  9.40k|                                                 ps_slice_hdr, num_poc_total_curr);
  630|  9.40k|            }
  631|  28.3k|            else
  632|  28.3k|            {
  633|  28.3k|                ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l0 = 0;
  634|  28.3k|                ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l1 = 0;
  635|  28.3k|            }
  636|       |
  637|  37.7k|            if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (637:16): [True: 35.3k, False: 2.41k]
  ------------------
  638|  35.3k|            {
  639|  35.3k|                BITS_PARSE("mvd_l1_zero_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  35.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  640|  35.3k|                ps_slice_hdr->i1_mvd_l1_zero_flag = value;
  641|  35.3k|            }
  642|       |
  643|  37.7k|            ps_slice_hdr->i1_cabac_init_flag = 0;
  644|  37.7k|            if(ps_pps->i1_cabac_init_present_flag)
  ------------------
  |  Branch (644:16): [True: 25.9k, False: 11.8k]
  ------------------
  645|  25.9k|            {
  646|  25.9k|                BITS_PARSE("cabac_init_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  25.9k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  647|  25.9k|                ps_slice_hdr->i1_cabac_init_flag = value;
  648|       |
  649|  25.9k|            }
  650|  37.7k|            ps_slice_hdr->i1_collocated_from_l0_flag = 1;
  651|  37.7k|            ps_slice_hdr->i1_collocated_ref_idx = 0;
  652|  37.7k|            if(ps_slice_hdr->i1_slice_temporal_mvp_enable_flag)
  ------------------
  |  Branch (652:16): [True: 15.8k, False: 21.8k]
  ------------------
  653|  15.8k|            {
  654|  15.8k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (654:20): [True: 15.1k, False: 756]
  ------------------
  655|  15.1k|                {
  656|  15.1k|                    BITS_PARSE("collocated_from_l0_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  15.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  657|  15.1k|                    ps_slice_hdr->i1_collocated_from_l0_flag = value;
  658|  15.1k|                }
  659|       |
  660|  15.8k|                if((ps_slice_hdr->i1_collocated_from_l0_flag  &&  (ps_slice_hdr->i1_num_ref_idx_l0_active > 1)) ||
  ------------------
  |  Branch (660:21): [True: 9.06k, False: 6.82k]
  |  Branch (660:67): [True: 4.10k, False: 4.95k]
  ------------------
  661|  11.7k|                   (!ps_slice_hdr->i1_collocated_from_l0_flag  && (ps_slice_hdr->i1_num_ref_idx_l1_active > 1)))
  ------------------
  |  Branch (661:21): [True: 6.82k, False: 4.95k]
  |  Branch (661:67): [True: 5.10k, False: 1.71k]
  ------------------
  662|  9.21k|                {
  663|  9.21k|                    UEV_PARSE("collocated_ref_idx", value, ps_bitstrm);
  ------------------
  |  |  155|  9.21k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  664|  9.21k|                    if((PSLICE == ps_slice_hdr->i1_slice_type || BSLICE == ps_slice_hdr->i1_slice_type) &&
  ------------------
  |  Branch (664:25): [True: 252, False: 8.96k]
  |  Branch (664:66): [True: 8.96k, False: 0]
  ------------------
  665|  9.21k|                                    ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (665:37): [True: 4.10k, False: 5.10k]
  ------------------
  666|  4.10k|                    {
  667|  4.10k|                        if(value >= ps_slice_hdr->i1_num_ref_idx_l0_active)
  ------------------
  |  Branch (667:28): [True: 240, False: 3.86k]
  ------------------
  668|    240|                        {
  669|    240|                            return IHEVCD_INVALID_PARAMETER;
  670|    240|                        }
  671|  4.10k|                    }
  672|  8.97k|                    if(BSLICE == ps_slice_hdr->i1_slice_type && !ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (672:24): [True: 8.72k, False: 246]
  |  Branch (672:65): [True: 5.10k, False: 3.62k]
  ------------------
  673|  5.10k|                    {
  674|  5.10k|                        if(value >= ps_slice_hdr->i1_num_ref_idx_l1_active)
  ------------------
  |  Branch (674:28): [True: 148, False: 4.95k]
  ------------------
  675|    148|                        {
  676|    148|                            return IHEVCD_INVALID_PARAMETER;
  677|    148|                        }
  678|  5.10k|                    }
  679|  8.82k|                    ps_slice_hdr->i1_collocated_ref_idx = value;
  680|  8.82k|                }
  681|       |
  682|  15.8k|            }
  683|       |
  684|  37.3k|            if((ps_pps->i1_weighted_pred_flag  &&   (PSLICE == ps_slice_hdr->i1_slice_type)) ||
  ------------------
  |  Branch (684:17): [True: 22.9k, False: 14.4k]
  |  Branch (684:53): [True: 1.63k, False: 21.3k]
  ------------------
  685|  35.7k|               (ps_pps->i1_weighted_bipred_flag  &&  (BSLICE == ps_slice_hdr->i1_slice_type)))
  ------------------
  |  Branch (685:17): [True: 16.6k, False: 19.1k]
  |  Branch (685:54): [True: 16.0k, False: 524]
  ------------------
  686|  17.7k|            {
  687|  17.7k|                ihevcd_parse_pred_wt_ofst(ps_bitstrm, ps_sps, ps_pps, ps_slice_hdr);
  688|  17.7k|            }
  689|  37.3k|            UEV_PARSE("five_minus_max_num_merge_cand", value, ps_bitstrm);
  ------------------
  |  |  155|  37.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  690|  37.3k|            if(value > 4)
  ------------------
  |  Branch (690:16): [True: 3.12k, False: 34.2k]
  ------------------
  691|  3.12k|            {
  692|  3.12k|                return IHEVCD_INVALID_PARAMETER;
  693|  3.12k|            }
  694|  34.2k|            ps_slice_hdr->i1_max_num_merge_cand = 5 - value;
  695|       |
  696|  34.2k|        }
  697|   112k|        SEV_PARSE("slice_qp_delta", i4_value, ps_bitstrm);
  ------------------
  |  |  162|   112k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  698|   112k|        if((i4_value < (MIN_HEVC_QP - ps_pps->i1_pic_init_qp - (6 * ps_sps->i1_bit_depth_luma_minus8))) ||
  ------------------
  |  |  471|   112k|#define MIN_HEVC_QP 0
  ------------------
  |  Branch (698:12): [True: 251, False: 111k]
  ------------------
  699|   111k|           (i4_value > (MAX_HEVC_QP - ps_pps->i1_pic_init_qp)))
  ------------------
  |  |  476|   111k|#define MAX_HEVC_QP 51  //FOR MAIN Branch Encoder
  ------------------
  |  Branch (699:12): [True: 695, False: 111k]
  ------------------
  700|    946|        {
  701|    946|            return IHEVCD_INVALID_PARAMETER;
  702|    946|        }
  703|   111k|        ps_slice_hdr->i1_slice_qp_delta = i4_value;
  704|       |
  705|   111k|        if(ps_pps->i1_pic_slice_level_chroma_qp_offsets_present_flag)
  ------------------
  |  Branch (705:12): [True: 50.6k, False: 60.4k]
  ------------------
  706|  50.6k|        {
  707|  50.6k|            SEV_PARSE("slice_cb_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  50.6k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  708|  50.6k|            if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (708:16): [True: 124, False: 50.5k]
  |  Branch (708:34): [True: 249, False: 50.2k]
  ------------------
  709|    373|            {
  710|    373|                return IHEVCD_INVALID_PARAMETER;
  711|    373|            }
  712|  50.2k|            ps_slice_hdr->i1_slice_cb_qp_offset = i4_value;
  713|       |
  714|  50.2k|            SEV_PARSE("slice_cr_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  50.2k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  715|  50.2k|            if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (715:16): [True: 112, False: 50.1k]
  |  Branch (715:34): [True: 359, False: 49.7k]
  ------------------
  716|    471|            {
  717|    471|                return IHEVCD_INVALID_PARAMETER;
  718|    471|            }
  719|  49.7k|            ps_slice_hdr->i1_slice_cr_qp_offset = i4_value;
  720|       |
  721|  49.7k|        }
  722|   110k|#ifdef ENABLE_MAIN_REXT_PROFILE
  723|   110k|        ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag = 0;
  724|   110k|        if(ps_pps->i1_chroma_qp_offset_list_enabled_flag)
  ------------------
  |  Branch (724:12): [True: 8.53k, False: 101k]
  ------------------
  725|  8.53k|        {
  726|  8.53k|            BITS_PARSE("cu_chroma_qp_offset_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.53k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  727|  8.53k|            ps_slice_hdr->i1_cu_chroma_qp_offset_enabled_flag = value;
  728|  8.53k|        }
  729|   110k|#endif
  730|   110k|        ps_slice_hdr->i1_deblocking_filter_override_flag = 0;
  731|   110k|        ps_slice_hdr->i1_slice_disable_deblocking_filter_flag  = ps_pps->i1_pic_disable_deblocking_filter_flag;
  732|   110k|        ps_slice_hdr->i1_beta_offset_div2 = ps_pps->i1_beta_offset_div2;
  733|   110k|        ps_slice_hdr->i1_tc_offset_div2 = ps_pps->i1_tc_offset_div2;
  734|       |
  735|   110k|        disable_deblocking_filter_flag = ps_pps->i1_pic_disable_deblocking_filter_flag;
  736|       |
  737|   110k|        if(ps_pps->i1_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (737:12): [True: 19.9k, False: 90.2k]
  ------------------
  738|  19.9k|        {
  739|       |
  740|  19.9k|            if(ps_pps->i1_deblocking_filter_override_enabled_flag)
  ------------------
  |  Branch (740:16): [True: 8.85k, False: 11.1k]
  ------------------
  741|  8.85k|            {
  742|  8.85k|                BITS_PARSE("deblocking_filter_override_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.85k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  743|  8.85k|                ps_slice_hdr->i1_deblocking_filter_override_flag = value;
  744|  8.85k|            }
  745|       |
  746|  19.9k|            if(ps_slice_hdr->i1_deblocking_filter_override_flag)
  ------------------
  |  Branch (746:16): [True: 4.27k, False: 15.7k]
  ------------------
  747|  4.27k|            {
  748|  4.27k|                BITS_PARSE("slice_disable_deblocking_filter_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.27k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  749|  4.27k|                ps_slice_hdr->i1_slice_disable_deblocking_filter_flag = value;
  750|  4.27k|                disable_deblocking_filter_flag = ps_slice_hdr->i1_slice_disable_deblocking_filter_flag;
  751|       |
  752|  4.27k|                if(!ps_slice_hdr->i1_slice_disable_deblocking_filter_flag)
  ------------------
  |  Branch (752:20): [True: 1.33k, False: 2.94k]
  ------------------
  753|  1.33k|                {
  754|  1.33k|                    SEV_PARSE("beta_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  1.33k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  755|  1.33k|                    if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (755:24): [True: 109, False: 1.22k]
  |  Branch (755:41): [True: 262, False: 962]
  ------------------
  756|    371|                    {
  757|    371|                        return IHEVCD_INVALID_PARAMETER;
  758|    371|                    }
  759|    962|                    ps_slice_hdr->i1_beta_offset_div2 = i4_value;
  760|       |
  761|    962|                    SEV_PARSE("tc_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|    962|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  762|    962|                    if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (762:24): [True: 89, False: 873]
  |  Branch (762:41): [True: 199, False: 674]
  ------------------
  763|    288|                    {
  764|    288|                        return IHEVCD_INVALID_PARAMETER;
  765|    288|                    }
  766|    674|                    ps_slice_hdr->i1_tc_offset_div2 = i4_value;
  767|       |
  768|    674|                }
  769|  4.27k|            }
  770|  19.9k|        }
  771|       |
  772|   109k|        ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag = ps_pps->i1_loop_filter_across_slices_enabled_flag;
  773|   109k|        if(ps_pps->i1_loop_filter_across_slices_enabled_flag  &&
  ------------------
  |  Branch (773:12): [True: 37.1k, False: 72.3k]
  ------------------
  774|  37.1k|                        (ps_slice_hdr->i1_slice_sao_luma_flag  ||  ps_slice_hdr->i1_slice_sao_chroma_flag  || !disable_deblocking_filter_flag))
  ------------------
  |  Branch (774:26): [True: 16.5k, False: 20.5k]
  |  Branch (774:68): [True: 3.97k, False: 16.6k]
  |  Branch (774:111): [True: 14.1k, False: 2.47k]
  ------------------
  775|  34.7k|        {
  776|  34.7k|            BITS_PARSE("slice_loop_filter_across_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  34.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  777|  34.7k|            ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag = value;
  778|  34.7k|        }
  779|       |
  780|   109k|    }
  781|       |
  782|       |    /* Check sanity of slice */
  783|   120k|    if((!first_slice_in_pic_flag) &&
  ------------------
  |  Branch (783:8): [True: 28.9k, False: 92.0k]
  ------------------
  784|  28.9k|                    (ps_codec->i4_pic_present))
  ------------------
  |  Branch (784:21): [True: 19.7k, False: 9.14k]
  ------------------
  785|  19.7k|    {
  786|  19.7k|        slice_header_t *ps_slice_hdr_base = ps_codec->ps_slice_hdr_base;
  787|       |
  788|       |
  789|       |        /* According to the standard, the above conditions must be satisfied - But for error resilience,
  790|       |         * only the following conditions are checked */
  791|  19.7k|        if((ps_slice_hdr_base->i1_pps_id != ps_slice_hdr->i1_pps_id) ||
  ------------------
  |  Branch (791:12): [True: 854, False: 18.9k]
  ------------------
  792|  18.9k|                        (ps_slice_hdr_base->i4_pic_order_cnt_lsb != ps_slice_hdr->i4_pic_order_cnt_lsb))
  ------------------
  |  Branch (792:25): [True: 918, False: 18.0k]
  ------------------
  793|  1.77k|        {
  794|  1.77k|            return IHEVCD_IGNORE_SLICE;
  795|  1.77k|        }
  796|       |
  797|  19.7k|    }
  798|       |
  799|       |
  800|   119k|    if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (800:8): [True: 101k, False: 18.0k]
  ------------------
  801|   101k|    {
  802|   101k|        ps_slice_hdr->i4_abs_pic_order_cnt = ihevcd_calc_poc(ps_codec, ps_nal, ps_sps->i1_log2_max_pic_order_cnt_lsb, ps_slice_hdr->i4_pic_order_cnt_lsb);
  803|   101k|    }
  804|  18.0k|    else
  805|  18.0k|    {
  806|  18.0k|        ps_slice_hdr->i4_abs_pic_order_cnt = ps_codec->s_parse.i4_abs_pic_order_cnt;
  807|  18.0k|    }
  808|       |
  809|       |
  810|   119k|    if(!first_slice_in_pic_flag)
  ------------------
  |  Branch (810:8): [True: 27.1k, False: 92.0k]
  ------------------
  811|  27.1k|    {
  812|       |        /* Check if the current slice belongs to the same pic (Pic being parsed) */
  813|  27.1k|        if(ps_codec->s_parse.i4_abs_pic_order_cnt == ps_slice_hdr->i4_abs_pic_order_cnt)
  ------------------
  |  Branch (813:12): [True: 19.7k, False: 7.43k]
  ------------------
  814|  19.7k|        {
  815|       |
  816|       |            /* If the Next CTB's index is less than the slice address,
  817|       |             * the previous slice is incomplete.
  818|       |             * Indicate slice error, and treat the remaining CTBs as skip */
  819|  19.7k|            if(slice_address > ps_codec->s_parse.i4_next_ctb_indx)
  ------------------
  |  Branch (819:16): [True: 846, False: 18.8k]
  ------------------
  820|    846|            {
  821|    846|                if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (821:20): [True: 759, False: 87]
  ------------------
  822|    759|                {
  823|    759|                    prev_slice_incomplete_flag = 1;
  824|    759|                    ps_codec->i4_slice_error = 1;
  825|    759|                    ps_codec->s_parse.i4_cur_slice_idx--;
  826|    759|                    if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (826:24): [True: 0, False: 759]
  ------------------
  827|      0|                        ps_codec->s_parse.i4_cur_slice_idx = 0;
  828|    759|                }
  829|    846|                return IHEVCD_IGNORE_SLICE;
  830|    846|            }
  831|       |            /* If the slice address is less than the next CTB's index,
  832|       |             * extra CTBs have been decoded in the previous slice.
  833|       |             * Ignore the current slice. Treat it as incomplete */
  834|  18.8k|            else if(slice_address < ps_codec->s_parse.i4_next_ctb_indx)
  ------------------
  |  Branch (834:21): [True: 3.46k, False: 15.4k]
  ------------------
  835|  3.46k|            {
  836|  3.46k|                return IHEVCD_IGNORE_SLICE;
  837|  3.46k|            }
  838|  15.4k|            else
  839|  15.4k|            {
  840|  15.4k|                ps_codec->i4_slice_error = 0;
  841|  15.4k|            }
  842|  19.7k|        }
  843|       |
  844|       |        /* The current slice does not belong to the pic that is being parsed */
  845|  7.43k|        else
  846|  7.43k|        {
  847|       |            /* The previous pic is incomplete.
  848|       |             * Treat the remaining CTBs as skip */
  849|  7.43k|            if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (849:16): [True: 0, False: 7.43k]
  ------------------
  850|      0|            {
  851|      0|                slice_header_t *ps_slice_hdr_next;
  852|      0|                ps_codec->i4_slice_error = 1;
  853|      0|                ps_codec->s_parse.i4_cur_slice_idx--;
  854|      0|                if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (854:20): [True: 0, False: 0]
  ------------------
  855|      0|                    ps_codec->s_parse.i4_cur_slice_idx = 0;
  856|       |
  857|      0|                ps_slice_hdr_next = ps_codec->s_parse.ps_slice_hdr_base + ((ps_codec->s_parse.i4_cur_slice_idx + 1) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|      0|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|      0|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  858|      0|                ps_slice_hdr_next->i2_ctb_x = 0;
  859|      0|                ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  860|      0|                return ret;
  861|      0|            }
  862|       |
  863|       |            /* If the previous pic is complete,
  864|       |             * return if the current slice is dependant
  865|       |             * otherwise, update the parse context's POC */
  866|  7.43k|            else
  867|  7.43k|            {
  868|  7.43k|                if(ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (868:20): [True: 0, False: 7.43k]
  ------------------
  869|      0|                    return IHEVCD_IGNORE_SLICE;
  870|       |
  871|  7.43k|                ps_codec->s_parse.i4_abs_pic_order_cnt = ps_slice_hdr->i4_abs_pic_order_cnt;
  872|  7.43k|            }
  873|  7.43k|        }
  874|  27.1k|    }
  875|       |
  876|       |    /* If the slice is the first slice in the pic, update the parse context's POC */
  877|  92.0k|    else
  878|  92.0k|    {
  879|       |        /* If the first slice is repeated, ignore the second occurrence
  880|       |         * If any other slice is repeated, the CTB addr will be greater than the slice addr,
  881|       |         * and hence the second occurrence is ignored */
  882|  92.0k|        if(ps_codec->s_parse.i4_abs_pic_order_cnt == ps_slice_hdr->i4_abs_pic_order_cnt)
  ------------------
  |  Branch (882:12): [True: 22.5k, False: 69.4k]
  ------------------
  883|  22.5k|            return IHEVCD_IGNORE_SLICE;
  884|       |
  885|  69.4k|        ps_codec->s_parse.i4_abs_pic_order_cnt = ps_slice_hdr->i4_abs_pic_order_cnt;
  886|  69.4k|    }
  887|       |
  888|       |    // printf("POC: %d\n", ps_slice_hdr->i4_abs_pic_order_cnt);
  889|       |    // AEV_TRACE("POC", ps_slice_hdr->i4_abs_pic_order_cnt, 0);
  890|  92.2k|    ps_slice_hdr->i4_num_entry_point_offsets = 0;
  891|  92.2k|    if((ps_pps->i1_tiles_enabled_flag) ||
  ------------------
  |  Branch (891:8): [True: 16.7k, False: 75.4k]
  ------------------
  892|  75.4k|       (ps_pps->i1_entropy_coding_sync_enabled_flag))
  ------------------
  |  Branch (892:8): [True: 6.25k, False: 69.2k]
  ------------------
  893|  23.0k|    {
  894|  23.0k|        UEV_PARSE("num_entry_point_offsets", value, ps_bitstrm);
  ------------------
  |  |  155|  23.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  895|  23.0k|        ps_slice_hdr->i4_num_entry_point_offsets = value;
  896|       |
  897|  23.0k|        {
  898|  23.0k|            WORD32 max_num_entry_point_offsets;
  899|  23.0k|            if((ps_pps->i1_tiles_enabled_flag) &&
  ------------------
  |  Branch (899:16): [True: 16.7k, False: 6.25k]
  ------------------
  900|  16.7k|                            (ps_pps->i1_entropy_coding_sync_enabled_flag))
  ------------------
  |  Branch (900:29): [True: 7.80k, False: 8.97k]
  ------------------
  901|  7.80k|            {
  902|  7.80k|                max_num_entry_point_offsets = ps_pps->i1_num_tile_columns * ps_sps->i2_pic_ht_in_ctb - 1;
  903|  7.80k|            }
  904|  15.2k|            else if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (904:21): [True: 8.97k, False: 6.25k]
  ------------------
  905|  8.97k|            {
  906|  8.97k|                max_num_entry_point_offsets = ps_pps->i1_num_tile_columns * ps_pps->i1_num_tile_rows - 1 ;
  907|  8.97k|            }
  908|  6.25k|            else
  909|  6.25k|            {
  910|  6.25k|                max_num_entry_point_offsets = (ps_sps->i2_pic_ht_in_ctb - 1);
  911|  6.25k|            }
  912|       |
  913|  23.0k|            if(ps_slice_hdr->i4_num_entry_point_offsets < 0 || ps_slice_hdr->i4_num_entry_point_offsets > max_num_entry_point_offsets)
  ------------------
  |  Branch (913:16): [True: 92, False: 22.9k]
  |  Branch (913:64): [True: 785, False: 22.1k]
  ------------------
  914|    877|            {
  915|    877|                return IHEVCD_INVALID_PARAMETER;
  916|    877|            }
  917|  23.0k|        }
  918|       |
  919|  22.1k|        if(ps_slice_hdr->i4_num_entry_point_offsets > 0)
  ------------------
  |  Branch (919:12): [True: 4.28k, False: 17.8k]
  ------------------
  920|  4.28k|        {
  921|  4.28k|            UEV_PARSE("offset_len_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  4.28k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  922|  4.28k|            if(value > 31)
  ------------------
  |  Branch (922:16): [True: 207, False: 4.08k]
  ------------------
  923|    207|            {
  924|    207|                return IHEVCD_INVALID_PARAMETER;
  925|    207|            }
  926|  4.08k|            ps_slice_hdr->i1_offset_len = value + 1;
  927|       |
  928|  15.3k|            for(i = 0; i < ps_slice_hdr->i4_num_entry_point_offsets; i++)
  ------------------
  |  Branch (928:24): [True: 11.2k, False: 4.08k]
  ------------------
  929|  11.2k|            {
  930|  11.2k|                BITS_PARSE("entry_point_offset", value, ps_bitstrm, ps_slice_hdr->i1_offset_len);
  ------------------
  |  |  148|  11.2k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  931|       |
  932|       |                /* TODO: pu4_entry_point_offset needs to be initialized */
  933|       |                //ps_slice_hdr->pu4_entry_point_offset[i] = value;
  934|  11.2k|            }
  935|       |
  936|  4.08k|        }
  937|  22.1k|    }
  938|       |
  939|  91.1k|    if(ps_pps->i1_slice_header_extension_present_flag)
  ------------------
  |  Branch (939:8): [True: 11.3k, False: 79.8k]
  ------------------
  940|  11.3k|    {
  941|  11.3k|        UEV_PARSE("slice_header_extension_length", value, ps_bitstrm);
  ------------------
  |  |  155|  11.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  942|  11.3k|        if(value > 256)
  ------------------
  |  Branch (942:12): [True: 457, False: 10.8k]
  ------------------
  943|    457|        {
  944|    457|            return IHEVCD_INVALID_PARAMETER;
  945|    457|        }
  946|  10.8k|        ps_slice_hdr->i2_slice_header_extension_length = value;
  947|       |
  948|       |
  949|  37.6k|        for(i = 0; i < ps_slice_hdr->i2_slice_header_extension_length; i++)
  ------------------
  |  Branch (949:20): [True: 26.7k, False: 10.8k]
  ------------------
  950|  26.7k|        {
  951|  26.7k|            BITS_PARSE("slice_header_extension_data_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  26.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  952|  26.7k|        }
  953|       |
  954|  10.8k|    }
  955|       |
  956|  90.7k|    ihevcd_bits_flush_to_byte_boundary(ps_bitstrm);
  957|       |
  958|  90.7k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (958:8): [True: 2.88k, False: 87.8k]
  ------------------
  959|  2.88k|        return IHEVCD_INVALID_PARAMETER;
  960|       |
  961|  87.8k|    {
  962|  87.8k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  963|  87.8k|        WORD32 r_idx;
  964|       |
  965|  87.8k|        if((NAL_IDR_W_LP == ps_slice_hdr->i1_nal_unit_type) ||
  ------------------
  |  Branch (965:12): [True: 13.8k, False: 73.9k]
  ------------------
  966|  73.9k|                        (NAL_IDR_N_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (966:25): [True: 37.0k, False: 36.8k]
  ------------------
  967|  36.8k|                        (NAL_BLA_N_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (967:25): [True: 1.07k, False: 35.7k]
  ------------------
  968|  35.7k|                        (NAL_BLA_W_DLP == ps_slice_hdr->i1_nal_unit_type) ||
  ------------------
  |  Branch (968:25): [True: 1.81k, False: 33.9k]
  ------------------
  969|  33.9k|                        (NAL_BLA_W_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (969:25): [True: 1.13k, False: 32.8k]
  ------------------
  970|  32.8k|                        (0 == ps_codec->u4_pic_cnt))
  ------------------
  |  Branch (970:25): [True: 10.9k, False: 21.8k]
  ------------------
  971|  65.9k|        {
  972|  4.28M|            for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  4.28M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  4.28M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (972:24): [True: 4.21M, False: 65.9k]
  ------------------
  973|  4.21M|            {
  974|  4.21M|                if(ps_dpb_mgr->as_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (974:20): [True: 39.9k, False: 4.17M]
  ------------------
  975|  39.9k|                {
  976|  39.9k|                    pic_buf_t *ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  977|  39.9k|                    mv_buf_t *ps_mv_buf;
  978|       |
  979|       |                    /* Long term index is set to MAX_DPB_BUFS to ensure it is not added as LT */
  980|  39.9k|                    ihevc_dpb_mgr_del_ref((dpb_mgr_t *)ps_codec->pv_dpb_mgr, (buf_mgr_t *)ps_codec->pv_pic_buf_mgr, ps_pic_buf->i4_abs_poc);
  981|       |                    /* Find buffer id of the MV bank corresponding to the buffer being freed (Buffer with POC of u4_abs_poc) */
  982|  39.9k|                    ps_mv_buf = (mv_buf_t *)ps_codec->ps_mv_buf;
  983|  40.8k|                    for(j = 0; j < ps_codec->i4_max_dpb_size; j++)
  ------------------
  |  Branch (983:32): [True: 40.8k, False: 0]
  ------------------
  984|  40.8k|                    {
  985|  40.8k|                        if(ps_mv_buf && ps_mv_buf->i4_abs_poc == ps_pic_buf->i4_abs_poc)
  ------------------
  |  Branch (985:28): [True: 40.8k, False: 0]
  |  Branch (985:41): [True: 39.9k, False: 837]
  ------------------
  986|  39.9k|                        {
  987|  39.9k|                            ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   40|  39.9k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  988|  39.9k|                            break;
  989|  39.9k|                        }
  990|    837|                        ps_mv_buf++;
  991|    837|                    }
  992|       |
  993|  39.9k|                }
  994|       |
  995|  4.21M|            }
  996|       |
  997|       |            /* Initialize the reference lists to NULL
  998|       |             * This is done to take care of the cases where the first pic is not IDR
  999|       |             * but the reference list is not created for the first pic because
 1000|       |             * pic count is zero leaving the reference list uninitialised  */
 1001|  1.12M|            for(r_idx = 0; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|  1.12M|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1001:28): [True: 1.05M, False: 65.9k]
  ------------------
 1002|  1.05M|            {
 1003|  1.05M|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = NULL;
 1004|  1.05M|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = NULL;
 1005|       |
 1006|  1.05M|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = NULL;
 1007|  1.05M|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = NULL;
 1008|  1.05M|            }
 1009|       |
 1010|  65.9k|        }
 1011|  21.8k|        else
 1012|  21.8k|        {
 1013|  21.8k|            ret = ihevcd_ref_list(ps_codec, ps_pps, ps_sps, ps_slice_hdr);
 1014|  21.8k|            if ((WORD32)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1014:17): [True: 1.21k, False: 20.6k]
  ------------------
 1015|  1.21k|            {
 1016|  1.21k|                return ret;
 1017|  1.21k|            }
 1018|       |
 1019|  21.8k|        }
 1020|       |
 1021|  87.8k|    }
 1022|       |
 1023|       |    /* Fill the remaining entries of the reference lists with the nearest POC
 1024|       |     * This is done to handle cases where there is a corruption in the reference index */
 1025|  86.6k|    if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (1025:8): [True: 15.3k, False: 71.2k]
  ------------------
 1026|  15.3k|    {
 1027|  15.3k|        pic_buf_t *ps_pic_buf_ref;
 1028|  15.3k|        mv_buf_t *ps_mv_buf_ref;
 1029|  15.3k|        WORD32 r_idx;
 1030|  15.3k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
 1031|  15.3k|        buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
 1032|       |
 1033|  15.3k|        ps_pic_buf_ref = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ps_slice_hdr->i4_abs_pic_order_cnt);
 1034|  15.3k|        if(NULL == ps_pic_buf_ref)
  ------------------
  |  Branch (1034:12): [True: 8.49k, False: 6.88k]
  ------------------
 1035|  8.49k|        {
 1036|  8.49k|            ps_pic_buf_ref = ps_codec->as_process[0].ps_cur_pic;
 1037|  8.49k|            ps_mv_buf_ref = ps_codec->s_parse.ps_cur_mv_buf;
 1038|  8.49k|        }
 1039|  6.88k|        else
 1040|  6.88k|        {
 1041|  6.88k|            ps_mv_buf_ref = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf_ref->i4_abs_poc);
 1042|  6.88k|        }
 1043|       |
 1044|  30.4k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (1044:24): [True: 15.1k, False: 15.3k]
  ------------------
 1045|  15.1k|        {
 1046|  15.1k|            if(NULL == ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1046:16): [True: 3.17k, False: 11.9k]
  ------------------
 1047|  3.17k|            {
 1048|  3.17k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1049|  3.17k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1050|  3.17k|            }
 1051|  15.1k|        }
 1052|       |
 1053|   246k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|   246k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1053:61): [True: 230k, False: 15.3k]
  ------------------
 1054|   230k|        {
 1055|   230k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1056|   230k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1057|   230k|        }
 1058|       |
 1059|  30.3k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (1059:24): [True: 14.9k, False: 15.3k]
  ------------------
 1060|  14.9k|        {
 1061|  14.9k|            if(NULL == ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1061:16): [True: 4.11k, False: 10.8k]
  ------------------
 1062|  4.11k|            {
 1063|  4.11k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1064|  4.11k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1065|  4.11k|            }
 1066|  14.9k|        }
 1067|       |
 1068|   246k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|   246k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1068:61): [True: 231k, False: 15.3k]
  ------------------
 1069|   231k|        {
 1070|   231k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1071|   231k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1072|   231k|        }
 1073|  15.3k|    }
 1074|       |
 1075|       |    /* Update slice address in the header */
 1076|  86.6k|    if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1076:8): [True: 22.0k, False: 64.5k]
  ------------------
 1077|  22.0k|    {
 1078|  22.0k|        ps_slice_hdr->i2_ctb_x = slice_address % ps_sps->i2_pic_wd_in_ctb;
 1079|  22.0k|        ps_slice_hdr->i2_ctb_y = slice_address / ps_sps->i2_pic_wd_in_ctb;
 1080|       |
 1081|  22.0k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (1081:12): [True: 13.0k, False: 9.02k]
  ------------------
 1082|  13.0k|        {
 1083|  13.0k|            ps_slice_hdr->i2_independent_ctb_x = ps_slice_hdr->i2_ctb_x;
 1084|  13.0k|            ps_slice_hdr->i2_independent_ctb_y = ps_slice_hdr->i2_ctb_y;
 1085|  13.0k|        }
 1086|  22.0k|    }
 1087|  64.5k|    else
 1088|  64.5k|    {
 1089|  64.5k|        ps_slice_hdr->i2_ctb_x = 0;
 1090|  64.5k|        ps_slice_hdr->i2_ctb_y = 0;
 1091|       |
 1092|  64.5k|        ps_slice_hdr->i2_independent_ctb_x = 0;
 1093|  64.5k|        ps_slice_hdr->i2_independent_ctb_y = 0;
 1094|  64.5k|    }
 1095|       |
 1096|       |    /* If the first slice in the pic is missing, copy the current slice header to
 1097|       |     * the first slice's header */
 1098|  86.6k|    if((!first_slice_in_pic_flag) &&
  ------------------
  |  Branch (1098:8): [True: 22.0k, False: 64.5k]
  ------------------
 1099|  22.0k|                    (0 == ps_codec->i4_pic_present))
  ------------------
  |  Branch (1099:21): [True: 6.65k, False: 15.3k]
  ------------------
 1100|  6.65k|    {
 1101|  6.65k|        slice_header_t *ps_slice_hdr_prev = ps_codec->s_parse.ps_slice_hdr_base;
 1102|  6.65k|        ihevcd_copy_slice_hdr(ps_codec, 0, (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1)));
  ------------------
  |  |  153|  6.65k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.65k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1103|       |
 1104|  6.65k|        prev_slice_incomplete_flag = 1;
 1105|  6.65k|        ASSERT(ps_codec->s_parse.i4_cur_slice_idx == 1);
  ------------------
  |  |   55|  6.65k|#define ASSERT(x) {}
  ------------------
 1106|       |
 1107|  6.65k|        ps_slice_hdr_prev->i2_ctb_x = 0;
 1108|  6.65k|        ps_slice_hdr_prev->i2_ctb_y = 0;
 1109|       |
 1110|  6.65k|        ps_codec->s_parse.i4_ctb_x = 0;
 1111|  6.65k|        ps_codec->s_parse.i4_ctb_y = 0;
 1112|       |
 1113|  6.65k|        ps_codec->s_parse.i4_cur_slice_idx = 0;
 1114|       |
 1115|  6.65k|        if((ps_slice_hdr->i2_ctb_x == 0) &&
  ------------------
  |  Branch (1115:12): [True: 1.60k, False: 5.04k]
  ------------------
 1116|  1.60k|                        (ps_slice_hdr->i2_ctb_y == 0))
  ------------------
  |  Branch (1116:25): [True: 0, False: 1.60k]
  ------------------
 1117|      0|        {
 1118|      0|            ps_slice_hdr->i2_ctb_x++;
 1119|      0|        }
 1120|  6.65k|    }
 1121|       |
 1122|  86.6k|    {
 1123|       |        /* If skip B is enabled,
 1124|       |         * ignore pictures that are non-reference
 1125|       |         * TODO: (i1_nal_unit_type < NAL_BLA_W_LP) && (i1_nal_unit_type % 2 == 0) only says it is
 1126|       |         * sub-layer non-reference slice. May need to find a way to detect actual non-reference pictures*/
 1127|       |
 1128|  86.6k|        if((i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1128:12): [True: 30.2k, False: 56.3k]
  ------------------
 1129|  30.2k|                        (i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1129:25): [True: 23.5k, False: 6.71k]
  ------------------
 1130|  23.5k|        {
 1131|  23.5k|            if(IVD_SKIP_B == ps_codec->e_pic_skip_mode)
  ------------------
  |  Branch (1131:16): [True: 0, False: 23.5k]
  ------------------
 1132|      0|                return IHEVCD_IGNORE_SLICE;
 1133|  23.5k|        }
 1134|       |
 1135|       |        /* If skip PB is enabled,
 1136|       |         * decode only I slices */
 1137|  86.6k|        if((IVD_SKIP_PB == ps_codec->e_pic_skip_mode) &&
  ------------------
  |  Branch (1137:12): [True: 0, False: 86.6k]
  ------------------
 1138|      0|                        (ISLICE != ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (1138:25): [True: 0, False: 0]
  ------------------
 1139|      0|        {
 1140|      0|            return IHEVCD_IGNORE_SLICE;
 1141|      0|        }
 1142|  86.6k|    }
 1143|       |
 1144|  86.6k|    if(prev_slice_incomplete_flag)
  ------------------
  |  Branch (1144:8): [True: 6.65k, False: 79.9k]
  ------------------
 1145|  6.65k|    {
 1146|  6.65k|        ps_codec->i4_slice_error = 1;
 1147|  6.65k|        ps_codec->s_parse.i4_cur_slice_idx--;
 1148|  6.65k|        if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (1148:12): [True: 6.65k, False: 0]
  ------------------
 1149|  6.65k|            ps_codec->s_parse.i4_cur_slice_idx = 0;
 1150|  6.65k|    }
 1151|       |
 1152|  86.6k|    return ret;
 1153|  86.6k|}

ihevcd_proc_map_check:
  110|  75.9M|{
  111|  75.9M|    tile_t *ps_tile = ps_proc->ps_tile;
  112|  75.9M|    sps_t *ps_sps = ps_proc->ps_sps;
  113|  75.9M|    pps_t *ps_pps = ps_proc->ps_pps;
  114|  75.9M|    codec_t *ps_codec = ps_proc->ps_codec;
  115|  75.9M|    WORD32 idx;
  116|  75.9M|    WORD32 nop_cnt;
  117|  75.9M|    WORD32 bit_pos = proc_type;
  118|  75.9M|    WORD32 bit_mask = (1 << bit_pos);
  119|       |
  120|  75.9M|    if(ps_proc->i4_check_proc_status)
  ------------------
  |  Branch (120:8): [True: 43.3M, False: 32.5M]
  ------------------
  121|  43.3M|    {
  122|  43.3M|        nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  43.3M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  123|   130M|        while(1)
  ------------------
  |  Branch (123:15): [True: 129M, Folded]
  ------------------
  124|   129M|        {
  125|   129M|            volatile UWORD8 *pu1_buf;
  126|   129M|            volatile WORD32 status;
  127|   129M|            status = 1;
  128|       |            /* Check if all dependencies for the next nCTBs are met */
  129|   129M|            {
  130|   129M|                WORD32 x_pos;
  131|       |
  132|   129M|                {
  133|       |                    /* Check if the top right of next nCTBs are processed */
  134|   129M|                    if(ps_proc->i4_ctb_y > 0)
  ------------------
  |  Branch (134:24): [True: 126M, False: 2.26M]
  ------------------
  135|   126M|                    {
  136|   126M|                        x_pos = (ps_proc->i4_ctb_tile_x + nctb);
  137|   126M|                        idx = MIN(x_pos, (ps_tile->u2_wd - 1));
  ------------------
  |  |   43|   126M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 104M, False: 21.8M]
  |  |  ------------------
  ------------------
  138|       |
  139|       |                        /* Check if top-right CTB for the last CTB in nCTB is within the tile */
  140|   126M|                        {
  141|   126M|                            idx += ps_tile->u1_pos_x;
  142|   126M|                            idx += ((ps_proc->i4_ctb_y - 1)
  143|   126M|                                            * ps_sps->i2_pic_wd_in_ctb);
  144|   126M|                            pu1_buf = (ps_codec->pu1_proc_map + idx);
  145|   126M|                            status = *pu1_buf & bit_mask;
  146|   126M|                        }
  147|   126M|                    }
  148|   129M|                }
  149|       |
  150|       |                /* If tiles are enabled, then test left and top-left as well */
  151|   129M|                ps_pps = ps_proc->ps_pps;
  152|   129M|                if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (152:20): [True: 36.4M, False: 92.6M]
  ------------------
  153|  36.4M|                {
  154|       |                    /*Check if left ctb is processed*/
  155|  36.4M|                    if((ps_proc->i4_ctb_x > 0) && ((0 != status)))
  ------------------
  |  Branch (155:24): [True: 33.7M, False: 2.65M]
  |  Branch (155:51): [True: 16.2M, False: 17.4M]
  ------------------
  156|  16.3M|                    {
  157|  16.3M|                        x_pos   = ps_tile->u1_pos_x + ps_proc->i4_ctb_tile_x - 1;
  158|  16.3M|                        idx     = x_pos + (ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  159|  16.3M|                        pu1_buf = (ps_codec->pu1_proc_map + idx);
  160|  16.3M|                        status  = *pu1_buf & bit_mask;
  161|  16.3M|                    }
  162|       |
  163|       |                    /*Check if top left ctb is processed*/
  164|  36.4M|                    if((ps_proc->i4_ctb_x > 0) && (0 != status) && (ps_proc->i4_ctb_y > 0))
  ------------------
  |  Branch (164:24): [True: 33.8M, False: 2.62M]
  |  Branch (164:51): [True: 15.3M, False: 18.4M]
  |  Branch (164:68): [True: 14.7M, False: 293k]
  ------------------
  165|  14.7M|                    {
  166|  14.7M|                        x_pos   = ps_tile->u1_pos_x + ps_proc->i4_ctb_tile_x - 1;
  167|  14.7M|                        idx     = x_pos + ((ps_proc->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  168|  14.7M|                        pu1_buf = (ps_codec->pu1_proc_map + idx);
  169|  14.7M|                        status  = *pu1_buf & bit_mask;
  170|  14.7M|                    }
  171|  36.4M|                }
  172|   129M|            }
  173|       |
  174|   129M|            if(status)
  ------------------
  |  Branch (174:16): [True: 41.7M, False: 87.2M]
  ------------------
  175|  41.7M|                break;
  176|       |
  177|       |            /* if dependencies are not met, then wait for few cycles.
  178|       |             * Even after few iterations, if the dependencies are not met then yield
  179|       |             */
  180|  87.2M|            if(nop_cnt > 0)
  ------------------
  |  Branch (180:16): [True: 76.8M, False: 10.4M]
  ------------------
  181|  76.8M|            {
  182|  76.8M|                NOP(128);
  ------------------
  |  |   68|  9.51G|#define NOP(nop_cnt)    {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (68:57): [True: 9.43G, False: 76.8M]
  |  |  ------------------
  ------------------
  183|  76.8M|                nop_cnt -= 128;
  184|  76.8M|            }
  185|  10.4M|            else
  186|  10.4M|            {
  187|  10.4M|                nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  10.4M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  188|  10.4M|                ithread_yield();
  189|       |                //NOP(128 * 16);
  190|  10.4M|            }
  191|  87.2M|        }
  192|  43.3M|        DATA_SYNC();
  ------------------
  |  |  100|  43.3M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  193|  43.3M|    }
  194|  75.9M|}
ihevcd_proc_map_update:
  197|  92.5M|{
  198|  92.5M|    codec_t *ps_codec = ps_proc->ps_codec;
  199|  92.5M|    WORD32 i, idx;
  200|  92.5M|    WORD32 bit_pos = proc_type;
  201|  92.5M|    WORD32 bit_mask = (1 << bit_pos);
  202|       |
  203|       |    /* Update the current CTBs processing status */
  204|  92.5M|    if(ps_proc->i4_check_proc_status)
  ------------------
  |  Branch (204:8): [True: 51.9M, False: 40.6M]
  ------------------
  205|  51.9M|    {
  206|  51.9M|        DATA_SYNC();
  ------------------
  |  |  100|  51.9M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  207|   108M|        for(i = 0; i < nctb; i++)
  ------------------
  |  Branch (207:20): [True: 56.0M, False: 51.9M]
  ------------------
  208|  56.0M|        {
  209|  56.0M|            sps_t *ps_sps = ps_proc->ps_sps;
  210|  56.0M|            UWORD8 *pu1_buf;
  211|  56.0M|            idx = (ps_proc->i4_ctb_x + i);
  212|  56.0M|            idx += ((ps_proc->i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb);
  213|  56.0M|            pu1_buf = (ps_codec->pu1_proc_map + idx);
  214|  56.0M|            *pu1_buf = *pu1_buf | bit_mask;
  215|  56.0M|        }
  216|  51.9M|    }
  217|  92.5M|}
ihevcd_slice_hdr_update:
  221|  76.9M|{
  222|       |
  223|       |    /* Slice x and y are initialized in proc_init. But initialize slice x and y count here
  224|       |     *  if a new slice begins at the middle of a row since proc_init is invoked only at the beginning of each row */
  225|  76.9M|    if(!((ps_proc->i4_ctb_x == 0) && (ps_proc->i4_ctb_y == 0)))
  ------------------
  |  Branch (225:10): [True: 4.14M, False: 72.8M]
  |  Branch (225:38): [True: 279k, False: 3.86M]
  ------------------
  226|  76.2M|    {
  227|  76.2M|        slice_header_t *ps_slice_hdr_next = ps_proc->ps_codec->ps_slice_hdr_base + ((ps_proc->i4_cur_slice_idx + 1) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  76.2M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  76.2M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  228|       |
  229|  76.2M|        if((ps_slice_hdr_next->i2_ctb_x == ps_proc->i4_ctb_x)
  ------------------
  |  Branch (229:12): [True: 2.78M, False: 73.5M]
  ------------------
  230|  2.78M|                        && (ps_slice_hdr_next->i2_ctb_y == ps_proc->i4_ctb_y))
  ------------------
  |  Branch (230:28): [True: 29.7k, False: 2.75M]
  ------------------
  231|  29.7k|        {
  232|  29.7k|            if(0 == ps_slice_hdr_next->i1_dependent_slice_flag)
  ------------------
  |  Branch (232:16): [True: 14.3k, False: 15.3k]
  ------------------
  233|  14.3k|            {
  234|  14.3k|                ps_proc->i4_ctb_slice_x = 0;
  235|  14.3k|                ps_proc->i4_ctb_slice_y = 0;
  236|  14.3k|            }
  237|       |
  238|  29.7k|            ps_proc->i4_cur_slice_idx++;
  239|  29.7k|            ps_proc->ps_slice_hdr = ps_slice_hdr_next;
  240|  29.7k|        }
  241|       |
  242|  76.2M|    }
  243|  76.9M|}
ihevcd_ctb_pos_update:
  246|  57.8M|{
  247|  57.8M|    WORD32 tile_start_ctb_idx, slice_start_ctb_idx;
  248|  57.8M|    slice_header_t *ps_slice_hdr = ps_proc->ps_slice_hdr;
  249|  57.8M|    tile_t *ps_tile = ps_proc->ps_tile;
  250|  57.8M|    sps_t *ps_sps = ps_proc->ps_sps;
  251|       |
  252|       |    /* Update x and y positions */
  253|  57.8M|    ps_proc->i4_ctb_tile_x += nctb;
  254|  57.8M|    ps_proc->i4_ctb_x += nctb;
  255|       |
  256|  57.8M|    ps_proc->i4_ctb_slice_x += nctb;
  257|       |    /*If tile are enabled, then handle the tile & slice counters differently*/
  258|  57.8M|    if(ps_proc->ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (258:8): [True: 17.5M, False: 40.2M]
  ------------------
  259|  17.5M|    {
  260|       |        /* Update slice counters*/
  261|  17.5M|        slice_start_ctb_idx = ps_slice_hdr->i2_ctb_x + (ps_slice_hdr->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  262|  17.5M|        tile_start_ctb_idx = ps_tile->u1_pos_x + (ps_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  263|       |        /*
  264|       |         * There can be 2 cases where slice counters must be handled differently.
  265|       |         * 1 - Multiple tiles span across a single/one of the many slice.
  266|       |         * 2 - Multiple slices span across a single/one of the many tiles.
  267|       |         */
  268|       |
  269|       |        /*Case 1 */
  270|  17.5M|        if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (270:12): [True: 14.2M, False: 3.32M]
  ------------------
  271|  14.2M|        {
  272|       |            /*End of tile row*/
  273|  14.2M|            if(ps_proc->i4_ctb_x > ps_slice_hdr->i2_ctb_x)
  ------------------
  |  Branch (273:16): [True: 13.9M, False: 365k]
  ------------------
  274|  13.9M|            {
  275|  13.9M|                if(ps_proc->i4_ctb_slice_x >= (ps_tile->u2_wd + ps_tile->u1_pos_x))
  ------------------
  |  Branch (275:20): [True: 1.58M, False: 12.3M]
  ------------------
  276|  1.58M|                {
  277|  1.58M|                    ps_proc->i4_ctb_slice_y++;
  278|  1.58M|                    ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_slice_x
  279|  1.58M|                                    - ps_tile->u2_wd;
  280|  1.58M|                }
  281|  13.9M|            }
  282|   365k|            else
  283|   365k|            {
  284|   365k|                WORD32 temp_stride = (ps_sps->i2_pic_wd_in_ctb - ps_slice_hdr->i2_ctb_x);
  285|   365k|                if(ps_proc->i4_ctb_slice_x >= (temp_stride + ps_tile->u2_wd + ps_tile->u1_pos_x))
  ------------------
  |  Branch (285:20): [True: 14.2k, False: 351k]
  ------------------
  286|  14.2k|                {
  287|  14.2k|                    ps_proc->i4_ctb_slice_y++;
  288|  14.2k|                    ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_slice_x
  289|  14.2k|                                    - ps_tile->u2_wd;
  290|  14.2k|                }
  291|   365k|            }
  292|  14.2M|        }
  293|       |        /*Case 2*/
  294|  3.32M|        else if(ps_proc->i4_ctb_slice_x >= (ps_tile->u2_wd))
  ------------------
  |  Branch (294:17): [True: 217k, False: 3.11M]
  ------------------
  295|   217k|        {
  296|       |            /*End of tile row*/
  297|   217k|            ps_proc->i4_ctb_slice_y++;
  298|   217k|            ps_proc->i4_ctb_slice_x = 0;
  299|   217k|        }
  300|  17.5M|    }
  301|  40.2M|    else
  302|  40.2M|    {
  303|  40.2M|        if(ps_proc->i4_ctb_slice_x >= ps_tile->u2_wd)
  ------------------
  |  Branch (303:12): [True: 2.72M, False: 37.4M]
  ------------------
  304|  2.72M|        {
  305|  2.72M|            ps_proc->i4_ctb_slice_y++;
  306|  2.72M|            ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_slice_x
  307|  2.72M|                            - ps_tile->u2_wd;
  308|  2.72M|        }
  309|  40.2M|    }
  310|  57.8M|}
ihevcd_ctb_avail_update:
  313|  38.4M|{
  314|  38.4M|    slice_header_t *ps_slice_hdr = ps_proc->ps_slice_hdr;
  315|  38.4M|    sps_t *ps_sps = ps_proc->ps_sps;
  316|  38.4M|    tile_t *ps_tile_prev;
  317|  38.4M|    tile_t *ps_tile = ps_proc->ps_tile;
  318|  38.4M|    WORD32 cur_pu_idx;
  319|  38.4M|    WORD32 tile_start_ctb_idx, slice_start_ctb_idx;
  320|  38.4M|    WORD16 i2_wd_in_ctb;
  321|  38.4M|    WORD32 continuous_tiles = 0;
  322|  38.4M|    WORD32 cur_ctb_idx;
  323|  38.4M|    WORD32 check_tile_wd;
  324|       |
  325|  38.4M|    if((0 != ps_tile->u1_pos_x) && (0 != ps_tile->u1_pos_y))
  ------------------
  |  Branch (325:8): [True: 6.95M, False: 31.5M]
  |  Branch (325:36): [True: 4.05M, False: 2.90M]
  ------------------
  326|  4.05M|    {
  327|  4.05M|        ps_tile_prev = ps_tile - 1;
  328|  4.05M|    }
  329|  34.4M|    else
  330|  34.4M|    {
  331|  34.4M|        ps_tile_prev = ps_tile;
  332|  34.4M|    }
  333|       |
  334|       |
  335|  38.4M|    check_tile_wd = ps_slice_hdr->i2_ctb_x + ps_tile_prev->u2_wd;
  336|  38.4M|    if(!(((check_tile_wd >= ps_sps->i2_pic_wd_in_ctb) && (check_tile_wd % ps_sps->i2_pic_wd_in_ctb == ps_tile->u1_pos_x))
  ------------------
  |  Branch (336:11): [True: 29.5M, False: 8.96M]
  |  Branch (336:58): [True: 28.2M, False: 1.30M]
  ------------------
  337|  10.2M|                                    || ((ps_slice_hdr->i2_ctb_x == ps_tile->u1_pos_x))))
  ------------------
  |  Branch (337:40): [True: 2.09M, False: 8.18M]
  ------------------
  338|  8.18M|    {
  339|  8.18M|        continuous_tiles = 1;
  340|  8.18M|    }
  341|       |
  342|  38.4M|    slice_start_ctb_idx = ps_slice_hdr->i2_ctb_x + (ps_slice_hdr->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  343|  38.4M|    tile_start_ctb_idx = ps_tile->u1_pos_x + (ps_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  344|       |
  345|  38.4M|    if((slice_start_ctb_idx < tile_start_ctb_idx) && (continuous_tiles))
  ------------------
  |  Branch (345:8): [True: 9.47M, False: 29.0M]
  |  Branch (345:54): [True: 6.64M, False: 2.83M]
  ------------------
  346|  6.64M|    {
  347|       |        //Slices span across multiple tiles.
  348|  6.64M|        i2_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
  349|  6.64M|    }
  350|  31.8M|    else
  351|  31.8M|    {
  352|  31.8M|        i2_wd_in_ctb = ps_tile->u2_wd;
  353|  31.8M|    }
  354|  38.4M|    cur_ctb_idx = ps_proc->i4_ctb_x
  355|  38.4M|                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  356|       |
  357|       |    /* Ctb level availability */
  358|       |    /* Bottom left will not be available at a CTB level, no need to pass this */
  359|  38.4M|    ps_proc->u1_top_ctb_avail = 1;
  360|  38.4M|    ps_proc->u1_left_ctb_avail = 1;
  361|  38.4M|    ps_proc->u1_top_lt_ctb_avail = 1;
  362|  38.4M|    ps_proc->u1_top_rt_ctb_avail = 1;
  363|       |    /* slice and tile boundaries */
  364|       |
  365|  38.4M|    if((0 == ps_proc->i4_ctb_y) || (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (365:8): [True: 1.52M, False: 36.9M]
  |  Branch (365:36): [True: 523k, False: 36.4M]
  ------------------
  366|  2.05M|    {
  367|  2.05M|        ps_proc->u1_top_ctb_avail = 0;
  368|  2.05M|        ps_proc->u1_top_lt_ctb_avail = 0;
  369|  2.05M|        ps_proc->u1_top_rt_ctb_avail = 0;
  370|  2.05M|    }
  371|       |
  372|  38.4M|    if((0 == ps_proc->i4_ctb_x) || (0 == ps_proc->i4_ctb_tile_x))
  ------------------
  |  Branch (372:8): [True: 2.08M, False: 36.4M]
  |  Branch (372:36): [True: 911k, False: 35.4M]
  ------------------
  373|  2.98M|    {
  374|  2.98M|        ps_proc->u1_left_ctb_avail = 0;
  375|  2.98M|        ps_proc->u1_top_lt_ctb_avail = 0;
  376|  2.98M|        if((0 == ps_proc->i4_ctb_slice_y) || (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (376:12): [True: 168k, False: 2.81M]
  |  Branch (376:46): [True: 100k, False: 2.71M]
  ------------------
  377|   270k|        {
  378|   270k|            ps_proc->u1_top_ctb_avail = 0;
  379|   270k|            if((i2_wd_in_ctb - 1) != ps_proc->i4_ctb_slice_x)
  ------------------
  |  Branch (379:16): [True: 196k, False: 74.0k]
  ------------------
  380|   196k|            {
  381|   196k|                ps_proc->u1_top_rt_ctb_avail = 0;
  382|   196k|            }
  383|   270k|        }
  384|  2.98M|    }
  385|       |    /*For slices not beginning at start of a ctb row*/
  386|  35.5M|    else if(ps_proc->i4_ctb_x > 0)
  ------------------
  |  Branch (386:13): [True: 35.5M, False: 8.35k]
  ------------------
  387|  35.5M|    {
  388|  35.5M|        if((0 == ps_proc->i4_ctb_slice_y) || (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (388:12): [True: 1.38M, False: 34.1M]
  |  Branch (388:46): [True: 694k, False: 33.4M]
  ------------------
  389|  2.08M|        {
  390|  2.08M|            ps_proc->u1_top_ctb_avail = 0;
  391|  2.08M|            ps_proc->u1_top_lt_ctb_avail = 0;
  392|  2.08M|            if(0 == ps_proc->i4_ctb_slice_x)
  ------------------
  |  Branch (392:16): [True: 24.7k, False: 2.06M]
  ------------------
  393|  24.7k|            {
  394|  24.7k|                ps_proc->u1_left_ctb_avail = 0;
  395|  24.7k|            }
  396|  2.08M|            if((i2_wd_in_ctb - 1) != ps_proc->i4_ctb_slice_x)
  ------------------
  |  Branch (396:16): [True: 1.95M, False: 130k]
  ------------------
  397|  1.95M|            {
  398|  1.95M|                ps_proc->u1_top_rt_ctb_avail = 0;
  399|  1.95M|            }
  400|  2.08M|        }
  401|  33.4M|        else if((1 == ps_proc->i4_ctb_slice_y) && (0 == ps_proc->i4_ctb_slice_x))
  ------------------
  |  Branch (401:17): [True: 1.26M, False: 32.1M]
  |  Branch (401:51): [True: 6.65k, False: 1.25M]
  ------------------
  402|  6.65k|        {
  403|  6.65k|            ps_proc->u1_top_lt_ctb_avail = 0;
  404|  6.65k|        }
  405|  35.5M|    }
  406|       |
  407|  38.4M|    if((ps_proc->i4_ctb_x == (ps_sps->i2_pic_wd_in_ctb - 1)) || ((ps_tile->u2_wd - 1) == ps_proc->i4_ctb_tile_x))
  ------------------
  |  Branch (407:8): [True: 2.14M, False: 36.3M]
  |  Branch (407:65): [True: 906k, False: 35.4M]
  ------------------
  408|  2.98M|    {
  409|  2.98M|        ps_proc->u1_top_rt_ctb_avail = 0;
  410|  2.98M|    }
  411|       |
  412|       |
  413|  38.4M|    {
  414|  38.4M|        WORD32 next_ctb_idx;
  415|  38.4M|        next_ctb_idx = cur_ctb_idx + 1;
  416|       |
  417|  38.4M|        if(ps_tile->u2_wd == (ps_proc->i4_ctb_tile_x + 1))
  ------------------
  |  Branch (417:12): [True: 2.98M, False: 35.5M]
  ------------------
  418|  2.98M|        {
  419|  2.98M|            if((ps_proc->i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (419:16): [True: 250k, False: 2.73M]
  ------------------
  420|   250k|            {
  421|       |                //Last tile
  422|   250k|                if(((ps_proc->i4_ctb_tile_y + 1 + ps_tile->u1_pos_y) == ps_sps->i2_pic_ht_in_ctb) && ((ps_proc->i4_ctb_tile_x + 1 + ps_tile->u1_pos_x) == ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (422:20): [True: 160k, False: 90.2k]
  |  Branch (422:102): [True: 139k, False: 20.5k]
  ------------------
  423|   139k|                {
  424|   139k|                    next_ctb_idx = cur_ctb_idx + 1;
  425|   139k|                }
  426|   110k|                else //Not last tile, but new tile
  427|   110k|                {
  428|   110k|                    tile_t *ps_tile_next = ps_proc->ps_tile + 1;
  429|   110k|                    next_ctb_idx = ps_tile_next->u1_pos_x + (ps_tile_next->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  430|   110k|                }
  431|   250k|            }
  432|  2.73M|            else //End of each tile row
  433|  2.73M|            {
  434|  2.73M|                next_ctb_idx = ((ps_tile->u1_pos_y + ps_proc->i4_ctb_tile_y + 1) * ps_sps->i2_pic_wd_in_ctb) + ps_tile->u1_pos_x;
  435|  2.73M|            }
  436|  2.98M|        }
  437|  38.4M|        ps_proc->i4_next_pu_ctb_cnt = next_ctb_idx;
  438|  38.4M|        ps_proc->i4_ctb_pu_cnt =
  439|  38.4M|                        ps_proc->pu4_pic_pu_idx[next_ctb_idx]
  440|  38.4M|                        - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  441|  38.4M|        cur_pu_idx = ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  442|  38.4M|        ps_proc->i4_ctb_start_pu_idx = cur_pu_idx;
  443|  38.4M|        ps_proc->ps_pu = &ps_proc->ps_pic_pu[cur_pu_idx];
  444|  38.4M|    }
  445|  38.4M|}
ihevcd_update_ctb_tu_cnt:
  448|  25.9M|{
  449|  25.9M|    sps_t *ps_sps = ps_proc->ps_sps;
  450|  25.9M|    codec_t *ps_codec = ps_proc->ps_codec;
  451|  25.9M|    WORD32 cur_ctb_idx;
  452|       |
  453|  25.9M|    cur_ctb_idx = ps_proc->i4_ctb_x
  454|  25.9M|                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  455|       |
  456|  25.9M|    {
  457|  25.9M|        tile_t *ps_tile;
  458|  25.9M|        WORD32 next_ctb_tu_idx;
  459|  25.9M|        ps_tile = ps_proc->ps_tile;
  460|       |
  461|       |
  462|  25.9M|        if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (462:12): [True: 8.14M, False: 17.8M]
  ------------------
  463|  8.14M|        {
  464|  8.14M|            next_ctb_tu_idx = cur_ctb_idx % RESET_TU_BUF_NCTB + 1;
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  8.14M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|  8.14M|            if(ps_tile->u2_wd == (ps_proc->i4_ctb_tile_x + 1))
  ------------------
  |  Branch (465:16): [True: 594k, False: 7.54M]
  ------------------
  466|   594k|            {
  467|   594k|                if((ps_proc->i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (467:20): [True: 48.3k, False: 546k]
  ------------------
  468|  48.3k|                {
  469|       |                    //Last tile
  470|  48.3k|                    if(((ps_proc->i4_ctb_tile_y + 1 + ps_tile->u1_pos_y) == ps_sps->i2_pic_ht_in_ctb) && ((ps_proc->i4_ctb_tile_x + 1 + ps_tile->u1_pos_x) == ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (470:24): [True: 26.9k, False: 21.4k]
  |  Branch (470:106): [True: 21.7k, False: 5.21k]
  ------------------
  471|  21.7k|                    {
  472|  21.7k|                        next_ctb_tu_idx = (cur_ctb_idx % RESET_TU_BUF_NCTB) + 1;
  ------------------
  |  |  175|  21.7k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  21.7k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  21.7k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  21.7k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  21.7k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  21.7k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|  21.7k|                    }
  474|  26.6k|                    else //Not last tile, but new tile
  475|  26.6k|                    {
  476|  26.6k|                        tile_t *ps_tile_next = ps_proc->ps_tile + 1;
  477|  26.6k|                        next_ctb_tu_idx = ps_tile_next->u1_pos_x + (ps_tile_next->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  478|  26.6k|                    }
  479|  48.3k|                }
  480|   546k|                else //End of each tile row
  481|   546k|                {
  482|   546k|                    next_ctb_tu_idx = ((ps_tile->u1_pos_y + ps_proc->i4_ctb_tile_y + 1) * ps_sps->i2_pic_wd_in_ctb) + ps_tile->u1_pos_x;
  483|   546k|                }
  484|   594k|            }
  485|  8.14M|            ps_proc->i4_next_tu_ctb_cnt = next_ctb_tu_idx;
  486|  8.14M|            ps_proc->i4_ctb_tu_cnt = ps_proc->pu4_pic_tu_idx[next_ctb_tu_idx] - ps_proc->pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  8.14M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  8.14M|        }
  488|  17.8M|        else
  489|  17.8M|        {
  490|  17.8M|            next_ctb_tu_idx = cur_ctb_idx + 1;
  491|  17.8M|            if(ps_tile->u2_wd == (ps_proc->i4_ctb_tile_x + 1))
  ------------------
  |  Branch (491:16): [True: 1.37M, False: 16.4M]
  ------------------
  492|  1.37M|            {
  493|  1.37M|                if((ps_proc->i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (493:20): [True: 118k, False: 1.25M]
  ------------------
  494|   118k|                {
  495|       |                    //Last tile
  496|   118k|                    if(((ps_proc->i4_ctb_tile_y + 1 + ps_tile->u1_pos_y) == ps_sps->i2_pic_ht_in_ctb) && ((ps_proc->i4_ctb_tile_x + 1 + ps_tile->u1_pos_x) == ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  Branch (496:24): [True: 82.9k, False: 35.5k]
  |  Branch (496:106): [True: 74.8k, False: 8.15k]
  ------------------
  497|  74.8k|                    {
  498|  74.8k|                        next_ctb_tu_idx = (cur_ctb_idx % RESET_TU_BUF_NCTB) + 1;
  ------------------
  |  |  175|  74.8k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  74.8k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  74.8k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  74.8k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  74.8k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  74.8k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|  74.8k|                    }
  500|  43.6k|                    else //Not last tile, but new tile
  501|  43.6k|                    {
  502|  43.6k|                        tile_t *ps_tile_next = ps_proc->ps_tile + 1;
  503|  43.6k|                        next_ctb_tu_idx = ps_tile_next->u1_pos_x + (ps_tile_next->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
  504|  43.6k|                    }
  505|   118k|                }
  506|  1.25M|                else //End of each tile row
  507|  1.25M|                {
  508|  1.25M|                    next_ctb_tu_idx = ((ps_tile->u1_pos_y + ps_proc->i4_ctb_tile_y + 1) * ps_sps->i2_pic_wd_in_ctb) + ps_tile->u1_pos_x;
  509|  1.25M|                }
  510|  1.37M|            }
  511|  17.8M|            ps_proc->i4_next_tu_ctb_cnt = next_ctb_tu_idx;
  512|  17.8M|            ps_proc->i4_ctb_tu_cnt = ps_proc->pu4_pic_tu_idx[next_ctb_tu_idx] -
  513|  17.8M|                            ps_proc->pu4_pic_tu_idx[cur_ctb_idx];
  514|  17.8M|        }
  515|  25.9M|    }
  516|  25.9M|}
ihevcd_process:
  519|  1.49M|{
  520|  1.49M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  521|  1.49M|    codec_t *ps_codec;
  522|  1.49M|    sps_t *ps_sps = ps_proc->ps_sps;
  523|       |
  524|  1.49M|    WORD32 nctb;
  525|  1.49M|    WORD32 i;
  526|  1.49M|    WORD32 idx;
  527|  1.49M|    WORD32 nop_cnt;
  528|  1.49M|    WORD32 num_minpu_in_ctb;
  529|  1.49M|    WORD32 cur_slice_idx, cur_ctb_tile_x, cur_ctb_slice_x, cur_ctb_tile_y, cur_ctb_slice_y;
  530|  1.49M|    WORD32 nxt_ctb_slice_y, nxt_ctb_slice_x;
  531|  1.49M|    tu_t *ps_tu_cur, *ps_tu_nxt;
  532|  1.49M|    UWORD8 *pu1_pu_map_cur, *pu1_pu_map_nxt;
  533|  1.49M|    WORD32 num_ctb, num_ctb_tmp;
  534|  1.49M|    proc_type_t proc_type;
  535|       |
  536|       |
  537|  1.49M|    WORD32 ctb_size = 1 << ps_sps->i1_log2_ctb_size;
  538|       |
  539|  1.49M|    WORD32 h_samp_factor, v_samp_factor;
  540|  1.49M|    WORD32 chroma_row_strd;
  541|  1.49M|    WORD32 chroma_pixel_strd = 2;
  542|       |
  543|  1.49M|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (543:21): [True: 0, False: 1.49M]
  ------------------
  544|  1.49M|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (544:21): [True: 1.36M, False: 123k]
  ------------------
  545|       |
  546|  1.49M|    PROFILE_DISABLE_PROCESS_CTB();
  ------------------
  |  |   77|  1.49M|#define PROFILE_DISABLE_PROCESS_CTB() ;
  ------------------
  547|       |
  548|  1.49M|    ps_codec = ps_proc->ps_codec;
  549|  1.49M|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.49M|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.49M|#define MIN_PU_SIZE         4
  ------------------
  550|       |
  551|  1.49M|    nctb = MIN(ps_codec->i4_proc_nctb, ps_proc->i4_ctb_cnt);
  ------------------
  |  |   43|  1.49M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.31M, False: 180k]
  |  |  ------------------
  ------------------
  552|  1.49M|    nctb = MIN(nctb, (ps_proc->ps_tile->u2_wd - ps_proc->i4_ctb_tile_x));
  ------------------
  |  |   43|  1.49M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.31M, False: 180k]
  |  |  ------------------
  ------------------
  553|       |
  554|  1.49M|    if(ps_proc->i4_cur_slice_idx > (MAX_SLICE_HDR_CNT - 2 * ps_sps->i2_pic_wd_in_ctb))
  ------------------
  |  |  153|  1.49M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.49M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (554:8): [True: 83.6k, False: 1.40M]
  ------------------
  555|  83.6k|    {
  556|  83.6k|        num_ctb = 1;
  557|  83.6k|    }
  558|  1.40M|    else
  559|  1.40M|    {
  560|  1.40M|        num_ctb = ps_proc->i4_nctb;
  561|  1.40M|    }
  562|  1.49M|    nxt_ctb_slice_y = ps_proc->i4_ctb_slice_y;
  563|  1.49M|    nxt_ctb_slice_x = ps_proc->i4_ctb_slice_x;
  564|  1.49M|    pu1_pu_map_nxt = ps_proc->pu1_pu_map;
  565|  1.49M|    ps_tu_nxt = ps_proc->ps_tu;
  566|       |
  567|  11.1M|    while(ps_proc->i4_ctb_cnt)
  ------------------
  |  Branch (567:11): [True: 9.66M, False: 1.49M]
  ------------------
  568|  9.66M|    {
  569|  9.66M|        ps_proc->i4_ctb_slice_y = nxt_ctb_slice_y;
  570|  9.66M|        ps_proc->i4_ctb_slice_x = nxt_ctb_slice_x;
  571|  9.66M|        ps_proc->pu1_pu_map = pu1_pu_map_nxt;
  572|  9.66M|        ps_proc->ps_tu = ps_tu_nxt;
  573|       |
  574|  9.66M|        cur_ctb_tile_x = ps_proc->i4_ctb_tile_x;
  575|  9.66M|        cur_ctb_tile_y = ps_proc->i4_ctb_tile_y;
  576|  9.66M|        cur_ctb_slice_x = ps_proc->i4_ctb_slice_x;
  577|  9.66M|        cur_ctb_slice_y = ps_proc->i4_ctb_slice_y;
  578|  9.66M|        cur_slice_idx = ps_proc->i4_cur_slice_idx;
  579|  9.66M|        ps_tu_cur = ps_proc->ps_tu;
  580|  9.66M|        pu1_pu_map_cur = ps_proc->pu1_pu_map;
  581|  9.66M|        proc_type = PROC_INTER_PRED;
  582|       |
  583|  9.66M|        if(ps_proc->i4_ctb_cnt < num_ctb)
  ------------------
  |  Branch (583:12): [True: 0, False: 9.66M]
  ------------------
  584|      0|        {
  585|      0|            num_ctb = ps_proc->i4_ctb_cnt;
  586|      0|        }
  587|  9.66M|        num_ctb_tmp = num_ctb;
  588|       |
  589|  29.1M|        while(num_ctb_tmp)
  ------------------
  |  Branch (589:15): [True: 19.4M, False: 9.66M]
  ------------------
  590|  19.4M|        {
  591|  19.4M|            slice_header_t *ps_slice_hdr;
  592|  19.4M|            tile_t *ps_tile = ps_proc->ps_tile;
  593|       |
  594|       |            /* Waiting for Parsing to be done*/
  595|  19.4M|            {
  596|       |
  597|       |
  598|  19.4M|                nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|  19.4M|#define PROC_NOP_CNT (8 * 128)
  ------------------
  599|  19.4M|                if(ps_proc->i4_check_parse_status || ps_proc->i4_check_proc_status)
  ------------------
  |  Branch (599:20): [True: 11.3M, False: 8.14M]
  |  Branch (599:54): [True: 0, False: 8.14M]
  ------------------
  600|  11.3M|                {
  601|  19.1M|                    while(1)
  ------------------
  |  Branch (601:27): [True: 19.1M, Folded]
  ------------------
  602|  19.1M|                    {
  603|  19.1M|                        volatile UWORD8 *pu1_buf;
  604|  19.1M|                        volatile WORD32 status;
  605|  19.1M|                        status = 1;
  606|       |                        /* Check if all dependencies for the next nCTBs are met */
  607|       |                        /* Check if the next nCTBs are parsed */
  608|  19.1M|                        if(ps_proc->i4_check_parse_status)
  ------------------
  |  Branch (608:28): [True: 19.1M, False: 18.4E]
  ------------------
  609|  19.1M|                        {
  610|  19.1M|                            idx = (ps_proc->i4_ctb_x + nctb - 1);
  611|  19.1M|                            idx += (ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  612|  19.1M|                            pu1_buf = (ps_codec->pu1_parse_map + idx);
  613|  19.1M|                            status = *pu1_buf;
  614|  19.1M|                        }
  615|       |
  616|  19.1M|                        if(status)
  ------------------
  |  Branch (616:28): [True: 11.3M, False: 7.86M]
  ------------------
  617|  11.3M|                            break;
  618|       |
  619|       |                        /* if dependencies are not met, then wait for few cycles.
  620|       |                         * Even after few iterations, if the dependencies are not met then yield
  621|       |                         */
  622|  7.86M|                        if(nop_cnt > 0)
  ------------------
  |  Branch (622:28): [True: 7.08M, False: 774k]
  ------------------
  623|  7.08M|                        {
  624|  7.08M|                            NOP(128);
  ------------------
  |  |   68|   914M|#define NOP(nop_cnt)    {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (68:57): [True: 907M, False: 7.08M]
  |  |  ------------------
  ------------------
  625|  7.08M|                            nop_cnt -= 128;
  626|  7.08M|                        }
  627|   774k|                        else
  628|   774k|                        {
  629|   774k|                            nop_cnt = PROC_NOP_CNT;
  ------------------
  |  |  156|   774k|#define PROC_NOP_CNT (8 * 128)
  ------------------
  630|   774k|                            ithread_yield();
  631|   774k|                        }
  632|  7.86M|                    }
  633|  11.3M|                }
  634|  19.4M|            }
  635|       |
  636|       |            /* Check proc map to ensure dependencies for recon are met */
  637|  19.4M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
  638|       |
  639|  19.4M|            ihevcd_slice_hdr_update(ps_proc);
  640|  19.4M|            ps_slice_hdr = ps_proc->ps_slice_hdr;
  641|       |
  642|       |            //ihevcd_mv_prediction();
  643|       |            //ihevcd_lvl_unpack();
  644|       |            //ihevcd_inter_iq_it_recon();
  645|       |            //Following does prediction, iq, it and recon on a TU by TU basis for intra TUs
  646|       |            //ihevcd_intra_process();
  647|       |            //ihevcd_ctb_boundary_strength_islice(ps_proc, ctb_size);
  648|       |            //ihevcd_deblk_ctb(ps_proc);
  649|       |
  650|       |            /* iq,it recon of Intra TU */
  651|  19.4M|            {
  652|  19.4M|                UWORD32 *pu4_ctb_top_pu_idx, *pu4_ctb_left_pu_idx, *pu4_ctb_top_left_pu_idx;
  653|  19.4M|                WORD32 cur_ctb_idx;
  654|       |
  655|  19.4M|                ihevcd_ctb_avail_update(ps_proc);
  656|       |
  657|       |#if DEBUG_DUMP_FRAME_BUFFERS_INFO
  658|       |                au1_pic_avail_ctb_flags[ps_proc->i4_ctb_x + ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb] =
  659|       |                                ((ps_proc->u1_top_ctb_avail << 3) | (ps_proc->u1_left_ctb_avail << 2) | (ps_proc->u1_top_lt_ctb_avail << 1) | (ps_proc->u1_top_rt_ctb_avail));
  660|       |                au4_pic_ctb_slice_xy[ps_proc->i4_ctb_x + ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb] =
  661|       |                                (((UWORD16)ps_proc->i4_ctb_slice_x << 16) | ((UWORD16)ps_proc->i4_ctb_slice_y << 16));
  662|       |#endif
  663|       |
  664|       |                /*************************************************/
  665|       |                /****************   MV pred **********************/
  666|       |                /*************************************************/
  667|  19.4M|                if(PSLICE == ps_slice_hdr->i1_slice_type
  ------------------
  |  Branch (667:20): [True: 182k, False: 19.2M]
  ------------------
  668|  19.2M|                                || BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (668:36): [True: 4.17M, False: 15.0M]
  ------------------
  669|  4.20M|                {
  670|  4.20M|                    mv_ctxt_t s_mv_ctxt;
  671|       |
  672|  4.20M|                    pu4_ctb_top_pu_idx = ps_proc->pu4_pic_pu_idx_top
  673|  4.20M|                                    + (ps_proc->i4_ctb_x * ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  4.20M|#define MIN_PU_SIZE         4
  ------------------
  674|  4.20M|                    pu4_ctb_left_pu_idx = ps_proc->pu4_pic_pu_idx_left;
  675|  4.20M|                    pu4_ctb_top_left_pu_idx = &ps_proc->u4_ctb_top_left_pu_idx;
  676|       |
  677|       |                    /* Initializing s_mv_ctxt */
  678|  4.20M|                    if(ps_codec->i4_num_cores > MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  4.20M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (678:24): [True: 1.65M, False: 2.54M]
  ------------------
  679|  1.65M|                    {
  680|  1.65M|                        s_mv_ctxt.ps_pps = ps_proc->ps_pps;
  681|  1.65M|                        s_mv_ctxt.ps_sps = ps_proc->ps_sps;
  682|  1.65M|                        s_mv_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
  683|  1.65M|                        s_mv_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
  684|  1.65M|                        s_mv_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
  685|  1.65M|                        s_mv_ctxt.ps_pu = ps_proc->ps_pu;
  686|  1.65M|                        s_mv_ctxt.ps_pic_pu = ps_proc->ps_pic_pu;
  687|  1.65M|                        s_mv_ctxt.ps_tile = ps_tile;
  688|  1.65M|                        s_mv_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
  689|  1.65M|                        s_mv_ctxt.pu4_pic_pu_idx = ps_proc->pu4_pic_pu_idx;
  690|  1.65M|                        s_mv_ctxt.pu1_pic_pu_map = ps_proc->pu1_pic_pu_map;
  691|  1.65M|                        s_mv_ctxt.i4_ctb_pu_cnt = ps_proc->i4_ctb_pu_cnt;
  692|  1.65M|                        s_mv_ctxt.i4_ctb_start_pu_idx = ps_proc->i4_ctb_start_pu_idx;
  693|  1.65M|                        s_mv_ctxt.u1_top_ctb_avail = ps_proc->u1_top_ctb_avail;
  694|  1.65M|                        s_mv_ctxt.u1_top_rt_ctb_avail = ps_proc->u1_top_rt_ctb_avail;
  695|  1.65M|                        s_mv_ctxt.u1_top_lt_ctb_avail = ps_proc->u1_top_lt_ctb_avail;
  696|  1.65M|                        s_mv_ctxt.u1_left_ctb_avail = ps_proc->u1_left_ctb_avail;
  697|       |
  698|  1.65M|                        ihevcd_get_mv_ctb(&s_mv_ctxt, pu4_ctb_top_pu_idx,
  699|  1.65M|                                          pu4_ctb_left_pu_idx, pu4_ctb_top_left_pu_idx);
  700|  1.65M|                    }
  701|       |
  702|  4.20M|                    ihevcd_inter_pred_ctb(ps_proc);
  703|  4.20M|                }
  704|  15.2M|                else if(ps_codec->i4_num_cores > MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  15.2M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (704:25): [True: 5.87M, False: 9.36M]
  ------------------
  705|  5.87M|                {
  706|  5.87M|                    WORD32 next_ctb_idx, num_pu_per_ctb, ctb_start_pu_idx, pu_cnt;
  707|  5.87M|                    pu_t *ps_pu;
  708|  5.87M|                    WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.87M|#define MIN_PU_SIZE         4
  ------------------
                                  WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.87M|#define MIN_PU_SIZE         4
  ------------------
  709|  5.87M|                    UWORD8 *pu1_pic_pu_map_ctb = ps_proc->pu1_pic_pu_map +
  710|  5.87M|                                    (ps_proc->i4_ctb_x + ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb) * num_minpu_in_ctb;
  711|  5.87M|                    WORD32 row, col;
  712|  5.87M|                    UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map;
  713|  5.87M|                    WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  351|  5.87M|#define MAX_CTB_SIZE        64
  ------------------
                                  WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  367|  5.87M|#define MIN_PU_SIZE         4
  ------------------
  714|  5.87M|                    WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  5.87M|#define MIN_PU_SIZE         4
  ------------------
  715|       |
  716|       |                    /* Neighbor PU idx update inside CTB */
  717|       |                    /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */
  718|       |
  719|  5.87M|                    cur_ctb_idx = ps_proc->i4_ctb_x
  720|  5.87M|                                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  721|  5.87M|                    next_ctb_idx = ps_proc->i4_next_pu_ctb_cnt;
  722|  5.87M|                    num_pu_per_ctb = ps_proc->pu4_pic_pu_idx[next_ctb_idx]
  723|  5.87M|                                    - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  724|  5.87M|                    ctb_start_pu_idx = ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  725|  5.87M|                    ps_pu = &ps_proc->ps_pic_pu[ctb_start_pu_idx];
  726|       |
  727|   117M|                    for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (727:37): [True: 111M, False: 5.87M]
  ------------------
  728|   111M|                    {
  729|   111M|                        UWORD32 cur_pu_idx;
  730|   111M|                        WORD32 pu_ht = (ps_pu->b4_ht + 1) << 2;
  731|   111M|                        WORD32 pu_wd = (ps_pu->b4_wd + 1) << 2;
  732|       |
  733|   111M|                        cur_pu_idx = ctb_start_pu_idx + pu_cnt;
  734|       |
  735|   339M|                        for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  367|   339M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (735:38): [True: 228M, False: 111M]
  ------------------
  736|   744M|                            for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  367|   744M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (736:42): [True: 515M, False: 228M]
  ------------------
  737|   515M|                                pu4_nbr_pu_idx[(1 + ps_pu->b4_pos_x + col)
  738|   515M|                                                + (1 + ps_pu->b4_pos_y + row)
  739|   515M|                                                * nbr_pu_idx_strd] =
  740|   515M|                                                cur_pu_idx;
  741|   111M|                    }
  742|       |
  743|       |                    /* Updating Top and Left pointers */
  744|  5.87M|                    {
  745|  5.87M|                        WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  746|  5.87M|                                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size);
  747|  5.87M|                        WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  5.87M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.60M, False: 265k]
  |  |  ------------------
  ------------------
  748|       |
  749|       |                        /* Top Left */
  750|       |                        /* saving top left before updating top ptr, as updating top ptr will overwrite the top left for the next ctb */
  751|  5.87M|                        ps_proc->u4_ctb_top_left_pu_idx = ps_proc->pu4_pic_pu_idx_top[((ps_proc->i4_ctb_x + 1) * ctb_size / MIN_PU_SIZE) - 1];
  ------------------
  |  |  367|  5.87M|#define MIN_PU_SIZE         4
  ------------------
  752|  54.8M|                        for(i = 0; i < ctb_size / MIN_PU_SIZE; i++)
  ------------------
  |  |  367|  54.8M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (752:36): [True: 49.0M, False: 5.87M]
  ------------------
  753|  49.0M|                        {
  754|       |                            /* Left */
  755|       |                            /* Last column of au4_nbr_pu_idx */
  756|  49.0M|                            ps_proc->pu4_pic_pu_idx_left[i] =
  757|  49.0M|                                            pu4_nbr_pu_idx[(ctb_size / MIN_PU_SIZE) + (i + 1) * nbr_pu_idx_strd];
  ------------------
  |  |  367|  49.0M|#define MIN_PU_SIZE         4
  ------------------
  758|       |                            /* Top */
  759|       |                            /* Last row of au4_nbr_pu_idx */
  760|  49.0M|                            ps_proc->pu4_pic_pu_idx_top[(ps_proc->i4_ctb_x * ctb_size / MIN_PU_SIZE) + i] =
  ------------------
  |  |  367|  49.0M|#define MIN_PU_SIZE         4
  ------------------
  761|  49.0M|                                            pu4_nbr_pu_idx[(ctb_size_left / MIN_PU_SIZE) * nbr_pu_idx_strd + i + 1];
  ------------------
  |  |  367|  49.0M|#define MIN_PU_SIZE         4
  ------------------
  762|       |
  763|  49.0M|                        }
  764|       |
  765|       |                        /* Updating the CTB level PU idx (Used for collocated MV pred)*/
  766|  5.87M|                        {
  767|  5.87M|                            WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
  768|  5.87M|                            WORD32 first_pu_of_ctb;
  769|  5.87M|                            first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
  770|  5.87M|                            UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  5.87M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 250k, False: 5.62M]
  |  |  ------------------
  ------------------
  771|  5.87M|                                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  772|  5.87M|                            UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  5.87M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 181k, False: 5.69M]
  |  |  ------------------
  ------------------
  773|  5.87M|                                        - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
  774|       |
  775|  5.87M|                            index_pic_map = 0 * ctb_size_in_min_pu + 0;
  776|  5.87M|                            index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
  777|       |
  778|  50.5M|                            for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (778:46): [True: 44.6M, False: 5.87M]
  ------------------
  779|  44.6M|                            {
  780|   549M|                                for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (780:50): [True: 504M, False: 44.6M]
  ------------------
  781|   504M|                                {
  782|   504M|                                    pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
  783|   504M|                                                    - first_pu_of_ctb;
  784|   504M|                                }
  785|  44.6M|                                index_pic_map += ctb_size_in_min_pu;
  786|  44.6M|                                index_nbr_map += nbr_pu_idx_strd;
  787|  44.6M|                            }
  788|  5.87M|                        }
  789|  5.87M|                    }
  790|  5.87M|                }
  791|  19.4M|            }
  792|       |
  793|  19.4M|            if(ps_proc->ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (793:16): [True: 5.79M, False: 13.6M]
  ------------------
  794|  5.79M|            {
  795|       |                /*Update the tile index buffer with tile information for the current ctb*/
  796|  5.79M|                UWORD16 *pu1_tile_idx = ps_proc->pu1_tile_idx;
  797|  5.79M|                pu1_tile_idx[(ps_proc->i4_ctb_x + (ps_proc->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb))]
  798|  5.79M|                                = ps_proc->i4_cur_tile_idx;
  799|  5.79M|            }
  800|       |
  801|       |            /*************************************************/
  802|       |            /*********** BS, QP and Deblocking  **************/
  803|       |            /*************************************************/
  804|       |            /* Boundary strength call has to be after IQ IT recon since QP population needs ps_proc->i4_qp_const_inc_ctb flag */
  805|       |
  806|  19.4M|            {
  807|  19.4M|                slice_header_t *ps_slice_hdr;
  808|  19.4M|                ps_slice_hdr = ps_proc->ps_slice_hdr;
  809|       |
  810|       |
  811|       |                /* Check if deblock is disabled for the current slice or if it is disabled for the current picture
  812|       |                 * because of disable deblock api
  813|       |                 */
  814|  19.4M|                if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (814:20): [True: 19.2M, False: 241k]
  ------------------
  815|  19.2M|                {
  816|  19.2M|                    if(ps_codec->i4_num_cores > MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  19.2M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (816:24): [True: 7.43M, False: 11.7M]
  ------------------
  817|  7.43M|                    {
  818|       |                        /* Boundary strength calculation is done irrespective of whether deblocking is disabled
  819|       |                         * in the slice or not, to handle deblocking slice boundaries */
  820|  7.43M|                        if((0 == ps_codec->i4_slice_error))
  ------------------
  |  Branch (820:28): [True: 6.95M, False: 481k]
  ------------------
  821|  6.95M|                        {
  822|  6.95M|                            ihevcd_update_ctb_tu_cnt(ps_proc);
  823|  6.95M|                            ps_proc->s_bs_ctxt.ps_pps = ps_proc->ps_pps;
  824|  6.95M|                            ps_proc->s_bs_ctxt.ps_sps = ps_proc->ps_sps;
  825|  6.95M|                            ps_proc->s_bs_ctxt.ps_codec = ps_proc->ps_codec;
  826|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_tu_cnt = ps_proc->i4_ctb_tu_cnt;
  827|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
  828|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
  829|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_tile_x = ps_proc->i4_ctb_tile_x;
  830|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_tile_y = ps_proc->i4_ctb_tile_y;
  831|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_slice_x = ps_proc->i4_ctb_slice_x;
  832|  6.95M|                            ps_proc->s_bs_ctxt.i4_ctb_slice_y = ps_proc->i4_ctb_slice_y;
  833|  6.95M|                            ps_proc->s_bs_ctxt.ps_tu = ps_proc->ps_tu;
  834|  6.95M|                            ps_proc->s_bs_ctxt.ps_pu = ps_proc->ps_pu;
  835|  6.95M|                            ps_proc->s_bs_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
  836|  6.95M|                            ps_proc->s_bs_ctxt.i4_next_pu_ctb_cnt = ps_proc->i4_next_pu_ctb_cnt;
  837|  6.95M|                            ps_proc->s_bs_ctxt.i4_next_tu_ctb_cnt = ps_proc->i4_next_tu_ctb_cnt;
  838|  6.95M|                            ps_proc->s_bs_ctxt.pu1_slice_idx = ps_proc->pu1_slice_idx;
  839|  6.95M|                            ps_proc->s_bs_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
  840|  6.95M|                            ps_proc->s_bs_ctxt.ps_tile = ps_proc->ps_tile;
  841|       |
  842|  6.95M|                            if(ISLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (842:32): [True: 5.44M, False: 1.51M]
  ------------------
  843|  5.44M|                            {
  844|  5.44M|                                ihevcd_ctb_boundary_strength_islice(&ps_proc->s_bs_ctxt);
  845|  5.44M|                            }
  846|  1.51M|                            else
  847|  1.51M|                            {
  848|  1.51M|                                ihevcd_ctb_boundary_strength_pbslice(&ps_proc->s_bs_ctxt);
  849|  1.51M|                            }
  850|  6.95M|                        }
  851|       |
  852|       |                        /* Boundary strength is set to zero if deblocking is disabled for the current slice */
  853|  7.43M|                        if((0 != ps_slice_hdr->i1_slice_disable_deblocking_filter_flag))
  ------------------
  |  Branch (853:28): [True: 1.56M, False: 5.87M]
  ------------------
  854|  1.56M|                        {
  855|  1.56M|                            WORD32 bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) * (ctb_size * ctb_size / 8 / 16);
  856|       |
  857|  1.56M|                            UWORD32 *pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_proc->s_bs_ctxt.pu4_pic_vert_bs +
  858|  1.56M|                                            ps_proc->i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
  859|  1.56M|                                            ps_proc->i4_ctb_y * bs_strd);
  860|  1.56M|                            UWORD32 *pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_proc->s_bs_ctxt.pu4_pic_horz_bs +
  861|  1.56M|                                            ps_proc->i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
  862|  1.56M|                                            ps_proc->i4_ctb_y * bs_strd);
  863|       |
  864|  1.56M|                            memset(pu4_vert_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  865|  1.56M|                            memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  866|  1.56M|                        }
  867|  7.43M|                    }
  868|  19.2M|                }
  869|  19.4M|            }
  870|       |
  871|       |            /* Per CTB update the following */
  872|  19.4M|            {
  873|  19.4M|                WORD32 cur_ctb_idx = ps_proc->i4_ctb_x
  874|  19.4M|                                + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  875|  19.4M|                cur_ctb_idx++;
  876|       |
  877|  19.4M|                ps_proc->pu1_pu_map += nctb * num_minpu_in_ctb;
  878|  19.4M|                ps_proc->ps_tu += ps_proc->i4_ctb_tu_cnt;
  879|  19.4M|                if((1 == ps_codec->i4_num_cores) &&
  ------------------
  |  Branch (879:20): [True: 8.14M, False: 11.3M]
  ------------------
  880|  8.14M|                                (0 == cur_ctb_idx % RESET_TU_BUF_NCTB))
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  8.14M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (880:33): [True: 0, False: 8.14M]
  ------------------
  881|      0|                {
  882|      0|                    ps_proc->ps_tu = ps_proc->ps_pic_tu;
  883|      0|                }
  884|  19.4M|                ps_proc->ps_pu += ps_proc->i4_ctb_pu_cnt;
  885|  19.4M|            }
  886|       |
  887|       |            /* Update proc map for recon*/
  888|  19.4M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
  889|       |
  890|  19.4M|            num_ctb_tmp -= nctb;
  891|  19.4M|            ihevcd_ctb_pos_update(ps_proc, nctb);
  892|       |
  893|  19.4M|        }
  894|       |
  895|  9.66M|        if(cur_slice_idx != ps_proc->i4_cur_slice_idx)
  ------------------
  |  Branch (895:12): [True: 6.50k, False: 9.65M]
  ------------------
  896|  6.50k|        {
  897|  6.50k|            ps_proc->ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((cur_slice_idx)&(MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  6.50k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.50k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  898|  6.50k|            ps_proc->i4_cur_slice_idx = cur_slice_idx;
  899|  6.50k|        }
  900|       |        /* Restore the saved variables  */
  901|  9.66M|        num_ctb_tmp = num_ctb;
  902|  9.66M|        ps_proc->i4_ctb_x -= num_ctb;
  903|  9.66M|        ps_proc->i4_ctb_tile_x = cur_ctb_tile_x;
  904|  9.66M|        ps_proc->i4_ctb_slice_x = cur_ctb_slice_x;
  905|  9.66M|        ps_proc->i4_ctb_tile_y = cur_ctb_tile_y;
  906|  9.66M|        ps_proc->i4_ctb_slice_y = cur_ctb_slice_y;
  907|  9.66M|        ps_proc->pu1_pu_map = pu1_pu_map_cur;
  908|  9.66M|        ps_proc->ps_tu = ps_tu_cur;
  909|  9.66M|        proc_type = PROC_RECON;
  910|       |
  911|  29.0M|        while(num_ctb_tmp)
  ------------------
  |  Branch (911:15): [True: 19.3M, False: 9.66M]
  ------------------
  912|  19.3M|        {
  913|       |
  914|       |            /* Check proc map to ensure dependencies for recon are met */
  915|  19.3M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
  916|       |
  917|  19.3M|            ihevcd_slice_hdr_update(ps_proc);
  918|       |
  919|  19.3M|            {
  920|       |
  921|  19.3M|                ihevcd_ctb_avail_update(ps_proc);
  922|       |
  923|       |                /*************************************************/
  924|       |                /**************** IQ IT RECON  *******************/
  925|       |                /*************************************************/
  926|       |
  927|  19.3M|                ihevcd_update_ctb_tu_cnt(ps_proc);
  928|       |
  929|       |                /* When scaling matrix is not to be used(scaling_list_enable_flag is zero in SPS),
  930|       |                 * default value of 16 has to be used. Since the value is same for all sizes,
  931|       |                 * same table is used for all cases.
  932|       |                 */
  933|  19.3M|                if(0 == ps_sps->i1_scaling_list_enable_flag)
  ------------------
  |  Branch (933:20): [True: 2.70M, False: 16.6M]
  ------------------
  934|  2.70M|                {
  935|  2.70M|                    ps_proc->api2_dequant_intra_matrix[0] =
  936|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  937|  2.70M|                    ps_proc->api2_dequant_intra_matrix[1] =
  938|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  939|  2.70M|                    ps_proc->api2_dequant_intra_matrix[2] =
  940|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  941|  2.70M|                    ps_proc->api2_dequant_intra_matrix[3] =
  942|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  943|       |
  944|  2.70M|                    ps_proc->api2_dequant_inter_matrix[0] =
  945|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  946|  2.70M|                    ps_proc->api2_dequant_inter_matrix[1] =
  947|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  948|  2.70M|                    ps_proc->api2_dequant_inter_matrix[2] =
  949|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  950|  2.70M|                    ps_proc->api2_dequant_inter_matrix[3] =
  951|  2.70M|                                    (WORD16 *)gi2_flat_scale_mat_32x32;
  952|  2.70M|                }
  953|  16.6M|                else
  954|  16.6M|                {
  955|  16.6M|                    if(0 == ps_sps->i1_sps_scaling_list_data_present_flag)
  ------------------
  |  Branch (955:24): [True: 13.4M, False: 3.22M]
  ------------------
  956|  13.4M|                    {
  957|  13.4M|                        ps_proc->api2_dequant_intra_matrix[0] =
  958|  13.4M|                                        (WORD16 *)gi2_flat_scale_mat_32x32;
  959|  13.4M|                        ps_proc->api2_dequant_intra_matrix[1] =
  960|  13.4M|                                        (WORD16 *)gi2_intra_default_scale_mat_8x8;
  961|  13.4M|                        ps_proc->api2_dequant_intra_matrix[2] =
  962|  13.4M|                                        (WORD16 *)gi2_intra_default_scale_mat_16x16;
  963|  13.4M|                        ps_proc->api2_dequant_intra_matrix[3] =
  964|  13.4M|                                        (WORD16 *)gi2_intra_default_scale_mat_32x32;
  965|       |
  966|  13.4M|                        ps_proc->api2_dequant_inter_matrix[0] =
  967|  13.4M|                                        (WORD16 *)gi2_flat_scale_mat_32x32;
  968|  13.4M|                        ps_proc->api2_dequant_inter_matrix[1] =
  969|  13.4M|                                        (WORD16 *)gi2_inter_default_scale_mat_8x8;
  970|  13.4M|                        ps_proc->api2_dequant_inter_matrix[2] =
  971|  13.4M|                                        (WORD16 *)gi2_inter_default_scale_mat_16x16;
  972|  13.4M|                        ps_proc->api2_dequant_inter_matrix[3] =
  973|  13.4M|                                        (WORD16 *)gi2_inter_default_scale_mat_32x32;
  974|  13.4M|                    }
  975|       |                    /*TODO: Add support for custom scaling matrices */
  976|  16.6M|                }
  977|       |
  978|       |                /* CTB Level pointers */
  979|  19.3M|                ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma
  980|  19.3M|                                + (ps_proc->i4_ctb_x * ctb_size
  981|  19.3M|                                + ps_proc->i4_ctb_y * ctb_size
  982|  19.3M|                                * ps_codec->i4_strd) * ps_codec->i4_pixel_size_y;
  983|  19.3M|                if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (983:20): [True: 19.2M, False: 164k]
  ------------------
  984|  19.2M|                {
  985|  19.2M|                    ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma
  986|  19.2M|                                    + ((ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor)
  987|  19.2M|                                    + (ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd * chroma_pixel_strd / (h_samp_factor * v_samp_factor))) * ps_codec->i4_pixel_size_uv;
  988|  19.2M|                }
  989|       |
  990|  19.3M|                ihevcd_iquant_itrans_recon_ctb(ps_proc);
  991|  19.3M|            }
  992|       |
  993|       |            /* Per CTB update the following */
  994|  19.3M|            {
  995|  19.3M|                WORD32 cur_ctb_idx = ps_proc->i4_ctb_x
  996|  19.3M|                                + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  997|  19.3M|                cur_ctb_idx++;
  998|       |
  999|  19.3M|                ps_proc->pu1_pu_map += nctb * num_minpu_in_ctb;
 1000|  19.3M|                ps_proc->ps_tu += ps_proc->i4_ctb_tu_cnt;
 1001|  19.3M|                if((1 == ps_codec->i4_num_cores) &&
  ------------------
  |  Branch (1001:20): [True: 8.14M, False: 11.2M]
  ------------------
 1002|  8.14M|                                (0 == cur_ctb_idx % RESET_TU_BUF_NCTB))
  ------------------
  |  |  175|  8.14M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|  8.14M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  8.14M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  8.14M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  8.14M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1002:33): [True: 0, False: 8.14M]
  ------------------
 1003|      0|                {
 1004|      0|                    ps_proc->ps_tu = ps_proc->ps_pic_tu;
 1005|      0|                }
 1006|  19.3M|                ps_proc->ps_pu += ps_proc->i4_ctb_pu_cnt;
 1007|  19.3M|            }
 1008|       |
 1009|       |
 1010|       |            /* Update proc map for recon*/
 1011|  19.3M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
 1012|       |
 1013|  19.3M|            num_ctb_tmp -= nctb;
 1014|  19.3M|            ihevcd_ctb_pos_update(ps_proc, nctb);
 1015|  19.3M|        }
 1016|       |
 1017|  9.66M|        if(cur_slice_idx != ps_proc->i4_cur_slice_idx)
  ------------------
  |  Branch (1017:12): [True: 6.48k, False: 9.65M]
  ------------------
 1018|  6.48k|        {
 1019|  6.48k|            ps_proc->ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((cur_slice_idx)&(MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  6.48k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.48k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1020|  6.48k|            ps_proc->i4_cur_slice_idx = cur_slice_idx;
 1021|  6.48k|        }
 1022|       |        /* Restore the saved variables  */
 1023|  9.66M|        num_ctb_tmp = num_ctb;
 1024|  9.66M|        ps_proc->i4_ctb_x -= num_ctb;
 1025|  9.66M|        ps_proc->i4_ctb_tile_x = cur_ctb_tile_x;
 1026|  9.66M|        ps_proc->i4_ctb_slice_x = cur_ctb_slice_x;
 1027|  9.66M|        ps_proc->i4_ctb_tile_y = cur_ctb_tile_y;
 1028|  9.66M|        ps_proc->i4_ctb_slice_y = cur_ctb_slice_y;
 1029|  9.66M|        pu1_pu_map_nxt = ps_proc->pu1_pu_map;
 1030|  9.66M|        ps_tu_nxt = ps_proc->ps_tu;
 1031|  9.66M|        ps_proc->pu1_pu_map = pu1_pu_map_cur;
 1032|  9.66M|        ps_proc->ps_tu = ps_tu_cur;
 1033|  9.66M|        proc_type = PROC_DEBLK;
 1034|       |
 1035|  28.9M|        while(num_ctb_tmp)
  ------------------
  |  Branch (1035:15): [True: 19.3M, False: 9.66M]
  ------------------
 1036|  19.3M|        {
 1037|       |
 1038|       |
 1039|       |            /* Check proc map to ensure dependencies for deblk are met */
 1040|  19.3M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
 1041|       |
 1042|  19.3M|            ihevcd_slice_hdr_update(ps_proc);
 1043|       |
 1044|       |
 1045|  19.3M|            if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (1045:16): [True: 19.2M, False: 36.7k]
  ------------------
 1046|  19.2M|            {
 1047|  19.2M|                WORD32 i4_is_last_ctb_x = 0;
 1048|  19.2M|                WORD32 i4_is_last_ctb_y = 0;
 1049|       |
 1050|       |
 1051|       |                /* Deblocking is done irrespective of whether it is disabled in the slice or not,
 1052|       |                 * to handle deblocking the slice boundaries */
 1053|  19.2M|                {
 1054|  19.2M|                    ps_proc->s_deblk_ctxt.ps_pps = ps_proc->ps_pps;
 1055|  19.2M|                    ps_proc->s_deblk_ctxt.ps_sps = ps_proc->ps_sps;
 1056|  19.2M|                    ps_proc->s_deblk_ctxt.ps_codec = ps_proc->ps_codec;
 1057|  19.2M|                    ps_proc->s_deblk_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
 1058|  19.2M|                    ps_proc->s_deblk_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
 1059|  19.2M|                    ps_proc->s_deblk_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
 1060|  19.2M|                    ps_proc->s_deblk_ctxt.pu1_slice_idx = ps_proc->pu1_slice_idx;
 1061|  19.2M|                    ps_proc->s_deblk_ctxt.is_chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
 1062|       |
 1063|       |                    /* Populating Current CTB's no_loop_filter flags */
 1064|  19.2M|                    {
 1065|  19.2M|                        WORD32 row;
 1066|  19.2M|                        WORD32 log2_ctb_size = ps_sps->i1_log2_ctb_size;
 1067|       |
 1068|       |                        /* Loop filter strd in units of num bits */
 1069|  19.2M|                        WORD32 loop_filter_strd = ((ps_sps->i2_pic_width_in_luma_samples + 63) >> 6) << 3;
 1070|       |                        /* Bit position is the current 8x8 bit offset wrt pic_no_loop_filter
 1071|       |                         * bit_pos has to be a WOR32 so that when it is negative, the downshift still retains it to be a negative value */
 1072|  19.2M|                        WORD32 bit_pos = ((ps_proc->i4_ctb_y << (log2_ctb_size - 3)) - 1) * loop_filter_strd + (ps_proc->i4_ctb_x << (log2_ctb_size - 3)) - 1;
 1073|       |
 1074|   108M|                        for(row = 0; row < (ctb_size >> 3) + 1; row++)
  ------------------
  |  Branch (1074:38): [True: 89.2M, False: 19.2M]
  ------------------
 1075|  89.2M|                        {
 1076|       |                            /* Go to the corresponding byte - read 32 bits and downshift */
 1077|  89.2M|                            ps_proc->s_deblk_ctxt.au2_ctb_no_loop_filter_flag[row] = (*(UWORD32 *)(ps_proc->pu1_pic_no_loop_filter_flag + (bit_pos >> 3))) >> (bit_pos & 7);
 1078|  89.2M|                            bit_pos += loop_filter_strd;
 1079|  89.2M|                        }
 1080|  19.2M|                    }
 1081|       |
 1082|  19.2M|                    ihevcd_deblk_ctb(&ps_proc->s_deblk_ctxt, i4_is_last_ctb_x, i4_is_last_ctb_y);
 1083|       |
 1084|       |                    /* If the last CTB in the row was a complete CTB then deblocking has to be called from remaining pixels, since deblocking
 1085|       |                     * is applied on a shifted CTB structure
 1086|       |                     */
 1087|  19.2M|                    if(ps_proc->i4_ctb_x == ps_sps->i2_pic_wd_in_ctb - 1)
  ------------------
  |  Branch (1087:24): [True: 1.03M, False: 18.2M]
  ------------------
 1088|  1.03M|                    {
 1089|  1.03M|                        WORD32 i4_is_last_ctb_x = 1;
 1090|  1.03M|                        WORD32 i4_is_last_ctb_y = 0;
 1091|       |
 1092|  1.03M|                        WORD32 last_x_pos;
 1093|  1.03M|                        last_x_pos = (ps_sps->i2_pic_wd_in_ctb << ps_sps->i1_log2_ctb_size);
 1094|  1.03M|                        if(last_x_pos  ==  ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1094:28): [True: 216k, False: 823k]
  ------------------
 1095|   216k|                        {
 1096|   216k|                            ihevcd_deblk_ctb(&ps_proc->s_deblk_ctxt, i4_is_last_ctb_x, i4_is_last_ctb_y);
 1097|   216k|                        }
 1098|  1.03M|                    }
 1099|       |
 1100|       |
 1101|       |                    /* If the last CTB in the column was a complete CTB then deblocking has to be called from remaining pixels, since deblocking
 1102|       |                     * is applied on a shifted CTB structure
 1103|       |                     */
 1104|  19.2M|                    if(ps_proc->i4_ctb_y == ps_sps->i2_pic_ht_in_ctb - 1)
  ------------------
  |  Branch (1104:24): [True: 756k, False: 18.5M]
  ------------------
 1105|   756k|                    {
 1106|   756k|                        WORD32 i4_is_last_ctb_x = 0;
 1107|   756k|                        WORD32 i4_is_last_ctb_y = 1;
 1108|   756k|                        WORD32 last_y_pos;
 1109|   756k|                        last_y_pos = (ps_sps->i2_pic_ht_in_ctb << ps_sps->i1_log2_ctb_size);
 1110|   756k|                        if(last_y_pos == ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1110:28): [True: 94.3k, False: 661k]
  ------------------
 1111|  94.3k|                        {
 1112|  94.3k|                            ihevcd_deblk_ctb(&ps_proc->s_deblk_ctxt, i4_is_last_ctb_x, i4_is_last_ctb_y);
 1113|  94.3k|                        }
 1114|   756k|                    }
 1115|  19.2M|                }
 1116|  19.2M|            }
 1117|       |
 1118|       |            /* Update proc map for deblk*/
 1119|  19.3M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
 1120|       |
 1121|  19.3M|            num_ctb_tmp -= nctb;
 1122|  19.3M|            ihevcd_ctb_pos_update(ps_proc, nctb);
 1123|  19.3M|        }
 1124|       |
 1125|  9.66M|        if(cur_slice_idx != ps_proc->i4_cur_slice_idx)
  ------------------
  |  Branch (1125:12): [True: 6.48k, False: 9.65M]
  ------------------
 1126|  6.48k|        {
 1127|  6.48k|            ps_proc->ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((cur_slice_idx)&(MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  6.48k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.48k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1128|  6.48k|            ps_proc->i4_cur_slice_idx = cur_slice_idx;
 1129|  6.48k|        }
 1130|       |        /* Restore the saved variables  */
 1131|  9.66M|        num_ctb_tmp = num_ctb;
 1132|  9.66M|        ps_proc->i4_ctb_x -= num_ctb;
 1133|  9.66M|        ps_proc->i4_ctb_tile_x = cur_ctb_tile_x;
 1134|  9.66M|        ps_proc->i4_ctb_tile_y = cur_ctb_tile_y;
 1135|  9.66M|        ps_proc->pu1_pu_map = pu1_pu_map_cur;
 1136|  9.66M|        ps_proc->ps_tu = ps_tu_cur;
 1137|  9.66M|        nxt_ctb_slice_y = ps_proc->i4_ctb_slice_y;
 1138|  9.66M|        nxt_ctb_slice_x = ps_proc->i4_ctb_slice_x;
 1139|  9.66M|        ps_proc->i4_ctb_slice_y = cur_ctb_slice_y;
 1140|  9.66M|        ps_proc->i4_ctb_slice_x = cur_ctb_slice_x;
 1141|  9.66M|        proc_type = PROC_SAO;
 1142|       |
 1143|  29.0M|        while(num_ctb_tmp)
  ------------------
  |  Branch (1143:15): [True: 19.3M, False: 9.66M]
  ------------------
 1144|  19.3M|        {
 1145|       |
 1146|       |
 1147|       |            /* Check proc map to ensure dependencies for SAO are met */
 1148|  19.3M|            ihevcd_proc_map_check(ps_proc, proc_type, nctb);
 1149|       |
 1150|  19.3M|            ihevcd_slice_hdr_update(ps_proc);
 1151|       |
 1152|       |
 1153|       |
 1154|  19.3M|            {
 1155|       |                /* SAO is done even when it is disabled in the current slice, because
 1156|       |                 * it is performed on a shifted CTB and the neighbor CTBs can belong
 1157|       |                 * to different slices with SAO enabled */
 1158|  19.3M|                if(0 == ps_codec->i4_disable_sao_pic)
  ------------------
  |  Branch (1158:20): [True: 19.3M, False: 3.55k]
  ------------------
 1159|  19.3M|                {
 1160|  19.3M|                    ps_proc->s_sao_ctxt.ps_pps = ps_proc->ps_pps;
 1161|  19.3M|                    ps_proc->s_sao_ctxt.ps_sps = ps_proc->ps_sps;
 1162|  19.3M|                    ps_proc->s_sao_ctxt.ps_tile = ps_proc->ps_tile;
 1163|  19.3M|                    ps_proc->s_sao_ctxt.ps_codec = ps_proc->ps_codec;
 1164|  19.3M|                    ps_proc->s_sao_ctxt.ps_slice_hdr = ps_proc->ps_slice_hdr;
 1165|  19.3M|                    ps_proc->s_sao_ctxt.i4_cur_slice_idx = ps_proc->i4_cur_slice_idx;
 1166|       |
 1167|       |
 1168|  19.3M|                    ps_proc->s_sao_ctxt.i4_ctb_x = ps_proc->i4_ctb_x;
 1169|  19.3M|                    ps_proc->s_sao_ctxt.i4_ctb_y = ps_proc->i4_ctb_y;
 1170|  19.3M|                    ps_proc->s_sao_ctxt.is_chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
 1171|       |
 1172|  19.3M|                    ihevcd_sao_shift_ctb(&ps_proc->s_sao_ctxt);
 1173|  19.3M|                }
 1174|       |
 1175|       |
 1176|       |                /* Call padding if required */
 1177|  19.3M|                {
 1178|  19.3M|                    chroma_row_strd = ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor;
 1179|       |
 1180|       |
 1181|  19.3M|                    if(0 == ps_proc->i4_ctb_x)
  ------------------
  |  Branch (1181:24): [True: 1.03M, False: 18.3M]
  ------------------
 1182|  1.03M|                    {
 1183|  1.03M|                        WORD32 pad_ht_luma;
 1184|  1.03M|                        WORD32 pad_ht_chroma;
 1185|       |
 1186|  1.03M|                        ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma
 1187|  1.03M|                                        + (ps_proc->i4_ctb_x * ctb_size
 1188|  1.03M|                                        + ps_proc->i4_ctb_y * ctb_size
 1189|  1.03M|                                        * ps_codec->i4_strd) * ps_codec->i4_pixel_size_y;
 1190|       |
 1191|  1.03M|                        pad_ht_luma = ctb_size;
 1192|  1.03M|                        pad_ht_luma += (ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y ? 8 : 0;
  ------------------
  |  Branch (1192:40): [True: 69.8k, False: 969k]
  ------------------
 1193|       |                        /* Pad left after 1st CTB is processed */
 1194|  1.03M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  1.03M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1194:28): [True: 884k, False: 155k]
  ------------------
 1195|   884k|                        {
 1196|   884k|                            ps_codec->s_func_selector.ihevc_pad_left_luma_fptr(ps_proc->pu1_cur_ctb_luma - 8 * ps_codec->i4_strd,
 1197|   884k|                                ps_codec->i4_strd, pad_ht_luma, PAD_LEFT);
  ------------------
  |  |   82|   884k|#define PAD_LEFT    80
  ------------------
 1198|   884k|                        }
 1199|   155k|                        else
 1200|   155k|                        {
 1201|   155k|                            ps_codec->s_func_selector.ihevc_hbd_pad_left_luma_fptr((UWORD16 *)ps_proc->pu1_cur_ctb_luma - 8 * ps_codec->i4_strd,
 1202|   155k|                                ps_codec->i4_strd, pad_ht_luma, PAD_LEFT);
  ------------------
  |  |   82|   155k|#define PAD_LEFT    80
  ------------------
 1203|   155k|                        }
 1204|  1.03M|                        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1204:28): [True: 1.03M, False: 5.82k]
  ------------------
 1205|  1.03M|                        {
 1206|  1.03M|                            ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma
 1207|  1.03M|                                            + ((ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor)
 1208|  1.03M|                                            + (ps_proc->i4_ctb_y * ctb_size * chroma_row_strd / v_samp_factor)) * ps_codec->i4_pixel_size_uv;
 1209|  1.03M|                            pad_ht_chroma = ctb_size / v_samp_factor;
 1210|  1.03M|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  1.03M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1210:32): [True: 880k, False: 153k]
  ------------------
 1211|   880k|                            {
 1212|   880k|                                ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(
 1213|   880k|                                                ps_proc->pu1_cur_ctb_chroma - (8 * v_samp_factor) * chroma_row_strd,
 1214|   880k|                                                chroma_row_strd, pad_ht_chroma, PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|   880k|#define PAD_LEFT    80
  ------------------
 1215|   880k|                            }
 1216|   153k|                            else
 1217|   153k|                            {
 1218|   153k|                                ps_codec->s_func_selector.ihevc_hbd_pad_left_chroma_fptr(
 1219|   153k|                                                (UWORD16 *)ps_proc->pu1_cur_ctb_chroma - (8 * v_samp_factor) * chroma_row_strd,
 1220|   153k|                                                chroma_row_strd, pad_ht_chroma, PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|   153k|#define PAD_LEFT    80
  ------------------
 1221|   153k|                            }
 1222|  1.03M|                        }
 1223|  1.03M|                    }
 1224|       |
 1225|  19.3M|                    if((ps_sps->i2_pic_wd_in_ctb - 1) == ps_proc->i4_ctb_x)
  ------------------
  |  Branch (1225:24): [True: 1.03M, False: 18.3M]
  ------------------
 1226|  1.03M|                    {
 1227|  1.03M|                        WORD32 pad_ht_luma;
 1228|  1.03M|                        WORD32 pad_ht_chroma;
 1229|  1.03M|                        WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size);
 1230|       |
 1231|  1.03M|                        ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma
 1232|  1.03M|                                        + (ps_proc->i4_ctb_x * ctb_size
 1233|  1.03M|                                        + ps_proc->i4_ctb_y * ctb_size
 1234|  1.03M|                                        * ps_codec->i4_strd) * ps_codec->i4_pixel_size_y;
 1235|  1.03M|                        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1235:28): [True: 1.03M, False: 5.82k]
  ------------------
 1236|  1.03M|                        {
 1237|  1.03M|                            ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma
 1238|  1.03M|                                            + ((ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor)
 1239|  1.03M|                                            + (ps_proc->i4_ctb_y * ctb_size * chroma_row_strd / v_samp_factor)) * ps_codec->i4_pixel_size_uv;
 1240|  1.03M|                            pad_ht_chroma = ctb_size / v_samp_factor;
 1241|  1.03M|                        }
 1242|  1.03M|                        pad_ht_luma = ctb_size;
 1243|  1.03M|                        if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y)
  ------------------
  |  Branch (1243:28): [True: 69.8k, False: 969k]
  ------------------
 1244|  69.8k|                        {
 1245|  69.8k|                            pad_ht_luma += 8;
 1246|  69.8k|                            if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1246:33): [True: 69.0k, False: 885]
  ------------------
 1247|  69.0k|                            {
 1248|  69.0k|                                pad_ht_chroma += (8 * v_samp_factor);
 1249|  69.0k|                                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  69.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1249:36): [True: 45.1k, False: 23.8k]
  ------------------
 1250|  45.1k|                                {
 1251|  45.1k|                                    ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(
 1252|  45.1k|                                                    ps_proc->pu1_cur_pic_chroma + ((ps_sps->i2_pic_height_in_luma_samples / v_samp_factor) - (8 * v_samp_factor)) * chroma_row_strd,
 1253|  45.1k|                                                    chroma_row_strd, (8 * v_samp_factor),
 1254|  45.1k|                                                    PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|  45.1k|#define PAD_LEFT    80
  ------------------
 1255|  45.1k|                                }
 1256|  23.8k|                                else
 1257|  23.8k|                                {
 1258|  23.8k|                                    ps_codec->s_func_selector.ihevc_hbd_pad_left_chroma_fptr(
 1259|  23.8k|                                                    (UWORD16 *)ps_proc->pu1_cur_pic_chroma + ((ps_sps->i2_pic_height_in_luma_samples / v_samp_factor) - (8 * v_samp_factor)) * chroma_row_strd,
 1260|  23.8k|                                                    chroma_row_strd, (8 * v_samp_factor),
 1261|  23.8k|                                                    PAD_LEFT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   82|  23.8k|#define PAD_LEFT    80
  ------------------
 1262|  23.8k|                                }
 1263|  69.0k|                            }
 1264|  69.8k|                        }
 1265|       |                        /* Pad right after last CTB in the current row is processed */
 1266|  1.03M|                        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  1.03M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1266:28): [True: 884k, False: 155k]
  ------------------
 1267|   884k|                        {
 1268|   884k|                            ps_codec->s_func_selector.ihevc_pad_right_luma_fptr(
 1269|   884k|                                ps_proc->pu1_cur_ctb_luma + cols_remaining - 8 * ps_codec->i4_strd,
 1270|   884k|                                ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT);
  ------------------
  |  |   87|   884k|#define PAD_RIGHT   80
  ------------------
 1271|   884k|                        }
 1272|   155k|                        else
 1273|   155k|                        {
 1274|   155k|                            ps_codec->s_func_selector.ihevc_hbd_pad_right_luma_fptr((UWORD16 *)ps_proc->pu1_cur_ctb_luma + cols_remaining - 8 * ps_codec->i4_strd,
 1275|   155k|                                ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT);
  ------------------
  |  |   87|   155k|#define PAD_RIGHT   80
  ------------------
 1276|   155k|                        }
 1277|  1.03M|                        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1277:28): [True: 1.03M, False: 5.82k]
  ------------------
 1278|  1.03M|                        {
 1279|  1.03M|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  1.03M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1279:32): [True: 880k, False: 153k]
  ------------------
 1280|   880k|                            {
 1281|   880k|                                 ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(
 1282|   880k|                                                ps_proc->pu1_cur_ctb_chroma + (cols_remaining * chroma_pixel_strd / h_samp_factor) - (8 * v_samp_factor) * chroma_row_strd,
 1283|   880k|                                                chroma_row_strd, pad_ht_chroma,
 1284|   880k|                                                PAD_RIGHT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   87|   880k|#define PAD_RIGHT   80
  ------------------
 1285|   880k|                            }
 1286|   153k|                            else
 1287|   153k|                            {
 1288|   153k|                                ihevc_hbd_pad_right_chroma(
 1289|   153k|                                                (UWORD16 *)ps_proc->pu1_cur_ctb_chroma + (cols_remaining * chroma_pixel_strd / h_samp_factor) - (8 * v_samp_factor) * chroma_row_strd,
 1290|   153k|                                                chroma_row_strd, pad_ht_chroma,
 1291|   153k|                                                PAD_RIGHT * chroma_pixel_strd / h_samp_factor);
  ------------------
  |  |   87|   153k|#define PAD_RIGHT   80
  ------------------
 1292|   153k|                            }
 1293|  1.03M|                        }
 1294|       |
 1295|  1.03M|                        if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y)
  ------------------
  |  Branch (1295:28): [True: 69.8k, False: 969k]
  ------------------
 1296|  69.8k|                        {
 1297|  69.8k|                            UWORD8 *pu1_buf;
 1298|       |                            /* Since SAO is shifted by 8x8, chroma padding can not be done till second row is processed */
 1299|       |                            /* Hence moving top padding to to end of frame, Moving it to second row also results in problems when there is only one row */
 1300|       |                            /* Pad top after padding left and right for current rows after processing 1st CTB row */
 1301|  69.8k|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  69.8k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1301:32): [True: 45.6k, False: 24.2k]
  ------------------
 1302|  45.6k|                            {
 1303|  45.6k|                                ihevc_pad_top(ps_proc->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd,
  ------------------
  |  |   82|  45.6k|#define PAD_LEFT    80
  ------------------
 1304|  45.6k|                                    ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   91|  45.6k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  45.6k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  45.6k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                  ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   72|  45.6k|#define PAD_TOP     80
  ------------------
 1305|  45.6k|                            }
 1306|  24.2k|                            else
 1307|  24.2k|                            {
 1308|  24.2k|                                ihevc_hbd_pad_top((UWORD16 *)ps_proc->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd,
  ------------------
  |  |   82|  24.2k|#define PAD_LEFT    80
  ------------------
 1309|  24.2k|                                    ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   91|  24.2k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  24.2k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  24.2k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                  ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP);
  ------------------
  |  |   72|  24.2k|#define PAD_TOP     80
  ------------------
 1310|  24.2k|                            }
 1311|  69.8k|                            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1311:32): [True: 69.0k, False: 885]
  ------------------
 1312|  69.0k|                            {
 1313|  69.0k|                                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  69.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1313:36): [True: 45.1k, False: 23.8k]
  ------------------
 1314|  45.1k|                                {
 1315|  45.1k|                                     ihevc_pad_top(ps_proc->pu1_cur_pic_chroma - PAD_LEFT * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   82|  45.1k|#define PAD_LEFT    80
  ------------------
 1316|  45.1k|                                                  chroma_row_strd,
 1317|  45.1k|                                                  (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  45.1k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  45.1k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  45.1k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1318|  45.1k|                                                  PAD_TOP / v_samp_factor);
  ------------------
  |  |   72|  45.1k|#define PAD_TOP     80
  ------------------
 1319|  45.1k|                                }
 1320|  23.8k|                                else
 1321|  23.8k|                                {
 1322|  23.8k|                                    ihevc_hbd_pad_top((UWORD16 *)ps_proc->pu1_cur_pic_chroma - PAD_LEFT * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   82|  23.8k|#define PAD_LEFT    80
  ------------------
 1323|  23.8k|                                                      chroma_row_strd,
 1324|  23.8k|                                                      (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  23.8k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  23.8k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  23.8k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1325|  23.8k|                                                      PAD_TOP / v_samp_factor);
  ------------------
  |  |   72|  23.8k|#define PAD_TOP     80
  ------------------
 1326|  23.8k|                                }
 1327|  69.0k|                            }
 1328|       |
 1329|       |                            /* Pad bottom after padding left and right for current rows after processing 1st CTB row */
 1330|  69.8k|                            pu1_buf = ps_proc->pu1_cur_pic_luma +
 1331|  69.8k|                                (ps_codec->i4_strd * ps_sps->i2_pic_height_in_luma_samples - PAD_LEFT) * ps_codec->i4_pixel_size_y;
  ------------------
  |  |   82|  69.8k|#define PAD_LEFT    80
  ------------------
 1332|  69.8k|                            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  69.8k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1332:32): [True: 45.6k, False: 24.2k]
  ------------------
 1333|  45.6k|                            {
 1334|  45.6k|                                ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd,
 1335|  45.6k|                                                 ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   91|  45.6k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  45.6k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  45.6k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                               ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   77|  45.6k|#define PAD_BOT     80
  ------------------
 1336|  45.6k|                            }
 1337|  24.2k|                            else
 1338|  24.2k|                            {
 1339|  24.2k|                                ihevc_hbd_pad_bottom((UWORD16 *)pu1_buf, ps_codec->i4_strd,
 1340|  24.2k|                                                     ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   91|  24.2k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  24.2k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  24.2k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                                                                   ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT);
  ------------------
  |  |   77|  24.2k|#define PAD_BOT     80
  ------------------
 1341|  24.2k|                            }
 1342|  69.8k|                            if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1342:32): [True: 69.0k, False: 885]
  ------------------
 1343|  69.0k|                            {
 1344|  69.0k|                                pu1_buf = ps_proc->pu1_cur_pic_chroma
 1345|  69.0k|                                                + (chroma_row_strd * (ps_sps->i2_pic_height_in_luma_samples / v_samp_factor)
 1346|  69.0k|                                                - (PAD_LEFT * chroma_pixel_strd / h_samp_factor)) * ps_codec->i4_pixel_size_uv;
  ------------------
  |  |   82|  69.0k|#define PAD_LEFT    80
  ------------------
 1347|  69.0k|                                if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  69.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1347:36): [True: 45.1k, False: 23.8k]
  ------------------
 1348|  45.1k|                                {
 1349|  45.1k|                                     ihevc_pad_bottom(pu1_buf,
 1350|  45.1k|                                                     chroma_row_strd,
 1351|  45.1k|                                                     (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  45.1k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  45.1k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  45.1k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1352|  45.1k|                                                     PAD_BOT / v_samp_factor);
  ------------------
  |  |   77|  45.1k|#define PAD_BOT     80
  ------------------
 1353|  45.1k|                                }
 1354|  23.8k|                                else
 1355|  23.8k|                                {
 1356|  23.8k|                                    ihevc_hbd_pad_bottom((UWORD16 *)pu1_buf,
 1357|  23.8k|                                                         chroma_row_strd,
 1358|  23.8k|                                                         (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor),
  ------------------
  |  |   91|  23.8k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  23.8k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  23.8k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1359|  23.8k|                                                         PAD_BOT / v_samp_factor);
  ------------------
  |  |   77|  23.8k|#define PAD_BOT     80
  ------------------
 1360|  23.8k|                                 }
 1361|  69.0k|                            }
 1362|  69.8k|                        }
 1363|  1.03M|                    }
 1364|       |
 1365|  19.3M|                }
 1366|  19.3M|            }
 1367|       |
 1368|       |
 1369|       |            /* Update proc map for SAO*/
 1370|  19.3M|            ihevcd_proc_map_update(ps_proc, proc_type, nctb);
 1371|       |            /* Update proc map for Completion of CTB*/
 1372|  19.3M|            ihevcd_proc_map_update(ps_proc, PROC_ALL, nctb);
 1373|  19.3M|            {
 1374|  19.3M|                tile_t *ps_tile;
 1375|       |
 1376|  19.3M|                ps_tile = ps_proc->ps_tile;
 1377|  19.3M|                num_ctb_tmp -= nctb;
 1378|       |
 1379|  19.3M|                ps_proc->i4_ctb_tile_x += nctb;
 1380|  19.3M|                ps_proc->i4_ctb_x += nctb;
 1381|       |
 1382|  19.3M|                ps_proc->i4_ctb_slice_x += nctb;
 1383|       |
 1384|       |
 1385|       |                /* Update tile counters */
 1386|  19.3M|                if(ps_proc->i4_ctb_tile_x >= (ps_tile->u2_wd))
  ------------------
  |  Branch (1386:20): [True: 1.49M, False: 17.8M]
  ------------------
 1387|  1.49M|                {
 1388|       |                    /*End of tile row*/
 1389|  1.49M|                    ps_proc->i4_ctb_tile_x = 0;
 1390|  1.49M|                    ps_proc->i4_ctb_x = ps_tile->u1_pos_x;
 1391|       |
 1392|  1.49M|                    ps_proc->i4_ctb_tile_y++;
 1393|  1.49M|                    ps_proc->i4_ctb_y++;
 1394|  1.49M|                    if(ps_proc->i4_ctb_tile_y == ps_tile->u2_ht)
  ------------------
  |  Branch (1394:24): [True: 125k, False: 1.36M]
  ------------------
 1395|   125k|                    {
 1396|       |                        /* Reached End of Tile */
 1397|   125k|                        ps_proc->i4_ctb_tile_y = 0;
 1398|   125k|                        ps_proc->i4_ctb_tile_x = 0;
 1399|   125k|                        ps_proc->ps_tile++;
 1400|       |                        //End of picture
 1401|   125k|                        if(!((ps_tile->u2_ht + ps_tile->u1_pos_y  ==  ps_sps->i2_pic_ht_in_ctb) && (ps_tile->u2_wd + ps_tile->u1_pos_x  ==  ps_sps->i2_pic_wd_in_ctb)))
  ------------------
  |  Branch (1401:30): [True: 80.1k, False: 45.1k]
  |  Branch (1401:100): [True: 69.8k, False: 10.2k]
  ------------------
 1402|  55.4k|                        {
 1403|  55.4k|                            ps_tile = ps_proc->ps_tile;
 1404|  55.4k|                            ps_proc->i4_ctb_x = ps_tile->u1_pos_x;
 1405|  55.4k|                            ps_proc->i4_ctb_y = ps_tile->u1_pos_y;
 1406|       |
 1407|  55.4k|                        }
 1408|   125k|                    }
 1409|  1.49M|                }
 1410|  19.3M|            }
 1411|  19.3M|        }
 1412|       |
 1413|  9.66M|        ps_proc->i4_ctb_cnt -= num_ctb;
 1414|  9.66M|    }
 1415|  1.49M|    return ret;
 1416|  1.49M|}
ihevcd_init_proc_ctxt:
 1419|  1.50M|{
 1420|  1.50M|    codec_t *ps_codec;
 1421|  1.50M|    slice_header_t *ps_slice_hdr;
 1422|  1.50M|    pps_t *ps_pps;
 1423|  1.50M|    sps_t *ps_sps;
 1424|  1.50M|    tile_t *ps_tile, *ps_tile_prev;
 1425|  1.50M|    WORD32 tile_idx;
 1426|  1.50M|    WORD32 ctb_size;
 1427|  1.50M|    WORD32 num_minpu_in_ctb;
 1428|  1.50M|    WORD32 num_ctb_in_row;
 1429|  1.50M|    WORD32 ctb_addr;
 1430|  1.50M|    WORD32 i4_wd_in_ctb;
 1431|  1.50M|    WORD32 tile_start_ctb_idx;
 1432|  1.50M|    WORD32 slice_start_ctb_idx;
 1433|  1.50M|    WORD32 check_tile_wd;
 1434|  1.50M|    WORD32 continuous_tiles = 0; //Refers to tiles that are continuous, within a slice, horizontally
 1435|       |
 1436|  1.50M|    ps_codec = ps_proc->ps_codec;
 1437|       |
 1438|  1.50M|    ps_slice_hdr = ps_codec->ps_slice_hdr_base + ((ps_proc->i4_cur_slice_idx) & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  1.50M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.50M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1439|  1.50M|    ps_proc->ps_slice_hdr = ps_slice_hdr;
 1440|  1.50M|    ps_proc->ps_pps = ps_codec->ps_pps_base + ps_slice_hdr->i1_pps_id;
 1441|  1.50M|    ps_pps = ps_proc->ps_pps;
 1442|  1.50M|    ps_proc->ps_sps = ps_codec->ps_sps_base + ps_pps->i1_sps_id;
 1443|  1.50M|    ps_sps = ps_proc->ps_sps;
 1444|  1.50M|    ps_proc->i4_init_done = 1;
 1445|  1.50M|    ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 1446|  1.50M|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.50M|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  367|  1.50M|#define MIN_PU_SIZE         4
  ------------------
 1447|  1.50M|    num_ctb_in_row = ps_sps->i2_pic_wd_in_ctb;
 1448|       |
 1449|  1.50M|    ps_proc->s_sao_ctxt.pu1_slice_idx = ps_proc->pu1_slice_idx;
 1450|       |
 1451|  1.50M|    ihevcd_get_tile_pos(ps_pps, ps_sps, ps_proc->i4_ctb_x, ps_proc->i4_ctb_y,
 1452|  1.50M|                        &ps_proc->i4_ctb_tile_x, &ps_proc->i4_ctb_tile_y,
 1453|  1.50M|                        &tile_idx);
 1454|       |
 1455|  1.50M|    ps_proc->ps_tile = ps_pps->ps_tile + tile_idx;
 1456|  1.50M|    ps_proc->i4_cur_tile_idx = tile_idx;
 1457|  1.50M|    ps_tile = ps_proc->ps_tile;
 1458|       |
 1459|  1.50M|    if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1459:8): [True: 583k, False: 918k]
  ------------------
 1460|   583k|    {
 1461|   583k|        if(tile_idx)
  ------------------
  |  Branch (1461:12): [True: 528k, False: 54.6k]
  ------------------
 1462|   528k|            ps_tile_prev = ps_tile - 1;
 1463|  54.6k|        else
 1464|  54.6k|            ps_tile_prev = ps_tile;
 1465|       |
 1466|   583k|        slice_start_ctb_idx = ps_slice_hdr->i2_ctb_x + (ps_slice_hdr->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb);
 1467|   583k|        tile_start_ctb_idx = ps_tile->u1_pos_x + (ps_tile->u1_pos_y * ps_sps->i2_pic_wd_in_ctb);
 1468|       |
 1469|       |        /*Check if
 1470|       |         * 1. Last tile that ends in frame boundary and 1st tile in next row belongs to same slice
 1471|       |         * 1.1. If it does, check if the slice that has these tiles spans across the frame row.
 1472|       |         * 2. Vertical tiles are present within a slice */
 1473|   583k|        if(((ps_slice_hdr->i2_ctb_x == ps_tile->u1_pos_x) && (ps_slice_hdr->i2_ctb_y != ps_tile->u1_pos_y)))
  ------------------
  |  Branch (1473:13): [True: 132k, False: 450k]
  |  Branch (1473:62): [True: 72.0k, False: 60.5k]
  ------------------
 1474|  72.0k|        {
 1475|  72.0k|            continuous_tiles = 1;
 1476|  72.0k|        }
 1477|   511k|        else
 1478|   511k|        {
 1479|   511k|            check_tile_wd = ps_slice_hdr->i2_ctb_x + ps_tile_prev->u2_wd;
 1480|   511k|            if(!(((check_tile_wd >= ps_sps->i2_pic_wd_in_ctb) && (check_tile_wd % ps_sps->i2_pic_wd_in_ctb == ps_tile->u1_pos_x))
  ------------------
  |  Branch (1480:19): [True: 30.1k, False: 480k]
  |  Branch (1480:66): [True: 24.9k, False: 5.26k]
  ------------------
 1481|   486k|                                            || ((ps_slice_hdr->i2_ctb_x == ps_tile->u1_pos_x))))
  ------------------
  |  Branch (1481:48): [True: 36.4k, False: 449k]
  ------------------
 1482|   449k|            {
 1483|   449k|                continuous_tiles = 1;
 1484|   449k|            }
 1485|   511k|        }
 1486|       |
 1487|   583k|        {
 1488|   583k|            WORD32 i2_independent_ctb_x = ps_slice_hdr->i2_independent_ctb_x;
 1489|   583k|            WORD32 i2_independent_ctb_y = ps_slice_hdr->i2_independent_ctb_y;
 1490|       |
 1491|       |            /* Handles cases where
 1492|       |             * 1. Slices begin at the start of each tile
 1493|       |             * 2. Tiles lie in the same slice row.i.e, starting tile_x > slice_x, but tile_y == slice_y
 1494|       |             * */
 1495|   583k|            if(ps_proc->i4_ctb_x >= i2_independent_ctb_x)
  ------------------
  |  Branch (1495:16): [True: 510k, False: 73.0k]
  ------------------
 1496|   510k|            {
 1497|   510k|                ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_x - i2_independent_ctb_x;
 1498|   510k|            }
 1499|  73.0k|            else
 1500|  73.0k|            {
 1501|       |                /* Indicates multiple tiles in a slice case where
 1502|       |                 * The new tile belongs to an older slice that started in the previous rows-not the present row
 1503|       |                 * & (tile_y > slice_y and tile_x < slice_x)
 1504|       |                 */
 1505|  73.0k|                if((slice_start_ctb_idx < tile_start_ctb_idx) && (continuous_tiles))
  ------------------
  |  Branch (1505:20): [True: 65.1k, False: 7.84k]
  |  Branch (1505:66): [True: 64.3k, False: 776]
  ------------------
 1506|  64.3k|                {
 1507|  64.3k|                    i4_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
 1508|  64.3k|                }
 1509|       |                /* Indicates many-tiles-in-one-slice case, for slices that end without spanning the frame width*/
 1510|  8.61k|                else
 1511|  8.61k|                {
 1512|  8.61k|                    i4_wd_in_ctb = ps_tile->u2_wd;
 1513|  8.61k|                }
 1514|       |
 1515|  73.0k|                if(continuous_tiles)
  ------------------
  |  Branch (1515:20): [True: 65.4k, False: 7.56k]
  ------------------
 1516|  65.4k|                {
 1517|  65.4k|                    ps_proc->i4_ctb_slice_x = i4_wd_in_ctb
 1518|  65.4k|                                    - (i2_independent_ctb_x - ps_proc->i4_ctb_x);
 1519|  65.4k|                }
 1520|  7.56k|                else
 1521|  7.56k|                {
 1522|  7.56k|                    ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_x - ps_tile->u1_pos_x;
 1523|  7.56k|                }
 1524|  73.0k|            }
 1525|       |            /* Initialize ctb slice y to zero and at the start of slice row initialize it
 1526|       |        to difference between ctb_y and slice's start ctb y */
 1527|       |
 1528|   583k|            ps_proc->i4_ctb_slice_y = ps_proc->i4_ctb_y - i2_independent_ctb_y;
 1529|       |
 1530|       |            /*If beginning of tile, check if slice counters are set correctly*/
 1531|   583k|            if((0 == ps_proc->i4_ctb_tile_x) && (0 == ps_proc->i4_ctb_tile_y))
  ------------------
  |  Branch (1531:16): [True: 583k, False: 18.4E]
  |  Branch (1531:49): [True: 63.9k, False: 519k]
  ------------------
 1532|  63.9k|            {
 1533|  63.9k|                if(ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (1533:20): [True: 3.19k, False: 60.7k]
  ------------------
 1534|  3.19k|                {
 1535|  3.19k|                    ps_proc->i4_ctb_slice_x = 0;
 1536|  3.19k|                    ps_proc->i4_ctb_slice_y = 0;
 1537|  3.19k|                }
 1538|       |                /*For slices that span across multiple tiles*/
 1539|  60.7k|                else if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (1539:25): [True: 50.8k, False: 9.90k]
  ------------------
 1540|  50.8k|                {
 1541|  50.8k|                    ps_proc->i4_ctb_slice_y = ps_tile->u1_pos_y - i2_independent_ctb_y;
 1542|       |                    /* Two Cases
 1543|       |                     * 1 - slice spans across frame-width- but dose not start from 1st column
 1544|       |                     * 2 - Slice spans across multiple tiles anywhere is a frame
 1545|       |                     */
 1546|       |                    /*TODO:In a multiple slice clip,  if an independent slice span across more than 2 tiles in a row, it is not supported*/
 1547|  50.8k|                    if(continuous_tiles) //Case 2-implemented for slices that span not more than 2 tiles
  ------------------
  |  Branch (1547:24): [True: 50.8k, False: 73]
  ------------------
 1548|  50.8k|                    {
 1549|  50.8k|                        if(i2_independent_ctb_y <= ps_tile->u1_pos_y)
  ------------------
  |  Branch (1549:28): [True: 41.4k, False: 9.33k]
  ------------------
 1550|  41.4k|                        {
 1551|       |                            //Check if ctb x is before or after
 1552|  41.4k|                            if(i2_independent_ctb_x > ps_tile->u1_pos_x)
  ------------------
  |  Branch (1552:32): [True: 2.23k, False: 39.2k]
  ------------------
 1553|  2.23k|                            {
 1554|  2.23k|                                ps_proc->i4_ctb_slice_y -= 1;
 1555|  2.23k|                            }
 1556|  41.4k|                        }
 1557|  50.8k|                    }
 1558|  50.8k|                }
 1559|  63.9k|            }
 1560|       |            //Slice starts from a column which is not the starting tile-column, but is within the tile
 1561|   583k|            if(((i2_independent_ctb_x - ps_tile->u1_pos_x) != 0) && ((ps_proc->i4_ctb_slice_y != 0))
  ------------------
  |  Branch (1561:16): [True: 467k, False: 115k]
  |  Branch (1561:69): [True: 455k, False: 12.0k]
  ------------------
 1562|   455k|                            && ((i2_independent_ctb_x >= ps_tile->u1_pos_x) && (i2_independent_ctb_x < ps_tile->u1_pos_x + ps_tile->u2_wd)))
  ------------------
  |  Branch (1562:33): [True: 70.4k, False: 385k]
  |  Branch (1562:80): [True: 16.6k, False: 53.8k]
  ------------------
 1563|  16.6k|            {
 1564|  16.6k|                ps_proc->i4_ctb_slice_y -= 1;
 1565|  16.6k|            }
 1566|   583k|        }
 1567|   583k|    }
 1568|   918k|    else
 1569|   918k|    {
 1570|   918k|        WORD32 i2_independent_ctb_x = ps_slice_hdr->i2_independent_ctb_x;
 1571|   918k|        WORD32 i2_independent_ctb_y = ps_slice_hdr->i2_independent_ctb_y;
 1572|       |
 1573|       |
 1574|   918k|        {
 1575|   918k|            ps_proc->i4_ctb_slice_x = ps_proc->i4_ctb_x - i2_independent_ctb_x;
 1576|   918k|            ps_proc->i4_ctb_slice_y = ps_proc->i4_ctb_y - i2_independent_ctb_y;
 1577|   918k|            if(ps_proc->i4_ctb_slice_x < 0)
  ------------------
  |  Branch (1577:16): [True: 65.9k, False: 852k]
  ------------------
 1578|  65.9k|            {
 1579|  65.9k|                ps_proc->i4_ctb_slice_x += ps_sps->i2_pic_wd_in_ctb;
 1580|  65.9k|                ps_proc->i4_ctb_slice_y -= 1;
 1581|  65.9k|            }
 1582|       |
 1583|       |            /* Initialize ctb slice y to zero and at the start of slice row initialize it
 1584|       |            to difference between ctb_y and slice's start ctb y */
 1585|   918k|        }
 1586|   918k|    }
 1587|       |
 1588|       |    /* Compute TU offset for the current CTB set */
 1589|  1.50M|    {
 1590|       |
 1591|  1.50M|        WORD32 ctb_luma_min_tu_cnt;
 1592|  1.50M|        WORD32 ctb_addr;
 1593|       |
 1594|  1.50M|        ctb_addr = ps_proc->i4_ctb_y * num_ctb_in_row + ps_proc->i4_ctb_x;
 1595|       |
 1596|  1.50M|        ctb_luma_min_tu_cnt = (1 << ps_sps->i1_log2_ctb_size) / MIN_TU_SIZE;
  ------------------
  |  |  358|  1.50M|#define MIN_TU_SIZE         4
  ------------------
 1597|  1.50M|        ctb_luma_min_tu_cnt *= ctb_luma_min_tu_cnt;
 1598|       |
 1599|  1.50M|        ps_proc->pu1_tu_map = ps_proc->pu1_pic_tu_map
 1600|  1.50M|                        + ctb_luma_min_tu_cnt * ctb_addr;
 1601|  1.50M|        if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (1601:12): [True: 594k, False: 907k]
  ------------------
 1602|   594k|        {
 1603|   594k|            ps_proc->ps_tu = ps_proc->ps_pic_tu + ps_proc->pu4_pic_tu_idx[ctb_addr % RESET_TU_BUF_NCTB];
  ------------------
  |  |  175|   594k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  166|   594k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|   594k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|   594k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   594k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   594k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|   594k|        }
 1605|   907k|        else
 1606|   907k|        {
 1607|   907k|            ps_proc->ps_tu = ps_proc->ps_pic_tu + ps_proc->pu4_pic_tu_idx[ctb_addr];
 1608|   907k|        }
 1609|  1.50M|        ps_proc->pv_tu_coeff_data = (UWORD8 *)ps_proc->pv_pic_tu_coeff_data
 1610|  1.50M|                        + tu_coeff_data_ofst;
 1611|       |
 1612|  1.50M|    }
 1613|       |
 1614|       |    /* Compute PU related elements for the current CTB set */
 1615|  1.50M|    {
 1616|  1.50M|        WORD32 pu_idx;
 1617|  1.50M|        ctb_addr = ps_proc->i4_ctb_y * num_ctb_in_row + ps_proc->i4_ctb_x;
 1618|  1.50M|        pu_idx = ps_proc->pu4_pic_pu_idx[ctb_addr];
 1619|  1.50M|        ps_proc->pu1_pu_map = ps_proc->pu1_pic_pu_map
 1620|  1.50M|                        + ctb_addr * num_minpu_in_ctb;
 1621|  1.50M|        ps_proc->ps_pu = ps_proc->ps_pic_pu + pu_idx;
 1622|  1.50M|    }
 1623|       |
 1624|       |    /* Number of ctbs processed in one loop of process function */
 1625|  1.50M|    {
 1626|  1.50M|        ps_proc->i4_nctb = MIN(ps_codec->u4_nctb, ps_tile->u2_wd);
  ------------------
  |  |   43|  1.50M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 1.50M]
  |  |  ------------------
  ------------------
 1627|  1.50M|    }
 1628|       |
 1629|  1.50M|}
ihevcd_process_thread:
 1631|  26.3k|{
 1632|  26.3k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1633|  26.3k|    {
 1634|  26.3k|        ithread_set_affinity(ps_proc->i4_id + 1);
 1635|  26.3k|    }
 1636|       |
 1637|   115k|    while(1)
  ------------------
  |  Branch (1637:11): [True: 115k, Folded]
  ------------------
 1638|   115k|    {
 1639|   115k|        codec_t *ps_dec = ps_proc->ps_codec;
 1640|   115k|        if(ps_proc->ps_codec->i4_threads_active)
  ------------------
  |  Branch (1640:12): [True: 115k, False: 0]
  ------------------
 1641|   115k|        {
 1642|   115k|            DEBUG("In ihevcd_process_thread \n");
  ------------------
  |  |   49|   115k|#define DEBUG(...) {}
  ------------------
 1643|       |
 1644|   115k|            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[ps_proc->i4_id]);
 1645|   115k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1645:16): [True: 0, False: 115k]
  ------------------
 1646|      0|                break;
 1647|       |
 1648|   204k|            while(!ps_dec->ai4_process_start[ps_proc->i4_id])
  ------------------
  |  Branch (1648:19): [True: 89.2k, False: 115k]
  ------------------
 1649|  89.2k|            {
 1650|  89.2k|                ithread_cond_wait(ps_dec->apv_proc_start_condition[ps_proc->i4_id],
 1651|  89.2k|                                  ps_dec->apv_proc_start_mutex[ps_proc->i4_id]);
 1652|  89.2k|            }
 1653|   115k|            ps_dec->ai4_process_start[ps_proc->i4_id] = 0;
 1654|   115k|            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[ps_proc->i4_id]);
 1655|   115k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1655:16): [True: 0, False: 115k]
  ------------------
 1656|      0|                break;
 1657|       |
 1658|   115k|            DEBUG(" Got control at ihevcd_process_thread \n");
  ------------------
  |  |   49|   115k|#define DEBUG(...) {}
  ------------------
 1659|       |
 1660|   115k|            if(ps_dec->i4_break_threads == 1)
  ------------------
  |  Branch (1660:16): [True: 26.3k, False: 89.2k]
  ------------------
 1661|  26.3k|                break;
 1662|   115k|        }
 1663|  1.08M|        while(1)
  ------------------
  |  Branch (1663:15): [True: 1.08M, Folded]
  ------------------
 1664|  1.08M|        {
 1665|  1.08M|            proc_job_t s_job;
 1666|       |
 1667|  1.08M|            ret = ihevcd_jobq_dequeue((jobq_t *)ps_proc->pv_proc_jobq, &s_job,
 1668|  1.08M|                                    sizeof(proc_job_t), 1);
 1669|  1.08M|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1669:16): [True: 89.2k, False: 997k]
  ------------------
 1670|  89.2k|                break;
 1671|       |
 1672|   997k|            ps_proc->i4_ctb_cnt = s_job.i2_ctb_cnt;
 1673|   997k|            ps_proc->i4_ctb_x = s_job.i2_ctb_x;
 1674|   997k|            ps_proc->i4_ctb_y = s_job.i2_ctb_y;
 1675|   997k|            ps_proc->i4_cur_slice_idx = s_job.i2_slice_idx;
 1676|       |
 1677|       |
 1678|       |
 1679|   997k|            if(CMD_PROCESS == s_job.i4_cmd)
  ------------------
  |  Branch (1679:16): [True: 606k, False: 391k]
  ------------------
 1680|   606k|            {
 1681|   606k|                ihevcd_init_proc_ctxt(ps_proc, s_job.i4_tu_coeff_data_ofst);
 1682|   606k|                ihevcd_process(ps_proc);
 1683|   606k|            }
 1684|   391k|            else if(CMD_FMTCONV == s_job.i4_cmd)
  ------------------
  |  Branch (1684:21): [True: 398k, False: 18.4E]
  ------------------
 1685|   398k|            {
 1686|   398k|                sps_t *ps_sps;
 1687|   398k|                codec_t *ps_codec;
 1688|   398k|                ivd_out_bufdesc_t *ps_out_buffer;
 1689|   398k|                WORD32 num_rows;
 1690|       |
 1691|   398k|                if(0 == ps_proc->i4_init_done)
  ------------------
  |  Branch (1691:20): [True: 3.28k, False: 394k]
  ------------------
 1692|  3.28k|                {
 1693|  3.28k|                    ihevcd_init_proc_ctxt(ps_proc, 0);
 1694|  3.28k|                }
 1695|   398k|                ps_sps = ps_proc->ps_sps;
 1696|   398k|                ps_codec = ps_proc->ps_codec;
 1697|   398k|                ps_out_buffer = ps_proc->ps_out_buffer;
 1698|   398k|                num_rows = 1 << ps_sps->i1_log2_ctb_size;
 1699|       |
 1700|   398k|                num_rows = MIN(num_rows,
  ------------------
  |  |   43|   398k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 370k, False: 27.1k]
  |  |  ------------------
  ------------------
 1701|   398k|                               (ps_codec->i4_disp_ht - (s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size))
 1702|   398k|                              );
 1703|       |
 1704|   398k|                if(num_rows < 0)
  ------------------
  |  Branch (1704:20): [True: 496, False: 397k]
  ------------------
 1705|    496|                    num_rows = 0;
 1706|       |
 1707|   398k|                ihevcd_fmt_conv(ps_proc->ps_codec, ps_proc, ps_out_buffer->pu1_bufs[0],
 1708|   398k|                                ps_out_buffer->pu1_bufs[1], ps_out_buffer->pu1_bufs[2],
 1709|   398k|                                s_job.i2_ctb_y << ps_sps->i1_log2_ctb_size, num_rows);
 1710|   398k|            }
 1711|   997k|        }
 1712|  89.2k|        if(ps_proc->ps_codec->i4_threads_active)
  ------------------
  |  Branch (1712:12): [True: 89.2k, False: 1]
  ------------------
 1713|  89.2k|        {
 1714|  89.2k|            ret = ithread_mutex_lock(ps_dec->apv_proc_done_mutex[ps_proc->i4_id]);
 1715|  89.2k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1715:16): [True: 0, False: 89.2k]
  ------------------
 1716|      0|                break;
 1717|       |
 1718|  89.2k|            ps_dec->ai4_process_done[ps_proc->i4_id] = 1;
 1719|  89.2k|            ithread_cond_signal(ps_dec->apv_proc_done_condition[ps_proc->i4_id]);
 1720|       |
 1721|  89.2k|            ret = ithread_mutex_unlock(ps_dec->apv_proc_done_mutex[ps_proc->i4_id]);
 1722|  89.2k|            if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1722:16): [True: 0, False: 89.2k]
  ------------------
 1723|      0|                break;
 1724|  89.2k|        }
 1725|      1|        else
 1726|      1|        {
 1727|      1|            break;
 1728|      1|        }
 1729|  89.2k|    }
 1730|       |    //ithread_exit(0);
 1731|  26.3k|    return;
 1732|  26.3k|}

ihevcd_mv_mgr_get_poc:
   74|  78.5k|{
   75|  78.5k|    UWORD32 i;
   76|  78.5k|    mv_buf_t *ps_mv_buf = NULL;
   77|       |
   78|       |
   79|       |
   80|   138k|    for(i = 0; i < ps_mv_buf_mgr->u4_max_buf_cnt; i++)
  ------------------
  |  Branch (80:16): [True: 138k, False: 0]
  ------------------
   81|   138k|    {
   82|   138k|        ps_mv_buf = (mv_buf_t *)ps_mv_buf_mgr->apv_ptr[i];
   83|   138k|        if(ps_mv_buf && (ps_mv_buf->i4_abs_poc == (WORD32)abs_poc))
  ------------------
  |  Branch (83:12): [True: 138k, False: 0]
  |  Branch (83:25): [True: 78.5k, False: 60.1k]
  ------------------
   84|  78.5k|        {
   85|  78.5k|            break;
   86|  78.5k|        }
   87|   138k|    }
   88|       |
   89|  78.5k|    return ps_mv_buf;
   90|  78.5k|}
ihevcd_ref_list:
   94|  21.8k|{
   95|  21.8k|    WORD32 i, j;
   96|  21.8k|    WORD32 st_rps_idx;
   97|  21.8k|    WORD32 num_neg_pics, num_pos_pics;
   98|  21.8k|    WORD8 *pi1_used;
   99|  21.8k|    WORD16 *pi2_delta_poc;
  100|  21.8k|    UWORD32 u4_max_poc_lsb;
  101|  21.8k|    pic_buf_t *ps_pic_buf;
  102|  21.8k|    mv_buf_t *ps_mv_buf;
  103|  21.8k|    UWORD32 r_idx;
  104|       |
  105|  21.8k|    dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  106|  21.8k|    buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
  107|       |
  108|  21.8k|    WORD32 ai4_poc_st_curr_before[MAX_DPB_SIZE], ai4_poc_st_foll[MAX_DPB_SIZE], ai4_poc_st_curr_after[MAX_DPB_SIZE];
  109|  21.8k|    WORD32 ai4_poc_lt_curr[MAX_DPB_SIZE], ai4_poc_lt_foll[MAX_DPB_SIZE];
  110|  21.8k|    UWORD32 u4_num_st_curr_before, u4_num_st_foll, u4_num_st_curr_after, u4_num_lt_curr, u4_num_lt_foll;
  111|  21.8k|    UWORD32 u4_num_total_curr;
  112|       |
  113|  21.8k|    WORD8 ai1_curr_delta_poc_msb_present_flag[MAX_DPB_SIZE], ai1_foll_delta_poc_msb_present_flag[MAX_DPB_SIZE];
  114|       |
  115|  21.8k|    pic_buf_t *as_ref_pic_lt_curr[MAX_DPB_SIZE];
  116|  21.8k|    pic_buf_t *as_ref_pic_lt_foll[MAX_DPB_SIZE];
  117|  21.8k|    pic_buf_t *as_ref_pic_st_curr_after[MAX_DPB_SIZE];
  118|  21.8k|    pic_buf_t *as_ref_pic_st_curr_before[MAX_DPB_SIZE];
  119|  21.8k|    pic_buf_t *as_ref_pic_st_foll[MAX_DPB_SIZE];
  120|       |
  121|  21.8k|    pic_buf_t *as_ref_pic_list_temp0[MAX_DPB_SIZE], *as_ref_pic_list_temp1[MAX_DPB_SIZE];
  122|       |
  123|  21.8k|    UWORD32 u4_num_rps_curr_temp_list0, u4_num_rps_curr_temp_list1;
  124|       |
  125|  21.8k|    WORD32 i4_pic_order_cnt_val;
  126|  21.8k|    WORD32 i4_poc_lt;
  127|  21.8k|    UNUSED(as_ref_pic_lt_foll);
  ------------------
  |  |   38|  21.8k|#define UNUSED(x) ((void)(x))
  ------------------
  128|  21.8k|    UNUSED(as_ref_pic_st_foll);
  ------------------
  |  |   38|  21.8k|#define UNUSED(x) ((void)(x))
  ------------------
  129|  21.8k|    UNUSED(ps_pps);
  ------------------
  |  |   38|  21.8k|#define UNUSED(x) ((void)(x))
  ------------------
  130|       |
  131|  21.8k|    RETURN_IF_NAL_INFO;
  132|       |
  133|  21.8k|    u4_max_poc_lsb = (1 << ps_sps->i1_log2_max_pic_order_cnt_lsb);
  134|       |
  135|  21.8k|    i4_pic_order_cnt_val = ps_slice_hdr->i4_abs_pic_order_cnt;
  136|       |
  137|  21.8k|    if(1 == ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag)
  ------------------
  |  Branch (137:8): [True: 13.5k, False: 8.34k]
  ------------------
  138|  13.5k|    {
  139|  13.5k|        st_rps_idx = ps_slice_hdr->i1_short_term_ref_pic_set_idx;
  140|  13.5k|        num_neg_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_neg_pics;
  141|  13.5k|        num_pos_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_pos_pics;
  142|  13.5k|        pi1_used = ps_sps->as_stref_picset[st_rps_idx].ai1_used;
  143|  13.5k|        pi2_delta_poc = ps_sps->as_stref_picset[st_rps_idx].ai2_delta_poc;
  144|  13.5k|    }
  145|  8.34k|    else
  146|  8.34k|    {
  147|  8.34k|        st_rps_idx = ps_sps->i1_num_short_term_ref_pic_sets;
  148|  8.34k|        num_neg_pics = ps_slice_hdr->s_stref_picset.i1_num_neg_pics;
  149|  8.34k|        num_pos_pics = ps_slice_hdr->s_stref_picset.i1_num_pos_pics;
  150|  8.34k|        pi1_used = ps_slice_hdr->s_stref_picset.ai1_used;
  151|  8.34k|        pi2_delta_poc = ps_slice_hdr->s_stref_picset.ai2_delta_poc;
  152|  8.34k|    }
  153|       |
  154|  21.8k|    u4_num_st_curr_before = 0;
  155|  21.8k|    u4_num_st_foll = 0;
  156|  64.3k|    for(i = 0; i < num_neg_pics; i++)
  ------------------
  |  Branch (156:16): [True: 42.5k, False: 21.8k]
  ------------------
  157|  42.5k|    {
  158|  42.5k|        if(pi1_used[i])
  ------------------
  |  Branch (158:12): [True: 36.5k, False: 5.92k]
  ------------------
  159|  36.5k|        {
  160|  36.5k|            ai4_poc_st_curr_before[u4_num_st_curr_before] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  161|  36.5k|            u4_num_st_curr_before++;
  162|  36.5k|        }
  163|  5.92k|        else
  164|  5.92k|        {
  165|  5.92k|            ai4_poc_st_foll[u4_num_st_foll] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  166|  5.92k|            u4_num_st_foll++;
  167|  5.92k|        }
  168|  42.5k|    }
  169|  21.8k|    u4_num_st_curr_after = 0;
  170|  67.6k|    for(i = num_neg_pics; i < num_neg_pics + num_pos_pics; i++)
  ------------------
  |  Branch (170:27): [True: 45.7k, False: 21.8k]
  ------------------
  171|  45.7k|    {
  172|  45.7k|        if(pi1_used[i])
  ------------------
  |  Branch (172:12): [True: 40.8k, False: 4.92k]
  ------------------
  173|  40.8k|        {
  174|  40.8k|            ai4_poc_st_curr_after[u4_num_st_curr_after] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  175|  40.8k|            u4_num_st_curr_after++;
  176|  40.8k|        }
  177|  4.92k|        else
  178|  4.92k|        {
  179|  4.92k|            ai4_poc_st_foll[u4_num_st_foll] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  180|  4.92k|            u4_num_st_foll++;
  181|  4.92k|        }
  182|  45.7k|    }
  183|       |
  184|  21.8k|    u4_num_lt_curr = 0;
  185|  21.8k|    u4_num_lt_foll = 0;
  186|  44.4k|    for(i = 0; i < ps_slice_hdr->i1_num_long_term_sps + ps_slice_hdr->i1_num_long_term_pics; i++)
  ------------------
  |  Branch (186:16): [True: 22.6k, False: 21.8k]
  ------------------
  187|  22.6k|    {
  188|  22.6k|        i4_poc_lt = ps_slice_hdr->ai4_poc_lsb_lt[i];
  189|  22.6k|        if(ps_slice_hdr->ai1_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (189:12): [True: 11.5k, False: 11.0k]
  ------------------
  190|  11.5k|        {
  191|  11.5k|            i4_poc_lt += i4_pic_order_cnt_val - ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] * (WORD32)u4_max_poc_lsb - ps_slice_hdr->i4_pic_order_cnt_lsb;
  192|  11.5k|        }
  193|       |
  194|  22.6k|        if(ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i])
  ------------------
  |  Branch (194:12): [True: 12.1k, False: 10.4k]
  ------------------
  195|  12.1k|        {
  196|  12.1k|            ai4_poc_lt_curr[u4_num_lt_curr] = i4_poc_lt;
  197|  12.1k|            ai1_curr_delta_poc_msb_present_flag[u4_num_lt_curr] = ps_slice_hdr->ai1_delta_poc_msb_present_flag[i];
  198|  12.1k|            u4_num_lt_curr++;
  199|  12.1k|        }
  200|  10.4k|        else
  201|  10.4k|        {
  202|  10.4k|            ai4_poc_lt_foll[u4_num_lt_foll] = i4_poc_lt;
  203|  10.4k|            ai1_foll_delta_poc_msb_present_flag[u4_num_lt_foll] = ps_slice_hdr->ai1_delta_poc_msb_present_flag[i];
  204|  10.4k|            u4_num_lt_foll++;
  205|  10.4k|        }
  206|  22.6k|    }
  207|       |
  208|  21.8k|    u4_num_total_curr = u4_num_lt_curr + u4_num_st_curr_after + u4_num_st_curr_before;
  209|       |
  210|       |    /* Bit stream conformance tests */
  211|       |/*
  212|       |    for(i = 0; i < u4_num_lt_curr; i++)
  213|       |    {
  214|       |        int j;
  215|       |        if(ai1_curr_delta_poc_msb_present_flag[i])
  216|       |        {
  217|       |            for(j = 0; j < u4_num_st_curr_before; j++)
  218|       |            {
  219|       |                ASSERT(ai4_poc_st_curr_before[j] != ai4_poc_lt_curr[i]);
  220|       |            }
  221|       |            for(j = 0; j < u4_num_st_curr_after; j++)
  222|       |            {
  223|       |                ASSERT(ai4_poc_st_curr_after[j] != ai4_poc_lt_curr[i]);
  224|       |            }
  225|       |            for(j = 0; j < u4_num_st_foll; j++)
  226|       |            {
  227|       |                ASSERT(ai4_poc_st_foll[j] != ai4_poc_lt_curr[i]);
  228|       |            }
  229|       |            for(j = 0; j < u4_num_lt_curr; j++)
  230|       |            {
  231|       |                ASSERT((ai4_poc_lt_curr[j] != ai4_poc_lt_curr[i]) || (j == i));
  232|       |            }
  233|       |        }
  234|       |        else
  235|       |        {
  236|       |            for(j = 0; j < u4_num_st_curr_before; j++)
  237|       |            {
  238|       |                ASSERT((ai4_poc_st_curr_before[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_curr[i]);
  239|       |            }
  240|       |            for(j = 0; j < u4_num_st_curr_after; j++)
  241|       |            {
  242|       |                ASSERT((ai4_poc_st_curr_after[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_curr[i]);
  243|       |            }
  244|       |            for(j = 0; j < u4_num_st_foll; j++)
  245|       |            {
  246|       |                ASSERT((ai4_poc_st_foll[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_curr[i]);
  247|       |            }
  248|       |            for(j = 0; j < u4_num_lt_curr; j++)
  249|       |            {
  250|       |                ASSERT(((ai4_poc_lt_curr[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_curr[i]) || (j == i));
  251|       |            }
  252|       |        }
  253|       |    }
  254|       |
  255|       |    for(i = 0; i < u4_num_lt_foll; i++)
  256|       |    {
  257|       |        int j;
  258|       |        if(ai1_foll_delta_poc_msb_present_flag[i])
  259|       |        {
  260|       |            for(j = 0; j < u4_num_st_curr_before; j++)
  261|       |            {
  262|       |                ASSERT(ai4_poc_st_curr_before[j] != ai4_poc_lt_foll[i]);
  263|       |            }
  264|       |            for(j = 0; j < u4_num_st_curr_after; j++)
  265|       |            {
  266|       |                ASSERT(ai4_poc_st_curr_after[j] != ai4_poc_lt_foll[i]);
  267|       |            }
  268|       |            for(j = 0; j < u4_num_st_foll; j++)
  269|       |            {
  270|       |                ASSERT(ai4_poc_st_foll[j] != ai4_poc_lt_foll[i]);
  271|       |            }
  272|       |            for(j = 0; j < u4_num_lt_curr; j++)
  273|       |            {
  274|       |                ASSERT(ai4_poc_lt_curr[j] != ai4_poc_lt_foll[i]);
  275|       |            }
  276|       |            for(j = 0; j < u4_num_lt_foll; j++)
  277|       |            {
  278|       |                ASSERT((ai4_poc_lt_foll[j] != ai4_poc_lt_foll[i]) || (j == i));
  279|       |            }
  280|       |        }
  281|       |        else
  282|       |        {
  283|       |            for(j = 0; j < u4_num_st_curr_before; j++)
  284|       |            {
  285|       |                ASSERT((ai4_poc_st_curr_before[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_foll[i]);
  286|       |            }
  287|       |            for(j = 0; j < u4_num_st_curr_after; j++)
  288|       |            {
  289|       |                ASSERT((ai4_poc_st_curr_after[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_foll[i]);
  290|       |            }
  291|       |            for(j = 0; j < u4_num_st_foll; j++)
  292|       |            {
  293|       |                ASSERT((ai4_poc_st_foll[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_foll[i]);
  294|       |            }
  295|       |            for(j = 0; j < u4_num_lt_curr; j++)
  296|       |            {
  297|       |                ASSERT((ai4_poc_lt_curr[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_foll[i]);
  298|       |            }
  299|       |            for(j = 0; j < u4_num_lt_foll; j++)
  300|       |            {
  301|       |                ASSERT(((ai4_poc_lt_foll[j] & (u4_max_poc_lsb - 1)) != ai4_poc_lt_foll[i]) || (j == i));
  302|       |            }
  303|       |        }
  304|       |    }
  305|       |*/
  306|       |
  307|       |
  308|       |    /* Reference Pic sets creation */
  309|       |
  310|       |    /* Set all the DPB buffers to UNUSED_FOR_REF */
  311|  21.8k|    if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (311:8): [True: 11.8k, False: 10.0k]
  ------------------
  312|  11.8k|    {
  313|   772k|        for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   772k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|   772k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (313:20): [True: 760k, False: 11.8k]
  ------------------
  314|   760k|        {
  315|   760k|            if(ps_dpb_mgr->as_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (315:16): [True: 26.3k, False: 733k]
  ------------------
  316|  26.3k|                ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref = UNUSED_FOR_REF;
  317|   760k|        }
  318|  11.8k|    }
  319|       |
  320|  34.0k|    for(i = 0; i < (WORD32)u4_num_lt_curr; i++)
  ------------------
  |  Branch (320:16): [True: 12.1k, False: 21.8k]
  ------------------
  321|  12.1k|    {
  322|  12.1k|        if(0 == ai1_curr_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (322:12): [True: 6.94k, False: 5.23k]
  ------------------
  323|  6.94k|        {
  324|  6.94k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc_lsb(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  325|  6.94k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (325:16): [True: 2.73k, False: 4.20k]
  ------------------
  326|  2.73k|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  327|       |
  328|  6.94k|            as_ref_pic_lt_curr[i] = ps_pic_buf;
  329|  6.94k|        }
  330|  5.23k|        else
  331|  5.23k|        {
  332|  5.23k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  333|  5.23k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (333:16): [True: 2.94k, False: 2.29k]
  ------------------
  334|  2.94k|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  335|       |
  336|  5.23k|            as_ref_pic_lt_curr[i] = ps_pic_buf;
  337|  5.23k|        }
  338|  12.1k|    }
  339|       |
  340|  32.3k|    for(i = 0; i < (WORD32)u4_num_lt_foll; i++)
  ------------------
  |  Branch (340:16): [True: 10.4k, False: 21.8k]
  ------------------
  341|  10.4k|    {
  342|  10.4k|        if(0 == ai1_foll_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (342:12): [True: 4.06k, False: 6.36k]
  ------------------
  343|  4.06k|        {
  344|  4.06k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc_lsb(ps_dpb_mgr, ai4_poc_lt_foll[i]);
  345|  4.06k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (345:16): [True: 360, False: 3.70k]
  ------------------
  346|    360|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  347|       |
  348|  4.06k|            as_ref_pic_lt_foll[i] = ps_pic_buf;
  349|  4.06k|        }
  350|  6.36k|        else
  351|  6.36k|        {
  352|  6.36k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_lt_foll[i]);
  353|  6.36k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (353:16): [True: 2.43k, False: 3.92k]
  ------------------
  354|  2.43k|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  355|       |
  356|  6.36k|            as_ref_pic_lt_foll[i] = ps_pic_buf;
  357|  6.36k|        }
  358|  10.4k|    }
  359|       |
  360|       |
  361|  58.4k|    for(i = 0; i < (WORD32)u4_num_st_curr_before; i++)
  ------------------
  |  Branch (361:16): [True: 36.5k, False: 21.8k]
  ------------------
  362|  36.5k|    {
  363|       |
  364|  36.5k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_curr_before[i]);
  365|  36.5k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (365:12): [True: 14.6k, False: 21.9k]
  ------------------
  366|  14.6k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  367|       |
  368|  36.5k|        as_ref_pic_st_curr_before[i] = ps_pic_buf;
  369|  36.5k|    }
  370|       |
  371|  62.7k|    for(i = 0; i < (WORD32)u4_num_st_curr_after; i++)
  ------------------
  |  Branch (371:16): [True: 40.8k, False: 21.8k]
  ------------------
  372|  40.8k|    {
  373|  40.8k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_curr_after[i]);
  374|  40.8k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (374:12): [True: 12.3k, False: 28.5k]
  ------------------
  375|  12.3k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  376|       |
  377|  40.8k|        as_ref_pic_st_curr_after[i] = ps_pic_buf;
  378|  40.8k|    }
  379|       |
  380|  32.7k|    for(i = 0; i < (WORD32)u4_num_st_foll; i++)
  ------------------
  |  Branch (380:16): [True: 10.8k, False: 21.8k]
  ------------------
  381|  10.8k|    {
  382|  10.8k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_foll[i]);
  383|  10.8k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (383:12): [True: 1.59k, False: 9.25k]
  ------------------
  384|  1.59k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  385|       |
  386|  10.8k|        as_ref_pic_st_foll[i] = ps_pic_buf;
  387|  10.8k|    }
  388|       |
  389|       |    //TODO: Bit stream conformance tests to be included
  390|       |
  391|  21.8k|    u4_num_rps_curr_temp_list0 = (WORD32)u4_num_total_curr > ps_slice_hdr->i1_num_ref_idx_l0_active ? (WORD32)u4_num_total_curr : ps_slice_hdr->i1_num_ref_idx_l0_active;
  ------------------
  |  Branch (391:34): [True: 14.5k, False: 7.31k]
  ------------------
  392|       |
  393|  21.8k|    r_idx = 0;
  394|  21.8k|    if((PSLICE == ps_slice_hdr->i1_slice_type) ||
  ------------------
  |  Branch (394:8): [True: 1.62k, False: 20.2k]
  ------------------
  395|  20.2k|       (BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (395:8): [True: 14.3k, False: 5.91k]
  ------------------
  396|  15.9k|    {
  397|  37.4k|        while(r_idx < u4_num_rps_curr_temp_list0)
  ------------------
  |  Branch (397:15): [True: 21.4k, False: 15.9k]
  ------------------
  398|  21.4k|        {
  399|  61.5k|            for(i = 0; (i < (WORD32)u4_num_st_curr_before) && (r_idx < u4_num_rps_curr_temp_list0); r_idx++, i++)
  ------------------
  |  Branch (399:24): [True: 40.3k, False: 21.1k]
  |  Branch (399:63): [True: 40.0k, False: 301]
  ------------------
  400|  40.0k|            {
  401|  40.0k|                if(NULL == as_ref_pic_st_curr_before[i])
  ------------------
  |  Branch (401:20): [True: 21.6k, False: 18.3k]
  ------------------
  402|  21.6k|                {
  403|  21.6k|                    as_ref_pic_st_curr_before[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_st_curr_before[i]);
  404|  21.6k|                }
  405|  40.0k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_st_curr_before[i];
  406|  40.0k|            }
  407|       |
  408|  51.7k|            for(i = 0; (i < (WORD32)u4_num_st_curr_after) && (r_idx < u4_num_rps_curr_temp_list0); r_idx++, i++)
  ------------------
  |  Branch (408:24): [True: 30.5k, False: 21.2k]
  |  Branch (408:62): [True: 30.2k, False: 247]
  ------------------
  409|  30.2k|            {
  410|  30.2k|                if(NULL == as_ref_pic_st_curr_after[i])
  ------------------
  |  Branch (410:20): [True: 18.5k, False: 11.7k]
  ------------------
  411|  18.5k|                {
  412|  18.5k|                    as_ref_pic_st_curr_after[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_st_curr_after[i]);
  413|  18.5k|                }
  414|  30.2k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_st_curr_after[i];
  415|  30.2k|            }
  416|       |
  417|  33.9k|            for(i = 0; (i < (WORD32)u4_num_lt_curr) && (r_idx < u4_num_rps_curr_temp_list0); r_idx++, i++)
  ------------------
  |  Branch (417:24): [True: 12.6k, False: 21.2k]
  |  Branch (417:56): [True: 12.4k, False: 239]
  ------------------
  418|  12.4k|            {
  419|  12.4k|                if(NULL == as_ref_pic_lt_curr[i])
  ------------------
  |  Branch (419:20): [True: 6.23k, False: 6.22k]
  ------------------
  420|  6.23k|                {
  421|  6.23k|                    as_ref_pic_lt_curr[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  422|  6.23k|                }
  423|  12.4k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_lt_curr[i];
  424|  12.4k|            }
  425|  21.4k|        }
  426|       |
  427|  48.3k|        for(r_idx = 0; (WORD32)r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (427:24): [True: 33.6k, False: 14.7k]
  ------------------
  428|  33.6k|        {
  429|  33.6k|            pic_buf_t *ps_pic_buf;
  430|  33.6k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l0 ?  (void *)as_ref_pic_list_temp0[ps_slice_hdr->s_rplm.i1_list_entry_l0[r_idx]] :  (void *)as_ref_pic_list_temp0[r_idx];
  ------------------
  |  Branch (430:64): [True: 5.70k, False: 27.9k]
  ------------------
  431|  33.6k|            ps_pic_buf = (pic_buf_t *)ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf;
  432|       |
  433|  33.6k|            if(ps_pic_buf == NULL)
  ------------------
  |  Branch (433:16): [True: 1.21k, False: 32.3k]
  ------------------
  434|  1.21k|                return IHEVCD_REF_PIC_NOT_FOUND;
  435|       |
  436|  32.3k|            ps_mv_buf = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf->i4_abs_poc);
  437|  32.3k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = ps_mv_buf;
  438|  32.3k|        }
  439|       |
  440|       |
  441|  14.7k|        if(ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (441:12): [True: 13.2k, False: 1.46k]
  ------------------
  442|  13.2k|        {
  443|  13.2k|            u4_num_rps_curr_temp_list1 = (WORD32)u4_num_total_curr > ps_slice_hdr->i1_num_ref_idx_l1_active ? (WORD32)u4_num_total_curr : ps_slice_hdr->i1_num_ref_idx_l1_active;
  ------------------
  |  Branch (443:42): [True: 10.9k, False: 2.30k]
  ------------------
  444|       |
  445|  13.2k|            r_idx = 0;
  446|  30.1k|            while(r_idx < u4_num_rps_curr_temp_list1)
  ------------------
  |  Branch (446:19): [True: 16.8k, False: 13.2k]
  ------------------
  447|  16.8k|            {
  448|  44.7k|                for(i = 0; (i < (WORD32)u4_num_st_curr_after) && (r_idx < u4_num_rps_curr_temp_list1); r_idx++, i++)
  ------------------
  |  Branch (448:28): [True: 27.8k, False: 16.8k]
  |  Branch (448:66): [True: 27.8k, False: 9]
  ------------------
  449|  27.8k|                {
  450|  27.8k|                    if(NULL == as_ref_pic_st_curr_after[i])
  ------------------
  |  Branch (450:24): [True: 0, False: 27.8k]
  ------------------
  451|      0|                    {
  452|      0|                        as_ref_pic_st_curr_after[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_st_curr_after[i]);
  453|      0|                    }
  454|  27.8k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_st_curr_after[i];
  455|  27.8k|                }
  456|       |
  457|  52.4k|                for(i = 0; (i < (WORD32)u4_num_st_curr_before) && (r_idx < u4_num_rps_curr_temp_list1); r_idx++, i++)
  ------------------
  |  Branch (457:28): [True: 35.7k, False: 16.6k]
  |  Branch (457:67): [True: 35.5k, False: 168]
  ------------------
  458|  35.5k|                {
  459|  35.5k|                    if(NULL == as_ref_pic_st_curr_before[i])
  ------------------
  |  Branch (459:24): [True: 0, False: 35.5k]
  ------------------
  460|      0|                    {
  461|      0|                        as_ref_pic_st_curr_before[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_st_curr_before[i]);
  462|      0|                    }
  463|  35.5k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_st_curr_before[i];
  464|  35.5k|                }
  465|       |
  466|  21.3k|                for(i = 0; (i < (WORD32)u4_num_lt_curr) && (r_idx < u4_num_rps_curr_temp_list1); r_idx++, i++)
  ------------------
  |  Branch (466:28): [True: 4.77k, False: 16.5k]
  |  Branch (466:60): [True: 4.48k, False: 284]
  ------------------
  467|  4.48k|                {
  468|  4.48k|                    if(NULL == as_ref_pic_lt_curr[i])
  ------------------
  |  Branch (468:24): [True: 0, False: 4.48k]
  ------------------
  469|      0|                    {
  470|      0|                        as_ref_pic_lt_curr[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  471|      0|                    }
  472|  4.48k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_lt_curr[i];
  473|  4.48k|                }
  474|  16.8k|            }
  475|       |
  476|  44.3k|            for(r_idx = 0; (WORD32)r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (476:28): [True: 31.0k, False: 13.2k]
  ------------------
  477|  31.0k|            {
  478|  31.0k|                pic_buf_t *ps_pic_buf;
  479|  31.0k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l1 ?  (void *)as_ref_pic_list_temp1[ps_slice_hdr->s_rplm.i1_list_entry_l1[r_idx]] :  (void *)as_ref_pic_list_temp1[r_idx];
  ------------------
  |  Branch (479:68): [True: 4.08k, False: 26.9k]
  ------------------
  480|  31.0k|                ps_pic_buf = (pic_buf_t *)ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf;
  481|       |
  482|  31.0k|                if(ps_pic_buf == NULL)
  ------------------
  |  Branch (482:20): [True: 0, False: 31.0k]
  ------------------
  483|      0|                    return IHEVCD_REF_PIC_NOT_FOUND;
  484|       |
  485|  31.0k|                ps_mv_buf = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf->i4_abs_poc);
  486|  31.0k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = ps_mv_buf;
  487|  31.0k|            }
  488|  13.2k|        }
  489|  14.7k|    }
  490|       |
  491|  20.6k|    DEBUG_PRINT_REF_LIST_POCS(i4_pic_order_cnt_val, ps_slice_hdr, ps_dpb_mgr, u4_num_st_curr_before, u4_num_st_curr_after, u4_num_st_foll, u4_num_lt_curr, u4_num_lt_foll, ai4_poc_st_curr_before, ai4_poc_st_curr_after, ai4_poc_st_foll, ai4_poc_lt_curr, ai4_poc_lt_foll);
  492|       |    /* Buffers that are still marked as UNUSED_FOR_REF are released from dpb (internally dpb calls release from pic buf manager)*/
  493|  1.34M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  1.34M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  291|  1.34M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (493:16): [True: 1.32M, False: 20.6k]
  ------------------
  494|  1.32M|    {
  495|  1.32M|        if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) && (UNUSED_FOR_REF == ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref))
  ------------------
  |  Branch (495:12): [True: 36.9k, False: 1.28M]
  |  Branch (495:55): [True: 6.71k, False: 30.2k]
  ------------------
  496|  6.71k|        {
  497|  6.71k|            pic_buf_t *ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  498|  6.71k|            mv_buf_t *ps_mv_buf;
  499|       |
  500|       |            /* Long term index is set to MAX_DPB_BUFS to ensure it is not added as LT */
  501|  6.71k|            ihevc_dpb_mgr_del_ref(ps_dpb_mgr, (buf_mgr_t *)ps_codec->pv_pic_buf_mgr, ps_pic_buf->i4_abs_poc);
  502|       |
  503|       |
  504|       |            /* Find buffer id of the MV bank corresponding to the buffer being freed (Buffer with POC of u4_abs_poc) */
  505|  6.71k|            ps_mv_buf = (mv_buf_t *)ps_codec->ps_mv_buf;
  506|  15.2k|            for(j = 0; j < ps_codec->i4_max_dpb_size; j++)
  ------------------
  |  Branch (506:24): [True: 15.2k, False: 0]
  ------------------
  507|  15.2k|            {
  508|  15.2k|                if(ps_mv_buf && ps_mv_buf->i4_abs_poc == ps_pic_buf->i4_abs_poc)
  ------------------
  |  Branch (508:20): [True: 15.2k, False: 0]
  |  Branch (508:33): [True: 6.71k, False: 8.50k]
  ------------------
  509|  6.71k|                {
  510|  6.71k|                    ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   40|  6.71k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  511|  6.71k|                    break;
  512|  6.71k|                }
  513|  8.50k|                ps_mv_buf++;
  514|  8.50k|            }
  515|  6.71k|        }
  516|       |
  517|  1.32M|    }
  518|       |
  519|  20.6k|    return IHEVCD_SUCCESS;
  520|  21.8k|}

ihevcd_sao_shift_ctb:
  123|  19.3M|{
  124|  19.3M|    codec_t *ps_codec = ps_sao_ctxt->ps_codec;
  125|  19.3M|    UWORD8 *pu1_src_luma;
  126|  19.3M|    UWORD8 *pu1_src_chroma;
  127|  19.3M|    WORD32 src_strd;
  128|  19.3M|    WORD32 chroma_strd;
  129|  19.3M|    WORD32 ctb_size;
  130|  19.3M|    WORD32 log2_ctb_size;
  131|  19.3M|    sps_t *ps_sps;
  132|  19.3M|    sao_t *ps_sao;
  133|  19.3M|    pps_t *ps_pps;
  134|  19.3M|    slice_header_t *ps_slice_hdr, *ps_slice_hdr_base;
  135|  19.3M|    tile_t *ps_tile;
  136|  19.3M|    UWORD16 *pu1_slice_idx;
  137|  19.3M|    UWORD16 *pu1_tile_idx;
  138|  19.3M|    WORD32 row, col;
  139|  19.3M|    UWORD8 au1_avail_luma[8];
  140|  19.3M|    UWORD8 au1_avail_chroma[8];
  141|  19.3M|    UWORD8 au1_tile_slice_boundary[8];
  142|  19.3M|    UWORD8 au4_ilf_across_tile_slice_enable[8];
  143|  19.3M|    WORD32 i;
  144|  19.3M|    UWORD8 *pu1_src_top_luma;
  145|  19.3M|    UWORD8 *pu1_src_top_chroma;
  146|  19.3M|    UWORD8 *pu1_src_left_luma;
  147|  19.3M|    UWORD8 *pu1_src_left_chroma;
  148|  19.3M|    UWORD8 au1_src_top_right[2];
  149|  19.3M|    UWORD8 au1_src_bot_left[2];
  150|  19.3M|    UWORD16 au2_src_top_right[2];
  151|  19.3M|    UWORD16 au2_src_bot_left[2];
  152|  19.3M|    UWORD8 *pu1_no_loop_filter_flag;
  153|  19.3M|    UWORD8 *pu1_src_backup_luma;
  154|  19.3M|    UWORD8 *pu1_src_backup_chroma;
  155|  19.3M|    WORD32 backup_strd;
  156|  19.3M|    WORD32 loop_filter_strd;
  157|  19.3M|    UWORD32 u4_bit_depth_luma, u4_bit_depth_chroma;
  158|  19.3M|    WORD32 pixel_size_y, pixel_size_uv;
  159|       |
  160|  19.3M|    WORD32 no_loop_filter_enabled_luma = 0;
  161|  19.3M|    WORD32 no_loop_filter_enabled_chroma = 0;
  162|  19.3M|    UWORD8 *pu1_sao_src_top_left_chroma_curr_ctb;
  163|  19.3M|    UWORD8 *pu1_sao_src_top_left_luma_curr_ctb;
  164|  19.3M|    UWORD8 *pu1_sao_src_luma_top_left_ctb;
  165|  19.3M|    UWORD8 *pu1_sao_src_chroma_top_left_ctb;
  166|  19.3M|    UWORD8 *pu1_sao_src_top_left_luma_top_right;
  167|  19.3M|    UWORD8 *pu1_sao_src_top_left_chroma_top_right;
  168|  19.3M|    UWORD8  u1_sao_src_top_left_luma_bot_left;
  169|  19.3M|    UWORD8  *pu1_sao_src_top_left_luma_bot_left;
  170|  19.3M|    UWORD8 *au1_sao_src_top_left_chroma_bot_left;
  171|  19.3M|    UWORD16 *au2_sao_src_top_left_chroma_bot_left;
  172|  19.3M|    UWORD16 u2_sao_src_top_left_luma_bot_left;
  173|  19.3M|    UWORD8 *pu1_sao_src_top_left_chroma_bot_left;
  174|       |    /* Only first 5 values are used, but arrays are large
  175|       |     enough so that SIMD functions can read 64 bits at a time */
  176|  19.3M|    WORD8 ai1_offset_y[8] = {0};
  177|  19.3M|    WORD8 ai1_offset_cb[8] = {0};
  178|  19.3M|    WORD8 ai1_offset_cr[8] = {0};
  179|  19.3M|    WORD32  chroma_yuv420sp_vu = ps_sao_ctxt->is_chroma_yuv420sp_vu;
  180|       |
  181|  19.3M|    PROFILE_DISABLE_SAO();
  ------------------
  |  |   51|  19.3M|#define PROFILE_DISABLE_SAO() ;
  ------------------
  182|       |
  183|  19.3M|    ps_sps = ps_sao_ctxt->ps_sps;
  184|  19.3M|    ps_pps = ps_sao_ctxt->ps_pps;
  185|  19.3M|    ps_tile = ps_sao_ctxt->ps_tile;
  186|       |
  187|  19.3M|    WORD32 is_yuv444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 1 : 0;
  ------------------
  |  Branch (187:24): [True: 0, False: 19.3M]
  ------------------
  188|  19.3M|    WORD32 h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (188:28): [True: 0, False: 19.3M]
  ------------------
  189|  19.3M|    WORD32 v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (189:28): [True: 18.4M, False: 873k]
  ------------------
  190|  19.3M|    WORD32 chroma_pixel_strd = 2;
  191|       |
  192|  19.3M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  193|  19.3M|    ctb_size = (1 << log2_ctb_size);
  194|  19.3M|    src_strd = ps_sao_ctxt->ps_codec->i4_strd;
  195|  19.3M|    chroma_strd = src_strd * chroma_pixel_strd / h_samp_factor;
  196|  19.3M|    u4_bit_depth_luma = (UWORD32)ps_sao_ctxt->ps_codec->i4_bit_depth_luma;
  197|  19.3M|    u4_bit_depth_chroma = (UWORD32)ps_sao_ctxt->ps_codec->i4_bit_depth_chroma;
  198|  19.3M|    pixel_size_y = (u4_bit_depth_luma > 8) ? 2 : 1;
  ------------------
  |  Branch (198:20): [True: 899k, False: 18.4M]
  ------------------
  199|  19.3M|    pixel_size_uv = (u4_bit_depth_chroma > 8) ? 2 : 1;
  ------------------
  |  Branch (199:21): [True: 899k, False: 18.4M]
  ------------------
  200|  19.3M|    ps_slice_hdr_base = ps_sao_ctxt->ps_codec->ps_slice_hdr_base;
  201|  19.3M|    ps_slice_hdr = ps_slice_hdr_base + (ps_sao_ctxt->i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  19.3M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  19.3M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  202|       |
  203|  19.3M|    pu1_slice_idx = ps_sao_ctxt->pu1_slice_idx;
  204|  19.3M|    pu1_tile_idx = ps_sao_ctxt->pu1_tile_idx;
  205|  19.3M|    pu1_src_luma = ps_sao_ctxt->pu1_cur_pic_luma + (((ps_sao_ctxt->i4_ctb_x + ps_sao_ctxt->i4_ctb_y * ps_sao_ctxt->ps_codec->i4_strd) << (log2_ctb_size)) * pixel_size_y);
  206|  19.3M|    pu1_src_chroma = ps_sao_ctxt->pu1_cur_pic_chroma
  207|  19.3M|                    + (((ps_sao_ctxt->i4_ctb_x * chroma_pixel_strd / h_samp_factor
  208|  19.3M|                    + ps_sao_ctxt->i4_ctb_y * ps_sao_ctxt->ps_codec->i4_strd * chroma_pixel_strd / (h_samp_factor * v_samp_factor)) << (log2_ctb_size)) * pixel_size_uv);
  209|       |
  210|       |    /*Stores the left value for each row ctbs- Needed for column tiles*/
  211|  19.3M|    pu1_sao_src_top_left_luma_curr_ctb = ps_sao_ctxt->pu1_sao_src_top_left_luma_curr_ctb + ((ps_sao_ctxt->i4_ctb_y) * pixel_size_y);
  212|  19.3M|    pu1_sao_src_top_left_chroma_curr_ctb = ps_sao_ctxt->pu1_sao_src_top_left_chroma_curr_ctb + (2 * (ps_sao_ctxt->i4_ctb_y) * pixel_size_uv);
  213|  19.3M|    pu1_sao_src_luma_top_left_ctb = ps_sao_ctxt->pu1_sao_src_luma_top_left_ctb + ((ps_sao_ctxt->i4_ctb_y) * pixel_size_y);
  214|  19.3M|    pu1_sao_src_chroma_top_left_ctb = ps_sao_ctxt->pu1_sao_src_chroma_top_left_ctb + (2 * ps_sao_ctxt->i4_ctb_y * pixel_size_uv);
  215|  19.3M|    u1_sao_src_top_left_luma_bot_left = ps_sao_ctxt->u2_sao_src_top_left_luma_bot_left; // + ((ps_sao_ctxt->i4_ctb_y));
  216|  19.3M|    u2_sao_src_top_left_luma_bot_left = ps_sao_ctxt->u2_sao_src_top_left_luma_bot_left;
  217|  19.3M|    pu1_sao_src_top_left_luma_bot_left = ps_sao_ctxt->pu1_sao_src_top_left_luma_bot_left + ((ps_sao_ctxt->i4_ctb_y) * pixel_size_y);
  218|  19.3M|    au1_sao_src_top_left_chroma_bot_left = (UWORD8 *)ps_sao_ctxt->au2_sao_src_top_left_chroma_bot_left; // + (2 * ps_sao_ctxt->i4_ctb_y);
  219|  19.3M|    au2_sao_src_top_left_chroma_bot_left = ps_sao_ctxt->au2_sao_src_top_left_chroma_bot_left;
  220|  19.3M|    pu1_sao_src_top_left_chroma_bot_left = ps_sao_ctxt->pu1_sao_src_top_left_chroma_bot_left + (2 * ps_sao_ctxt->i4_ctb_y * pixel_size_uv);
  221|  19.3M|    pu1_sao_src_top_left_luma_top_right = ps_sao_ctxt->pu1_sao_src_top_left_luma_top_right + ((ps_sao_ctxt->i4_ctb_x) * pixel_size_y);
  222|  19.3M|    pu1_sao_src_top_left_chroma_top_right = ps_sao_ctxt->pu1_sao_src_top_left_chroma_top_right + (2 * ps_sao_ctxt->i4_ctb_x * pixel_size_uv);
  223|       |
  224|  19.3M|    ps_sao = ps_sao_ctxt->ps_pic_sao + ps_sao_ctxt->i4_ctb_x + ps_sao_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  225|  19.3M|    loop_filter_strd =  (ps_sps->i2_pic_width_in_luma_samples + 63) >> 6;
  226|  19.3M|    backup_strd = 2 * MAX_CTB_SIZE;
  ------------------
  |  |  351|  19.3M|#define MAX_CTB_SIZE        64
  ------------------
  227|       |
  228|  19.3M|    DEBUG_INIT_TMP_BUF(ps_sao_ctxt->pu1_tmp_buf_luma, ps_sao_ctxt->pu1_tmp_buf_chroma);
  229|       |
  230|  19.3M|    {
  231|       |        /* Check the loop filter flags and copy the original values for back up */
  232|       |        /* Luma */
  233|       |
  234|       |        /* Done unconditionally since SAO is done on a shifted CTB and the constituent CTBs
  235|       |         * can belong to different slice with their own sao_enable flag */
  236|  19.3M|        {
  237|  19.3M|            UWORD32 u4_no_loop_filter_flag;
  238|  19.3M|            WORD32 loop_filter_bit_pos;
  239|  19.3M|            WORD32 log2_min_cu = 3;
  240|  19.3M|            WORD32 min_cu = (1 << log2_min_cu);
  241|  19.3M|            UWORD8 *pu1_src_tmp_luma = pu1_src_luma;
  242|  19.3M|            WORD32 sao_blk_ht = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  243|  19.3M|            WORD32 sao_blk_wd = ctb_size;
  244|  19.3M|            WORD32 remaining_rows;
  245|  19.3M|            WORD32 remaining_cols;
  246|       |
  247|  19.3M|            remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + ctb_size - SAO_SHIFT_CTB);
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  248|  19.3M|            remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + ctb_size - SAO_SHIFT_CTB);
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  249|  19.3M|            if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (249:16): [True: 756k, False: 18.5M]
  ------------------
  250|   756k|                sao_blk_ht += remaining_rows;
  251|  19.3M|            if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (251:16): [True: 1.03M, False: 18.2M]
  ------------------
  252|  1.03M|                sao_blk_wd += remaining_cols;
  253|       |
  254|  19.3M|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * pixel_size_y : 0;
  ------------------
  |  |   78|  18.2M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (254:33): [True: 18.2M, False: 1.04M]
  ------------------
  255|  19.3M|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd * pixel_size_y : 0;
  ------------------
  |  |   78|  18.6M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (255:33): [True: 18.6M, False: 691k]
  ------------------
  256|       |
  257|  19.3M|            pu1_src_backup_luma = ps_sao_ctxt->pu1_tmp_buf_luma;
  258|       |
  259|  19.3M|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
  260|  19.3M|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
  261|  19.3M|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (261:16): [True: 18.3M, False: 1.01M]
  ------------------
  262|  18.3M|                loop_filter_bit_pos -= 1;
  263|       |
  264|  19.3M|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
  265|  19.3M|                            (loop_filter_bit_pos >> 3);
  266|       |
  267|  19.3M|            for(i = -(ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  18.6M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (267:23): [True: 18.6M, False: 693k]
  ------------------
  268|  87.5M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (268:29): [True: 68.2M, False: 19.3M]
  ------------------
  269|  68.2M|            {
  270|  68.2M|                WORD32 tmp_wd = sao_blk_wd;
  271|       |
  272|  68.2M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
  273|  68.2M|                                (loop_filter_bit_pos & 7);
  274|  68.2M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
  275|       |
  276|  68.2M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (276:20): [True: 368k, False: 67.8M]
  ------------------
  277|   368k|                {
  278|   368k|                    no_loop_filter_enabled_luma = 1;
  279|  1.02M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (279:27): [True: 652k, False: 368k]
  ------------------
  280|   652k|                    {
  281|   652k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (281:28): [True: 261k, False: 391k]
  ------------------
  282|   261k|                        {
  283|   261k|                            pu1_src_tmp_luma += MIN((WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   261k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 139k, False: 122k]
  |  |  ------------------
  ------------------
  284|   261k|                            pu1_src_backup_luma += MIN((WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   261k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 139k, False: 122k]
  |  |  ------------------
  ------------------
  285|   261k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
  286|   261k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
  287|   261k|                        }
  288|   391k|                        else
  289|   391k|                        {
  290|  3.46M|                            for(row = 0; row < min_cu; row++)
  ------------------
  |  Branch (290:42): [True: 3.06M, False: 391k]
  ------------------
  291|  3.06M|                            {
  292|   165M|                                for(col = 0; col < MIN((WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y; col++)
  ------------------
  |  |   43|   165M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 30.4M, False: 135M]
  |  |  ------------------
  ------------------
  |  Branch (292:46): [True: 162M, False: 3.06M]
  ------------------
  293|   162M|                                {
  294|   162M|                                    pu1_src_backup_luma[row * backup_strd * pixel_size_y + col] = pu1_src_tmp_luma[row * src_strd * pixel_size_y + col];
  295|   162M|                                }
  296|  3.06M|                            }
  297|   391k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   391k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 145k, False: 245k]
  |  |  ------------------
  ------------------
  298|   391k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   391k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 145k, False: 245k]
  |  |  ------------------
  ------------------
  299|   391k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
  300|   391k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
  301|   391k|                        }
  302|   652k|                    }
  303|       |
  304|   368k|                    pu1_src_tmp_luma -= sao_blk_wd * pixel_size_y;
  305|   368k|                    pu1_src_backup_luma -= sao_blk_wd * pixel_size_y;
  306|   368k|                }
  307|       |
  308|  68.2M|                pu1_src_tmp_luma += ((src_strd << log2_min_cu) * pixel_size_y);
  309|  68.2M|                pu1_src_backup_luma += ((backup_strd << log2_min_cu) * pixel_size_y);
  310|  68.2M|            }
  311|  19.3M|        }
  312|       |
  313|       |        /* Chroma */
  314|       |
  315|  19.3M|        if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (315:13): [True: 19.3M, False: 18.4E]
  ------------------
  316|  19.3M|        {
  317|  19.3M|            UWORD32 u4_no_loop_filter_flag;
  318|  19.3M|            WORD32 loop_filter_bit_pos;
  319|  19.3M|            WORD32 log2_min_cu = 3;
  320|  19.3M|            WORD32 min_cu = (1 << log2_min_cu);
  321|  19.3M|            UWORD8 *pu1_src_tmp_chroma = pu1_src_chroma;
  322|  19.3M|            WORD32 sao_blk_ht = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  323|  19.3M|            WORD32 sao_blk_wd = ctb_size;
  324|  19.3M|            WORD32 remaining_rows;
  325|  19.3M|            WORD32 remaining_cols;
  326|       |
  327|  19.3M|            remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + ctb_size - 2 * SAO_SHIFT_CTB);
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  328|  19.3M|            remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + ctb_size - 2 * SAO_SHIFT_CTB);
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  329|  19.3M|            if(remaining_rows <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (329:16): [True: 753k, False: 18.5M]
  ------------------
  330|   753k|                sao_blk_ht += remaining_rows;
  331|  19.3M|            if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (331:16): [True: 1.03M, False: 18.3M]
  ------------------
  332|  1.03M|                sao_blk_wd += remaining_cols;
  333|       |
  334|  19.3M|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * 2 : 0) * pixel_size_uv;
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (334:36): [True: 18.3M, False: 1.03M]
  ------------------
  335|  19.3M|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * chroma_strd : 0) * pixel_size_uv;
  ------------------
  |  |   78|  18.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (335:36): [True: 18.5M, False: 753k]
  ------------------
  336|       |
  337|  19.3M|            pu1_src_backup_chroma = ps_sao_ctxt->pu1_tmp_buf_chroma;
  338|       |
  339|  19.3M|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
  340|  19.3M|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
  341|  19.3M|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (341:16): [True: 18.3M, False: 1.02M]
  ------------------
  342|  18.3M|                loop_filter_bit_pos -= (is_yuv444 ? 1 : 2);
  ------------------
  |  Branch (342:41): [True: 0, False: 18.3M]
  ------------------
  343|       |
  344|  19.3M|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
  345|  19.3M|                            (loop_filter_bit_pos >> 3);
  346|       |
  347|  19.3M|            for(i = -(ps_sao_ctxt->i4_ctb_y ? 2 * SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  18.5M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (347:23): [True: 18.5M, False: 753k]
  ------------------
  348|  87.3M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (348:29): [True: 68.0M, False: 19.3M]
  ------------------
  349|  68.0M|            {
  350|  68.0M|                WORD32 tmp_wd = sao_blk_wd;
  351|       |
  352|  68.0M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
  353|  68.0M|                                (loop_filter_bit_pos & 7);
  354|  68.0M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
  355|       |
  356|  68.0M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (356:20): [True: 363k, False: 67.6M]
  ------------------
  357|   363k|                {
  358|   363k|                    no_loop_filter_enabled_chroma = 1;
  359|  1.00M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (359:27): [True: 644k, False: 363k]
  ------------------
  360|   644k|                    {
  361|   644k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (361:28): [True: 262k, False: 381k]
  ------------------
  362|   262k|                        {
  363|   262k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   262k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 131k, False: 130k]
  |  |  ------------------
  ------------------
  364|   262k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   262k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 131k, False: 130k]
  |  |  ------------------
  ------------------
  365|   262k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
  366|   262k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
  367|   262k|                        }
  368|   381k|                        else
  369|   381k|                        {
  370|  2.71M|                            for(row = 0; row < min_cu / v_samp_factor; row++)
  ------------------
  |  Branch (370:42): [True: 2.32M, False: 381k]
  ------------------
  371|  2.32M|                            {
  372|   139M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv; col++)
  ------------------
  |  |   43|   139M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 33.3M, False: 106M]
  |  |  ------------------
  ------------------
  |  Branch (372:46): [True: 137M, False: 2.32M]
  ------------------
  373|   137M|                                {
  374|   137M|                                    pu1_src_backup_chroma[row * backup_strd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv + col] = pu1_src_tmp_chroma[row * chroma_strd * pixel_size_uv + col];
  375|   137M|                                }
  376|  2.32M|                            }
  377|       |
  378|   381k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   381k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 149k, False: 232k]
  |  |  ------------------
  ------------------
  379|   381k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   381k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 149k, False: 232k]
  |  |  ------------------
  ------------------
  380|   381k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
  381|   381k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
  382|   381k|                        }
  383|   644k|                    }
  384|       |
  385|   363k|                    pu1_src_tmp_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  386|   363k|                    pu1_src_backup_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  387|   363k|                }
  388|       |
  389|  68.0M|                pu1_src_tmp_chroma += ((((src_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
  390|  68.0M|                pu1_src_backup_chroma += ((((backup_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
  391|  68.0M|            }
  392|  19.3M|        }
  393|  19.3M|    }
  394|       |
  395|  19.3M|    DEBUG_PROCESS_TMP_BUF(ps_sao_ctxt->pu1_tmp_buf_luma, ps_sao_ctxt->pu1_tmp_buf_chroma);
  396|       |
  397|       |    /* Top-left CTB */
  398|  19.3M|    if(ps_sao_ctxt->i4_ctb_x > 0 && ps_sao_ctxt->i4_ctb_y > 0)
  ------------------
  |  Branch (398:8): [True: 18.3M, False: 1.01M]
  |  Branch (398:37): [True: 17.6M, False: 671k]
  ------------------
  399|  17.6M|    {
  400|  17.6M|        WORD32 sao_wd_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  17.6M|#define SAO_SHIFT_CTB    8
  ------------------
  401|  17.6M|        WORD32 sao_wd_chroma = 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  17.6M|#define SAO_SHIFT_CTB    8
  ------------------
  402|  17.6M|        WORD32 sao_ht_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  17.6M|#define SAO_SHIFT_CTB    8
  ------------------
  403|  17.6M|        WORD32 sao_ht_chroma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  17.6M|#define SAO_SHIFT_CTB    8
  ------------------
  404|       |
  405|  17.6M|        WORD32 ctbx_tl_t = 0, ctbx_tl_l = 0, ctbx_tl_r = 0, ctbx_tl_d = 0, ctbx_tl = 0;
  406|  17.6M|        WORD32 ctby_tl_t = 0, ctby_tl_l = 0, ctby_tl_r = 0, ctby_tl_d = 0, ctby_tl = 0;
  407|  17.6M|        WORD32 au4_idx_tl[8], idx_tl;
  408|       |
  409|  17.6M|        slice_header_t *ps_slice_hdr_top_left;
  410|  17.6M|        {
  411|  17.6M|            WORD32 top_left_ctb_indx = (ps_sao_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb +
  412|  17.6M|                                        (ps_sao_ctxt->i4_ctb_x - 1);
  413|  17.6M|            ps_slice_hdr_top_left = ps_slice_hdr_base + pu1_slice_idx[top_left_ctb_indx];
  414|  17.6M|        }
  415|       |
  416|       |
  417|  17.6M|        pu1_src_luma -= (sao_wd_luma + sao_ht_luma * src_strd) * pixel_size_y;
  418|  17.6M|        pu1_src_chroma -= (sao_wd_chroma + sao_ht_chroma * chroma_strd) * pixel_size_uv;
  419|  17.6M|        ps_sao -= (1 + ps_sps->i2_pic_wd_in_ctb);
  420|  17.6M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma) * pixel_size_y;
  421|  17.6M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor) - sao_wd_chroma) * pixel_size_uv;
  422|  17.6M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma) * pixel_size_y;
  423|  17.6M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) * (chroma_pixel_strd / v_samp_factor) - (2 * sao_ht_chroma)) * pixel_size_uv;
  424|       |
  425|  17.6M|        if(ps_slice_hdr_top_left->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (425:12): [True: 6.12M, False: 11.5M]
  ------------------
  426|  6.12M|        {
  427|  6.12M|            if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (427:16): [True: 5.85M, False: 270k]
  ------------------
  428|  5.85M|            {
  429|  5.85M|                UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_luma_top_left_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  5.85M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  5.85M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  5.85M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 5.48M, False: 365k]
  |  |  ------------------
  |  |   82|  48.9M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 43.4M, False: 5.48M]
  |  |  ------------------
  |  |   83|  43.4M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  43.4M|        } \
  |  |   85|  5.48M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  5.48M|    } else { \
  |  |   87|   365k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   365k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   365k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   365k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  3.28M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 2.92M, False: 365k]
  |  |  ------------------
  |  |   92|  2.92M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  2.92M|        } \
  |  |   94|   365k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   365k|    } \
  |  |   96|  5.85M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  5.85M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 5.85M]
  |  |  ------------------
  ------------------
  430|  5.85M|            }
  431|       |
  432|   270k|            else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (432:21): [True: 135k, False: 135k]
  ------------------
  433|   135k|            {
  434|   135k|                ai1_offset_y[1] = ps_sao->b8_y_offset_1;
  435|   135k|                ai1_offset_y[2] = ps_sao->b8_y_offset_2;
  436|   135k|                ai1_offset_y[3] = ps_sao->b8_y_offset_3;
  437|   135k|                ai1_offset_y[4] = ps_sao->b8_y_offset_4;
  438|       |
  439|   135k|                if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   135k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (439:20): [True: 57.2k, False: 78.0k]
  ------------------
  440|  57.2k|                {
  441|  57.2k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
  442|  57.2k|                        pu1_src_luma,
  443|  57.2k|                        src_strd,
  444|  57.2k|                        pu1_src_left_luma,
  445|  57.2k|                        pu1_src_top_luma,
  446|  57.2k|                        pu1_sao_src_luma_top_left_ctb,
  447|  57.2k|                        ps_sao->b5_y_band_pos,
  448|  57.2k|                        ai1_offset_y,
  449|  57.2k|                        sao_wd_luma,
  450|  57.2k|                        sao_ht_luma);
  451|  57.2k|                }
  452|  78.0k|                else
  453|  78.0k|                {
  454|  78.0k|                    ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
  455|  78.0k|                        (UWORD16 *)pu1_src_luma,
  456|  78.0k|                        src_strd,
  457|  78.0k|                        (UWORD16 *)pu1_src_left_luma,
  458|  78.0k|                        (UWORD16 *)pu1_src_top_luma,
  459|  78.0k|                        (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
  460|  78.0k|                        ps_sao->b5_y_band_pos,
  461|  78.0k|                        ai1_offset_y,
  462|  78.0k|                        sao_wd_luma,
  463|  78.0k|                        sao_ht_luma,
  464|  78.0k|                        u4_bit_depth_luma);
  465|  78.0k|                }
  466|   135k|            }
  467|       |
  468|   135k|            else // if(2 <= ps_sao->b3_y_type_idx)
  469|   135k|            {
  470|   135k|                ai1_offset_y[1] = ps_sao->b8_y_offset_1;
  471|   135k|                ai1_offset_y[2] = ps_sao->b8_y_offset_2;
  472|   135k|                ai1_offset_y[3] = ps_sao->b8_y_offset_3;
  473|   135k|                ai1_offset_y[4] = ps_sao->b8_y_offset_4;
  474|       |
  475|  1.23M|                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (475:28): [True: 1.10M, False: 135k]
  ------------------
  476|  1.10M|                {
  477|  1.10M|                    au1_avail_luma[i] = 255;
  478|  1.10M|                    au1_tile_slice_boundary[i] = 0;
  479|  1.10M|                    au4_idx_tl[i] = 0;
  480|  1.10M|                    au4_ilf_across_tile_slice_enable[i] = 1;
  481|  1.10M|                }
  482|       |
  483|       |                /******************************************************************
  484|       |                 * Derive the  Top-left CTB's neighbor pixel's slice indices.
  485|       |                 *
  486|       |                 *          TL_T
  487|       |                 *       4  _2__5________
  488|       |                 *     0   |    |       |
  489|       |                 *    TL_L | TL | 1 TL_R|
  490|       |                 *         |____|_______|____
  491|       |                 *        6|TL_D|7      |    |
  492|       |                 *         | 3  |       |    |
  493|       |                 *         |____|_______|    |
  494|       |                 *              |            |
  495|       |                 *              |            |
  496|       |                 *              |____________|
  497|       |                 *
  498|       |                 *****************************************************************/
  499|       |
  500|       |                /*In case of slices, unless we encounter multiple slice/tiled clips, don't enter*/
  501|   135k|                {
  502|   135k|                    if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (502:24): [True: 10.8k, False: 124k]
  |  Branch (502:71): [True: 29.7k, False: 94.6k]
  ------------------
  503|  43.2k|                    {
  504|  43.2k|                        {
  505|       |                            /*Assuming that sao shift is uniform along x and y directions*/
  506|  43.2k|                            if((0 == (1 << log2_ctb_size) - sao_wd_luma) && (ps_sao_ctxt->i4_ctb_y > 1) && (ps_sao_ctxt->i4_ctb_x > 1))
  ------------------
  |  Branch (506:32): [True: 0, False: 43.2k]
  |  Branch (506:77): [True: 0, False: 0]
  |  Branch (506:108): [True: 0, False: 0]
  ------------------
  507|      0|                            {
  508|      0|                                ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 2;
  509|      0|                                ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 2;
  510|      0|                            }
  511|  43.2k|                            else if(!(0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (511:37): [True: 43.2k, False: 8]
  ------------------
  512|  43.2k|                            {
  513|  43.2k|                                ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 1;
  514|  43.2k|                                ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 1;
  515|  43.2k|                            }
  516|  43.2k|                            ctbx_tl_t = ps_sao_ctxt->i4_ctb_x - 1;
  517|  43.2k|                            ctby_tl_l = ps_sao_ctxt->i4_ctb_y - 1;
  518|       |
  519|  43.2k|                            ctbx_tl_r = ps_sao_ctxt->i4_ctb_x;
  520|  43.2k|                            ctby_tl_r = ps_sao_ctxt->i4_ctb_y - 1;
  521|       |
  522|  43.2k|                            ctbx_tl_d =  ps_sao_ctxt->i4_ctb_x - 1;
  523|  43.2k|                            ctby_tl_d =  ps_sao_ctxt->i4_ctb_y;
  524|       |
  525|  43.2k|                            ctbx_tl = ps_sao_ctxt->i4_ctb_x - 1;
  526|  43.2k|                            ctby_tl = ps_sao_ctxt->i4_ctb_y - 1;
  527|  43.2k|                        }
  528|       |
  529|  43.2k|                        if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (529:28): [True: 13.5k, False: 29.7k]
  ------------------
  530|  13.5k|                        {
  531|       |                            /*Calculate slice indices for neighbor pixels*/
  532|  13.5k|                            idx_tl   = pu1_slice_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  533|  13.5k|                            au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_slice_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
  534|  13.5k|                            au4_idx_tl[0] =  pu1_slice_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  535|  13.5k|                            au4_idx_tl[1] = au4_idx_tl[5] = pu1_slice_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  536|  13.5k|                            au4_idx_tl[3] = au4_idx_tl[6] =   pu1_slice_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  537|  13.5k|                            au4_idx_tl[7] = pu1_slice_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  538|       |
  539|  13.5k|                            if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (539:32): [True: 0, False: 13.5k]
  ------------------
  540|      0|                            {
  541|      0|                                if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (541:36): [True: 0, False: 0]
  ------------------
  542|      0|                                {
  543|      0|                                    au4_idx_tl[6] = -1;
  544|      0|                                    au4_idx_tl[4] = -1;
  545|      0|                                }
  546|      0|                                else
  547|      0|                                {
  548|      0|                                    au4_idx_tl[6] = pu1_slice_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  549|      0|                                }
  550|      0|                                if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (550:36): [True: 0, False: 0]
  ------------------
  551|      0|                                {
  552|      0|                                    au4_idx_tl[5] = -1;
  553|      0|                                    au4_idx_tl[4] = -1;
  554|      0|                                }
  555|      0|                                else
  556|      0|                                {
  557|      0|                                    au4_idx_tl[5] = pu1_slice_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  558|      0|                                    au4_idx_tl[4] = pu1_slice_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
  559|      0|                                }
  560|      0|                                au4_idx_tl[7] = pu1_slice_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  561|      0|                            }
  562|       |
  563|       |                            /* Verify that the neighbor ctbs dont cross pic boundary.
  564|       |                             * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
  565|       |                             * of the pixel having a greater address is checked. Accordingly, set the availability flags.
  566|       |                             * Hence, for top and left pixels, current ctb flag is checked. For right and down pixels,
  567|       |                             * the respective pixel's flags are checked
  568|       |                             */
  569|       |
  570|  13.5k|                            if((0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (570:32): [True: 0, False: 13.5k]
  ------------------
  571|      0|                            {
  572|      0|                                au4_ilf_across_tile_slice_enable[4] = 0;
  573|      0|                                au4_ilf_across_tile_slice_enable[6] = 0;
  574|      0|                            }
  575|  13.5k|                            else
  576|  13.5k|                            {
  577|  13.5k|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_tl[6])->i1_slice_loop_filter_across_slices_enabled_flag;
  578|  13.5k|                            }
  579|  13.5k|                            if((0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma))
  ------------------
  |  Branch (579:32): [True: 0, False: 13.5k]
  ------------------
  580|      0|                            {
  581|      0|                                au4_ilf_across_tile_slice_enable[5] = 0;
  582|      0|                                au4_ilf_across_tile_slice_enable[4] = 0;
  583|      0|                            }
  584|  13.5k|                            else
  585|  13.5k|                            {
  586|  13.5k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  587|  13.5k|                                au4_ilf_across_tile_slice_enable[4] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  588|  13.5k|                            }
  589|  13.5k|                            au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  590|  13.5k|                            au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  591|  13.5k|                            au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_tl[1])->i1_slice_loop_filter_across_slices_enabled_flag;
  592|  13.5k|                            au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_tl[3])->i1_slice_loop_filter_across_slices_enabled_flag;
  593|  13.5k|                            au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_tl[7])->i1_slice_loop_filter_across_slices_enabled_flag;
  594|       |
  595|  13.5k|                            if(au4_idx_tl[5] > idx_tl)
  ------------------
  |  Branch (595:32): [True: 798, False: 12.7k]
  ------------------
  596|    798|                            {
  597|    798|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_tl[5])->i1_slice_loop_filter_across_slices_enabled_flag;
  598|    798|                            }
  599|       |
  600|       |                            /*
  601|       |                             * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
  602|       |                             * of the pixel having a greater address is checked. Accordingly, set the availability flags.
  603|       |                             * Hence, for top and left pixels, current ctb flag is checked. For right and down pixels,
  604|       |                             * the respective pixel's flags are checked
  605|       |                             */
  606|   121k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (606:40): [True: 108k, False: 13.5k]
  ------------------
  607|   108k|                            {
  608|       |                                /*Sets the edges that lie on the slice/tile boundary*/
  609|   108k|                                if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (609:36): [True: 9.01k, False: 99.2k]
  ------------------
  610|  9.01k|                                {
  611|  9.01k|                                    au1_tile_slice_boundary[i] = 1;
  612|  9.01k|                                }
  613|  99.2k|                                else
  614|  99.2k|                                {
  615|  99.2k|                                    au4_ilf_across_tile_slice_enable[i] = 1;
  616|  99.2k|                                }
  617|   108k|                            }
  618|       |
  619|  13.5k|                            memset((UWORD8 *)au4_idx_tl, 0, 8 * sizeof(WORD32));
  620|  13.5k|                        }
  621|       |
  622|  43.2k|                        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (622:28): [True: 30.2k, False: 13.0k]
  ------------------
  623|  30.2k|                        {
  624|       |                            /* Calculate availability flags at slice boundary */
  625|  30.2k|                            if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (625:33): [True: 3.00k, False: 27.2k]
  |  Branch (625:81): [True: 11.7k, False: 15.4k]
  |  Branch (625:133): [True: 10.0k, False: 4.68k]
  |  Branch (625:161): [True: 0, False: 10.0k]
  ------------------
  626|  14.7k|                            {
  627|       |                                /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
  628|  14.7k|                                if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (628:36): [True: 12.6k, False: 2.11k]
  ------------------
  629|  12.6k|                                {
  630|       |                                    /*Set the boundary arrays*/
  631|       |                                    /*Calculate tile indices for neighbor pixels*/
  632|  12.6k|                                    idx_tl   = pu1_tile_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  633|  12.6k|                                    au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_tile_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
  634|  12.6k|                                    au4_idx_tl[0] =  pu1_tile_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  635|  12.6k|                                    au4_idx_tl[1] = au4_idx_tl[5] = pu1_tile_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  636|  12.6k|                                    au4_idx_tl[3] = au4_idx_tl[6] =   pu1_tile_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  637|  12.6k|                                    au4_idx_tl[7] = pu1_tile_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  638|       |
  639|  12.6k|                                    if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (639:40): [True: 0, False: 12.6k]
  ------------------
  640|      0|                                    {
  641|      0|                                        if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (641:44): [True: 0, False: 0]
  ------------------
  642|      0|                                        {
  643|      0|                                            au4_idx_tl[6] = -1;
  644|      0|                                            au4_idx_tl[4] = -1;
  645|      0|                                        }
  646|      0|                                        else
  647|      0|                                        {
  648|      0|                                            au4_idx_tl[6] = pu1_tile_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  649|      0|                                        }
  650|      0|                                        if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (650:44): [True: 0, False: 0]
  ------------------
  651|      0|                                        {
  652|      0|                                            au4_idx_tl[5] = -1;
  653|      0|                                            au4_idx_tl[4] = -1;
  654|      0|                                        }
  655|      0|                                        else
  656|      0|                                        {
  657|      0|                                            au4_idx_tl[5] = pu1_tile_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  658|      0|                                            au4_idx_tl[4] = pu1_tile_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
  659|      0|                                        }
  660|      0|                                        au4_idx_tl[7] = pu1_tile_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  661|      0|                                    }
  662|   113k|                                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (662:48): [True: 101k, False: 12.6k]
  ------------------
  663|   101k|                                    {
  664|       |                                        /*Sets the edges that lie on the tile boundary*/
  665|   101k|                                        if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (665:44): [True: 38.3k, False: 62.6k]
  ------------------
  666|  38.3k|                                        {
  667|  38.3k|                                            au1_tile_slice_boundary[i] |= 1;
  668|  38.3k|                                            au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
  669|  38.3k|                                        }
  670|   101k|                                    }
  671|  12.6k|                                }
  672|  14.7k|                            }
  673|  30.2k|                        }
  674|       |
  675|       |
  676|       |                        /*Set availability flags based on tile and slice boundaries*/
  677|   389k|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (677:36): [True: 346k, False: 43.2k]
  ------------------
  678|   346k|                        {
  679|       |                            /*Sets the edges that lie on the slice/tile boundary*/
  680|   346k|                            if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (680:32): [True: 47.3k, False: 298k]
  |  Branch (680:64): [True: 38.6k, False: 8.76k]
  ------------------
  681|  38.6k|                            {
  682|  38.6k|                                au1_avail_luma[i] = 0;
  683|  38.6k|                            }
  684|   346k|                        }
  685|  43.2k|                    }
  686|   135k|                }
  687|       |
  688|   135k|                if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma)
  ------------------
  |  Branch (688:20): [True: 0, False: 135k]
  ------------------
  689|      0|                {
  690|      0|                    au1_avail_luma[0] = 0;
  691|      0|                    au1_avail_luma[4] = 0;
  692|      0|                    au1_avail_luma[6] = 0;
  693|      0|                }
  694|       |
  695|   135k|                if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (695:20): [True: 0, False: 135k]
  ------------------
  696|      0|                {
  697|      0|                    au1_avail_luma[1] = 0;
  698|      0|                    au1_avail_luma[5] = 0;
  699|      0|                    au1_avail_luma[7] = 0;
  700|      0|                }
  701|       |                //y==1 case
  702|   135k|                if((0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma))
  ------------------
  |  Branch (702:20): [True: 0, False: 135k]
  ------------------
  703|      0|                {
  704|      0|                    au1_avail_luma[2] = 0;
  705|      0|                    au1_avail_luma[4] = 0;
  706|      0|                    au1_avail_luma[5] = 0;
  707|      0|                }
  708|   135k|                if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (708:20): [True: 0, False: 135k]
  ------------------
  709|      0|                {
  710|      0|                    au1_avail_luma[3] = 0;
  711|      0|                    au1_avail_luma[6] = 0;
  712|      0|                    au1_avail_luma[7] = 0;
  713|      0|                }
  714|       |
  715|   135k|                if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   135k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (715:20): [True: 73.4k, False: 61.6k]
  ------------------
  716|  73.4k|                {
  717|  73.4k|                    au1_src_top_right[0] = pu1_src_top_luma[sao_wd_luma];
  718|  73.4k|                    u1_sao_src_top_left_luma_bot_left = pu1_src_left_luma[sao_ht_luma];
  719|  73.4k|                    ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
  720|  73.4k|                                                              src_strd,
  721|  73.4k|                                                              pu1_src_left_luma,
  722|  73.4k|                                                              pu1_src_top_luma,
  723|  73.4k|                                                              pu1_sao_src_luma_top_left_ctb,
  724|  73.4k|                                                              au1_src_top_right,
  725|  73.4k|                                                              &u1_sao_src_top_left_luma_bot_left,
  726|  73.4k|                                                              au1_avail_luma,
  727|  73.4k|                                                              ai1_offset_y,
  728|  73.4k|                                                              sao_wd_luma,
  729|  73.4k|                                                              sao_ht_luma);
  730|  73.4k|                }
  731|  61.6k|                else
  732|  61.6k|                {
  733|  61.6k|                    UWORD16 *pu2_src_top_luma = (UWORD16 *)pu1_src_top_luma;
  734|  61.6k|                    UWORD16 *pu2_src_left_luma = (UWORD16 *)pu1_src_left_luma;
  735|  61.6k|                    au2_src_top_right[0] = pu2_src_top_luma[sao_wd_luma];
  736|  61.6k|                    u2_sao_src_top_left_luma_bot_left = pu2_src_left_luma[sao_ht_luma];
  737|  61.6k|                    ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
  738|  61.6k|                                                                  src_strd,
  739|  61.6k|                                                                  (UWORD16 *)pu1_src_left_luma,
  740|  61.6k|                                                                  (UWORD16 *)pu1_src_top_luma,
  741|  61.6k|                                                                  (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
  742|  61.6k|                                                                  au2_src_top_right,
  743|  61.6k|                                                                  &u2_sao_src_top_left_luma_bot_left,
  744|  61.6k|                                                                  au1_avail_luma,
  745|  61.6k|                                                                  ai1_offset_y,
  746|  61.6k|                                                                  sao_wd_luma,
  747|  61.6k|                                                                  sao_ht_luma,
  748|  61.6k|                                                                  u4_bit_depth_luma);
  749|  61.6k|                }
  750|   135k|            }
  751|       |
  752|  6.12M|        }
  753|  11.5M|        else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (753:17): [True: 4.33M, False: 7.18M]
  |  Branch (753:64): [True: 1.87M, False: 5.30M]
  ------------------
  754|  6.21M|        {
  755|  6.21M|            UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_luma_top_left_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  6.21M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  6.21M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  6.21M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 6.16M, False: 47.5k]
  |  |  ------------------
  |  |   82|  55.2M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 49.0M, False: 6.16M]
  |  |  ------------------
  |  |   83|  49.0M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  49.0M|        } \
  |  |   85|  6.16M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  6.16M|    } else { \
  |  |   87|  47.5k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|  47.5k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|  47.5k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|  47.5k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|   408k|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 361k, False: 47.5k]
  |  |  ------------------
  |  |   92|   361k|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|   361k|        } \
  |  |   94|  47.5k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|  47.5k|    } \
  |  |   96|  6.21M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  6.21M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 6.21M]
  |  |  ------------------
  ------------------
  756|  6.21M|        }
  757|       |
  758|  17.6M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && ps_slice_hdr_top_left->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (758:12): [True: 17.4M, False: 154k]
  |  Branch (758:73): [True: 5.78M, False: 11.6M]
  ------------------
  759|  5.78M|        {
  760|  5.78M|            if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (760:16): [True: 5.52M, False: 264k]
  ------------------
  761|  5.52M|            {
  762|  5.52M|                UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_chroma_top_left_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  5.52M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  5.52M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  5.52M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 5.09M, False: 423k]
  |  |  ------------------
  |  |  101|  45.8M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 40.7M, False: 5.09M]
  |  |  ------------------
  |  |  102|  40.7M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  40.7M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  40.7M|        } \
  |  |  105|  5.09M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  5.09M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  5.09M|    } else { \
  |  |  108|   423k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   423k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   423k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   423k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  3.80M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 3.38M, False: 423k]
  |  |  ------------------
  |  |  113|  3.38M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  3.38M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  3.38M|        } \
  |  |  116|   423k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   423k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   423k|    } \
  |  |  119|  5.52M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  5.52M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 5.52M]
  |  |  ------------------
  ------------------
  763|  5.52M|            }
  764|       |
  765|   264k|            else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (765:21): [True: 102k, False: 161k]
  ------------------
  766|   102k|            {
  767|   102k|                ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
  768|   102k|                ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
  769|   102k|                ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
  770|   102k|                ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
  771|       |
  772|   102k|                ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
  773|   102k|                ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
  774|   102k|                ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
  775|   102k|                ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
  776|       |
  777|   102k|                if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (777:20): [True: 20.2k, False: 82.0k]
  ------------------
  778|  20.2k|                {
  779|  20.2k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  20.2k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (779:24): [True: 7.71k, False: 12.5k]
  ------------------
  780|  7.71k|                    {
  781|  7.71k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
  782|  7.71k|                            pu1_src_chroma,
  783|  7.71k|                            chroma_strd,
  784|  7.71k|                            pu1_src_left_chroma,
  785|  7.71k|                            pu1_src_top_chroma,
  786|  7.71k|                            pu1_sao_src_chroma_top_left_ctb,
  787|  7.71k|                            ps_sao->b5_cr_band_pos,
  788|  7.71k|                            ps_sao->b5_cb_band_pos,
  789|  7.71k|                            ai1_offset_cr,
  790|  7.71k|                            ai1_offset_cb,
  791|  7.71k|                            sao_wd_chroma,
  792|  7.71k|                            sao_ht_chroma);
  793|  7.71k|                    }
  794|  12.5k|                    else
  795|  12.5k|                    {
  796|  12.5k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
  797|  12.5k|                            (UWORD16 *)pu1_src_chroma,
  798|  12.5k|                            chroma_strd,
  799|  12.5k|                            (UWORD16 *)pu1_src_left_chroma,
  800|  12.5k|                            (UWORD16 *)pu1_src_top_chroma,
  801|  12.5k|                            (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
  802|  12.5k|                            ps_sao->b5_cr_band_pos,
  803|  12.5k|                            ps_sao->b5_cb_band_pos,
  804|  12.5k|                            ai1_offset_cr,
  805|  12.5k|                            ai1_offset_cb,
  806|  12.5k|                            sao_wd_chroma,
  807|  12.5k|                            sao_ht_chroma,
  808|  12.5k|                            u4_bit_depth_chroma);
  809|  12.5k|                    }
  810|  20.2k|                }
  811|  82.0k|                else
  812|  82.0k|                {
  813|  82.0k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  82.0k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (813:24): [True: 33.4k, False: 48.5k]
  ------------------
  814|  33.4k|                    {
  815|  33.4k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
  816|  33.4k|                            pu1_src_chroma,
  817|  33.4k|                            chroma_strd,
  818|  33.4k|                            pu1_src_left_chroma,
  819|  33.4k|                            pu1_src_top_chroma,
  820|  33.4k|                            pu1_sao_src_chroma_top_left_ctb,
  821|  33.4k|                            ps_sao->b5_cb_band_pos,
  822|  33.4k|                            ps_sao->b5_cr_band_pos,
  823|  33.4k|                            ai1_offset_cb,
  824|  33.4k|                            ai1_offset_cr,
  825|  33.4k|                            sao_wd_chroma,
  826|  33.4k|                            sao_ht_chroma);
  827|  33.4k|                    }
  828|  48.5k|                    else
  829|  48.5k|                    {
  830|  48.5k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
  831|  48.5k|                            (UWORD16 *)pu1_src_chroma,
  832|  48.5k|                            chroma_strd,
  833|  48.5k|                            (UWORD16 *)pu1_src_left_chroma,
  834|  48.5k|                            (UWORD16 *)pu1_src_top_chroma,
  835|  48.5k|                            (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
  836|  48.5k|                            ps_sao->b5_cb_band_pos,
  837|  48.5k|                            ps_sao->b5_cr_band_pos,
  838|  48.5k|                            ai1_offset_cb,
  839|  48.5k|                            ai1_offset_cr,
  840|  48.5k|                            sao_wd_chroma,
  841|  48.5k|                            sao_ht_chroma,
  842|  48.5k|                            u4_bit_depth_chroma);
  843|  48.5k|                    }
  844|  82.0k|                }
  845|   102k|            }
  846|       |
  847|   161k|            else // if(2 <= ps_sao->b3_cb_type_idx)
  848|   161k|            {
  849|   161k|                ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
  850|   161k|                ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
  851|   161k|                ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
  852|   161k|                ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
  853|       |
  854|   161k|                ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
  855|   161k|                ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
  856|   161k|                ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
  857|   161k|                ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
  858|  1.47M|                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (858:28): [True: 1.31M, False: 161k]
  ------------------
  859|  1.31M|                {
  860|  1.31M|                    au1_avail_chroma[i] = 255;
  861|  1.31M|                    au1_tile_slice_boundary[i] = 0;
  862|  1.31M|                    au4_idx_tl[i] = 0;
  863|  1.31M|                    au4_ilf_across_tile_slice_enable[i] = 1;
  864|  1.31M|                }
  865|       |                /*In case of slices*/
  866|   161k|                {
  867|   161k|                    if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (867:24): [True: 13.9k, False: 147k]
  |  Branch (867:71): [True: 29.8k, False: 118k]
  ------------------
  868|  46.2k|                    {
  869|  46.2k|                        if((0 == (1 << log2_ctb_size) - sao_wd_chroma) && (ps_sao_ctxt->i4_ctb_y > 1) && (ps_sao_ctxt->i4_ctb_x > 1))
  ------------------
  |  Branch (869:28): [True: 9.35k, False: 36.9k]
  |  Branch (869:75): [True: 4.50k, False: 4.85k]
  |  Branch (869:106): [True: 3.48k, False: 1.01k]
  ------------------
  870|  3.48k|                        {
  871|  3.48k|                            ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 2;
  872|  3.48k|                            ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 2;
  873|  3.48k|                        }
  874|  42.8k|                        else if(!(0 == (1 << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (874:33): [True: 36.9k, False: 5.87k]
  ------------------
  875|  36.9k|                        {
  876|  36.9k|                            ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 1;
  877|  36.9k|                            ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 1;
  878|  36.9k|                        }
  879|  46.2k|                        ctbx_tl_t = ps_sao_ctxt->i4_ctb_x - 1;
  880|  46.2k|                        ctby_tl_l = ps_sao_ctxt->i4_ctb_y - 1;
  881|       |
  882|  46.2k|                        ctbx_tl_r = ps_sao_ctxt->i4_ctb_x;
  883|  46.2k|                        ctby_tl_r = ps_sao_ctxt->i4_ctb_y - 1;
  884|       |
  885|  46.2k|                        ctbx_tl_d =  ps_sao_ctxt->i4_ctb_x - 1;
  886|  46.2k|                        ctby_tl_d =  ps_sao_ctxt->i4_ctb_y;
  887|       |
  888|  46.2k|                        ctbx_tl = ps_sao_ctxt->i4_ctb_x - 1;
  889|  46.2k|                        ctby_tl = ps_sao_ctxt->i4_ctb_y - 1;
  890|       |
  891|  46.2k|                        if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (891:28): [True: 16.4k, False: 29.8k]
  ------------------
  892|  16.4k|                        {
  893|       |
  894|  16.4k|                            idx_tl   = pu1_slice_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  895|  16.4k|                            au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_slice_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
  896|  16.4k|                            au4_idx_tl[0] =  pu1_slice_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  897|  16.4k|                            au4_idx_tl[1] = au4_idx_tl[5] = pu1_slice_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  898|  16.4k|                            au4_idx_tl[3] = au4_idx_tl[6] =   pu1_slice_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  899|  16.4k|                            au4_idx_tl[7] = pu1_slice_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  900|       |
  901|  16.4k|                            if((0 == (1 << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (901:32): [True: 4.12k, False: 12.2k]
  ------------------
  902|  4.12k|                            {
  903|  4.12k|                                if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (903:36): [True: 256, False: 3.87k]
  ------------------
  904|    256|                                {
  905|    256|                                    au4_idx_tl[6] = -1;
  906|    256|                                    au4_idx_tl[4] = -1;
  907|    256|                                }
  908|  3.87k|                                else
  909|  3.87k|                                {
  910|  3.87k|                                    au4_idx_tl[6] = pu1_slice_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  911|  3.87k|                                }
  912|  4.12k|                                if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (912:36): [True: 2.21k, False: 1.91k]
  ------------------
  913|  2.21k|                                {
  914|  2.21k|                                    au4_idx_tl[5] = -1;
  915|  2.21k|                                    au4_idx_tl[4] = -1;
  916|  2.21k|                                }
  917|  1.91k|                                else
  918|  1.91k|                                {
  919|  1.91k|                                    au4_idx_tl[5] = pu1_slice_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  920|  1.91k|                                    if(ctbx_tl_t > 0)
  ------------------
  |  Branch (920:40): [True: 1.69k, False: 222]
  ------------------
  921|  1.69k|                                        au4_idx_tl[4] = pu1_slice_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
  922|  1.91k|                                }
  923|  4.12k|                                au4_idx_tl[7] = pu1_slice_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  924|  4.12k|                            }
  925|       |
  926|       |                            /* Verify that the neighbor ctbs don't cross pic boundary
  927|       |                             * Also, the ILF flag belonging to the higher pixel address (between neighbor and current pixels) must be assigned*/
  928|  16.4k|                            if((0 == ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor)) - sao_wd_chroma))
  ------------------
  |  Branch (928:32): [True: 256, False: 16.1k]
  ------------------
  929|    256|                            {
  930|    256|                                au4_ilf_across_tile_slice_enable[4] = 0;
  931|    256|                                au4_ilf_across_tile_slice_enable[6] = 0;
  932|    256|                            }
  933|  16.1k|                            else
  934|  16.1k|                            {
  935|  16.1k|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  936|  16.1k|                            }
  937|  16.4k|                            if((0 == ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) - sao_ht_chroma))
  ------------------
  |  Branch (937:32): [True: 2.21k, False: 14.1k]
  ------------------
  938|  2.21k|                            {
  939|  2.21k|                                au4_ilf_across_tile_slice_enable[5] = 0;
  940|  2.21k|                                au4_ilf_across_tile_slice_enable[4] = 0;
  941|  2.21k|                            }
  942|  14.1k|                            else
  943|  14.1k|                            {
  944|  14.1k|                                au4_ilf_across_tile_slice_enable[4] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  945|  14.1k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  946|  14.1k|                            }
  947|       |
  948|  16.4k|                            if(au4_idx_tl[5] > idx_tl)
  ------------------
  |  Branch (948:32): [True: 970, False: 15.4k]
  ------------------
  949|    970|                            {
  950|    970|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_tl[5])->i1_slice_loop_filter_across_slices_enabled_flag;
  951|    970|                            }
  952|  16.4k|                            if(au4_idx_tl[6] > idx_tl)
  ------------------
  |  Branch (952:32): [True: 1.00k, False: 15.4k]
  ------------------
  953|  1.00k|                            {
  954|  1.00k|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_tl[6])->i1_slice_loop_filter_across_slices_enabled_flag;
  955|  1.00k|                            }
  956|  16.4k|                            au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  957|  16.4k|                            au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  958|  16.4k|                            au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_tl[1])->i1_slice_loop_filter_across_slices_enabled_flag;
  959|  16.4k|                            au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_tl[3])->i1_slice_loop_filter_across_slices_enabled_flag;
  960|  16.4k|                            au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_tl[7])->i1_slice_loop_filter_across_slices_enabled_flag;
  961|       |                            /*
  962|       |                             * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
  963|       |                             * of the pixel having a greater address is checked. Accordingly, set the availability flags
  964|       |                             */
  965|   147k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (965:40): [True: 131k, False: 16.4k]
  ------------------
  966|   131k|                            {
  967|       |                                /*Sets the edges that lie on the slice/tile boundary*/
  968|   131k|                                if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (968:36): [True: 10.8k, False: 120k]
  ------------------
  969|  10.8k|                                {
  970|  10.8k|                                    au1_tile_slice_boundary[i] = 1;
  971|  10.8k|                                }
  972|   120k|                                else
  973|   120k|                                {
  974|   120k|                                    au4_ilf_across_tile_slice_enable[i] = 1;
  975|   120k|                                }
  976|   131k|                            }
  977|       |
  978|       |                            /*Reset indices*/
  979|   147k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (979:40): [True: 131k, False: 16.4k]
  ------------------
  980|   131k|                            {
  981|   131k|                                au4_idx_tl[i] = 0;
  982|   131k|                            }
  983|  16.4k|                        }
  984|  46.2k|                        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (984:28): [True: 30.7k, False: 15.5k]
  ------------------
  985|  30.7k|                        {
  986|       |                            /* Calculate availability flags at slice boundary */
  987|  30.7k|                            if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (987:33): [True: 3.25k, False: 27.5k]
  |  Branch (987:81): [True: 12.2k, False: 15.3k]
  |  Branch (987:133): [True: 10.6k, False: 4.79k]
  |  Branch (987:161): [True: 0, False: 10.6k]
  ------------------
  988|  15.4k|                            {
  989|       |                                /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
  990|  15.4k|                                if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (990:36): [True: 13.4k, False: 1.97k]
  ------------------
  991|  13.4k|                                {
  992|       |                                    /*Set the boundary arrays*/
  993|       |                                    /*Calculate tile indices for neighbor pixels*/
  994|  13.4k|                                    idx_tl   = pu1_tile_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  995|  13.4k|                                    au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_tile_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
  996|  13.4k|                                    au4_idx_tl[0] =  pu1_tile_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  997|  13.4k|                                    au4_idx_tl[1] = au4_idx_tl[5] = pu1_tile_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  998|  13.4k|                                    au4_idx_tl[3] = au4_idx_tl[6] =   pu1_tile_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  999|  13.4k|                                    au4_idx_tl[7] = pu1_tile_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1000|       |
 1001|  13.4k|                                    if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (1001:40): [True: 0, False: 13.4k]
  ------------------
 1002|      0|                                    {
 1003|      0|                                        if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (1003:44): [True: 0, False: 0]
  ------------------
 1004|      0|                                        {
 1005|      0|                                            au4_idx_tl[6] = -1;
 1006|      0|                                            au4_idx_tl[4] = -1;
 1007|      0|                                        }
 1008|      0|                                        else
 1009|      0|                                        {
 1010|      0|                                            au4_idx_tl[6] = pu1_tile_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1011|      0|                                        }
 1012|      0|                                        if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (1012:44): [True: 0, False: 0]
  ------------------
 1013|      0|                                        {
 1014|      0|                                            au4_idx_tl[5] = -1;
 1015|      0|                                            au4_idx_tl[4] = -1;
 1016|      0|                                        }
 1017|      0|                                        else
 1018|      0|                                        {
 1019|      0|                                            au4_idx_tl[5] = pu1_tile_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1020|      0|                                            au4_idx_tl[4] = pu1_tile_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
 1021|      0|                                        }
 1022|      0|                                        au4_idx_tl[7] = pu1_tile_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1023|      0|                                    }
 1024|   121k|                                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1024:48): [True: 107k, False: 13.4k]
  ------------------
 1025|   107k|                                    {
 1026|       |                                        /*Sets the edges that lie on the tile boundary*/
 1027|   107k|                                        if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (1027:44): [True: 41.7k, False: 66.2k]
  ------------------
 1028|  41.7k|                                        {
 1029|  41.7k|                                            au1_tile_slice_boundary[i] |= 1;
 1030|  41.7k|                                            au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 1031|  41.7k|                                        }
 1032|   107k|                                    }
 1033|  13.4k|                                }
 1034|  15.4k|                            }
 1035|  30.7k|                        }
 1036|       |
 1037|   416k|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1037:36): [True: 370k, False: 46.2k]
  ------------------
 1038|   370k|                        {
 1039|       |                            /*Sets the edges that lie on the slice/tile boundary*/
 1040|   370k|                            if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1040:32): [True: 52.5k, False: 317k]
  |  Branch (1040:64): [True: 47.2k, False: 5.37k]
  ------------------
 1041|  47.2k|                            {
 1042|  47.2k|                                au1_avail_chroma[i] = 0;
 1043|  47.2k|                            }
 1044|   370k|                        }
 1045|  46.2k|                    }
 1046|   161k|                }
 1047|       |
 1048|   161k|                if(0 == ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor)) - sao_wd_chroma)
  ------------------
  |  Branch (1048:20): [True: 3.09k, False: 158k]
  ------------------
 1049|  3.09k|                {
 1050|  3.09k|                    au1_avail_chroma[0] = 0;
 1051|  3.09k|                    au1_avail_chroma[4] = 0;
 1052|  3.09k|                    au1_avail_chroma[6] = 0;
 1053|  3.09k|                }
 1054|   161k|                if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1054:20): [True: 0, False: 161k]
  ------------------
 1055|      0|                {
 1056|      0|                    au1_avail_chroma[1] = 0;
 1057|      0|                    au1_avail_chroma[5] = 0;
 1058|      0|                    au1_avail_chroma[7] = 0;
 1059|      0|                }
 1060|       |
 1061|   161k|                if(0 == ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) - sao_ht_chroma)
  ------------------
  |  Branch (1061:20): [True: 6.80k, False: 155k]
  ------------------
 1062|  6.80k|                {
 1063|  6.80k|                    au1_avail_chroma[2] = 0;
 1064|  6.80k|                    au1_avail_chroma[4] = 0;
 1065|  6.80k|                    au1_avail_chroma[5] = 0;
 1066|  6.80k|                }
 1067|   161k|                if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1067:20): [True: 0, False: 161k]
  ------------------
 1068|      0|                {
 1069|      0|                    au1_avail_chroma[3] = 0;
 1070|      0|                    au1_avail_chroma[6] = 0;
 1071|      0|                    au1_avail_chroma[7] = 0;
 1072|      0|                }
 1073|       |
 1074|   161k|                if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   161k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1074:20): [True: 75.6k, False: 86.2k]
  ------------------
 1075|  75.6k|                {
 1076|  75.6k|                    au1_src_top_right[0] = pu1_src_top_chroma[sao_wd_chroma];
 1077|  75.6k|                    au1_src_top_right[1] = pu1_src_top_chroma[sao_wd_chroma + 1];
 1078|  75.6k|                    au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_left_chroma[2 * sao_ht_chroma];
 1079|  75.6k|                    au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_left_chroma[2 * sao_ht_chroma + 1];
 1080|  75.6k|                    if((ctb_size == (8 * v_samp_factor)) && (ps_sao_ctxt->i4_ctb_y != ps_sps->i2_pic_ht_in_ctb - 1))
  ------------------
  |  Branch (1080:24): [True: 10.2k, False: 65.4k]
  |  Branch (1080:61): [True: 8.33k, False: 1.89k]
  ------------------
 1081|  8.33k|                    {
 1082|  8.33k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1083|  8.33k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1084|  8.33k|                    }
 1085|       |
 1086|  75.6k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1086:24): [True: 14.9k, False: 60.6k]
  ------------------
 1087|  14.9k|                    {
 1088|  14.9k|                        ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1089|  14.9k|                                                                     chroma_strd,
 1090|  14.9k|                                                                     pu1_src_left_chroma,
 1091|  14.9k|                                                                     pu1_src_top_chroma,
 1092|  14.9k|                                                                     pu1_sao_src_chroma_top_left_ctb,
 1093|  14.9k|                                                                     au1_src_top_right,
 1094|  14.9k|                                                                     au1_sao_src_top_left_chroma_bot_left,
 1095|  14.9k|                                                                     au1_avail_chroma,
 1096|  14.9k|                                                                     ai1_offset_cr,
 1097|  14.9k|                                                                     ai1_offset_cb,
 1098|  14.9k|                                                                     sao_wd_chroma,
 1099|  14.9k|                                                                     sao_ht_chroma);
 1100|  14.9k|                    }
 1101|  60.6k|                    else
 1102|  60.6k|                    {
 1103|  60.6k|                        ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1104|  60.6k|                                                                     chroma_strd,
 1105|  60.6k|                                                                     pu1_src_left_chroma,
 1106|  60.6k|                                                                     pu1_src_top_chroma,
 1107|  60.6k|                                                                     pu1_sao_src_chroma_top_left_ctb,
 1108|  60.6k|                                                                     au1_src_top_right,
 1109|  60.6k|                                                                     au1_sao_src_top_left_chroma_bot_left,
 1110|  60.6k|                                                                     au1_avail_chroma,
 1111|  60.6k|                                                                     ai1_offset_cb,
 1112|  60.6k|                                                                     ai1_offset_cr,
 1113|  60.6k|                                                                     sao_wd_chroma,
 1114|  60.6k|                                                                     sao_ht_chroma);
 1115|  60.6k|                    }
 1116|  75.6k|                }
 1117|  86.2k|                else
 1118|  86.2k|                {
 1119|  86.2k|                    UWORD16 *pu2_src_top_chroma = (UWORD16 *)pu1_src_top_chroma;
 1120|  86.2k|                    UWORD16 *pu2_src_left_chroma = (UWORD16 *)pu1_src_left_chroma;
 1121|  86.2k|                    UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 1122|       |
 1123|  86.2k|                    au2_src_top_right[0] = pu2_src_top_chroma[sao_wd_chroma];
 1124|  86.2k|                    au2_src_top_right[1] = pu2_src_top_chroma[sao_wd_chroma + 1];
 1125|  86.2k|                    au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_left_chroma[2 * sao_ht_chroma];
 1126|  86.2k|                    au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_left_chroma[2 * sao_ht_chroma + 1];
 1127|  86.2k|                    if((ctb_size == (8 * v_samp_factor)) && (ps_sao_ctxt->i4_ctb_y != ps_sps->i2_pic_ht_in_ctb - 1))
  ------------------
  |  Branch (1127:24): [True: 3.94k, False: 82.3k]
  |  Branch (1127:61): [True: 3.60k, False: 342]
  ------------------
 1128|  3.60k|                    {
 1129|  3.60k|                        au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1130|  3.60k|                        au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1131|  3.60k|                    }
 1132|       |
 1133|  86.2k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1133:24): [True: 42.9k, False: 43.3k]
  ------------------
 1134|  42.9k|                    {
 1135|  42.9k|                        ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1136|  42.9k|                                                                         chroma_strd,
 1137|  42.9k|                                                                         (UWORD16 *)pu1_src_left_chroma,
 1138|  42.9k|                                                                         (UWORD16 *)pu1_src_top_chroma,
 1139|  42.9k|                                                                         (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1140|  42.9k|                                                                         au2_src_top_right,
 1141|  42.9k|                                                                         au2_sao_src_top_left_chroma_bot_left,
 1142|  42.9k|                                                                         au1_avail_chroma,
 1143|  42.9k|                                                                         ai1_offset_cr,
 1144|  42.9k|                                                                         ai1_offset_cb,
 1145|  42.9k|                                                                         sao_wd_chroma,
 1146|  42.9k|                                                                         sao_ht_chroma,
 1147|  42.9k|                                                                         u4_bit_depth_chroma);
 1148|  42.9k|                    }
 1149|  43.3k|                    else
 1150|  43.3k|                    {
 1151|  43.3k|                        ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1152|  43.3k|                                                                         chroma_strd,
 1153|  43.3k|                                                                         (UWORD16 *)pu1_src_left_chroma,
 1154|  43.3k|                                                                         (UWORD16 *)pu1_src_top_chroma,
 1155|  43.3k|                                                                         (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1156|  43.3k|                                                                         au2_src_top_right,
 1157|  43.3k|                                                                         au2_sao_src_top_left_chroma_bot_left,
 1158|  43.3k|                                                                         au1_avail_chroma,
 1159|  43.3k|                                                                         ai1_offset_cb,
 1160|  43.3k|                                                                         ai1_offset_cr,
 1161|  43.3k|                                                                         sao_wd_chroma,
 1162|  43.3k|                                                                         sao_ht_chroma,
 1163|  43.3k|                                                                         u4_bit_depth_chroma);
 1164|  43.3k|                    }
 1165|  86.2k|                }
 1166|   161k|            }
 1167|  5.78M|        }
 1168|  11.8M|        else if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && ((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag)))
  ------------------
  |  Branch (1168:17): [True: 11.6M, False: 152k]
  |  Branch (1168:79): [True: 4.61M, False: 7.08M]
  |  Branch (1168:126): [True: 2.40M, False: 4.68M]
  ------------------
 1169|  7.01M|        {
 1170|  7.01M|            UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_chroma_top_left_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  7.01M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  7.01M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  7.01M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 7.00M, False: 9.80k]
  |  |  ------------------
  |  |  101|  62.8M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 55.7M, False: 7.00M]
  |  |  ------------------
  |  |  102|  55.7M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  55.7M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  55.7M|        } \
  |  |  105|  7.00M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  7.00M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  7.00M|    } else { \
  |  |  108|  9.80k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  9.80k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  9.80k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  9.80k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  58.8k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 49.0k, False: 9.80k]
  |  |  ------------------
  |  |  113|  49.0k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  49.0k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  49.0k|        } \
  |  |  116|  9.80k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  9.80k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  9.80k|    } \
  |  |  119|  7.01M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  7.01M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 7.01M]
  |  |  ------------------
  ------------------
 1171|  7.01M|        }
 1172|       |
 1173|  17.6M|        pu1_src_luma += (sao_wd_luma + sao_ht_luma * src_strd) * pixel_size_y;
 1174|  17.6M|        pu1_src_chroma += (sao_wd_chroma + sao_ht_chroma * chroma_strd) * pixel_size_uv;
 1175|  17.6M|        ps_sao += (1 + ps_sps->i2_pic_wd_in_ctb);
 1176|  17.6M|    }
 1177|       |
 1178|       |
 1179|       |    /* Top CTB */
 1180|  19.3M|    if((ps_sao_ctxt->i4_ctb_y > 0))
  ------------------
  |  Branch (1180:8): [True: 18.3M, False: 969k]
  ------------------
 1181|  18.3M|    {
 1182|  18.3M|        WORD32 sao_wd_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1183|  18.3M|        WORD32 sao_wd_chroma = ctb_size * (chroma_pixel_strd / h_samp_factor) - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1184|  18.3M|        WORD32 sao_ht_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1185|  18.3M|        WORD32 sao_ht_chroma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
 1186|       |
 1187|  18.3M|        WORD32 ctbx_t_t = 0, ctbx_t_l = 0, ctbx_t_r = 0, ctbx_t_d = 0, ctbx_t = 0;
 1188|  18.3M|        WORD32 ctby_t_t = 0, ctby_t_l = 0, ctby_t_r = 0, ctby_t_d = 0, ctby_t = 0;
 1189|  18.3M|        WORD32 au4_idx_t[8], idx_t;
 1190|       |
 1191|  18.3M|        WORD32 remaining_cols;
 1192|       |
 1193|  18.3M|        slice_header_t *ps_slice_hdr_top;
 1194|  18.3M|        {
 1195|  18.3M|            WORD32 top_ctb_indx = (ps_sao_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb +
 1196|  18.3M|                                        (ps_sao_ctxt->i4_ctb_x);
 1197|  18.3M|            ps_slice_hdr_top = ps_slice_hdr_base + pu1_slice_idx[top_ctb_indx];
 1198|  18.3M|        }
 1199|       |
 1200|  18.3M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_luma);
 1201|  18.3M|        if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1201:12): [True: 969k, False: 17.3M]
  ------------------
 1202|   969k|        {
 1203|   969k|            sao_wd_luma += remaining_cols;
 1204|   969k|        }
 1205|  18.3M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples * (chroma_pixel_strd / h_samp_factor) - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor) + sao_wd_chroma);
 1206|  18.3M|        if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  18.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1206:12): [True: 969k, False: 17.3M]
  ------------------
 1207|   969k|        {
 1208|   969k|            sao_wd_chroma += remaining_cols;
 1209|   969k|        }
 1210|       |
 1211|  18.3M|        pu1_src_luma -= (sao_ht_luma * src_strd) * pixel_size_y;
 1212|  18.3M|        pu1_src_chroma -= (sao_ht_chroma * chroma_strd) * pixel_size_uv;
 1213|  18.3M|        ps_sao -= (ps_sps->i2_pic_wd_in_ctb);
 1214|  18.3M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * pixel_size_y);
 1215|  18.3M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv);
 1216|  18.3M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + (((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_chroma) * pixel_size_y);
 1217|  18.3M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + (((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) * (chroma_pixel_strd / v_samp_factor) - (2 * sao_ht_chroma)) * pixel_size_uv);
 1218|       |
 1219|  18.3M|        if(0 != sao_wd_luma)
  ------------------
  |  Branch (1219:12): [True: 18.4M, False: 18.4E]
  ------------------
 1220|  18.4M|        {
 1221|  18.4M|            if(ps_slice_hdr_top->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (1221:16): [True: 6.25M, False: 12.1M]
  ------------------
 1222|  6.25M|            {
 1223|  6.25M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1223:20): [True: 5.93M, False: 326k]
  ------------------
 1224|  5.93M|                {
 1225|  5.93M|                    UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_luma_top_left_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  5.93M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  5.93M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  5.93M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 5.52M, False: 405k]
  |  |  ------------------
  |  |   82|  49.3M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 43.7M, False: 5.52M]
  |  |  ------------------
  |  |   83|  43.7M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  43.7M|        } \
  |  |   85|  5.52M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  5.52M|    } else { \
  |  |   87|   405k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   405k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   405k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   405k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  3.66M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 3.26M, False: 405k]
  |  |  ------------------
  |  |   92|  3.26M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  3.26M|        } \
  |  |   94|   405k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   405k|    } \
  |  |   96|  5.93M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  5.93M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 5.93M]
  |  |  ------------------
  ------------------
 1226|  5.93M|                }
 1227|       |
 1228|   326k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1228:25): [True: 159k, False: 166k]
  ------------------
 1229|   159k|                {
 1230|   159k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1231|   159k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1232|   159k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1233|   159k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1234|       |
 1235|   159k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   159k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1235:24): [True: 65.7k, False: 93.4k]
  ------------------
 1236|  65.7k|                    {
 1237|  65.7k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
 1238|  65.7k|                            pu1_src_luma,
 1239|  65.7k|                            src_strd,
 1240|  65.7k|                            pu1_src_left_luma,
 1241|  65.7k|                            pu1_src_top_luma,
 1242|  65.7k|                            pu1_sao_src_luma_top_left_ctb,
 1243|  65.7k|                            ps_sao->b5_y_band_pos,
 1244|  65.7k|                            ai1_offset_y,
 1245|  65.7k|                            sao_wd_luma,
 1246|  65.7k|                            sao_ht_luma);
 1247|  65.7k|                    }
 1248|  93.4k|                    else
 1249|  93.4k|                    {
 1250|  93.4k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
 1251|  93.4k|                            (UWORD16 *)pu1_src_luma,
 1252|  93.4k|                            src_strd,
 1253|  93.4k|                            (UWORD16 *)pu1_src_left_luma,
 1254|  93.4k|                            (UWORD16 *)pu1_src_top_luma,
 1255|  93.4k|                            (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
 1256|  93.4k|                            ps_sao->b5_y_band_pos,
 1257|  93.4k|                            ai1_offset_y,
 1258|  93.4k|                            sao_wd_luma,
 1259|  93.4k|                            sao_ht_luma,
 1260|  93.4k|                            u4_bit_depth_luma);
 1261|  93.4k|                    }
 1262|   159k|                }
 1263|       |
 1264|   166k|                else // if(2 <= ps_sao->b3_y_type_idx)
 1265|   166k|                {
 1266|   166k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1267|   166k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1268|   166k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1269|   166k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1270|       |
 1271|   166k|                    memset(au1_avail_luma, 255, 8);
 1272|   166k|                    memset(au1_tile_slice_boundary, 0, 8);
 1273|   166k|                    memset((UWORD8 *)au4_idx_t, 0, 8 * sizeof(WORD32));
 1274|       |
 1275|  1.48M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1275:32): [True: 1.31M, False: 166k]
  ------------------
 1276|  1.31M|                    {
 1277|       |
 1278|  1.31M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1279|  1.31M|                    }
 1280|       |                    /******************************************************************
 1281|       |                     * Derive the  Top-left CTB's neighbor pixel's slice indices.
 1282|       |                     *
 1283|       |                     *               T_T
 1284|       |                     *          ____________
 1285|       |                     *         |    |       |
 1286|       |                     *         | T_L|  T    |T_R
 1287|       |                     *         |    | ______|____
 1288|       |                     *         |    |  T_D  |    |
 1289|       |                     *         |    |       |    |
 1290|       |                     *         |____|_______|    |
 1291|       |                     *              |            |
 1292|       |                     *              |            |
 1293|       |                     *              |____________|
 1294|       |                     *
 1295|       |                     *****************************************************************/
 1296|       |
 1297|       |                    /*In case of slices*/
 1298|   166k|                    {
 1299|   166k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1299:28): [True: 16.2k, False: 150k]
  |  Branch (1299:75): [True: 37.2k, False: 113k]
  ------------------
 1300|  51.1k|                        {
 1301|       |
 1302|  51.1k|                            ctbx_t_t = ps_sao_ctxt->i4_ctb_x;
 1303|  51.1k|                            ctby_t_t = ps_sao_ctxt->i4_ctb_y - 1;
 1304|       |
 1305|  51.1k|                            ctbx_t_l = ps_sao_ctxt->i4_ctb_x - 1;
 1306|  51.1k|                            ctby_t_l = ps_sao_ctxt->i4_ctb_y - 1;
 1307|       |
 1308|  51.1k|                            ctbx_t_r = ps_sao_ctxt->i4_ctb_x;
 1309|  51.1k|                            ctby_t_r = ps_sao_ctxt->i4_ctb_y - 1;
 1310|       |
 1311|  51.1k|                            ctbx_t_d =  ps_sao_ctxt->i4_ctb_x;
 1312|  51.1k|                            ctby_t_d =  ps_sao_ctxt->i4_ctb_y;
 1313|       |
 1314|  51.1k|                            ctbx_t = ps_sao_ctxt->i4_ctb_x;
 1315|  51.1k|                            ctby_t = ps_sao_ctxt->i4_ctb_y - 1;
 1316|       |
 1317|  51.1k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1317:32): [True: 13.9k, False: 37.2k]
  ------------------
 1318|  13.9k|                            {
 1319|       |                                /*Calculate neighbor ctb slice indices*/
 1320|  13.9k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1320:36): [True: 1.11k, False: 12.7k]
  ------------------
 1321|  1.11k|                                {
 1322|  1.11k|                                    au4_idx_t[0] = -1;
 1323|  1.11k|                                    au4_idx_t[6] = -1;
 1324|  1.11k|                                    au4_idx_t[4] = -1;
 1325|  1.11k|                                }
 1326|  12.7k|                                else
 1327|  12.7k|                                {
 1328|  12.7k|                                    au4_idx_t[0] = au4_idx_t[4] = pu1_slice_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1329|  12.7k|                                    au4_idx_t[6] = pu1_slice_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1330|  12.7k|                                }
 1331|  13.9k|                                idx_t   = pu1_slice_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1332|  13.9k|                                au4_idx_t[2] = au4_idx_t[5] = pu1_slice_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1333|  13.9k|                                au4_idx_t[1] = pu1_slice_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1334|  13.9k|                                au4_idx_t[3] = au4_idx_t[7] = pu1_slice_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1335|       |
 1336|       |                                /*Verify that the neighbor ctbs don't cross pic boundary.*/
 1337|  13.9k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1337:36): [True: 1.11k, False: 12.7k]
  ------------------
 1338|  1.11k|                                {
 1339|  1.11k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 1340|  1.11k|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 1341|  1.11k|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 1342|  1.11k|                                }
 1343|  12.7k|                                else
 1344|  12.7k|                                {
 1345|  12.7k|                                    au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1346|  12.7k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_t[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1347|  12.7k|                                }
 1348|       |
 1349|       |
 1350|       |
 1351|  13.9k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1352|  13.9k|                                au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1353|  13.9k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_t[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1354|  13.9k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_t[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1355|  13.9k|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_t[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 1356|       |
 1357|  13.9k|                                if(au4_idx_t[6] < idx_t)
  ------------------
  |  Branch (1357:36): [True: 1.11k, False: 12.7k]
  ------------------
 1358|  1.11k|                                {
 1359|  1.11k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1360|  1.11k|                                }
 1361|       |
 1362|       |                                /*
 1363|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 1364|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 1365|       |                                 */
 1366|       |
 1367|   125k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1367:44): [True: 111k, False: 13.9k]
  ------------------
 1368|   111k|                                {
 1369|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 1370|   111k|                                    if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1370:40): [True: 11.1k, False: 100k]
  ------------------
 1371|  11.1k|                                    {
 1372|  11.1k|                                        au1_tile_slice_boundary[i] = 1;
 1373|       |                                        /*Check for slice flag at such boundaries*/
 1374|  11.1k|                                    }
 1375|   100k|                                    else
 1376|   100k|                                    {
 1377|   100k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 1378|   100k|                                    }
 1379|   111k|                                }
 1380|       |                                /*Reset indices*/
 1381|   125k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1381:44): [True: 111k, False: 13.9k]
  ------------------
 1382|   111k|                                {
 1383|   111k|                                    au4_idx_t[i] = 0;
 1384|   111k|                                }
 1385|  13.9k|                            }
 1386|       |
 1387|  51.1k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1387:32): [True: 37.3k, False: 13.7k]
  ------------------
 1388|  37.3k|                            {
 1389|       |                                /* Calculate availability flags at slice boundary */
 1390|  37.3k|                                if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (1390:37): [True: 11.3k, False: 26.0k]
  |  Branch (1390:85): [True: 11.3k, False: 14.7k]
  |  Branch (1390:137): [True: 19.5k, False: 3.18k]
  |  Branch (1390:165): [True: 3.99k, False: 15.5k]
  ------------------
 1391|  18.7k|                                {
 1392|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1393|  18.7k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1393:40): [True: 16.5k, False: 2.13k]
  ------------------
 1394|  16.5k|                                    {
 1395|       |                                        /*Calculate neighbor ctb slice indices*/
 1396|  16.5k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1396:44): [True: 5.31k, False: 11.2k]
  ------------------
 1397|  5.31k|                                        {
 1398|  5.31k|                                            au4_idx_t[0] = -1;
 1399|  5.31k|                                            au4_idx_t[6] = -1;
 1400|  5.31k|                                            au4_idx_t[4] = -1;
 1401|  5.31k|                                        }
 1402|  11.2k|                                        else
 1403|  11.2k|                                        {
 1404|  11.2k|                                            au4_idx_t[0] = au4_idx_t[4] = pu1_tile_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1405|  11.2k|                                            au4_idx_t[6] = pu1_tile_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1406|  11.2k|                                        }
 1407|  16.5k|                                        idx_t   = pu1_tile_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1408|  16.5k|                                        au4_idx_t[2] = au4_idx_t[5] = pu1_tile_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1409|  16.5k|                                        au4_idx_t[1] = pu1_tile_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1410|  16.5k|                                        au4_idx_t[3] = au4_idx_t[7] = pu1_tile_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1411|       |
 1412|   149k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1412:52): [True: 132k, False: 16.5k]
  ------------------
 1413|   132k|                                        {
 1414|       |                                            /*Sets the edges that lie on the tile boundary*/
 1415|   132k|                                            if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1415:48): [True: 54.3k, False: 78.3k]
  ------------------
 1416|  54.3k|                                            {
 1417|  54.3k|                                                au1_tile_slice_boundary[i] |= 1;
 1418|  54.3k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 1419|  54.3k|                                            }
 1420|   132k|                                        }
 1421|  16.5k|                                    }
 1422|  18.7k|                                }
 1423|  37.3k|                            }
 1424|       |
 1425|   460k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1425:40): [True: 408k, False: 51.1k]
  ------------------
 1426|   408k|                            {
 1427|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1428|   408k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1428:36): [True: 65.4k, False: 343k]
  |  Branch (1428:68): [True: 57.2k, False: 8.16k]
  ------------------
 1429|  57.2k|                                {
 1430|  57.2k|                                    au1_avail_luma[i] = 0;
 1431|  57.2k|                                }
 1432|   408k|                            }
 1433|  51.1k|                        }
 1434|   166k|                    }
 1435|       |
 1436|       |
 1437|   166k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1437:24): [True: 35.7k, False: 131k]
  ------------------
 1438|  35.7k|                    {
 1439|  35.7k|                        au1_avail_luma[0] = 0;
 1440|  35.7k|                        au1_avail_luma[4] = 0;
 1441|  35.7k|                        au1_avail_luma[6] = 0;
 1442|  35.7k|                    }
 1443|       |
 1444|   166k|                    if(ps_sps->i2_pic_width_in_luma_samples - (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) <= sao_wd_luma)
  ------------------
  |  Branch (1444:24): [True: 26.7k, False: 140k]
  ------------------
 1445|  26.7k|                    {
 1446|  26.7k|                        au1_avail_luma[1] = 0;
 1447|  26.7k|                        au1_avail_luma[5] = 0;
 1448|  26.7k|                        au1_avail_luma[7] = 0;
 1449|  26.7k|                    }
 1450|       |
 1451|   166k|                    if(0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma)
  ------------------
  |  Branch (1451:24): [True: 0, False: 166k]
  ------------------
 1452|      0|                    {
 1453|      0|                        au1_avail_luma[2] = 0;
 1454|      0|                        au1_avail_luma[4] = 0;
 1455|      0|                        au1_avail_luma[5] = 0;
 1456|      0|                    }
 1457|       |
 1458|   166k|                    if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1458:24): [True: 0, False: 166k]
  ------------------
 1459|      0|                    {
 1460|      0|                        au1_avail_luma[3] = 0;
 1461|      0|                        au1_avail_luma[6] = 0;
 1462|      0|                        au1_avail_luma[7] = 0;
 1463|      0|                    }
 1464|       |
 1465|   166k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   166k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1465:24): [True: 86.0k, False: 80.8k]
  ------------------
 1466|  86.0k|                    {
 1467|  86.0k|                        au1_src_top_right[0] = pu1_sao_src_top_left_luma_top_right[0];
 1468|  86.0k|                        u1_sao_src_top_left_luma_bot_left = pu1_src_luma[sao_ht_luma * src_strd - 1];
 1469|  86.0k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 1470|  86.0k|                                                                  src_strd,
 1471|  86.0k|                                                                  pu1_src_left_luma,
 1472|  86.0k|                                                                  pu1_src_top_luma,
 1473|  86.0k|                                                                  pu1_sao_src_luma_top_left_ctb,
 1474|  86.0k|                                                                  au1_src_top_right,
 1475|  86.0k|                                                                  &u1_sao_src_top_left_luma_bot_left,
 1476|  86.0k|                                                                  au1_avail_luma,
 1477|  86.0k|                                                                  ai1_offset_y,
 1478|  86.0k|                                                                  sao_wd_luma,
 1479|  86.0k|                                                                  sao_ht_luma);
 1480|  86.0k|                    }
 1481|  80.8k|                    else
 1482|  80.8k|                    {
 1483|  80.8k|                        UWORD16 *pu2_sao_src_top_left_luma_top_right = (UWORD16 *)pu1_sao_src_top_left_luma_top_right;
 1484|  80.8k|                        UWORD16 *pu2_src_luma = (UWORD16 *)pu1_src_luma;
 1485|  80.8k|                        au2_src_top_right[0] = pu2_sao_src_top_left_luma_top_right[0];
 1486|  80.8k|                        u2_sao_src_top_left_luma_bot_left = pu2_src_luma[sao_ht_luma * src_strd - 1];
 1487|  80.8k|                        ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
 1488|  80.8k|                                                                      src_strd,
 1489|  80.8k|                                                                      (UWORD16 *)pu1_src_left_luma,
 1490|  80.8k|                                                                      (UWORD16 *)pu1_src_top_luma,
 1491|  80.8k|                                                                      (UWORD16 *)pu1_sao_src_luma_top_left_ctb,
 1492|  80.8k|                                                                      au2_src_top_right,
 1493|  80.8k|                                                                      &u2_sao_src_top_left_luma_bot_left,
 1494|  80.8k|                                                                      au1_avail_luma,
 1495|  80.8k|                                                                      ai1_offset_y,
 1496|  80.8k|                                                                      sao_wd_luma,
 1497|  80.8k|                                                                      sao_ht_luma,
 1498|  80.8k|                                                                      u4_bit_depth_luma);
 1499|  80.8k|                    }
 1500|   166k|                }
 1501|  6.25M|            }
 1502|  12.1M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1502:21): [True: 4.34M, False: 7.81M]
  |  Branch (1502:68): [True: 1.88M, False: 5.93M]
  ------------------
 1503|  6.22M|            {
 1504|  6.22M|                UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_luma_top_left_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  6.22M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  6.22M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  6.22M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 6.17M, False: 50.1k]
  |  |  ------------------
  |  |   82|  55.2M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 49.0M, False: 6.17M]
  |  |  ------------------
  |  |   83|  49.0M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  49.0M|        } \
  |  |   85|  6.17M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  6.17M|    } else { \
  |  |   87|  50.1k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|  50.1k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|  50.1k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|  50.1k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|   456k|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 406k, False: 50.1k]
  |  |  ------------------
  |  |   92|   406k|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|   406k|        } \
  |  |   94|  50.1k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|  50.1k|    } \
  |  |   96|  6.22M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  6.22M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 6.22M]
  |  |  ------------------
  ------------------
 1505|  6.22M|            }
 1506|  18.4M|        }
 1507|       |
 1508|  18.3M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 != sao_wd_chroma)
  ------------------
  |  Branch (1508:12): [True: 18.2M, False: 70.8k]
  |  Branch (1508:73): [True: 7.80M, False: 10.4M]
  ------------------
 1509|  7.80M|        {
 1510|  7.80M|            if(ps_slice_hdr_top->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (1510:16): [True: 3.03M, False: 4.77M]
  ------------------
 1511|  3.03M|            {
 1512|  3.03M|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1512:20): [True: 2.75M, False: 285k]
  ------------------
 1513|  2.75M|                {
 1514|  2.75M|                    UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_chroma_top_left_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  2.75M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  2.75M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  2.75M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 2.31M, False: 434k]
  |  |  ------------------
  |  |  101|  20.8M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 18.4M, False: 2.31M]
  |  |  ------------------
  |  |  102|  18.4M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  18.4M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  18.4M|        } \
  |  |  105|  2.31M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  2.31M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  2.31M|    } else { \
  |  |  108|   434k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   434k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   434k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   434k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  3.91M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 3.47M, False: 434k]
  |  |  ------------------
  |  |  113|  3.47M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  3.47M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  3.47M|        } \
  |  |  116|   434k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   434k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   434k|    } \
  |  |  119|  2.75M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  2.75M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 2.75M]
  |  |  ------------------
  ------------------
 1515|  2.75M|                }
 1516|       |
 1517|   285k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1517:25): [True: 104k, False: 181k]
  ------------------
 1518|   104k|                {
 1519|   104k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 1520|   104k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 1521|   104k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 1522|   104k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 1523|       |
 1524|   104k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 1525|   104k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 1526|   104k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 1527|   104k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 1528|       |
 1529|   104k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1529:24): [True: 22.9k, False: 81.2k]
  ------------------
 1530|  22.9k|                    {
 1531|  22.9k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  22.9k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1531:28): [True: 7.34k, False: 15.5k]
  ------------------
 1532|  7.34k|                        {
 1533|  7.34k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 1534|  7.34k|                                pu1_src_chroma,
 1535|  7.34k|                                chroma_strd,
 1536|  7.34k|                                pu1_src_left_chroma,
 1537|  7.34k|                                pu1_src_top_chroma,
 1538|  7.34k|                                pu1_sao_src_chroma_top_left_ctb,
 1539|  7.34k|                                ps_sao->b5_cr_band_pos,
 1540|  7.34k|                                ps_sao->b5_cb_band_pos,
 1541|  7.34k|                                ai1_offset_cr,
 1542|  7.34k|                                ai1_offset_cb,
 1543|  7.34k|                                sao_wd_chroma,
 1544|  7.34k|                                sao_ht_chroma);
 1545|  7.34k|                        }
 1546|  15.5k|                        else
 1547|  15.5k|                        {
 1548|  15.5k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 1549|  15.5k|                                (UWORD16 *)pu1_src_chroma,
 1550|  15.5k|                                chroma_strd,
 1551|  15.5k|                                (UWORD16 *)pu1_src_left_chroma,
 1552|  15.5k|                                (UWORD16 *)pu1_src_top_chroma,
 1553|  15.5k|                                (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1554|  15.5k|                                ps_sao->b5_cr_band_pos,
 1555|  15.5k|                                ps_sao->b5_cb_band_pos,
 1556|  15.5k|                                ai1_offset_cr,
 1557|  15.5k|                                ai1_offset_cb,
 1558|  15.5k|                                sao_wd_chroma,
 1559|  15.5k|                                sao_ht_chroma,
 1560|  15.5k|                                u4_bit_depth_chroma);
 1561|  15.5k|                        }
 1562|  22.9k|                    }
 1563|  81.2k|                    else
 1564|  81.2k|                    {
 1565|  81.2k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  81.2k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1565:28): [True: 34.9k, False: 46.3k]
  ------------------
 1566|  34.9k|                        {
 1567|  34.9k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 1568|  34.9k|                                pu1_src_chroma,
 1569|  34.9k|                                chroma_strd,
 1570|  34.9k|                                pu1_src_left_chroma,
 1571|  34.9k|                                pu1_src_top_chroma,
 1572|  34.9k|                                pu1_sao_src_chroma_top_left_ctb,
 1573|  34.9k|                                ps_sao->b5_cb_band_pos,
 1574|  34.9k|                                ps_sao->b5_cr_band_pos,
 1575|  34.9k|                                ai1_offset_cb,
 1576|  34.9k|                                ai1_offset_cr,
 1577|  34.9k|                                sao_wd_chroma,
 1578|  34.9k|                                sao_ht_chroma);
 1579|  34.9k|                        }
 1580|  46.3k|                        else
 1581|  46.3k|                        {
 1582|  46.3k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 1583|  46.3k|                                (UWORD16 *)pu1_src_chroma,
 1584|  46.3k|                                chroma_strd,
 1585|  46.3k|                                (UWORD16 *)pu1_src_left_chroma,
 1586|  46.3k|                                (UWORD16 *)pu1_src_top_chroma,
 1587|  46.3k|                                (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1588|  46.3k|                                ps_sao->b5_cb_band_pos,
 1589|  46.3k|                                ps_sao->b5_cr_band_pos,
 1590|  46.3k|                                ai1_offset_cb,
 1591|  46.3k|                                ai1_offset_cr,
 1592|  46.3k|                                sao_wd_chroma,
 1593|  46.3k|                                sao_ht_chroma,
 1594|  46.3k|                                u4_bit_depth_chroma);
 1595|  46.3k|                        }
 1596|  81.2k|                    }
 1597|   104k|                }
 1598|   181k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 1599|   181k|                {
 1600|   181k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 1601|   181k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 1602|   181k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 1603|   181k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 1604|       |
 1605|   181k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 1606|   181k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 1607|   181k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 1608|   181k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 1609|       |
 1610|  1.63M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1610:32): [True: 1.45M, False: 181k]
  ------------------
 1611|  1.45M|                    {
 1612|  1.45M|                        au1_avail_chroma[i] = 255;
 1613|  1.45M|                        au1_tile_slice_boundary[i] = 0;
 1614|  1.45M|                        au4_idx_t[i] = 0;
 1615|  1.45M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1616|  1.45M|                    }
 1617|       |
 1618|   181k|                    {
 1619|   181k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1619:28): [True: 12.3k, False: 168k]
  |  Branch (1619:75): [True: 33.0k, False: 135k]
  ------------------
 1620|  45.9k|                        {
 1621|  45.9k|                            ctbx_t_t = ps_sao_ctxt->i4_ctb_x;
 1622|  45.9k|                            ctby_t_t = ps_sao_ctxt->i4_ctb_y - 1;
 1623|       |
 1624|  45.9k|                            ctbx_t_l = ps_sao_ctxt->i4_ctb_x - 1;
 1625|  45.9k|                            ctby_t_l = ps_sao_ctxt->i4_ctb_y - 1;
 1626|       |
 1627|  45.9k|                            ctbx_t_r = ps_sao_ctxt->i4_ctb_x;
 1628|  45.9k|                            ctby_t_r = ps_sao_ctxt->i4_ctb_y - 1;
 1629|       |
 1630|  45.9k|                            ctbx_t_d =  ps_sao_ctxt->i4_ctb_x;
 1631|  45.9k|                            ctby_t_d =  ps_sao_ctxt->i4_ctb_y;
 1632|       |
 1633|  45.9k|                            ctbx_t = ps_sao_ctxt->i4_ctb_x;
 1634|  45.9k|                            ctby_t = ps_sao_ctxt->i4_ctb_y - 1;
 1635|       |
 1636|  45.9k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1636:32): [True: 12.9k, False: 33.0k]
  ------------------
 1637|  12.9k|                            {
 1638|  12.9k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1638:36): [True: 1.69k, False: 11.2k]
  ------------------
 1639|  1.69k|                                {
 1640|  1.69k|                                    au4_idx_t[0] = -1;
 1641|  1.69k|                                    au4_idx_t[6] = -1;
 1642|  1.69k|                                    au4_idx_t[4] = -1;
 1643|  1.69k|                                }
 1644|  11.2k|                                else
 1645|  11.2k|                                {
 1646|  11.2k|                                    au4_idx_t[0] = au4_idx_t[4] = pu1_slice_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1647|  11.2k|                                    au4_idx_t[6] = pu1_slice_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1648|  11.2k|                                }
 1649|  12.9k|                                idx_t   = pu1_slice_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1650|  12.9k|                                au4_idx_t[2] = au4_idx_t[5] = pu1_slice_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1651|  12.9k|                                au4_idx_t[1] = pu1_slice_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1652|  12.9k|                                au4_idx_t[3] = au4_idx_t[7] = pu1_slice_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1653|       |
 1654|       |                                /*Verify that the neighbor ctbs don't cross pic boundary.*/
 1655|       |
 1656|  12.9k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1656:36): [True: 1.69k, False: 11.2k]
  ------------------
 1657|  1.69k|                                {
 1658|  1.69k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 1659|  1.69k|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 1660|  1.69k|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 1661|  1.69k|                                }
 1662|  11.2k|                                else
 1663|  11.2k|                                {
 1664|  11.2k|                                    au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1665|  11.2k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_t[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1666|  11.2k|                                }
 1667|       |
 1668|  12.9k|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_t[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 1669|  12.9k|                                au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1670|  12.9k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_t[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1671|  12.9k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_t[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1672|  12.9k|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_t[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 1673|       |
 1674|  12.9k|                                if(idx_t > au4_idx_t[6])
  ------------------
  |  Branch (1674:36): [True: 1.70k, False: 11.2k]
  ------------------
 1675|  1.70k|                                {
 1676|  1.70k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1677|  1.70k|                                }
 1678|       |
 1679|       |                                /*
 1680|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 1681|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 1682|       |                                 */
 1683|   116k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1683:44): [True: 103k, False: 12.9k]
  ------------------
 1684|   103k|                                {
 1685|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 1686|   103k|                                    if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1686:40): [True: 8.67k, False: 94.6k]
  ------------------
 1687|  8.67k|                                    {
 1688|  8.67k|                                        au1_tile_slice_boundary[i] = 1;
 1689|  8.67k|                                    }
 1690|  94.6k|                                    else
 1691|  94.6k|                                    {
 1692|       |                                        /*Indicates that the neighbour belongs to same/dependent slice*/
 1693|  94.6k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 1694|  94.6k|                                    }
 1695|   103k|                                }
 1696|       |                                /*Reset indices*/
 1697|   116k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1697:44): [True: 103k, False: 12.9k]
  ------------------
 1698|   103k|                                {
 1699|   103k|                                    au4_idx_t[i] = 0;
 1700|   103k|                                }
 1701|  12.9k|                            }
 1702|  45.9k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1702:32): [True: 33.2k, False: 12.7k]
  ------------------
 1703|  33.2k|                            {
 1704|       |                                /* Calculate availability flags at slice boundary */
 1705|  33.2k|                                if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (1705:37): [True: 9.68k, False: 23.5k]
  |  Branch (1705:85): [True: 10.0k, False: 13.4k]
  |  Branch (1705:137): [True: 16.9k, False: 2.87k]
  |  Branch (1705:165): [True: 2.82k, False: 14.1k]
  ------------------
 1706|  16.9k|                                {
 1707|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1708|  16.9k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1708:40): [True: 15.8k, False: 1.17k]
  ------------------
 1709|  15.8k|                                    {
 1710|       |                                        /*Calculate neighbor ctb slice indices*/
 1711|  15.8k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1711:44): [True: 4.99k, False: 10.8k]
  ------------------
 1712|  4.99k|                                        {
 1713|  4.99k|                                            au4_idx_t[0] = -1;
 1714|  4.99k|                                            au4_idx_t[6] = -1;
 1715|  4.99k|                                            au4_idx_t[4] = -1;
 1716|  4.99k|                                        }
 1717|  10.8k|                                        else
 1718|  10.8k|                                        {
 1719|  10.8k|                                            au4_idx_t[0] = au4_idx_t[4] = pu1_tile_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1720|  10.8k|                                            au4_idx_t[6] = pu1_tile_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1721|  10.8k|                                        }
 1722|  15.8k|                                        idx_t   = pu1_tile_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1723|  15.8k|                                        au4_idx_t[2] = au4_idx_t[5] = pu1_tile_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1724|  15.8k|                                        au4_idx_t[1] = pu1_tile_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1725|  15.8k|                                        au4_idx_t[3] = au4_idx_t[7] = pu1_tile_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1726|       |
 1727|   142k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1727:52): [True: 126k, False: 15.8k]
  ------------------
 1728|   126k|                                        {
 1729|       |                                            /*Sets the edges that lie on the tile boundary*/
 1730|   126k|                                            if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1730:48): [True: 51.2k, False: 75.1k]
  ------------------
 1731|  51.2k|                                            {
 1732|  51.2k|                                                au1_tile_slice_boundary[i] |= 1;
 1733|  51.2k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 1734|  51.2k|                                            }
 1735|   126k|                                        }
 1736|  15.8k|                                    }
 1737|  16.9k|                                }
 1738|  33.2k|                            }
 1739|   413k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1739:40): [True: 367k, False: 45.9k]
  ------------------
 1740|   367k|                            {
 1741|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1742|   367k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1742:36): [True: 59.9k, False: 307k]
  |  Branch (1742:68): [True: 56.2k, False: 3.66k]
  ------------------
 1743|  56.2k|                                {
 1744|  56.2k|                                    au1_avail_chroma[i] = 0;
 1745|  56.2k|                                }
 1746|   367k|                            }
 1747|       |
 1748|  45.9k|                        }
 1749|   181k|                    }
 1750|   181k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1750:24): [True: 44.2k, False: 136k]
  ------------------
 1751|  44.2k|                    {
 1752|  44.2k|                        au1_avail_chroma[0] = 0;
 1753|  44.2k|                        au1_avail_chroma[4] = 0;
 1754|  44.2k|                        au1_avail_chroma[6] = 0;
 1755|  44.2k|                    }
 1756|       |
 1757|   181k|                    if(ps_sps->i2_pic_width_in_luma_samples * (chroma_pixel_strd / h_samp_factor) - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor)) <= sao_wd_chroma)
  ------------------
  |  Branch (1757:24): [True: 35.0k, False: 145k]
  ------------------
 1758|  35.0k|                    {
 1759|  35.0k|                        au1_avail_chroma[1] = 0;
 1760|  35.0k|                        au1_avail_chroma[5] = 0;
 1761|  35.0k|                        au1_avail_chroma[7] = 0;
 1762|  35.0k|                    }
 1763|       |
 1764|   181k|                    if(0 == ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) - sao_ht_chroma)
  ------------------
  |  Branch (1764:24): [True: 438, False: 180k]
  ------------------
 1765|    438|                    {
 1766|    438|                        au1_avail_chroma[2] = 0;
 1767|    438|                        au1_avail_chroma[4] = 0;
 1768|    438|                        au1_avail_chroma[5] = 0;
 1769|    438|                    }
 1770|       |
 1771|   181k|                    if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1771:24): [True: 0, False: 181k]
  ------------------
 1772|      0|                    {
 1773|      0|                        au1_avail_chroma[3] = 0;
 1774|      0|                        au1_avail_chroma[6] = 0;
 1775|      0|                        au1_avail_chroma[7] = 0;
 1776|      0|                    }
 1777|       |
 1778|   181k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   181k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1778:24): [True: 78.1k, False: 102k]
  ------------------
 1779|  78.1k|                    {
 1780|  78.1k|                        au1_src_top_right[0] = pu1_sao_src_top_left_chroma_top_right[0];
 1781|  78.1k|                        au1_src_top_right[1] = pu1_sao_src_top_left_chroma_top_right[1];
 1782|  78.1k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1783|  78.1k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1784|       |
 1785|  78.1k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1785:28): [True: 15.5k, False: 62.6k]
  ------------------
 1786|  15.5k|                        {
 1787|  15.5k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1788|  15.5k|                                                                         chroma_strd,
 1789|  15.5k|                                                                         pu1_src_left_chroma,
 1790|  15.5k|                                                                         pu1_src_top_chroma,
 1791|  15.5k|                                                                         pu1_sao_src_chroma_top_left_ctb,
 1792|  15.5k|                                                                         au1_src_top_right,
 1793|  15.5k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 1794|  15.5k|                                                                         au1_avail_chroma,
 1795|  15.5k|                                                                         ai1_offset_cr,
 1796|  15.5k|                                                                         ai1_offset_cb,
 1797|  15.5k|                                                                         sao_wd_chroma,
 1798|  15.5k|                                                                         sao_ht_chroma);
 1799|  15.5k|                        }
 1800|  62.6k|                        else
 1801|  62.6k|                        {
 1802|  62.6k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1803|  62.6k|                                                                         chroma_strd,
 1804|  62.6k|                                                                         pu1_src_left_chroma,
 1805|  62.6k|                                                                         pu1_src_top_chroma,
 1806|  62.6k|                                                                         pu1_sao_src_chroma_top_left_ctb,
 1807|  62.6k|                                                                         au1_src_top_right,
 1808|  62.6k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 1809|  62.6k|                                                                         au1_avail_chroma,
 1810|  62.6k|                                                                         ai1_offset_cb,
 1811|  62.6k|                                                                         ai1_offset_cr,
 1812|  62.6k|                                                                         sao_wd_chroma,
 1813|  62.6k|                                                                         sao_ht_chroma);
 1814|  62.6k|                        }
 1815|  78.1k|                    }
 1816|   102k|                    else
 1817|   102k|                    {
 1818|   102k|                        UWORD16 *pu2_sao_src_top_left_chroma_top_right = (UWORD16 *)pu1_sao_src_top_left_chroma_top_right;
 1819|   102k|                        UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 1820|       |
 1821|   102k|                        au2_src_top_right[0] = pu2_sao_src_top_left_chroma_top_right[0];
 1822|   102k|                        au2_src_top_right[1] = pu2_sao_src_top_left_chroma_top_right[1];
 1823|   102k|                        au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 2];
 1824|   102k|                        au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 1];
 1825|       |
 1826|   102k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1826:28): [True: 57.0k, False: 45.8k]
  ------------------
 1827|  57.0k|                        {
 1828|  57.0k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1829|  57.0k|                                                                             chroma_strd,
 1830|  57.0k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 1831|  57.0k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 1832|  57.0k|                                                                             (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1833|  57.0k|                                                                             au2_src_top_right,
 1834|  57.0k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 1835|  57.0k|                                                                             au1_avail_chroma,
 1836|  57.0k|                                                                             ai1_offset_cr,
 1837|  57.0k|                                                                             ai1_offset_cb,
 1838|  57.0k|                                                                             sao_wd_chroma,
 1839|  57.0k|                                                                             sao_ht_chroma,
 1840|  57.0k|                                                                             u4_bit_depth_chroma);
 1841|  57.0k|                        }
 1842|  45.8k|                        else
 1843|  45.8k|                        {
 1844|  45.8k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 1845|  45.8k|                                                                             chroma_strd,
 1846|  45.8k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 1847|  45.8k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 1848|  45.8k|                                                                             (UWORD16 *)pu1_sao_src_chroma_top_left_ctb,
 1849|  45.8k|                                                                             au2_src_top_right,
 1850|  45.8k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 1851|  45.8k|                                                                             au1_avail_chroma,
 1852|  45.8k|                                                                             ai1_offset_cb,
 1853|  45.8k|                                                                             ai1_offset_cr,
 1854|  45.8k|                                                                             sao_wd_chroma,
 1855|  45.8k|                                                                             sao_ht_chroma,
 1856|  45.8k|                                                                             u4_bit_depth_chroma);
 1857|  45.8k|                        }
 1858|   102k|                    }
 1859|       |
 1860|   181k|                }
 1861|  3.03M|            }
 1862|  4.77M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1862:21): [True: 809k, False: 3.96M]
  |  Branch (1862:68): [True: 1.12M, False: 2.83M]
  ------------------
 1863|  1.93M|            {
 1864|  1.93M|                UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_chroma_top_left_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  1.93M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  1.93M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  1.93M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 1.92M, False: 6.57k]
  |  |  ------------------
  |  |  101|  17.3M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 15.3M, False: 1.92M]
  |  |  ------------------
  |  |  102|  15.3M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  15.3M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  15.3M|        } \
  |  |  105|  1.92M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  1.92M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  1.92M|    } else { \
  |  |  108|  6.57k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  6.57k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  6.57k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  6.57k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  59.4k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 52.8k, False: 6.57k]
  |  |  ------------------
  |  |  113|  52.8k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  52.8k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  52.8k|        } \
  |  |  116|  6.57k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  6.57k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  6.57k|    } \
  |  |  119|  1.93M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  1.93M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 1.93M]
  |  |  ------------------
  ------------------
 1865|  1.93M|            }
 1866|  7.80M|        }
 1867|       |
 1868|  18.3M|        pu1_src_luma += sao_ht_luma * src_strd * pixel_size_y;
 1869|  18.3M|        pu1_src_chroma += sao_ht_chroma * chroma_strd * pixel_size_uv;
 1870|  18.3M|        ps_sao += (ps_sps->i2_pic_wd_in_ctb);
 1871|  18.3M|    }
 1872|       |
 1873|       |    /* Left CTB */
 1874|  19.3M|    if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (1874:8): [True: 18.0M, False: 1.32M]
  ------------------
 1875|  18.0M|    {
 1876|  18.0M|        WORD32 sao_wd_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.0M|#define SAO_SHIFT_CTB    8
  ------------------
 1877|  18.0M|        WORD32 sao_wd_chroma = 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.0M|#define SAO_SHIFT_CTB    8
  ------------------
 1878|  18.0M|        WORD32 sao_ht_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.0M|#define SAO_SHIFT_CTB    8
  ------------------
 1879|  18.0M|        WORD32 sao_ht_chroma = (ctb_size / v_samp_factor) - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  18.0M|#define SAO_SHIFT_CTB    8
  ------------------
 1880|       |
 1881|  18.0M|        WORD32 ctbx_l_t = 0, ctbx_l_l = 0, ctbx_l_r = 0, ctbx_l_d = 0, ctbx_l = 0;
 1882|  18.0M|        WORD32 ctby_l_t = 0, ctby_l_l = 0, ctby_l_r = 0, ctby_l_d = 0, ctby_l = 0;
 1883|  18.0M|        WORD32 au4_idx_l[8], idx_l;
 1884|       |
 1885|  18.0M|        WORD32 remaining_rows;
 1886|  18.0M|        slice_header_t *ps_slice_hdr_left;
 1887|  18.0M|        {
 1888|  18.0M|            WORD32 left_ctb_indx = (ps_sao_ctxt->i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb +
 1889|  18.0M|                                        (ps_sao_ctxt->i4_ctb_x - 1);
 1890|  18.0M|            ps_slice_hdr_left = ps_slice_hdr_base + pu1_slice_idx[left_ctb_indx];
 1891|  18.0M|        }
 1892|       |
 1893|  18.0M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + sao_ht_luma);
 1894|  18.0M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  18.0M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1894:12): [True: 686k, False: 17.3M]
  ------------------
 1895|   686k|        {
 1896|   686k|            sao_ht_luma += remaining_rows;
 1897|   686k|        }
 1898|  18.0M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples / v_samp_factor - (((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) + sao_ht_chroma);
 1899|  18.0M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  18.0M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1899:12): [True: 686k, False: 17.3M]
  ------------------
 1900|   686k|        {
 1901|   686k|            sao_ht_chroma += remaining_rows;
 1902|   686k|        }
 1903|       |
 1904|  18.0M|        pu1_src_luma -= sao_wd_luma * pixel_size_y;
 1905|  18.0M|        pu1_src_chroma -= sao_wd_chroma * pixel_size_uv;
 1906|  18.0M|        ps_sao -= 1;
 1907|  18.0M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma) * pixel_size_y;
 1908|  18.0M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor) - sao_wd_chroma) * pixel_size_uv;
 1909|  18.0M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) * pixel_size_y);
 1910|  18.0M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) * (chroma_pixel_strd / v_samp_factor) * pixel_size_uv);
 1911|       |
 1912|       |
 1913|  18.0M|        if(0 != sao_ht_luma)
  ------------------
  |  Branch (1913:12): [True: 18.0M, False: 18.4E]
  ------------------
 1914|  18.0M|        {
 1915|  18.0M|            if(ps_slice_hdr_left->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (1915:16): [True: 6.27M, False: 11.7M]
  ------------------
 1916|  6.27M|            {
 1917|  6.27M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1917:20): [True: 5.98M, False: 285k]
  ------------------
 1918|  5.98M|                {
 1919|  5.98M|                    UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_top_left_luma_curr_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  5.98M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  5.98M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  5.98M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 5.52M, False: 459k]
  |  |  ------------------
  |  |   82|  98.7M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 93.2M, False: 5.52M]
  |  |  ------------------
  |  |   83|  93.2M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  93.2M|        } \
  |  |   85|  5.52M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  5.52M|    } else { \
  |  |   87|   459k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   459k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   459k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   459k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  20.0M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 19.5M, False: 459k]
  |  |  ------------------
  |  |   92|  19.5M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  19.5M|        } \
  |  |   94|   459k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   459k|    } \
  |  |   96|  5.98M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  5.98M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 5.98M]
  |  |  ------------------
  ------------------
 1920|  5.98M|                }
 1921|       |
 1922|   285k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1922:25): [True: 140k, False: 144k]
  ------------------
 1923|   140k|                {
 1924|   140k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1925|   140k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1926|   140k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1927|   140k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1928|       |
 1929|   140k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   140k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1929:24): [True: 61.7k, False: 79.2k]
  ------------------
 1930|  61.7k|                    {
 1931|  61.7k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
 1932|  61.7k|                            pu1_src_luma,
 1933|  61.7k|                            src_strd,
 1934|  61.7k|                            pu1_src_left_luma,
 1935|  61.7k|                            pu1_src_top_luma,
 1936|  61.7k|                            pu1_sao_src_top_left_luma_curr_ctb,
 1937|  61.7k|                            ps_sao->b5_y_band_pos,
 1938|  61.7k|                            ai1_offset_y,
 1939|  61.7k|                            sao_wd_luma,
 1940|  61.7k|                            sao_ht_luma);
 1941|  61.7k|                    }
 1942|  79.2k|                    else
 1943|  79.2k|                    {
 1944|  79.2k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
 1945|  79.2k|                            (UWORD16 *)pu1_src_luma,
 1946|  79.2k|                            src_strd,
 1947|  79.2k|                            (UWORD16 *)pu1_src_left_luma,
 1948|  79.2k|                            (UWORD16 *)pu1_src_top_luma,
 1949|  79.2k|                            (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 1950|  79.2k|                            ps_sao->b5_y_band_pos,
 1951|  79.2k|                            ai1_offset_y,
 1952|  79.2k|                            sao_wd_luma,
 1953|  79.2k|                            sao_ht_luma,
 1954|  79.2k|                            u4_bit_depth_luma);
 1955|  79.2k|                    }
 1956|   140k|                }
 1957|       |
 1958|   144k|                else // if(2 <= ps_sao->b3_y_type_idx)
 1959|   144k|                {
 1960|   144k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 1961|   144k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 1962|   144k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 1963|   144k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 1964|       |
 1965|  1.31M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1965:32): [True: 1.17M, False: 144k]
  ------------------
 1966|  1.17M|                    {
 1967|  1.17M|                        au1_avail_luma[i] = 255;
 1968|  1.17M|                        au1_tile_slice_boundary[i] = 0;
 1969|  1.17M|                        au4_idx_l[i] = 0;
 1970|  1.17M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1971|  1.17M|                    }
 1972|       |                    /******************************************************************
 1973|       |                     * Derive the  Top-left CTB's neighbour pixel's slice indices.
 1974|       |                     *
 1975|       |                     *
 1976|       |                     *          ____________
 1977|       |                     *         |    |       |
 1978|       |                     *         | L_T|       |
 1979|       |                     *         |____|_______|____
 1980|       |                     *         |    |       |    |
 1981|       |                     *     L_L |  L |  L_R  |    |
 1982|       |                     *         |____|_______|    |
 1983|       |                     *              |            |
 1984|       |                     *          L_D |            |
 1985|       |                     *              |____________|
 1986|       |                     *
 1987|       |                     *****************************************************************/
 1988|       |
 1989|       |                    /*In case of slices or tiles*/
 1990|   144k|                    {
 1991|   144k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1991:28): [True: 12.0k, False: 132k]
  |  Branch (1991:75): [True: 30.7k, False: 102k]
  ------------------
 1992|  44.6k|                        {
 1993|  44.6k|                            ctbx_l_t = ps_sao_ctxt->i4_ctb_x - 1;
 1994|  44.6k|                            ctby_l_t = ps_sao_ctxt->i4_ctb_y - 1;
 1995|       |
 1996|  44.6k|                            ctbx_l_l = ps_sao_ctxt->i4_ctb_x - 1;
 1997|  44.6k|                            ctby_l_l = ps_sao_ctxt->i4_ctb_y;
 1998|       |
 1999|  44.6k|                            ctbx_l_r = ps_sao_ctxt->i4_ctb_x;
 2000|  44.6k|                            ctby_l_r = ps_sao_ctxt->i4_ctb_y;
 2001|       |
 2002|  44.6k|                            ctbx_l_d =  ps_sao_ctxt->i4_ctb_x - 1;
 2003|  44.6k|                            ctby_l_d =  ps_sao_ctxt->i4_ctb_y;
 2004|       |
 2005|  44.6k|                            ctbx_l = ps_sao_ctxt->i4_ctb_x - 1;
 2006|  44.6k|                            ctby_l = ps_sao_ctxt->i4_ctb_y;
 2007|       |
 2008|  44.6k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2008:32): [True: 13.8k, False: 30.7k]
  ------------------
 2009|  13.8k|                            {
 2010|  13.8k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2010:36): [True: 1.67k, False: 12.2k]
  ------------------
 2011|  1.67k|                                {
 2012|  1.67k|                                    au4_idx_l[2] = -1;
 2013|  1.67k|                                    au4_idx_l[4] = -1;
 2014|  1.67k|                                    au4_idx_l[5] = -1;
 2015|  1.67k|                                }
 2016|  12.2k|                                else
 2017|  12.2k|                                {
 2018|  12.2k|                                    au4_idx_l[2] = au4_idx_l[4] = pu1_slice_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2019|  12.2k|                                    au4_idx_l[5] =  pu1_slice_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2020|  12.2k|                                }
 2021|  13.8k|                                idx_l   = au4_idx_l[6] = pu1_slice_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2022|  13.8k|                                au4_idx_l[0] = pu1_slice_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2023|  13.8k|                                au4_idx_l[1] = au4_idx_l[7] = pu1_slice_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2024|  13.8k|                                au4_idx_l[3] = pu1_slice_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2025|       |
 2026|       |                                /*Verify that the neighbor ctbs don't cross pic boundary.*/
 2027|  13.8k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2027:36): [True: 1.67k, False: 12.2k]
  ------------------
 2028|  1.67k|                                {
 2029|  1.67k|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2030|  1.67k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2031|  1.67k|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2032|  1.67k|                                }
 2033|  12.2k|                                else
 2034|  12.2k|                                {
 2035|  12.2k|                                    au4_ilf_across_tile_slice_enable[2] =  (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2036|  12.2k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2037|       |
 2038|  12.2k|                                }
 2039|       |                                //TODO: ILF flag checks for [0] and [6] is missing.
 2040|  13.8k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_l[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2041|  13.8k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_l[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2042|  13.8k|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_l[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 2043|       |
 2044|  13.8k|                                if(idx_l < au4_idx_l[5])
  ------------------
  |  Branch (2044:36): [True: 445, False: 13.4k]
  ------------------
 2045|    445|                                {
 2046|    445|                                    au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_l[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 2047|    445|                                }
 2048|       |
 2049|       |                                /*
 2050|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 2051|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 2052|       |                                 */
 2053|   124k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2053:44): [True: 111k, False: 13.8k]
  ------------------
 2054|   111k|                                {
 2055|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2056|   111k|                                    if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2056:40): [True: 14.6k, False: 96.4k]
  ------------------
 2057|  14.6k|                                    {
 2058|  14.6k|                                        au1_tile_slice_boundary[i] = 1;
 2059|  14.6k|                                    }
 2060|  96.4k|                                    else
 2061|  96.4k|                                    {
 2062|  96.4k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2063|  96.4k|                                    }
 2064|   111k|                                }
 2065|       |                                /*Reset indices*/
 2066|   124k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2066:44): [True: 111k, False: 13.8k]
  ------------------
 2067|   111k|                                {
 2068|   111k|                                    au4_idx_l[i] = 0;
 2069|   111k|                                }
 2070|  13.8k|                            }
 2071|       |
 2072|  44.6k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2072:32): [True: 31.2k, False: 13.3k]
  ------------------
 2073|  31.2k|                            {
 2074|       |                                /* Calculate availability flags at slice boundary */
 2075|  31.2k|                                if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (2075:37): [True: 3.09k, False: 28.1k]
  |  Branch (2075:85): [True: 13.5k, False: 14.5k]
  |  Branch (2075:137): [True: 11.0k, False: 5.64k]
  |  Branch (2075:165): [True: 5.70k, False: 5.34k]
  ------------------
 2076|  10.9k|                                {
 2077|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2078|  10.9k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2078:40): [True: 9.79k, False: 1.18k]
  ------------------
 2079|  9.79k|                                    {
 2080|  9.79k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2080:44): [True: 1.54k, False: 8.25k]
  ------------------
 2081|  1.54k|                                        {
 2082|  1.54k|                                            au4_idx_l[2] = -1;
 2083|  1.54k|                                            au4_idx_l[4] = -1;
 2084|  1.54k|                                            au4_idx_l[5] = -1;
 2085|  1.54k|                                        }
 2086|  8.25k|                                        else
 2087|  8.25k|                                        {
 2088|  8.25k|                                            au4_idx_l[2] = au4_idx_l[4] = pu1_tile_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2089|  8.25k|                                            au4_idx_l[5] =  pu1_tile_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2090|  8.25k|                                        }
 2091|       |
 2092|  9.79k|                                        idx_l   = au4_idx_l[6] = pu1_tile_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2093|  9.79k|                                        au4_idx_l[0] = pu1_tile_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2094|  9.79k|                                        au4_idx_l[1] = au4_idx_l[7] = pu1_tile_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2095|  9.79k|                                        au4_idx_l[3] = pu1_tile_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2096|       |
 2097|  88.1k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2097:52): [True: 78.3k, False: 9.79k]
  ------------------
 2098|  78.3k|                                        {
 2099|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2100|  78.3k|                                            if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2100:48): [True: 30.4k, False: 47.8k]
  ------------------
 2101|  30.4k|                                            {
 2102|  30.4k|                                                au1_tile_slice_boundary[i] |= 1;
 2103|  30.4k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 2104|  30.4k|                                            }
 2105|  78.3k|                                        }
 2106|  9.79k|                                    }
 2107|  10.9k|                                }
 2108|  31.2k|                            }
 2109|       |
 2110|   401k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2110:40): [True: 356k, False: 44.6k]
  ------------------
 2111|   356k|                            {
 2112|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2113|   356k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2113:36): [True: 45.0k, False: 311k]
  |  Branch (2113:68): [True: 36.2k, False: 8.87k]
  ------------------
 2114|  36.2k|                                {
 2115|  36.2k|                                    au1_avail_luma[i] = 0;
 2116|  36.2k|                                }
 2117|   356k|                            }
 2118|  44.6k|                        }
 2119|   144k|                    }
 2120|   144k|                    if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma)
  ------------------
  |  Branch (2120:24): [True: 0, False: 144k]
  ------------------
 2121|      0|                    {
 2122|      0|                        au1_avail_luma[0] = 0;
 2123|      0|                        au1_avail_luma[4] = 0;
 2124|      0|                        au1_avail_luma[6] = 0;
 2125|      0|                    }
 2126|   144k|                    if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2126:24): [True: 0, False: 144k]
  ------------------
 2127|      0|                    {
 2128|      0|                        au1_avail_luma[1] = 0;
 2129|      0|                        au1_avail_luma[5] = 0;
 2130|      0|                        au1_avail_luma[7] = 0;
 2131|      0|                    }
 2132|       |
 2133|   144k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2133:24): [True: 35.1k, False: 109k]
  ------------------
 2134|  35.1k|                    {
 2135|  35.1k|                        au1_avail_luma[2] = 0;
 2136|  35.1k|                        au1_avail_luma[4] = 0;
 2137|  35.1k|                        au1_avail_luma[5] = 0;
 2138|  35.1k|                    }
 2139|       |
 2140|   144k|                    if(ps_sps->i2_pic_height_in_luma_samples - (ps_sao_ctxt->i4_ctb_y  << log2_ctb_size) <= sao_ht_luma)
  ------------------
  |  Branch (2140:24): [True: 8.57k, False: 136k]
  ------------------
 2141|  8.57k|                    {
 2142|  8.57k|                        au1_avail_luma[3] = 0;
 2143|  8.57k|                        au1_avail_luma[6] = 0;
 2144|  8.57k|                        au1_avail_luma[7] = 0;
 2145|  8.57k|                    }
 2146|       |
 2147|   144k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   144k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2147:24): [True: 78.0k, False: 66.7k]
  ------------------
 2148|  78.0k|                    {
 2149|  78.0k|                        au1_src_top_right[0] = pu1_src_top_luma[sao_wd_luma];
 2150|  78.0k|                        u1_sao_src_top_left_luma_bot_left = pu1_sao_src_top_left_luma_bot_left[0];
 2151|  78.0k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 2152|  78.0k|                                                                  src_strd,
 2153|  78.0k|                                                                  pu1_src_left_luma,
 2154|  78.0k|                                                                  pu1_src_top_luma,
 2155|  78.0k|                                                                  pu1_sao_src_top_left_luma_curr_ctb,
 2156|  78.0k|                                                                  au1_src_top_right,
 2157|  78.0k|                                                                  &u1_sao_src_top_left_luma_bot_left,
 2158|  78.0k|                                                                  au1_avail_luma,
 2159|  78.0k|                                                                  ai1_offset_y,
 2160|  78.0k|                                                                  sao_wd_luma,
 2161|  78.0k|                                                                  sao_ht_luma);
 2162|  78.0k|                    }
 2163|  66.7k|                    else
 2164|  66.7k|                    {
 2165|  66.7k|                        UWORD16 *pu2_src_top_luma = (UWORD16 *)pu1_src_top_luma;
 2166|  66.7k|                        UWORD16 *pu2_sao_src_top_left_luma_bot_left = (UWORD16 *)pu1_sao_src_top_left_luma_bot_left;
 2167|  66.7k|                        au2_src_top_right[0] = pu2_src_top_luma[sao_wd_luma];
 2168|  66.7k|                        u2_sao_src_top_left_luma_bot_left = pu2_sao_src_top_left_luma_bot_left[0];
 2169|  66.7k|                        ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
 2170|  66.7k|                                                                      src_strd,
 2171|  66.7k|                                                                      (UWORD16 *)pu1_src_left_luma,
 2172|  66.7k|                                                                      (UWORD16 *)pu1_src_top_luma,
 2173|  66.7k|                                                                      (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 2174|  66.7k|                                                                      au2_src_top_right,
 2175|  66.7k|                                                                      &u2_sao_src_top_left_luma_bot_left,
 2176|  66.7k|                                                                      au1_avail_luma,
 2177|  66.7k|                                                                      ai1_offset_y,
 2178|  66.7k|                                                                      sao_wd_luma,
 2179|  66.7k|                                                                      sao_ht_luma,
 2180|  66.7k|                                                                      u4_bit_depth_luma);
 2181|  66.7k|                    }
 2182|       |
 2183|   144k|                }
 2184|  6.27M|            }
 2185|  11.7M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2185:21): [True: 4.30M, False: 7.44M]
  |  Branch (2185:68): [True: 1.88M, False: 5.55M]
  ------------------
 2186|  6.18M|            {
 2187|  6.18M|                UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_top_left_luma_curr_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  6.18M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  6.18M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  6.18M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 6.13M, False: 54.8k]
  |  |  ------------------
  |  |   82|  98.6M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 92.4M, False: 6.13M]
  |  |  ------------------
  |  |   83|  92.4M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  92.4M|        } \
  |  |   85|  6.13M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  6.13M|    } else { \
  |  |   87|  54.8k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|  54.8k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|  54.8k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|  54.8k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  2.35M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 2.29M, False: 54.8k]
  |  |  ------------------
  |  |   92|  2.29M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  2.29M|        } \
  |  |   94|  54.8k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|  54.8k|    } \
  |  |   96|  6.18M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  6.18M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 6.18M]
  |  |  ------------------
  ------------------
 2188|  6.18M|            }
 2189|  18.0M|        }
 2190|       |
 2191|  18.0M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 != sao_ht_chroma)
  ------------------
  |  Branch (2191:12): [True: 17.9M, False: 22.8k]
  |  Branch (2191:73): [True: 7.58M, False: 10.3M]
  ------------------
 2192|  7.58M|        {
 2193|  7.58M|            if(ps_slice_hdr_left->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (2193:16): [True: 3.21M, False: 4.36M]
  ------------------
 2194|  3.21M|            {
 2195|  3.21M|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2195:20): [True: 2.96M, False: 256k]
  ------------------
 2196|  2.96M|                {
 2197|  2.96M|                    UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_top_left_chroma_curr_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  2.96M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  2.96M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  2.96M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 2.47M, False: 483k]
  |  |  ------------------
  |  |  101|  45.2M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 42.7M, False: 2.47M]
  |  |  ------------------
  |  |  102|  42.7M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  42.7M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  42.7M|        } \
  |  |  105|  2.47M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  2.47M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  2.47M|    } else { \
  |  |  108|   483k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   483k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   483k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   483k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  22.3M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 21.8M, False: 483k]
  |  |  ------------------
  |  |  113|  21.8M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  21.8M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  21.8M|        } \
  |  |  116|   483k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   483k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   483k|    } \
  |  |  119|  2.96M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  2.96M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 2.96M]
  |  |  ------------------
  ------------------
 2198|  2.96M|                }
 2199|       |
 2200|   256k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2200:25): [True: 97.1k, False: 159k]
  ------------------
 2201|  97.1k|                {
 2202|  97.1k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 2203|  97.1k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 2204|  97.1k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 2205|  97.1k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 2206|       |
 2207|  97.1k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 2208|  97.1k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 2209|  97.1k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 2210|  97.1k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 2211|       |
 2212|  97.1k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2212:24): [True: 18.5k, False: 78.5k]
  ------------------
 2213|  18.5k|                    {
 2214|  18.5k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  18.5k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2214:28): [True: 6.87k, False: 11.6k]
  ------------------
 2215|  6.87k|                        {
 2216|  6.87k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 2217|  6.87k|                                pu1_src_chroma,
 2218|  6.87k|                                chroma_strd,
 2219|  6.87k|                                pu1_src_left_chroma,
 2220|  6.87k|                                pu1_src_top_chroma,
 2221|  6.87k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 2222|  6.87k|                                ps_sao->b5_cr_band_pos,
 2223|  6.87k|                                ps_sao->b5_cb_band_pos,
 2224|  6.87k|                                ai1_offset_cr,
 2225|  6.87k|                                ai1_offset_cb,
 2226|  6.87k|                                sao_wd_chroma,
 2227|  6.87k|                                sao_ht_chroma);
 2228|  6.87k|                        }
 2229|  11.6k|                        else
 2230|  11.6k|                        {
 2231|  11.6k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 2232|  11.6k|                                (UWORD16 *)pu1_src_chroma,
 2233|  11.6k|                                chroma_strd,
 2234|  11.6k|                                (UWORD16 *)pu1_src_left_chroma,
 2235|  11.6k|                                (UWORD16 *)pu1_src_top_chroma,
 2236|  11.6k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2237|  11.6k|                                ps_sao->b5_cr_band_pos,
 2238|  11.6k|                                ps_sao->b5_cb_band_pos,
 2239|  11.6k|                                ai1_offset_cr,
 2240|  11.6k|                                ai1_offset_cb,
 2241|  11.6k|                                sao_wd_chroma,
 2242|  11.6k|                                sao_ht_chroma,
 2243|  11.6k|                                u4_bit_depth_chroma);
 2244|  11.6k|                        }
 2245|  18.5k|                    }
 2246|  78.5k|                    else
 2247|  78.5k|                    {
 2248|  78.5k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  78.5k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2248:28): [True: 33.0k, False: 45.5k]
  ------------------
 2249|  33.0k|                        {
 2250|  33.0k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 2251|  33.0k|                                pu1_src_chroma,
 2252|  33.0k|                                chroma_strd,
 2253|  33.0k|                                pu1_src_left_chroma,
 2254|  33.0k|                                pu1_src_top_chroma,
 2255|  33.0k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 2256|  33.0k|                                ps_sao->b5_cb_band_pos,
 2257|  33.0k|                                ps_sao->b5_cr_band_pos,
 2258|  33.0k|                                ai1_offset_cb,
 2259|  33.0k|                                ai1_offset_cr,
 2260|  33.0k|                                sao_wd_chroma,
 2261|  33.0k|                                sao_ht_chroma);
 2262|  33.0k|                        }
 2263|  45.5k|                        else
 2264|  45.5k|                        {
 2265|  45.5k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 2266|  45.5k|                                (UWORD16 *)pu1_src_chroma,
 2267|  45.5k|                                chroma_strd,
 2268|  45.5k|                                (UWORD16 *)pu1_src_left_chroma,
 2269|  45.5k|                                (UWORD16 *)pu1_src_top_chroma,
 2270|  45.5k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2271|  45.5k|                                ps_sao->b5_cb_band_pos,
 2272|  45.5k|                                ps_sao->b5_cr_band_pos,
 2273|  45.5k|                                ai1_offset_cb,
 2274|  45.5k|                                ai1_offset_cr,
 2275|  45.5k|                                sao_wd_chroma,
 2276|  45.5k|                                sao_ht_chroma,
 2277|  45.5k|                                u4_bit_depth_chroma);
 2278|  45.5k|                        }
 2279|  78.5k|                    }
 2280|  97.1k|                }
 2281|       |
 2282|   159k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 2283|   159k|                {
 2284|   159k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 2285|   159k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 2286|   159k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 2287|   159k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 2288|       |
 2289|   159k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 2290|   159k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 2291|   159k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 2292|   159k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 2293|       |
 2294|  1.43M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2294:32): [True: 1.27M, False: 159k]
  ------------------
 2295|  1.27M|                    {
 2296|  1.27M|                        au1_avail_chroma[i] = 255;
 2297|  1.27M|                        au1_tile_slice_boundary[i] = 0;
 2298|  1.27M|                        au4_idx_l[i] = 0;
 2299|  1.27M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2300|  1.27M|                    }
 2301|       |                    /*In case of slices*/
 2302|   159k|                    {
 2303|   159k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2303:28): [True: 13.3k, False: 145k]
  |  Branch (2303:75): [True: 26.9k, False: 119k]
  ------------------
 2304|  40.2k|                        {
 2305|  40.2k|                            ctbx_l_t = ps_sao_ctxt->i4_ctb_x - 1;
 2306|  40.2k|                            ctby_l_t = ps_sao_ctxt->i4_ctb_y - 1;
 2307|       |
 2308|  40.2k|                            ctbx_l_l = ps_sao_ctxt->i4_ctb_x - 1;
 2309|  40.2k|                            ctby_l_l = ps_sao_ctxt->i4_ctb_y;
 2310|       |
 2311|  40.2k|                            ctbx_l_r = ps_sao_ctxt->i4_ctb_x;
 2312|  40.2k|                            ctby_l_r = ps_sao_ctxt->i4_ctb_y;
 2313|       |
 2314|  40.2k|                            ctbx_l_d =  ps_sao_ctxt->i4_ctb_x - 1;
 2315|  40.2k|                            ctby_l_d =  ps_sao_ctxt->i4_ctb_y;
 2316|       |
 2317|  40.2k|                            ctbx_l = ps_sao_ctxt->i4_ctb_x - 1;
 2318|  40.2k|                            ctby_l = ps_sao_ctxt->i4_ctb_y;
 2319|       |
 2320|  40.2k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2320:32): [True: 13.3k, False: 26.9k]
  ------------------
 2321|  13.3k|                            {
 2322|  13.3k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2322:36): [True: 335, False: 12.9k]
  ------------------
 2323|    335|                                {
 2324|    335|                                    au4_idx_l[2] = -1;
 2325|    335|                                    au4_idx_l[4] = -1;
 2326|    335|                                    au4_idx_l[5] = -1;
 2327|    335|                                }
 2328|  12.9k|                                else
 2329|  12.9k|                                {
 2330|  12.9k|                                    au4_idx_l[2] = au4_idx_l[4] = pu1_slice_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2331|  12.9k|                                    au4_idx_l[5] =  pu1_slice_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2332|  12.9k|                                }
 2333|  13.3k|                                idx_l   = au4_idx_l[6] = pu1_slice_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2334|  13.3k|                                au4_idx_l[0] = pu1_slice_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2335|  13.3k|                                au4_idx_l[1] = au4_idx_l[7] = pu1_slice_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2336|  13.3k|                                au4_idx_l[3] = pu1_slice_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2337|       |
 2338|       |                                /*Verify that the neighbour ctbs dont cross pic boundary.*/
 2339|  13.3k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2339:36): [True: 335, False: 12.9k]
  ------------------
 2340|    335|                                {
 2341|    335|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2342|    335|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2343|    335|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2344|    335|                                }
 2345|  12.9k|                                else
 2346|  12.9k|                                {
 2347|  12.9k|                                    au4_ilf_across_tile_slice_enable[2] =  (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2348|  12.9k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2349|  12.9k|                                }
 2350|       |
 2351|  13.3k|                                if(au4_idx_l[5] > idx_l)
  ------------------
  |  Branch (2351:36): [True: 663, False: 12.6k]
  ------------------
 2352|    663|                                {
 2353|    663|                                    au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_l[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 2354|    663|                                }
 2355|       |
 2356|       |                                //  au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2357|  13.3k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_l[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2358|  13.3k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_l[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2359|  13.3k|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_l[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 2360|       |                                /*
 2361|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 2362|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 2363|       |                                 */
 2364|   119k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2364:44): [True: 106k, False: 13.3k]
  ------------------
 2365|   106k|                                {
 2366|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2367|   106k|                                    if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2367:40): [True: 9.33k, False: 97.3k]
  ------------------
 2368|  9.33k|                                    {
 2369|  9.33k|                                        au1_tile_slice_boundary[i] = 1;
 2370|  9.33k|                                    }
 2371|  97.3k|                                    else
 2372|  97.3k|                                    {
 2373|  97.3k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2374|  97.3k|                                    }
 2375|   106k|                                }
 2376|       |                                /*Reset indices*/
 2377|   120k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2377:44): [True: 106k, False: 13.3k]
  ------------------
 2378|   106k|                                {
 2379|   106k|                                    au4_idx_l[i] = 0;
 2380|   106k|                                }
 2381|  13.3k|                            }
 2382|  40.2k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2382:32): [True: 27.8k, False: 12.4k]
  ------------------
 2383|  27.8k|                            {
 2384|       |                                /* Calculate availability flags at slice boundary */
 2385|  27.8k|                                if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (2385:37): [True: 2.98k, False: 24.8k]
  |  Branch (2385:85): [True: 13.8k, False: 10.9k]
  |  Branch (2385:137): [True: 11.5k, False: 5.33k]
  |  Branch (2385:165): [True: 6.17k, False: 5.33k]
  ------------------
 2386|  10.6k|                                {
 2387|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2388|  10.6k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2388:40): [True: 9.23k, False: 1.42k]
  ------------------
 2389|  9.23k|                                    {
 2390|  9.23k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2390:44): [True: 1.22k, False: 8.00k]
  ------------------
 2391|  1.22k|                                        {
 2392|  1.22k|                                            au4_idx_l[2] = -1;
 2393|  1.22k|                                            au4_idx_l[4] = -1;
 2394|  1.22k|                                            au4_idx_l[5] = -1;
 2395|  1.22k|                                        }
 2396|  8.00k|                                        else
 2397|  8.00k|                                        {
 2398|  8.00k|                                            au4_idx_l[2] = au4_idx_l[4] = pu1_tile_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2399|  8.00k|                                            au4_idx_l[5] =  pu1_tile_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2400|  8.00k|                                        }
 2401|       |
 2402|  9.23k|                                        idx_l   = au4_idx_l[6] = pu1_tile_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2403|  9.23k|                                        au4_idx_l[0] = pu1_tile_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2404|  9.23k|                                        au4_idx_l[1] = au4_idx_l[7] = pu1_tile_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2405|  9.23k|                                        au4_idx_l[3] = pu1_tile_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2406|       |
 2407|  83.0k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2407:52): [True: 73.8k, False: 9.23k]
  ------------------
 2408|  73.8k|                                        {
 2409|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2410|  73.8k|                                            if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2410:48): [True: 28.6k, False: 45.2k]
  ------------------
 2411|  28.6k|                                            {
 2412|  28.6k|                                                au1_tile_slice_boundary[i] |= 1;
 2413|  28.6k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 2414|  28.6k|                                            }
 2415|  73.8k|                                        }
 2416|  9.23k|                                    }
 2417|  10.6k|                                }
 2418|  27.8k|                            }
 2419|   362k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2419:40): [True: 322k, False: 40.2k]
  ------------------
 2420|   322k|                            {
 2421|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2422|   322k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2422:36): [True: 37.9k, False: 284k]
  |  Branch (2422:68): [True: 30.5k, False: 7.37k]
  ------------------
 2423|  30.5k|                                {
 2424|  30.5k|                                    au1_avail_chroma[i] = 0;
 2425|  30.5k|                                }
 2426|   322k|                            }
 2427|  40.2k|                        }
 2428|   159k|                    }
 2429|   159k|                    if(0 == ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor)) - sao_wd_chroma)
  ------------------
  |  Branch (2429:24): [True: 1.54k, False: 157k]
  ------------------
 2430|  1.54k|                    {
 2431|  1.54k|                        au1_avail_chroma[0] = 0;
 2432|  1.54k|                        au1_avail_chroma[4] = 0;
 2433|  1.54k|                        au1_avail_chroma[6] = 0;
 2434|  1.54k|                    }
 2435|       |
 2436|   159k|                    if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2436:24): [True: 0, False: 159k]
  ------------------
 2437|      0|                    {
 2438|      0|                        au1_avail_chroma[1] = 0;
 2439|      0|                        au1_avail_chroma[5] = 0;
 2440|      0|                        au1_avail_chroma[7] = 0;
 2441|      0|                    }
 2442|       |
 2443|   159k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2443:24): [True: 42.4k, False: 116k]
  ------------------
 2444|  42.4k|                    {
 2445|  42.4k|                        au1_avail_chroma[2] = 0;
 2446|  42.4k|                        au1_avail_chroma[4] = 0;
 2447|  42.4k|                        au1_avail_chroma[5] = 0;
 2448|  42.4k|                    }
 2449|       |
 2450|   159k|                    if((ps_sps->i2_pic_height_in_luma_samples / v_samp_factor) - ((ps_sao_ctxt->i4_ctb_y  << log2_ctb_size) / v_samp_factor) <= sao_ht_chroma)
  ------------------
  |  Branch (2450:24): [True: 8.73k, False: 150k]
  ------------------
 2451|  8.73k|                    {
 2452|  8.73k|                        au1_avail_chroma[3] = 0;
 2453|  8.73k|                        au1_avail_chroma[6] = 0;
 2454|  8.73k|                        au1_avail_chroma[7] = 0;
 2455|  8.73k|                    }
 2456|       |
 2457|   159k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   159k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2457:24): [True: 70.2k, False: 89.1k]
  ------------------
 2458|  70.2k|                    {
 2459|  70.2k|                        au1_src_top_right[0] = pu1_src_top_chroma[sao_wd_chroma];
 2460|  70.2k|                        au1_src_top_right[1] = pu1_src_top_chroma[sao_wd_chroma + 1];
 2461|  70.2k|                        au1_src_bot_left[0] = pu1_sao_src_top_left_chroma_bot_left[0];
 2462|  70.2k|                        au1_src_bot_left[1] = pu1_sao_src_top_left_chroma_bot_left[1];
 2463|       |                        //au1_src_bot_left[0] = pu1_src_chroma[sao_ht_chroma * src_strd - 2];
 2464|       |                        //au1_src_bot_left[1] = pu1_src_chroma[sao_ht_chroma * src_strd - 1];
 2465|  70.2k|                        if((ctb_size == (8 * h_samp_factor)) && (ps_sao_ctxt->i4_ctb_y != 0))
  ------------------
  |  Branch (2465:28): [True: 3.07k, False: 67.1k]
  |  Branch (2465:65): [True: 2.36k, False: 708]
  ------------------
 2466|  2.36k|                        {
 2467|  2.36k|                            au1_src_top_right[0] = pu1_src_chroma[sao_wd_chroma - chroma_strd];
 2468|  2.36k|                            au1_src_top_right[1] = pu1_src_chroma[sao_wd_chroma - chroma_strd + 1];
 2469|  2.36k|                        }
 2470|  70.2k|                        if (ctb_size == (8 * h_samp_factor))
  ------------------
  |  Branch (2470:29): [True: 3.07k, False: 67.1k]
  ------------------
 2471|  3.07k|                        {
 2472|  3.07k|                            au1_src_bot_left[0] = pu1_src_chroma[-2 + sao_ht_chroma * chroma_strd];
 2473|  3.07k|                            au1_src_bot_left[1] = pu1_src_chroma[-1 + sao_ht_chroma * chroma_strd];
 2474|  3.07k|                        }
 2475|       |
 2476|  70.2k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2476:28): [True: 14.4k, False: 55.7k]
  ------------------
 2477|  14.4k|                        {
 2478|  14.4k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2479|  14.4k|                                                                         chroma_strd,
 2480|  14.4k|                                                                         pu1_src_left_chroma,
 2481|  14.4k|                                                                         pu1_src_top_chroma,
 2482|  14.4k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 2483|  14.4k|                                                                         au1_src_top_right,
 2484|  14.4k|                                                                         au1_src_bot_left,
 2485|  14.4k|                                                                         au1_avail_chroma,
 2486|  14.4k|                                                                         ai1_offset_cr,
 2487|  14.4k|                                                                         ai1_offset_cb,
 2488|  14.4k|                                                                         sao_wd_chroma,
 2489|  14.4k|                                                                         sao_ht_chroma);
 2490|  14.4k|                        }
 2491|  55.7k|                        else
 2492|  55.7k|                        {
 2493|  55.7k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2494|  55.7k|                                                                         chroma_strd,
 2495|  55.7k|                                                                         pu1_src_left_chroma,
 2496|  55.7k|                                                                         pu1_src_top_chroma,
 2497|  55.7k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 2498|  55.7k|                                                                         au1_src_top_right,
 2499|  55.7k|                                                                         au1_src_bot_left,
 2500|  55.7k|                                                                         au1_avail_chroma,
 2501|  55.7k|                                                                         ai1_offset_cb,
 2502|  55.7k|                                                                         ai1_offset_cr,
 2503|  55.7k|                                                                         sao_wd_chroma,
 2504|  55.7k|                                                                         sao_ht_chroma);
 2505|  55.7k|                        }
 2506|  70.2k|                    }
 2507|  89.1k|                    else
 2508|  89.1k|                    {
 2509|  89.1k|                        UWORD16 *pu2_src_top_chroma = (UWORD16 *)pu1_src_top_chroma;
 2510|  89.1k|                        UWORD16 *pu2_sao_src_top_left_chroma_bot_left = (UWORD16 *)pu1_sao_src_top_left_chroma_bot_left;
 2511|  89.1k|                        UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 2512|       |
 2513|  89.1k|                        au2_src_top_right[0] = pu2_src_top_chroma[sao_wd_chroma];
 2514|  89.1k|                        au2_src_top_right[1] = pu2_src_top_chroma[sao_wd_chroma + 1];
 2515|  89.1k|                        au2_src_bot_left[0] = pu2_sao_src_top_left_chroma_bot_left[0];
 2516|  89.1k|                        au2_src_bot_left[1] = pu2_sao_src_top_left_chroma_bot_left[1];
 2517|  89.1k|                        if((ctb_size == (8 * h_samp_factor)) && (ps_sao_ctxt->i4_ctb_y != 0))
  ------------------
  |  Branch (2517:28): [True: 2.36k, False: 86.7k]
  |  Branch (2517:65): [True: 2.13k, False: 225]
  ------------------
 2518|  2.13k|                        {
 2519|  2.13k|                            au2_src_top_right[0] = pu2_src_chroma[sao_wd_chroma - chroma_strd];
 2520|  2.13k|                            au2_src_top_right[1] = pu2_src_chroma[sao_wd_chroma - chroma_strd + 1];
 2521|  2.13k|                        }
 2522|  89.1k|                        if (ctb_size == (8 * h_samp_factor))
  ------------------
  |  Branch (2522:29): [True: 2.36k, False: 86.7k]
  ------------------
 2523|  2.36k|                        {
 2524|  2.36k|                            au2_src_bot_left[0] = pu2_src_chroma[-2 + sao_ht_chroma * chroma_strd];
 2525|  2.36k|                            au2_src_bot_left[1] = pu2_src_chroma[-1 + sao_ht_chroma * chroma_strd];
 2526|  2.36k|                        }
 2527|       |
 2528|  89.1k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2528:28): [True: 45.7k, False: 43.3k]
  ------------------
 2529|  45.7k|                        {
 2530|  45.7k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 2531|  45.7k|                                                                             chroma_strd,
 2532|  45.7k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 2533|  45.7k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 2534|  45.7k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2535|  45.7k|                                                                             au2_src_top_right,
 2536|  45.7k|                                                                             au2_src_bot_left,
 2537|  45.7k|                                                                             au1_avail_chroma,
 2538|  45.7k|                                                                             ai1_offset_cr,
 2539|  45.7k|                                                                             ai1_offset_cb,
 2540|  45.7k|                                                                             sao_wd_chroma,
 2541|  45.7k|                                                                             sao_ht_chroma,
 2542|  45.7k|                                                                             u4_bit_depth_chroma);
 2543|  45.7k|                        }
 2544|  43.3k|                        else
 2545|  43.3k|                        {
 2546|  43.3k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 2547|  43.3k|                                                                             chroma_strd,
 2548|  43.3k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 2549|  43.3k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 2550|  43.3k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 2551|  43.3k|                                                                             au2_src_top_right,
 2552|  43.3k|                                                                             au2_src_bot_left,
 2553|  43.3k|                                                                             au1_avail_chroma,
 2554|  43.3k|                                                                             ai1_offset_cb,
 2555|  43.3k|                                                                             ai1_offset_cr,
 2556|  43.3k|                                                                             sao_wd_chroma,
 2557|  43.3k|                                                                             sao_ht_chroma,
 2558|  43.3k|                                                                             u4_bit_depth_chroma);
 2559|  43.3k|                        }
 2560|  89.1k|                    }
 2561|       |
 2562|   159k|                }
 2563|  3.21M|            }
 2564|  4.36M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2564:21): [True: 787k, False: 3.57M]
  |  Branch (2564:68): [True: 1.14M, False: 2.43M]
  ------------------
 2565|  1.93M|            {
 2566|  1.93M|                UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_top_left_chroma_curr_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  1.93M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  1.93M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  1.93M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 1.92M, False: 5.48k]
  |  |  ------------------
  |  |  101|  23.5M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 21.5M, False: 1.92M]
  |  |  ------------------
  |  |  102|  21.5M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  21.5M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  21.5M|        } \
  |  |  105|  1.92M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  1.92M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  1.92M|    } else { \
  |  |  108|  5.48k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  5.48k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  5.48k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  5.48k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|   219k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 214k, False: 5.48k]
  |  |  ------------------
  |  |  113|   214k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|   214k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|   214k|        } \
  |  |  116|  5.48k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  5.48k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  5.48k|    } \
  |  |  119|  1.93M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  1.93M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 1.93M]
  |  |  ------------------
  ------------------
 2567|  1.93M|            }
 2568|       |
 2569|  7.58M|        }
 2570|  18.0M|        pu1_src_luma += sao_wd_luma * pixel_size_y;
 2571|  18.0M|        pu1_src_chroma += sao_wd_chroma * pixel_size_uv;
 2572|  18.0M|        ps_sao += 1;
 2573|  18.0M|    }
 2574|       |
 2575|       |
 2576|       |    /* Current CTB */
 2577|  19.3M|    {
 2578|  19.3M|        WORD32 sao_wd_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
 2579|  19.3M|        WORD32 sao_wd_chroma = ctb_size * (chroma_pixel_strd / h_samp_factor) - SAO_SHIFT_CTB * 2;
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
 2580|  19.3M|        WORD32 sao_ht_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
 2581|  19.3M|        WORD32 sao_ht_chroma = (ctb_size / v_samp_factor) - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
 2582|  19.3M|        WORD32 ctbx_c_t = 0, ctbx_c_l = 0, ctbx_c_r = 0, ctbx_c_d = 0, ctbx_c = 0;
 2583|  19.3M|        WORD32 ctby_c_t = 0, ctby_c_l = 0, ctby_c_r = 0, ctby_c_d = 0, ctby_c = 0;
 2584|  19.3M|        WORD32 au4_idx_c[8], idx_c;
 2585|  19.3M|        WORD32 chroma_strd = is_yuv444 ? src_strd * 2 : src_strd;
  ------------------
  |  Branch (2585:30): [True: 0, False: 19.3M]
  ------------------
 2586|       |
 2587|  19.3M|        WORD32 remaining_rows;
 2588|  19.3M|        WORD32 remaining_cols;
 2589|       |
 2590|  19.3M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_luma);
 2591|  19.3M|        if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2591:12): [True: 1.03M, False: 18.2M]
  ------------------
 2592|  1.03M|        {
 2593|  1.03M|            sao_wd_luma += remaining_cols;
 2594|  1.03M|        }
 2595|  19.3M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples * (chroma_pixel_strd / h_samp_factor) - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor) + sao_wd_chroma);
 2596|  19.3M|        if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2596:12): [True: 1.03M, False: 18.2M]
  ------------------
 2597|  1.03M|        {
 2598|  1.03M|            sao_wd_chroma += remaining_cols;
 2599|  1.03M|        }
 2600|       |
 2601|  19.3M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + sao_ht_luma);
 2602|  19.3M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2602:12): [True: 756k, False: 18.5M]
  ------------------
 2603|   756k|        {
 2604|   756k|            sao_ht_luma += remaining_rows;
 2605|   756k|        }
 2606|  19.3M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples / v_samp_factor - (((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) / v_samp_factor) + sao_ht_chroma);
 2607|  19.3M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  19.3M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2607:12): [True: 756k, False: 18.5M]
  ------------------
 2608|   756k|        {
 2609|   756k|            sao_ht_chroma += remaining_rows;
 2610|   756k|        }
 2611|       |
 2612|  19.3M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * pixel_size_y);
 2613|  19.3M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv);
 2614|  19.3M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) * pixel_size_y);
 2615|  19.3M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) * (chroma_pixel_strd / v_samp_factor) * pixel_size_uv);
 2616|       |
 2617|  19.3M|        if((0 != sao_wd_luma) && (0 != sao_ht_luma))
  ------------------
  |  Branch (2617:12): [True: 19.0M, False: 279k]
  |  Branch (2617:34): [True: 19.0M, False: 18.4E]
  ------------------
 2618|  19.0M|        {
 2619|  19.0M|            if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (2619:16): [True: 6.52M, False: 12.5M]
  ------------------
 2620|  6.52M|            {
 2621|  6.52M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2621:20): [True: 6.18M, False: 334k]
  ------------------
 2622|  6.18M|                {
 2623|  6.18M|                    UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_top_left_luma_curr_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  6.18M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  6.18M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  6.18M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 5.66M, False: 517k]
  |  |  ------------------
  |  |   82|   102M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 97.0M, False: 5.66M]
  |  |  ------------------
  |  |   83|  97.0M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  97.0M|        } \
  |  |   85|  5.66M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  5.66M|    } else { \
  |  |   87|   517k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|   517k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|   517k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|   517k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  22.3M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 21.8M, False: 517k]
  |  |  ------------------
  |  |   92|  21.8M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  21.8M|        } \
  |  |   94|   517k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|   517k|    } \
  |  |   96|  6.18M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  6.18M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 6.18M]
  |  |  ------------------
  ------------------
 2624|  6.18M|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  6.18M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2624:24): [True: 5.65M, False: 531k]
  ------------------
 2625|  5.65M|                    {
 2626|  5.65M|                        pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2627|  5.65M|                    }
 2628|   531k|                    else
 2629|   531k|                    {
 2630|   531k|                        ((UWORD16 *)pu1_sao_src_top_left_luma_top_right)[0] = ((UWORD16 *)pu1_src_luma)[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2631|   531k|                    }
 2632|  6.18M|                }
 2633|       |
 2634|   334k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2634:25): [True: 167k, False: 167k]
  ------------------
 2635|   167k|                {
 2636|   167k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 2637|   167k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 2638|   167k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 2639|   167k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 2640|       |
 2641|   167k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   167k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2641:24): [True: 72.3k, False: 94.7k]
  ------------------
 2642|  72.3k|                    {
 2643|  72.3k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(
 2644|  72.3k|                            pu1_src_luma,
 2645|  72.3k|                            src_strd,
 2646|  72.3k|                            pu1_src_left_luma,
 2647|  72.3k|                            pu1_src_top_luma,
 2648|  72.3k|                            pu1_sao_src_top_left_luma_curr_ctb,
 2649|  72.3k|                            ps_sao->b5_y_band_pos,
 2650|  72.3k|                            ai1_offset_y,
 2651|  72.3k|                            sao_wd_luma,
 2652|  72.3k|                            sao_ht_luma);
 2653|  72.3k|                    }
 2654|  94.7k|                    else
 2655|  94.7k|                    {
 2656|  94.7k|                        ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_luma_fptr(
 2657|  94.7k|                            (UWORD16 *)pu1_src_luma,
 2658|  94.7k|                            src_strd,
 2659|  94.7k|                            (UWORD16 *)pu1_src_left_luma,
 2660|  94.7k|                            (UWORD16 *)pu1_src_top_luma,
 2661|  94.7k|                            (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 2662|  94.7k|                            ps_sao->b5_y_band_pos,
 2663|  94.7k|                            ai1_offset_y,
 2664|  94.7k|                            sao_wd_luma,
 2665|  94.7k|                            sao_ht_luma,
 2666|  94.7k|                            u4_bit_depth_luma);
 2667|  94.7k|                    }
 2668|   167k|                }
 2669|       |
 2670|   167k|                else // if(2 <= ps_sao->b3_y_type_idx)
 2671|   167k|                {
 2672|   167k|                    ai1_offset_y[1] = ps_sao->b8_y_offset_1;
 2673|   167k|                    ai1_offset_y[2] = ps_sao->b8_y_offset_2;
 2674|   167k|                    ai1_offset_y[3] = ps_sao->b8_y_offset_3;
 2675|   167k|                    ai1_offset_y[4] = ps_sao->b8_y_offset_4;
 2676|       |
 2677|  1.56M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2677:32): [True: 1.40M, False: 167k]
  ------------------
 2678|  1.40M|                    {
 2679|  1.40M|                        au1_avail_luma[i] = 255;
 2680|  1.40M|                        au1_tile_slice_boundary[i] = 0;
 2681|  1.40M|                        au4_idx_c[i] = 0;
 2682|  1.40M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2683|  1.40M|                    }
 2684|       |                    /******************************************************************
 2685|       |                     * Derive the  Top-left CTB's neighbour pixel's slice indices.
 2686|       |                     *
 2687|       |                     *
 2688|       |                     *          ____________
 2689|       |                     *         |    |       |
 2690|       |                     *         |    | C_T   |
 2691|       |                     *         |____|_______|____
 2692|       |                     *         |    |       |    |
 2693|       |                     *         | C_L|   C   | C_R|
 2694|       |                     *         |____|_______|    |
 2695|       |                     *              |  C_D       |
 2696|       |                     *              |            |
 2697|       |                     *              |____________|
 2698|       |                     *
 2699|       |                     *****************************************************************/
 2700|       |
 2701|       |                    /*In case of slices*/
 2702|   167k|                    {
 2703|   167k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2703:28): [True: 6.84k, False: 160k]
  |  Branch (2703:75): [True: 38.4k, False: 122k]
  ------------------
 2704|  52.4k|                        {
 2705|  52.4k|                            ctbx_c_t = ps_sao_ctxt->i4_ctb_x;
 2706|  52.4k|                            ctby_c_t = ps_sao_ctxt->i4_ctb_y - 1;
 2707|       |
 2708|  52.4k|                            ctbx_c_l = ps_sao_ctxt->i4_ctb_x - 1;
 2709|  52.4k|                            ctby_c_l = ps_sao_ctxt->i4_ctb_y;
 2710|       |
 2711|  52.4k|                            ctbx_c_r = ps_sao_ctxt->i4_ctb_x;
 2712|  52.4k|                            ctby_c_r = ps_sao_ctxt->i4_ctb_y;
 2713|       |
 2714|  52.4k|                            ctbx_c_d =  ps_sao_ctxt->i4_ctb_x;
 2715|  52.4k|                            ctby_c_d =  ps_sao_ctxt->i4_ctb_y;
 2716|       |
 2717|  52.4k|                            ctbx_c = ps_sao_ctxt->i4_ctb_x;
 2718|  52.4k|                            ctby_c = ps_sao_ctxt->i4_ctb_y;
 2719|       |
 2720|  52.4k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2720:32): [True: 14.0k, False: 38.4k]
  ------------------
 2721|  14.0k|                            {
 2722|  14.0k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2722:36): [True: 991, False: 13.0k]
  ------------------
 2723|    991|                                {
 2724|    991|                                    au4_idx_c[6] = -1;
 2725|    991|                                    au4_idx_c[0] = -1;
 2726|    991|                                    au4_idx_c[4] = -1;
 2727|    991|                                }
 2728|  13.0k|                                else
 2729|  13.0k|                                {
 2730|  13.0k|                                    au4_idx_c[0] =  au4_idx_c[6] = pu1_slice_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 2731|  13.0k|                                }
 2732|       |
 2733|  14.0k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2733:36): [True: 1.63k, False: 12.4k]
  ------------------
 2734|  1.63k|                                {
 2735|  1.63k|                                    au4_idx_c[2] = -1;
 2736|  1.63k|                                    au4_idx_c[5] = -1;
 2737|  1.63k|                                    au4_idx_c[4] = -1;
 2738|  1.63k|                                }
 2739|  12.4k|                                else
 2740|  12.4k|                                {
 2741|  12.4k|                                    au4_idx_c[4] =  pu1_slice_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 2742|  12.4k|                                    au4_idx_c[2] = au4_idx_c[5] = pu1_slice_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 2743|  12.4k|                                }
 2744|  14.0k|                                idx_c   = pu1_slice_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 2745|  14.0k|                                au4_idx_c[1] = au4_idx_c[7] = pu1_slice_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 2746|  14.0k|                                au4_idx_c[3] = pu1_slice_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 2747|       |
 2748|  14.0k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2748:36): [True: 991, False: 13.0k]
  ------------------
 2749|    991|                                {
 2750|    991|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 2751|    991|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 2752|    991|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2753|    991|                                }
 2754|  13.0k|                                else
 2755|  13.0k|                                {
 2756|  13.0k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_c[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 2757|  13.0k|                                    au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;;
 2758|  13.0k|                                }
 2759|  14.0k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2759:36): [True: 1.63k, False: 12.4k]
  ------------------
 2760|  1.63k|                                {
 2761|  1.63k|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2762|  1.63k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2763|  1.63k|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2764|  1.63k|                                }
 2765|  12.4k|                                else
 2766|  12.4k|                                {
 2767|  12.4k|                                    au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 2768|  12.4k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2769|  12.4k|                                }
 2770|  14.0k|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_c[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2771|  14.0k|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_c[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2772|  14.0k|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_c[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 2773|       |
 2774|  14.0k|                                if(au4_idx_c[6] < idx_c)
  ------------------
  |  Branch (2774:36): [True: 1.40k, False: 12.6k]
  ------------------
 2775|  1.40k|                                {
 2776|  1.40k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 2777|  1.40k|                                }
 2778|       |
 2779|       |                                /*
 2780|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 2781|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 2782|       |                                 */
 2783|   126k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2783:44): [True: 112k, False: 14.0k]
  ------------------
 2784|   112k|                                {
 2785|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2786|   112k|                                    if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (2786:40): [True: 15.7k, False: 96.7k]
  ------------------
 2787|  15.7k|                                    {
 2788|  15.7k|                                        au1_tile_slice_boundary[i] = 1;
 2789|  15.7k|                                    }
 2790|  96.7k|                                    else
 2791|  96.7k|                                    {
 2792|  96.7k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2793|  96.7k|                                    }
 2794|   112k|                                }
 2795|       |                                /*Reset indices*/
 2796|   126k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2796:44): [True: 112k, False: 14.0k]
  ------------------
 2797|   112k|                                {
 2798|   112k|                                    au4_idx_c[i] = 0;
 2799|   112k|                                }
 2800|  14.0k|                            }
 2801|       |
 2802|  52.4k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2802:32): [True: 38.4k, False: 14.0k]
  ------------------
 2803|  38.4k|                            {
 2804|       |                                /* Calculate availability flags at slice boundary */
 2805|  38.4k|                                if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (2805:37): [True: 11.5k, False: 26.9k]
  |  Branch (2805:85): [True: 12.7k, False: 14.1k]
  |  Branch (2805:137): [True: 20.3k, False: 3.96k]
  |  Branch (2805:165): [True: 9.92k, False: 10.4k]
  ------------------
 2806|  14.3k|                                {
 2807|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2808|  14.3k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2808:40): [True: 13.2k, False: 1.12k]
  ------------------
 2809|  13.2k|                                    {
 2810|  13.2k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2810:44): [True: 4.74k, False: 8.53k]
  ------------------
 2811|  4.74k|                                        {
 2812|  4.74k|                                            au4_idx_c[6] = -1;
 2813|  4.74k|                                            au4_idx_c[0] = -1;
 2814|  4.74k|                                            au4_idx_c[4] = -1;
 2815|  4.74k|                                        }
 2816|  8.53k|                                        else
 2817|  8.53k|                                        {
 2818|  8.53k|                                            au4_idx_c[0] =  au4_idx_c[6] = pu1_tile_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 2819|  8.53k|                                        }
 2820|       |
 2821|  13.2k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2821:44): [True: 1.36k, False: 11.9k]
  ------------------
 2822|  1.36k|                                        {
 2823|  1.36k|                                            au4_idx_c[2] = -1;
 2824|  1.36k|                                            au4_idx_c[5] = -1;
 2825|  1.36k|                                            au4_idx_c[4] = -1;
 2826|  1.36k|                                        }
 2827|  11.9k|                                        else
 2828|  11.9k|                                        {
 2829|  11.9k|                                            au4_idx_c[4] =  pu1_tile_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 2830|  11.9k|                                            au4_idx_c[2] = au4_idx_c[5] = pu1_tile_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 2831|  11.9k|                                        }
 2832|  13.2k|                                        idx_c   = pu1_tile_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 2833|  13.2k|                                        au4_idx_c[1] = au4_idx_c[7] = pu1_tile_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 2834|  13.2k|                                        au4_idx_c[3] = pu1_tile_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 2835|       |
 2836|   119k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2836:52): [True: 106k, False: 13.2k]
  ------------------
 2837|   106k|                                        {
 2838|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2839|   106k|                                            if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (2839:48): [True: 43.5k, False: 62.6k]
  ------------------
 2840|  43.5k|                                            {
 2841|  43.5k|                                                au1_tile_slice_boundary[i] |= 1;
 2842|  43.5k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 2843|  43.5k|                                            }
 2844|   106k|                                        }
 2845|  13.2k|                                    }
 2846|  14.3k|                                }
 2847|  38.4k|                            }
 2848|       |
 2849|   472k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2849:40): [True: 419k, False: 52.4k]
  ------------------
 2850|   419k|                            {
 2851|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2852|   419k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2852:36): [True: 59.2k, False: 360k]
  |  Branch (2852:68): [True: 50.7k, False: 8.50k]
  ------------------
 2853|  50.7k|                                {
 2854|  50.7k|                                    au1_avail_luma[i] = 0;
 2855|  50.7k|                                }
 2856|   419k|                            }
 2857|       |
 2858|  52.4k|                        }
 2859|   167k|                    }
 2860|   167k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2860:24): [True: 37.8k, False: 129k]
  ------------------
 2861|  37.8k|                    {
 2862|  37.8k|                        au1_avail_luma[0] = 0;
 2863|  37.8k|                        au1_avail_luma[4] = 0;
 2864|  37.8k|                        au1_avail_luma[6] = 0;
 2865|  37.8k|                    }
 2866|       |
 2867|   167k|                    if(ps_sps->i2_pic_width_in_luma_samples - (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) <= sao_wd_luma)
  ------------------
  |  Branch (2867:24): [True: 28.5k, False: 139k]
  ------------------
 2868|  28.5k|                    {
 2869|  28.5k|                        au1_avail_luma[1] = 0;
 2870|  28.5k|                        au1_avail_luma[5] = 0;
 2871|  28.5k|                        au1_avail_luma[7] = 0;
 2872|  28.5k|                    }
 2873|       |
 2874|   167k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2874:24): [True: 38.8k, False: 128k]
  ------------------
 2875|  38.8k|                    {
 2876|  38.8k|                        au1_avail_luma[2] = 0;
 2877|  38.8k|                        au1_avail_luma[4] = 0;
 2878|  38.8k|                        au1_avail_luma[5] = 0;
 2879|  38.8k|                    }
 2880|       |
 2881|   167k|                    if(ps_sps->i2_pic_height_in_luma_samples - (ps_sao_ctxt->i4_ctb_y  << log2_ctb_size) <= sao_ht_luma)
  ------------------
  |  Branch (2881:24): [True: 10.3k, False: 157k]
  ------------------
 2882|  10.3k|                    {
 2883|  10.3k|                        au1_avail_luma[3] = 0;
 2884|  10.3k|                        au1_avail_luma[6] = 0;
 2885|  10.3k|                        au1_avail_luma[7] = 0;
 2886|  10.3k|                    }
 2887|       |
 2888|   167k|                    if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|   167k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2888:24): [True: 91.0k, False: 76.7k]
  ------------------
 2889|  91.0k|                    {
 2890|  91.0k|                        au1_src_top_right[0] = pu1_src_luma[sao_wd_luma - src_strd];
 2891|  91.0k|                        u1_sao_src_top_left_luma_bot_left = pu1_src_luma[sao_ht_luma * src_strd - 1];
 2892|       |
 2893|  91.0k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 2894|  91.0k|                                                                  src_strd,
 2895|  91.0k|                                                                  pu1_src_left_luma,
 2896|  91.0k|                                                                  pu1_src_top_luma,
 2897|  91.0k|                                                                  pu1_sao_src_top_left_luma_curr_ctb,
 2898|  91.0k|                                                                  au1_src_top_right,
 2899|  91.0k|                                                                  &u1_sao_src_top_left_luma_bot_left,
 2900|  91.0k|                                                                  au1_avail_luma,
 2901|  91.0k|                                                                  ai1_offset_y,
 2902|  91.0k|                                                                  sao_wd_luma,
 2903|  91.0k|                                                                  sao_ht_luma);
 2904|  91.0k|                        pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2905|  91.0k|                        pu1_sao_src_top_left_luma_bot_left[0] = pu1_src_luma[(sao_ht_luma)*src_strd + sao_wd_luma - 1];
 2906|  91.0k|                    }
 2907|  76.7k|                    else
 2908|  76.7k|                    {
 2909|  76.7k|                        UWORD16 *pu2_src_luma = (UWORD16 *)pu1_src_luma;
 2910|  76.7k|                        au2_src_top_right[0] = pu2_src_luma[sao_wd_luma - src_strd];
 2911|  76.7k|                        u2_sao_src_top_left_luma_bot_left = pu2_src_luma[sao_ht_luma * src_strd - 1];
 2912|       |
 2913|  76.7k|                        ps_codec->apf_hbd_sao_luma[ps_sao->b3_y_type_idx - 2]((UWORD16 *)pu1_src_luma,
 2914|  76.7k|                                                                      src_strd,
 2915|  76.7k|                                                                      (UWORD16 *)pu1_src_left_luma,
 2916|  76.7k|                                                                      (UWORD16 *)pu1_src_top_luma,
 2917|  76.7k|                                                                      (UWORD16 *)pu1_sao_src_top_left_luma_curr_ctb,
 2918|  76.7k|                                                                      au2_src_top_right,
 2919|  76.7k|                                                                      &u2_sao_src_top_left_luma_bot_left,
 2920|  76.7k|                                                                      au1_avail_luma,
 2921|  76.7k|                                                                      ai1_offset_y,
 2922|  76.7k|                                                                      sao_wd_luma,
 2923|  76.7k|                                                                      sao_ht_luma,
 2924|  76.7k|                                                                      u4_bit_depth_luma);
 2925|  76.7k|                        ((UWORD16 *)pu1_sao_src_top_left_luma_top_right)[0] = pu2_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2926|  76.7k|                        ((UWORD16 *)pu1_sao_src_top_left_luma_bot_left)[0] = pu2_src_luma[(sao_ht_luma)*src_strd + sao_wd_luma - 1];
 2927|  76.7k|                    }
 2928|   167k|                }
 2929|  6.52M|            }
 2930|  12.5M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2930:21): [True: 4.38M, False: 8.15M]
  |  Branch (2930:68): [True: 1.92M, False: 6.22M]
  ------------------
 2931|  6.30M|            {
 2932|  6.30M|                UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_sao_src_top_left_luma_curr_ctb, sao_wd_luma, sao_ht_luma, pixel_size_y);
  ------------------
  |  |   80|  6.30M|#define UPDATE_LUMA_BUFFERS(pu1_src_luma, src_strd, pu1_src_left_luma, pu1_src_top_luma, pu1_top_left, sao_wd_luma, sao_ht_luma, pixel_size_y) do { \
  |  |   81|  6.30M|    if(PIXEL_SIZE_1BYTE == (pixel_size_y)) { \
  |  |  ------------------
  |  |  |  |  279|  6.30M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (81:8): [True: 6.25M, False: 58.5k]
  |  |  ------------------
  |  |   82|   101M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (82:22): [True: 95.3M, False: 6.25M]
  |  |  ------------------
  |  |   83|  95.3M|            (pu1_src_left_luma)[row] = (pu1_src_luma)[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   84|  95.3M|        } \
  |  |   85|  6.25M|        (pu1_top_left)[0] = (pu1_src_top_luma)[(sao_wd_luma) - 1]; \
  |  |   86|  6.25M|    } else { \
  |  |   87|  58.5k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_luma); \
  |  |   88|  58.5k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_luma); \
  |  |   89|  58.5k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_luma); \
  |  |   90|  58.5k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |   91|  2.61M|        for(row = 0; row < (sao_ht_luma); row++) { \
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 2.56M, False: 58.5k]
  |  |  ------------------
  |  |   92|  2.56M|            pu2_src_left[row] = pu2_src[row * (src_strd) + ((sao_wd_luma) - 1)]; \
  |  |   93|  2.56M|        } \
  |  |   94|  58.5k|        pu2_top_left[0] = pu2_top[(sao_wd_luma) - 1]; \
  |  |   95|  58.5k|    } \
  |  |   96|  6.30M|    memcpy((pu1_src_top_luma), &(pu1_src_luma)[((sao_ht_luma) - 1) * (src_strd) * (pixel_size_y)], (sao_wd_luma) * (pixel_size_y)); \
  |  |   97|  6.30M|} while(0)
  |  |  ------------------
  |  |  |  Branch (97:9): [Folded, False: 6.30M]
  |  |  ------------------
  ------------------
 2933|  6.30M|                if(PIXEL_SIZE_1BYTE == pixel_size_y)
  ------------------
  |  |  279|  6.30M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2933:20): [True: 6.21M, False: 92.9k]
  ------------------
 2934|  6.21M|                {
 2935|  6.21M|                    pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2936|  6.21M|                }
 2937|  92.9k|                else
 2938|  92.9k|                {
 2939|  92.9k|                    ((UWORD16 *)pu1_sao_src_top_left_luma_top_right)[0] = ((UWORD16 *)pu1_src_luma)[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2940|  92.9k|                }
 2941|  6.30M|            }
 2942|  19.0M|        }
 2943|       |
 2944|  19.3M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && (0 != sao_wd_chroma) && (0 != sao_ht_chroma))
  ------------------
  |  Branch (2944:12): [True: 18.9M, False: 334k]
  |  Branch (2944:73): [True: 8.45M, False: 10.5M]
  |  Branch (2944:97): [True: 8.13M, False: 321k]
  ------------------
 2945|  8.13M|        {
 2946|  8.13M|            if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (2946:16): [True: 3.36M, False: 4.77M]
  ------------------
 2947|  3.36M|            {
 2948|  3.36M|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2948:20): [True: 3.06M, False: 299k]
  ------------------
 2949|  3.06M|                {
 2950|  3.06M|                    UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_top_left_chroma_curr_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  3.06M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  3.06M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  3.06M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 2.50M, False: 556k]
  |  |  ------------------
  |  |  101|  46.4M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 43.9M, False: 2.50M]
  |  |  ------------------
  |  |  102|  43.9M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  43.9M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  43.9M|        } \
  |  |  105|  2.50M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  2.50M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  2.50M|    } else { \
  |  |  108|   556k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|   556k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|   556k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|   556k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|  25.7M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 25.2M, False: 556k]
  |  |  ------------------
  |  |  113|  25.2M|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|  25.2M|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|  25.2M|        } \
  |  |  116|   556k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|   556k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|   556k|    } \
  |  |  119|  3.06M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  3.06M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 3.06M]
  |  |  ------------------
  ------------------
 2951|  3.06M|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  3.06M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2951:24): [True: 2.49M, False: 568k]
  ------------------
 2952|  2.49M|                    {
 2953|  2.49M|                        pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 2954|  2.49M|                        pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 2955|  2.49M|                    }
 2956|   568k|                    else
 2957|   568k|                    {
 2958|   568k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[0] = ((UWORD16 *)pu1_src_chroma)[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 2959|   568k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[1] = ((UWORD16 *)pu1_src_chroma)[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 2960|   568k|                    }
 2961|  3.06M|                }
 2962|       |
 2963|   299k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2963:25): [True: 110k, False: 189k]
  ------------------
 2964|   110k|                {
 2965|   110k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 2966|   110k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 2967|   110k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 2968|   110k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 2969|       |
 2970|   110k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 2971|   110k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 2972|   110k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 2973|   110k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 2974|       |
 2975|   110k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2975:24): [True: 23.8k, False: 86.8k]
  ------------------
 2976|  23.8k|                    {
 2977|  23.8k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  23.8k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (2977:28): [True: 8.32k, False: 15.5k]
  ------------------
 2978|  8.32k|                        {
 2979|  8.32k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 2980|  8.32k|                                pu1_src_chroma,
 2981|  8.32k|                                chroma_strd,
 2982|  8.32k|                                pu1_src_left_chroma,
 2983|  8.32k|                                pu1_src_top_chroma,
 2984|  8.32k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 2985|  8.32k|                                ps_sao->b5_cr_band_pos,
 2986|  8.32k|                                ps_sao->b5_cb_band_pos,
 2987|  8.32k|                                ai1_offset_cr,
 2988|  8.32k|                                ai1_offset_cb,
 2989|  8.32k|                                sao_wd_chroma,
 2990|  8.32k|                                sao_ht_chroma);
 2991|  8.32k|                        }
 2992|  15.5k|                        else
 2993|  15.5k|                        {
 2994|  15.5k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 2995|  15.5k|                                (UWORD16 *)pu1_src_chroma,
 2996|  15.5k|                                chroma_strd,
 2997|  15.5k|                                (UWORD16 *)pu1_src_left_chroma,
 2998|  15.5k|                                (UWORD16 *)pu1_src_top_chroma,
 2999|  15.5k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3000|  15.5k|                                ps_sao->b5_cr_band_pos,
 3001|  15.5k|                                ps_sao->b5_cb_band_pos,
 3002|  15.5k|                                ai1_offset_cr,
 3003|  15.5k|                                ai1_offset_cb,
 3004|  15.5k|                                sao_wd_chroma,
 3005|  15.5k|                                sao_ht_chroma,
 3006|  15.5k|                                u4_bit_depth_chroma);
 3007|  15.5k|                        }
 3008|  23.8k|                    }
 3009|  86.8k|                    else
 3010|  86.8k|                    {
 3011|  86.8k|                        if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  86.8k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (3011:28): [True: 40.1k, False: 46.6k]
  ------------------
 3012|  40.1k|                        {
 3013|  40.1k|                            ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(
 3014|  40.1k|                                pu1_src_chroma,
 3015|  40.1k|                                chroma_strd,
 3016|  40.1k|                                pu1_src_left_chroma,
 3017|  40.1k|                                pu1_src_top_chroma,
 3018|  40.1k|                                pu1_sao_src_top_left_chroma_curr_ctb,
 3019|  40.1k|                                ps_sao->b5_cb_band_pos,
 3020|  40.1k|                                ps_sao->b5_cr_band_pos,
 3021|  40.1k|                                ai1_offset_cb,
 3022|  40.1k|                                ai1_offset_cr,
 3023|  40.1k|                                sao_wd_chroma,
 3024|  40.1k|                                sao_ht_chroma);
 3025|  40.1k|                        }
 3026|  46.6k|                        else
 3027|  46.6k|                        {
 3028|  46.6k|                            ps_codec->s_func_selector.ihevc_hbd_sao_band_offset_chroma_fptr(
 3029|  46.6k|                                (UWORD16 *)pu1_src_chroma,
 3030|  46.6k|                                chroma_strd,
 3031|  46.6k|                                (UWORD16 *)pu1_src_left_chroma,
 3032|  46.6k|                                (UWORD16 *)pu1_src_top_chroma,
 3033|  46.6k|                                (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3034|  46.6k|                                ps_sao->b5_cb_band_pos,
 3035|  46.6k|                                ps_sao->b5_cr_band_pos,
 3036|  46.6k|                                ai1_offset_cb,
 3037|  46.6k|                                ai1_offset_cr,
 3038|  46.6k|                                sao_wd_chroma,
 3039|  46.6k|                                sao_ht_chroma,
 3040|  46.6k|                                u4_bit_depth_chroma);
 3041|  46.6k|                        }
 3042|  86.8k|                    }
 3043|   110k|                }
 3044|       |
 3045|   189k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 3046|   189k|                {
 3047|   189k|                    ai1_offset_cb[1] = ps_sao->b8_cb_offset_1;
 3048|   189k|                    ai1_offset_cb[2] = ps_sao->b8_cb_offset_2;
 3049|   189k|                    ai1_offset_cb[3] = ps_sao->b8_cb_offset_3;
 3050|   189k|                    ai1_offset_cb[4] = ps_sao->b8_cb_offset_4;
 3051|       |
 3052|   189k|                    ai1_offset_cr[1] = ps_sao->b8_cr_offset_1;
 3053|   189k|                    ai1_offset_cr[2] = ps_sao->b8_cr_offset_2;
 3054|   189k|                    ai1_offset_cr[3] = ps_sao->b8_cr_offset_3;
 3055|   189k|                    ai1_offset_cr[4] = ps_sao->b8_cr_offset_4;
 3056|       |
 3057|  1.71M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3057:32): [True: 1.52M, False: 189k]
  ------------------
 3058|  1.52M|                    {
 3059|  1.52M|                        au1_avail_chroma[i] = 255;
 3060|  1.52M|                        au1_tile_slice_boundary[i] = 0;
 3061|  1.52M|                        au4_idx_c[i] = 0;
 3062|  1.52M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 3063|  1.52M|                    }
 3064|   189k|                    {
 3065|   189k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (3065:28): [True: 11.8k, False: 177k]
  |  Branch (3065:75): [True: 33.8k, False: 143k]
  ------------------
 3066|  46.8k|                        {
 3067|  46.8k|                            ctbx_c_t = ps_sao_ctxt->i4_ctb_x;
 3068|  46.8k|                            ctby_c_t = ps_sao_ctxt->i4_ctb_y - 1;
 3069|       |
 3070|  46.8k|                            ctbx_c_l = ps_sao_ctxt->i4_ctb_x - 1;
 3071|  46.8k|                            ctby_c_l = ps_sao_ctxt->i4_ctb_y;
 3072|       |
 3073|  46.8k|                            ctbx_c_r = ps_sao_ctxt->i4_ctb_x;
 3074|  46.8k|                            ctby_c_r = ps_sao_ctxt->i4_ctb_y;
 3075|       |
 3076|  46.8k|                            ctbx_c_d =  ps_sao_ctxt->i4_ctb_x;
 3077|  46.8k|                            ctby_c_d =  ps_sao_ctxt->i4_ctb_y;
 3078|       |
 3079|  46.8k|                            ctbx_c = ps_sao_ctxt->i4_ctb_x;
 3080|  46.8k|                            ctby_c = ps_sao_ctxt->i4_ctb_y;
 3081|       |
 3082|  46.8k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (3082:32): [True: 12.9k, False: 33.8k]
  ------------------
 3083|  12.9k|                            {
 3084|  12.9k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3084:36): [True: 1.49k, False: 11.4k]
  ------------------
 3085|  1.49k|                                {
 3086|  1.49k|                                    au4_idx_c[0] = -1;
 3087|  1.49k|                                    au4_idx_c[4] = -1;
 3088|  1.49k|                                    au4_idx_c[6] = -1;
 3089|  1.49k|                                }
 3090|  11.4k|                                else
 3091|  11.4k|                                {
 3092|  11.4k|                                    au4_idx_c[0] =  au4_idx_c[6] = pu1_slice_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 3093|  11.4k|                                }
 3094|       |
 3095|  12.9k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3095:36): [True: 197, False: 12.7k]
  ------------------
 3096|    197|                                {
 3097|    197|                                    au4_idx_c[2] = -1;
 3098|    197|                                    au4_idx_c[4] = -1;
 3099|    197|                                    au4_idx_c[5] = -1;
 3100|    197|                                }
 3101|  12.7k|                                else
 3102|  12.7k|                                {
 3103|  12.7k|                                    au4_idx_c[2] = au4_idx_c[5] = pu1_slice_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 3104|  12.7k|                                    au4_idx_c[4] =  pu1_slice_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 3105|  12.7k|                                }
 3106|  12.9k|                                idx_c = pu1_slice_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 3107|  12.9k|                                au4_idx_c[1] = au4_idx_c[7] = pu1_slice_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 3108|  12.9k|                                au4_idx_c[3] = pu1_slice_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 3109|       |
 3110|  12.9k|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3110:36): [True: 1.49k, False: 11.4k]
  ------------------
 3111|  1.49k|                                {
 3112|  1.49k|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 3113|  1.49k|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 3114|  1.49k|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 3115|  1.49k|                                }
 3116|  11.4k|                                else
 3117|  11.4k|                                {
 3118|  11.4k|                                    au4_ilf_across_tile_slice_enable[6] &= (ps_slice_hdr_base + au4_idx_c[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 3119|  11.4k|                                    au4_ilf_across_tile_slice_enable[0] &= (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3120|  11.4k|                                }
 3121|       |
 3122|  12.9k|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3122:36): [True: 197, False: 12.7k]
  ------------------
 3123|    197|                                {
 3124|    197|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 3125|    197|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 3126|    197|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 3127|    197|                                }
 3128|  12.7k|                                else
 3129|  12.7k|                                {
 3130|  12.7k|                                    au4_ilf_across_tile_slice_enable[2] &= (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3131|  12.7k|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 3132|  12.7k|                                }
 3133|       |
 3134|  12.9k|                                au4_ilf_across_tile_slice_enable[1] &= (ps_slice_hdr_base + au4_idx_c[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 3135|  12.9k|                                au4_ilf_across_tile_slice_enable[3] &= (ps_slice_hdr_base + au4_idx_c[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 3136|  12.9k|                                au4_ilf_across_tile_slice_enable[7] &= (ps_slice_hdr_base + au4_idx_c[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 3137|       |
 3138|  12.9k|                                if(idx_c > au4_idx_c[6])
  ------------------
  |  Branch (3138:36): [True: 1.81k, False: 11.1k]
  ------------------
 3139|  1.81k|                                {
 3140|  1.81k|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3141|  1.81k|                                }
 3142|       |
 3143|       |                                /*
 3144|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 3145|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 3146|       |                                 */
 3147|   116k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3147:44): [True: 103k, False: 12.9k]
  ------------------
 3148|   103k|                                {
 3149|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 3150|   103k|                                    if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (3150:40): [True: 10.3k, False: 93.3k]
  ------------------
 3151|  10.3k|                                    {
 3152|  10.3k|                                        au1_tile_slice_boundary[i] = 1;
 3153|  10.3k|                                    }
 3154|  93.3k|                                    else
 3155|  93.3k|                                    {
 3156|  93.3k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 3157|  93.3k|                                    }
 3158|   103k|                                }
 3159|       |                                /*Reset indices*/
 3160|   116k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3160:44): [True: 103k, False: 12.9k]
  ------------------
 3161|   103k|                                {
 3162|   103k|                                    au4_idx_c[i] = 0;
 3163|   103k|                                }
 3164|  12.9k|                            }
 3165|       |
 3166|  46.8k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3166:32): [True: 33.9k, False: 12.8k]
  ------------------
 3167|  33.9k|                            {
 3168|       |                                /* Calculate availability flags at slice boundary */
 3169|  33.9k|                                if(((ps_tile->u1_pos_x == ps_sao_ctxt->i4_ctb_x) || (ps_tile->u1_pos_y == ps_sao_ctxt->i4_ctb_y)) && (!((0 == ps_tile->u1_pos_x) && (0 == ps_tile->u1_pos_y))))
  ------------------
  |  Branch (3169:37): [True: 9.89k, False: 24.0k]
  |  Branch (3169:85): [True: 13.4k, False: 10.6k]
  |  Branch (3169:137): [True: 19.3k, False: 3.97k]
  |  Branch (3169:165): [True: 9.33k, False: 10.0k]
  ------------------
 3170|  13.9k|                                {
 3171|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 3172|  13.9k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (3172:40): [True: 13.1k, False: 835]
  ------------------
 3173|  13.1k|                                    {
 3174|  13.1k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3174:44): [True: 4.52k, False: 8.64k]
  ------------------
 3175|  4.52k|                                        {
 3176|  4.52k|                                            au4_idx_c[6] = -1;
 3177|  4.52k|                                            au4_idx_c[0] = -1;
 3178|  4.52k|                                            au4_idx_c[4] = -1;
 3179|  4.52k|                                        }
 3180|  8.64k|                                        else
 3181|  8.64k|                                        {
 3182|  8.64k|                                            au4_idx_c[0] =  au4_idx_c[6] = pu1_tile_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 3183|  8.64k|                                        }
 3184|       |
 3185|  13.1k|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3185:44): [True: 1.13k, False: 12.0k]
  ------------------
 3186|  1.13k|                                        {
 3187|  1.13k|                                            au4_idx_c[2] = -1;
 3188|  1.13k|                                            au4_idx_c[5] = -1;
 3189|  1.13k|                                            au4_idx_c[4] = -1;
 3190|  1.13k|                                        }
 3191|  12.0k|                                        else
 3192|  12.0k|                                        {
 3193|  12.0k|                                            au4_idx_c[4] =  pu1_tile_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 3194|  12.0k|                                            au4_idx_c[2] = au4_idx_c[5] = pu1_tile_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 3195|  12.0k|                                        }
 3196|  13.1k|                                        idx_c   = pu1_tile_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 3197|  13.1k|                                        au4_idx_c[1] = au4_idx_c[7] = pu1_tile_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 3198|  13.1k|                                        au4_idx_c[3] = pu1_tile_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 3199|       |
 3200|   118k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3200:52): [True: 105k, False: 13.1k]
  ------------------
 3201|   105k|                                        {
 3202|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 3203|   105k|                                            if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (3203:48): [True: 43.4k, False: 61.8k]
  ------------------
 3204|  43.4k|                                            {
 3205|  43.4k|                                                au1_tile_slice_boundary[i] |= 1;
 3206|  43.4k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 3207|  43.4k|                                            }
 3208|   105k|                                        }
 3209|  13.1k|                                    }
 3210|  13.9k|                                }
 3211|  33.9k|                            }
 3212|       |
 3213|   421k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3213:40): [True: 374k, False: 46.8k]
  ------------------
 3214|   374k|                            {
 3215|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 3216|   374k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (3216:36): [True: 53.7k, False: 320k]
  |  Branch (3216:68): [True: 47.8k, False: 5.90k]
  ------------------
 3217|  47.8k|                                {
 3218|  47.8k|                                    au1_avail_chroma[i] = 0;
 3219|  47.8k|                                }
 3220|   374k|                            }
 3221|  46.8k|                        }
 3222|   189k|                    }
 3223|       |
 3224|   189k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3224:24): [True: 47.0k, False: 142k]
  ------------------
 3225|  47.0k|                    {
 3226|  47.0k|                        au1_avail_chroma[0] = 0;
 3227|  47.0k|                        au1_avail_chroma[4] = 0;
 3228|  47.0k|                        au1_avail_chroma[6] = 0;
 3229|  47.0k|                    }
 3230|       |
 3231|   189k|                    if(ps_sps->i2_pic_width_in_luma_samples * (chroma_pixel_strd / h_samp_factor) - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) * (chroma_pixel_strd / h_samp_factor)) <= sao_wd_chroma)
  ------------------
  |  Branch (3231:24): [True: 36.5k, False: 152k]
  ------------------
 3232|  36.5k|                    {
 3233|  36.5k|                        au1_avail_chroma[1] = 0;
 3234|  36.5k|                        au1_avail_chroma[5] = 0;
 3235|  36.5k|                        au1_avail_chroma[7] = 0;
 3236|  36.5k|                    }
 3237|       |
 3238|   189k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3238:24): [True: 47.8k, False: 141k]
  ------------------
 3239|  47.8k|                    {
 3240|  47.8k|                        au1_avail_chroma[2] = 0;
 3241|  47.8k|                        au1_avail_chroma[4] = 0;
 3242|  47.8k|                        au1_avail_chroma[5] = 0;
 3243|  47.8k|                    }
 3244|       |
 3245|   189k|                    if(ps_sps->i2_pic_height_in_luma_samples / v_samp_factor - ((ps_sao_ctxt->i4_ctb_y  << log2_ctb_size) / v_samp_factor) <= sao_ht_chroma)
  ------------------
  |  Branch (3245:24): [True: 10.0k, False: 179k]
  ------------------
 3246|  10.0k|                    {
 3247|  10.0k|                        au1_avail_chroma[3] = 0;
 3248|  10.0k|                        au1_avail_chroma[6] = 0;
 3249|  10.0k|                        au1_avail_chroma[7] = 0;
 3250|  10.0k|                    }
 3251|       |
 3252|   189k|                    if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|   189k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (3252:24): [True: 82.4k, False: 106k]
  ------------------
 3253|  82.4k|                    {
 3254|  82.4k|                        au1_src_top_right[0] = pu1_src_chroma[sao_wd_chroma - chroma_strd];
 3255|  82.4k|                        au1_src_top_right[1] = pu1_src_chroma[sao_wd_chroma - chroma_strd + 1];
 3256|       |
 3257|  82.4k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 2];
 3258|  82.4k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * chroma_strd - 1];
 3259|       |
 3260|  82.4k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (3260:28): [True: 16.2k, False: 66.1k]
  ------------------
 3261|  16.2k|                        {
 3262|  16.2k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 3263|  16.2k|                                                                         chroma_strd,
 3264|  16.2k|                                                                         pu1_src_left_chroma,
 3265|  16.2k|                                                                         pu1_src_top_chroma,
 3266|  16.2k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 3267|  16.2k|                                                                         au1_src_top_right,
 3268|  16.2k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 3269|  16.2k|                                                                         au1_avail_chroma,
 3270|  16.2k|                                                                         ai1_offset_cr,
 3271|  16.2k|                                                                         ai1_offset_cb,
 3272|  16.2k|                                                                         sao_wd_chroma,
 3273|  16.2k|                                                                         sao_ht_chroma);
 3274|  16.2k|                        }
 3275|  66.1k|                        else
 3276|  66.1k|                        {
 3277|  66.1k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 3278|  66.1k|                                                                         chroma_strd,
 3279|  66.1k|                                                                         pu1_src_left_chroma,
 3280|  66.1k|                                                                         pu1_src_top_chroma,
 3281|  66.1k|                                                                         pu1_sao_src_top_left_chroma_curr_ctb,
 3282|  66.1k|                                                                         au1_src_top_right,
 3283|  66.1k|                                                                         au1_sao_src_top_left_chroma_bot_left,
 3284|  66.1k|                                                                         au1_avail_chroma,
 3285|  66.1k|                                                                         ai1_offset_cb,
 3286|  66.1k|                                                                         ai1_offset_cr,
 3287|  66.1k|                                                                         sao_wd_chroma,
 3288|  66.1k|                                                                         sao_ht_chroma);
 3289|  66.1k|                        }
 3290|  82.4k|                        pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3291|  82.4k|                        pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 3292|       |
 3293|  82.4k|                        pu1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 2];
 3294|  82.4k|                        pu1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 1];
 3295|  82.4k|                    }
 3296|   106k|                    else
 3297|   106k|                    {
 3298|   106k|                        UWORD16 *pu2_src_chroma = (UWORD16 *)pu1_src_chroma;
 3299|       |
 3300|   106k|                        au2_src_top_right[0] = pu2_src_chroma[sao_wd_chroma - chroma_strd];
 3301|   106k|                        au2_src_top_right[1] = pu2_src_chroma[sao_wd_chroma - chroma_strd + 1];
 3302|       |
 3303|   106k|                        au2_sao_src_top_left_chroma_bot_left[0] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 2];
 3304|   106k|                        au2_sao_src_top_left_chroma_bot_left[1] = pu2_src_chroma[sao_ht_chroma * chroma_strd - 1];
 3305|       |
 3306|   106k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (3306:28): [True: 61.1k, False: 45.6k]
  ------------------
 3307|  61.1k|                        {
 3308|  61.1k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 3309|  61.1k|                                                                             chroma_strd,
 3310|  61.1k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 3311|  61.1k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 3312|  61.1k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3313|  61.1k|                                                                             au2_src_top_right,
 3314|  61.1k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 3315|  61.1k|                                                                             au1_avail_chroma,
 3316|  61.1k|                                                                             ai1_offset_cr,
 3317|  61.1k|                                                                             ai1_offset_cb,
 3318|  61.1k|                                                                             sao_wd_chroma,
 3319|  61.1k|                                                                             sao_ht_chroma,
 3320|  61.1k|                                                                             u4_bit_depth_chroma);
 3321|  61.1k|                        }
 3322|  45.6k|                        else
 3323|  45.6k|                        {
 3324|  45.6k|                            ps_codec->apf_hbd_sao_chroma[ps_sao->b3_cb_type_idx - 2]((UWORD16 *)pu1_src_chroma,
 3325|  45.6k|                                                                             chroma_strd,
 3326|  45.6k|                                                                             (UWORD16 *)pu1_src_left_chroma,
 3327|  45.6k|                                                                             (UWORD16 *)pu1_src_top_chroma,
 3328|  45.6k|                                                                             (UWORD16 *)pu1_sao_src_top_left_chroma_curr_ctb,
 3329|  45.6k|                                                                             au2_src_top_right,
 3330|  45.6k|                                                                             au2_sao_src_top_left_chroma_bot_left,
 3331|  45.6k|                                                                             au1_avail_chroma,
 3332|  45.6k|                                                                             ai1_offset_cb,
 3333|  45.6k|                                                                             ai1_offset_cr,
 3334|  45.6k|                                                                             sao_wd_chroma,
 3335|  45.6k|                                                                             sao_ht_chroma,
 3336|  45.6k|                                                                             u4_bit_depth_chroma);
 3337|  45.6k|                        }
 3338|   106k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[0] = pu2_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3339|   106k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[1] = pu2_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 3340|       |
 3341|   106k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_bot_left)[0] = pu2_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 2];
 3342|   106k|                        ((UWORD16 *)pu1_sao_src_top_left_chroma_bot_left)[1] = pu2_src_chroma[(sao_ht_chroma) * chroma_strd + sao_wd_chroma - 1];
 3343|   106k|                    }
 3344|   189k|                }
 3345|  3.36M|            }
 3346|  4.77M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (3346:21): [True: 814k, False: 3.95M]
  |  Branch (3346:68): [True: 1.16M, False: 2.78M]
  ------------------
 3347|  1.98M|            {
 3348|  1.98M|                UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_sao_src_top_left_chroma_curr_ctb, sao_wd_chroma, sao_ht_chroma, pixel_size_uv);
  ------------------
  |  |   99|  1.98M|#define UPDATE_CHROMA_BUFFERS(pu1_src_chroma, chroma_strd, pu1_src_left_chroma, pu1_src_top_chroma, pu1_top_left, sao_wd_chroma, sao_ht_chroma, pixel_size_uv) do { \
  |  |  100|  1.98M|    if(PIXEL_SIZE_1BYTE == (pixel_size_uv)) { \
  |  |  ------------------
  |  |  |  |  279|  1.98M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  |  |  ------------------
  |  |  |  Branch (100:8): [True: 1.97M, False: 7.59k]
  |  |  ------------------
  |  |  101|  24.5M|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (101:22): [True: 22.5M, False: 1.97M]
  |  |  ------------------
  |  |  102|  22.5M|            (pu1_src_left_chroma)[2 * row] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  103|  22.5M|            (pu1_src_left_chroma)[2 * row + 1] = (pu1_src_chroma)[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  104|  22.5M|        } \
  |  |  105|  1.97M|        (pu1_top_left)[0] = (pu1_src_top_chroma)[(sao_wd_chroma) - 2]; \
  |  |  106|  1.97M|        (pu1_top_left)[1] = (pu1_src_top_chroma)[(sao_wd_chroma) - 1]; \
  |  |  107|  1.97M|    } else { \
  |  |  108|  7.59k|        UWORD16 *pu2_src_left = (UWORD16 *)(pu1_src_left_chroma); \
  |  |  109|  7.59k|        UWORD16 *pu2_src = (UWORD16 *)(pu1_src_chroma); \
  |  |  110|  7.59k|        UWORD16 *pu2_top = (UWORD16 *)(pu1_src_top_chroma); \
  |  |  111|  7.59k|        UWORD16 *pu2_top_left = (UWORD16 *)(pu1_top_left); \
  |  |  112|   291k|        for(row = 0; row < (sao_ht_chroma); row++) { \
  |  |  ------------------
  |  |  |  Branch (112:22): [True: 284k, False: 7.59k]
  |  |  ------------------
  |  |  113|   284k|            pu2_src_left[2 * row] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 2)]; \
  |  |  114|   284k|            pu2_src_left[2 * row + 1] = pu2_src[row * (chroma_strd) + ((sao_wd_chroma) - 1)]; \
  |  |  115|   284k|        } \
  |  |  116|  7.59k|        pu2_top_left[0] = pu2_top[(sao_wd_chroma) - 2]; \
  |  |  117|  7.59k|        pu2_top_left[1] = pu2_top[(sao_wd_chroma) - 1]; \
  |  |  118|  7.59k|    } \
  |  |  119|  1.98M|    memcpy((pu1_src_top_chroma), &(pu1_src_chroma)[((sao_ht_chroma) - 1) * (chroma_strd) * (pixel_size_uv)], (sao_wd_chroma) * (pixel_size_uv)); \
  |  |  120|  1.98M|} while(0)
  |  |  ------------------
  |  |  |  Branch (120:9): [Folded, False: 1.98M]
  |  |  ------------------
  ------------------
 3349|  1.98M|                if(PIXEL_SIZE_1BYTE == pixel_size_uv)
  ------------------
  |  |  279|  1.98M|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (3349:20): [True: 1.97M, False: 10.4k]
  ------------------
 3350|  1.97M|                {
 3351|  1.97M|                    pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3352|  1.97M|                    pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 3353|  1.97M|                }
 3354|  10.4k|                else
 3355|  10.4k|                {
 3356|  10.4k|                    ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[0] = ((UWORD16 *)pu1_src_chroma)[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma];
 3357|  10.4k|                    ((UWORD16 *)pu1_sao_src_top_left_chroma_top_right)[1] = ((UWORD16 *)pu1_src_chroma)[(sao_ht_chroma - 1) * chroma_strd + sao_wd_chroma + 1];
 3358|  10.4k|                }
 3359|  1.98M|            }
 3360|       |
 3361|  8.13M|        }
 3362|  19.3M|    }
 3363|       |
 3364|       |
 3365|       |
 3366|       |
 3367|       |/* If no loop filter is enabled copy the backed up values */
 3368|  19.3M|    {
 3369|       |        /* Luma */
 3370|  19.3M|        if(no_loop_filter_enabled_luma)
  ------------------
  |  Branch (3370:12): [True: 114k, False: 19.2M]
  ------------------
 3371|   114k|        {
 3372|   114k|            UWORD32 u4_no_loop_filter_flag;
 3373|   114k|            WORD32 loop_filter_bit_pos;
 3374|   114k|            WORD32 log2_min_cu = 3;
 3375|   114k|            WORD32 min_cu = (1 << log2_min_cu);
 3376|   114k|            UWORD8 *pu1_src_tmp_luma = pu1_src_luma;
 3377|   114k|            WORD32 sao_blk_ht = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|   114k|#define SAO_SHIFT_CTB    8
  ------------------
 3378|   114k|            WORD32 sao_blk_wd = ctb_size;
 3379|   114k|            WORD32 remaining_rows;
 3380|   114k|            WORD32 remaining_cols;
 3381|       |
 3382|   114k|            remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + ctb_size - SAO_SHIFT_CTB);
  ------------------
  |  |   78|   114k|#define SAO_SHIFT_CTB    8
  ------------------
 3383|   114k|            remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + ctb_size - SAO_SHIFT_CTB);
  ------------------
  |  |   78|   114k|#define SAO_SHIFT_CTB    8
  ------------------
 3384|   114k|            if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|   114k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3384:16): [True: 22.3k, False: 91.8k]
  ------------------
 3385|  22.3k|                sao_blk_ht += remaining_rows;
 3386|   114k|            if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|   114k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3386:16): [True: 30.9k, False: 83.2k]
  ------------------
 3387|  30.9k|                sao_blk_wd += remaining_cols;
 3388|       |
 3389|   114k|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * pixel_size_y : 0;
  ------------------
  |  |   78|  80.0k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3389:33): [True: 80.0k, False: 34.1k]
  ------------------
 3390|   114k|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd * pixel_size_y : 0;
  ------------------
  |  |   78|  76.6k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3390:33): [True: 76.6k, False: 37.5k]
  ------------------
 3391|       |
 3392|   114k|            pu1_src_backup_luma = ps_sao_ctxt->pu1_tmp_buf_luma;
 3393|       |
 3394|   114k|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
 3395|   114k|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
 3396|   114k|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (3396:16): [True: 80.0k, False: 34.1k]
  ------------------
 3397|  80.0k|                loop_filter_bit_pos -= 1;
 3398|       |
 3399|   114k|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
 3400|   114k|                            (loop_filter_bit_pos >> 3);
 3401|       |
 3402|   114k|            for(i = -(ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  76.6k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3402:23): [True: 76.6k, False: 37.5k]
  ------------------
 3403|   799k|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (3403:29): [True: 685k, False: 114k]
  ------------------
 3404|   685k|            {
 3405|   685k|                WORD32 tmp_wd = sao_blk_wd;
 3406|       |
 3407|   685k|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
 3408|   685k|                                (loop_filter_bit_pos & 7);
 3409|   685k|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
 3410|       |
 3411|   685k|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (3411:20): [True: 368k, False: 316k]
  ------------------
 3412|   368k|                {
 3413|  1.02M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (3413:27): [True: 653k, False: 368k]
  ------------------
 3414|   653k|                    {
 3415|   653k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (3415:28): [True: 261k, False: 391k]
  ------------------
 3416|   261k|                        {
 3417|   261k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   261k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 139k, False: 122k]
  |  |  ------------------
  ------------------
 3418|   261k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   261k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 139k, False: 122k]
  |  |  ------------------
  ------------------
 3419|   261k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
 3420|   261k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
 3421|   261k|                        }
 3422|   391k|                        else
 3423|   391k|                        {
 3424|  3.48M|                            for(row = 0; row < min_cu; row++)
  ------------------
  |  Branch (3424:42): [True: 3.09M, False: 391k]
  ------------------
 3425|  3.09M|                            {
 3426|   167M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y; col++)
  ------------------
  |  |   43|   167M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 30.5M, False: 136M]
  |  |  ------------------
  ------------------
  |  Branch (3426:46): [True: 164M, False: 3.09M]
  ------------------
 3427|   164M|                                {
 3428|   164M|                                    pu1_src_tmp_luma[row * src_strd * pixel_size_y + col] = pu1_src_backup_luma[row * backup_strd * pixel_size_y + col];
 3429|   164M|                                }
 3430|  3.09M|                            }
 3431|   391k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   391k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 145k, False: 246k]
  |  |  ------------------
  ------------------
 3432|   391k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * pixel_size_y;
  ------------------
  |  |   43|   391k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 145k, False: 246k]
  |  |  ------------------
  ------------------
 3433|   391k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
 3434|   391k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
 3435|   391k|                        }
 3436|   653k|                    }
 3437|       |
 3438|   368k|                    pu1_src_tmp_luma -= sao_blk_wd * pixel_size_y;
 3439|   368k|                    pu1_src_backup_luma -= sao_blk_wd * pixel_size_y;
 3440|   368k|                }
 3441|       |
 3442|   685k|                pu1_src_tmp_luma += ((src_strd << log2_min_cu) * pixel_size_y);
 3443|   685k|                pu1_src_backup_luma += ((backup_strd << log2_min_cu) * pixel_size_y);
 3444|   685k|            }
 3445|   114k|        }
 3446|       |
 3447|       |        /* Chroma */
 3448|  19.3M|        if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && no_loop_filter_enabled_chroma)
  ------------------
  |  Branch (3448:12): [True: 18.9M, False: 350k]
  |  Branch (3448:73): [True: 108k, False: 18.8M]
  ------------------
 3449|   108k|        {
 3450|   108k|            UWORD32 u4_no_loop_filter_flag;
 3451|   108k|            WORD32 loop_filter_bit_pos;
 3452|   108k|            WORD32 log2_min_cu = 3;
 3453|   108k|            WORD32 min_cu = (1 << log2_min_cu);
 3454|   108k|            UWORD8 *pu1_src_tmp_chroma = pu1_src_chroma;
 3455|   108k|            WORD32 sao_blk_ht = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|   108k|#define SAO_SHIFT_CTB    8
  ------------------
 3456|   108k|            WORD32 sao_blk_wd = ctb_size;
 3457|   108k|            WORD32 remaining_rows;
 3458|   108k|            WORD32 remaining_cols;
 3459|       |
 3460|   108k|            remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + ctb_size - 2 * SAO_SHIFT_CTB);
  ------------------
  |  |   78|   108k|#define SAO_SHIFT_CTB    8
  ------------------
 3461|   108k|            remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + ctb_size - 2 * SAO_SHIFT_CTB);
  ------------------
  |  |   78|   108k|#define SAO_SHIFT_CTB    8
  ------------------
 3462|   108k|            if(remaining_rows <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|   108k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3462:16): [True: 22.2k, False: 86.0k]
  ------------------
 3463|  22.2k|                sao_blk_ht += remaining_rows;
 3464|   108k|            if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|   108k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3464:16): [True: 30.1k, False: 78.0k]
  ------------------
 3465|  30.1k|                sao_blk_wd += remaining_cols;
 3466|       |
 3467|   108k|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * 2 : 0) * pixel_size_uv;
  ------------------
  |  |   78|  75.2k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3467:36): [True: 75.2k, False: 33.0k]
  ------------------
 3468|   108k|            pu1_src_tmp_chroma -= (ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * chroma_strd : 0) * pixel_size_uv;
  ------------------
  |  |   78|  74.3k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3468:36): [True: 74.3k, False: 33.9k]
  ------------------
 3469|       |
 3470|   108k|            pu1_src_backup_chroma = ps_sao_ctxt->pu1_tmp_buf_chroma;
 3471|       |
 3472|   108k|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
 3473|   108k|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
 3474|   108k|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (3474:16): [True: 75.2k, False: 32.9k]
  ------------------
 3475|  75.2k|                loop_filter_bit_pos -= (is_yuv444 ? 1 : 2);
  ------------------
  |  Branch (3475:41): [True: 0, False: 75.2k]
  ------------------
 3476|       |
 3477|   108k|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
 3478|   108k|                            (loop_filter_bit_pos >> 3);
 3479|       |
 3480|   108k|            for(i = -(ps_sao_ctxt->i4_ctb_y ? 2 * SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  74.3k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3480:23): [True: 74.3k, False: 33.9k]
  ------------------
 3481|   771k|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (3481:29): [True: 663k, False: 108k]
  ------------------
 3482|   663k|            {
 3483|   663k|                WORD32 tmp_wd = sao_blk_wd;
 3484|       |
 3485|   663k|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
 3486|   663k|                                (loop_filter_bit_pos & 7);
 3487|   663k|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
 3488|       |
 3489|   663k|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (3489:20): [True: 363k, False: 299k]
  ------------------
 3490|   363k|                {
 3491|  1.00M|                    while(tmp_wd > 0)
  ------------------
  |  Branch (3491:27): [True: 644k, False: 363k]
  ------------------
 3492|   644k|                    {
 3493|   644k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (3493:28): [True: 262k, False: 382k]
  ------------------
 3494|   262k|                        {
 3495|   262k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   262k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 131k, False: 130k]
  |  |  ------------------
  ------------------
 3496|   262k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   262k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 131k, False: 130k]
  |  |  ------------------
  ------------------
 3497|   262k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
 3498|   262k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
 3499|   262k|                        }
 3500|   382k|                        else
 3501|   382k|                        {
 3502|  2.72M|                            for(row = 0; row < min_cu / v_samp_factor; row++)
  ------------------
  |  Branch (3502:42): [True: 2.34M, False: 382k]
  ------------------
 3503|  2.34M|                            {
 3504|   140M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv; col++)
  ------------------
  |  |   43|   140M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 33.4M, False: 107M]
  |  |  ------------------
  ------------------
  |  Branch (3504:46): [True: 138M, False: 2.34M]
  ------------------
 3505|   138M|                                {
 3506|   138M|                                    pu1_src_tmp_chroma[row * chroma_strd * pixel_size_uv + col] = pu1_src_backup_chroma[row * backup_strd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv + col];
 3507|   138M|                                }
 3508|  2.34M|                            }
 3509|       |
 3510|   382k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   382k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 149k, False: 232k]
  |  |  ------------------
  ------------------
 3511|   382k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd) * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
  ------------------
  |  |   43|   382k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 149k, False: 232k]
  |  |  ------------------
  ------------------
 3512|   382k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
 3513|   382k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
 3514|   382k|                        }
 3515|   644k|                    }
 3516|       |
 3517|   363k|                    pu1_src_tmp_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
 3518|   363k|                    pu1_src_backup_chroma -= sao_blk_wd * (chroma_pixel_strd / h_samp_factor) * pixel_size_uv;
 3519|   363k|                }
 3520|       |
 3521|   663k|                pu1_src_tmp_chroma += ((((src_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
 3522|   663k|                pu1_src_backup_chroma += ((((backup_strd * chroma_pixel_strd) / (h_samp_factor * v_samp_factor)) << log2_min_cu) * pixel_size_uv);
 3523|   663k|            }
 3524|   108k|        }
 3525|  19.3M|    }
 3526|       |
 3527|  19.3M|}

ihevcd_get_total_pic_buf_size:
  195|  24.8k|{
  196|  24.8k|    WORD32 size;
  197|  24.8k|    WORD32 pixel_size = ps_codec->i4_pixel_size_y;
  198|  24.8k|    WORD32 num_luma_samples;
  199|  24.8k|    WORD32 max_dpb_size;
  200|  24.8k|    WORD32 num_samples;
  201|       |
  202|       |
  203|  24.8k|    sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
  204|       |
  205|       |    /* Get maximum number of buffers for the current picture size */
  206|  24.8k|    max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
  207|       |
  208|  24.8k|    if(ps_codec->e_frm_out_mode != IVD_DECODE_FRAME_OUT)
  ------------------
  |  Branch (208:8): [True: 24.8k, False: 0]
  ------------------
  209|  24.8k|        max_dpb_size += ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
  210|       |
  211|  24.8k|    max_dpb_size++;
  212|       |    /* Allocation is required for
  213|       |     * (Wd + horz_pad) * (Ht + vert_pad) * (2 * max_dpb_size + 1)
  214|       |     */
  215|       |
  216|       |    /* Account for padding area */
  217|  24.8k|    num_luma_samples = (wd + PAD_WD) * (ht + PAD_HT);
  ------------------
  |  |   91|  24.8k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  24.8k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  24.8k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                  num_luma_samples = (wd + PAD_WD) * (ht + PAD_HT);
  ------------------
  |  |   95|  24.8k|#define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   72|  24.8k|#define PAD_TOP     80
  |  |  ------------------
  |  |               #define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   77|  24.8k|#define PAD_BOT     80
  |  |  ------------------
  ------------------
  218|       |
  219|       |    /* Account for chroma */
  220|  24.8k|    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (220:8): [True: 0, False: 24.8k]
  ------------------
  221|      0|    {
  222|      0|        num_samples = num_luma_samples * 3;
  223|      0|    }
  224|  24.8k|    else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (224:13): [True: 4.24k, False: 20.5k]
  ------------------
  225|  4.24k|    {
  226|  4.24k|        num_samples = num_luma_samples * 2;
  227|  4.24k|    }
  228|  20.5k|    else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (228:13): [True: 20.1k, False: 386]
  ------------------
  229|  20.1k|    {
  230|  20.1k|        num_samples = num_luma_samples * 3 / 2;
  231|  20.1k|    }
  232|    386|    else
  233|    386|    {
  234|    386|        num_samples = num_luma_samples;
  235|    386|    }
  236|       |
  237|       |    /* Number of bytes in reference pictures */
  238|  24.8k|    size = num_samples * max_dpb_size;
  239|       |
  240|       |
  241|       |    /* Account for bit depth of pixels */
  242|  24.8k|    size *= pixel_size;
  243|       |
  244|  24.8k|    return size;
  245|  24.8k|}
ihevcd_get_pic_mv_bank_size:
  267|  45.8k|{
  268|  45.8k|    WORD32 size;
  269|       |
  270|  45.8k|    WORD32 pic_size;
  271|       |
  272|  45.8k|    WORD32 mv_bank_size;
  273|  45.8k|    WORD32 num_pu;
  274|  45.8k|    WORD32 num_ctb;
  275|  45.8k|    pic_size = num_luma_samples;
  276|       |
  277|       |
  278|  45.8k|    num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  367|  45.8k|#define MIN_PU_SIZE         4
  ------------------
                  num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  367|  45.8k|#define MIN_PU_SIZE         4
  ------------------
  279|  45.8k|    num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  45.8k|#define MIN_CTB_SIZE        16
  ------------------
                  num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  45.8k|#define MIN_CTB_SIZE        16
  ------------------
  280|       |
  281|  45.8k|    mv_bank_size = 0;
  282|       |
  283|       |    /* Size for storing pu_t start index each CTB */
  284|       |    /* One extra entry is needed to compute number of PUs in the last CTB */
  285|  45.8k|    mv_bank_size += (num_ctb + 1) * sizeof(WORD32);
  286|       |
  287|       |    /* Size for pu_map */
  288|  45.8k|    mv_bank_size += num_pu;
  289|       |
  290|       |    /* Size for storing pu_t for each PU */
  291|  45.8k|    mv_bank_size += num_pu * sizeof(pu_t);
  292|       |
  293|       |    /* Size for storing slice_idx for each CTB */
  294|  45.8k|    mv_bank_size += ALIGN4(num_ctb * sizeof(UWORD16));
  ------------------
  |  |   54|  45.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  295|       |
  296|  45.8k|    size =  mv_bank_size;
  297|  45.8k|    return size;
  298|  45.8k|}
ihevcd_get_tu_data_size:
  321|  24.8k|{
  322|       |
  323|  24.8k|    sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
  324|  24.8k|    WORD32 tu_data_size;
  325|  24.8k|    WORD32 num_ctb;
  326|  24.8k|    WORD32 num_luma_tu, num_chroma_tu, num_tu;
  327|  24.8k|    WORD32 num_chroma_sub_tu = 0;
  328|  24.8k|    num_ctb = num_luma_samples / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
                  num_ctb = num_luma_samples / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  24.8k|#define MIN_CTB_SIZE        16
  ------------------
  329|       |
  330|  24.8k|    num_luma_tu = num_luma_samples / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  358|  24.8k|#define MIN_TU_SIZE         4
  ------------------
                  num_luma_tu = num_luma_samples / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  358|  24.8k|#define MIN_TU_SIZE         4
  ------------------
  331|       |
  332|  24.8k|    if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (332:8): [True: 0, False: 24.8k]
  ------------------
  333|      0|    {
  334|      0|        num_chroma_tu = num_luma_tu << 1;
  335|      0|    }
  336|  24.8k|    else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422)
  ------------------
  |  Branch (336:13): [True: 4.24k, False: 20.5k]
  ------------------
  337|  4.24k|    {
  338|  4.24k|        num_chroma_tu = num_luma_tu >> 1;
  339|  4.24k|        num_chroma_sub_tu = num_luma_tu >> 1;
  340|  4.24k|    }
  341|  20.5k|    else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (341:13): [True: 20.1k, False: 386]
  ------------------
  342|  20.1k|    {
  343|  20.1k|        num_chroma_tu = num_luma_tu >> 1;
  344|  20.1k|    }
  345|    386|    else
  346|    386|    {
  347|    386|        num_chroma_tu = 0;
  348|    386|    }
  349|       |
  350|  24.8k|    num_tu = num_luma_tu + num_chroma_tu;
  351|  24.8k|    tu_data_size = 0;
  352|       |
  353|       |    /* Size for storing tu_t start index each CTB */
  354|       |    /* One extra entry is needed to compute number of TUs in the last CTB */
  355|  24.8k|    tu_data_size += (num_ctb + 1) * sizeof(WORD32);
  356|       |
  357|       |    /* Size for storing tu map */
  358|  24.8k|    tu_data_size += num_tu * sizeof(UWORD8);
  359|       |
  360|       |    /* Size for storing tu_t for each TU */
  361|  24.8k|    tu_data_size += num_tu * sizeof(tu_t);
  362|       |
  363|       |    /* Size for storing number of coded subblocks and scan_idx for each TU */
  364|  24.8k|    tu_data_size += (num_tu + num_chroma_sub_tu) * (sizeof(WORD8) + sizeof(WORD8));
  365|       |
  366|       |    /* Size for storing coeff data for each TU */
  367|  24.8k|    tu_data_size += (num_tu + num_chroma_sub_tu) * sizeof(tu_sblk_coeff_data_t);
  368|       |
  369|       |
  370|  24.8k|    return tu_data_size;
  371|  24.8k|}
ihevcd_nctb_cnt:
  375|  69.8k|{
  376|  69.8k|    WORD32 nctb = 1;
  377|  69.8k|    UNUSED(ps_codec);
  ------------------
  |  |   38|  69.8k|#define UNUSED(x) ((void)(x))
  ------------------
  378|       |    //TODO: Currently set to 1
  379|       |    /* If CTB size is less than 32 x 32 then set nCTB as 4 */
  380|  69.8k|    if(ps_sps->i1_log2_ctb_size < 5)
  ------------------
  |  Branch (380:8): [True: 8.08k, False: 61.8k]
  ------------------
  381|  8.08k|        nctb = 1;
  382|       |
  383|  69.8k|    return nctb;
  384|  69.8k|}
ihevcd_get_tile_pos:
  393|  1.69M|{
  394|       |
  395|  1.69M|    tile_t *ps_tile_tmp;
  396|  1.69M|    WORD32 i;
  397|  1.69M|    WORD32 tile_row, tile_col;
  398|       |
  399|  1.69M|    if(ctb_x < 0 || ctb_y < 0)
  ------------------
  |  Branch (399:8): [True: 18.4E, False: 1.69M]
  |  Branch (399:21): [True: 18.4E, False: 1.69M]
  ------------------
  400|      0|    {
  401|      0|        *pi4_ctb_tile_x = 0;
  402|      0|        *pi4_ctb_tile_y = 0;
  403|      0|        *pi4_tile_idx = 0;
  404|       |
  405|      0|        return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  406|      0|    }
  407|       |
  408|  1.69M|    tile_row = 0;
  409|  1.69M|    tile_col = 0;
  410|  1.69M|    ps_tile_tmp = ps_pps->ps_tile;
  411|  1.69M|    if(0 == ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (411:8): [True: 1.03M, False: 656k]
  ------------------
  412|  1.03M|    {
  413|  1.03M|        *pi4_ctb_tile_x = ctb_x;
  414|  1.03M|        *pi4_ctb_tile_y = ctb_y;
  415|  1.03M|        *pi4_tile_idx = 0;
  416|  1.03M|    }
  417|   656k|    else
  418|   656k|    {
  419|  9.26M|        for(i = 0; i < ps_pps->i1_num_tile_columns; i++)
  ------------------
  |  Branch (419:20): [True: 9.26M, False: 294]
  ------------------
  420|  9.26M|        {
  421|  9.26M|            WORD16 next_tile_ctb_x;
  422|  9.26M|            ps_tile_tmp = ps_pps->ps_tile + i; //* ps_pps->i1_num_tile_rows;
  423|  9.26M|            if((ps_pps->i1_num_tile_columns - 1) == i)
  ------------------
  |  Branch (423:16): [True: 162k, False: 9.09M]
  ------------------
  424|   162k|            {
  425|   162k|                next_tile_ctb_x = ps_sps->i2_pic_wd_in_ctb;
  426|   162k|            }
  427|  9.09M|            else
  428|  9.09M|            {
  429|  9.09M|                tile_t *ps_tile_next_tmp;
  430|  9.09M|                ps_tile_next_tmp = ps_pps->ps_tile + i + 1;
  431|  9.09M|                next_tile_ctb_x = ps_tile_next_tmp->u1_pos_x;
  432|  9.09M|            }
  433|  9.26M|            if((ctb_x >= ps_tile_tmp->u1_pos_x) && (ctb_x < next_tile_ctb_x))
  ------------------
  |  Branch (433:16): [True: 9.26M, False: 62]
  |  Branch (433:52): [True: 656k, False: 8.60M]
  ------------------
  434|   656k|            {
  435|   656k|                tile_col = i;
  436|   656k|                break;
  437|   656k|            }
  438|  9.26M|        }
  439|   656k|        *pi4_ctb_tile_x = ctb_x - ps_tile_tmp->u1_pos_x;
  440|       |
  441|  3.35M|        for(i = 0; i < ps_pps->i1_num_tile_rows; i++)
  ------------------
  |  Branch (441:20): [True: 3.35M, False: 254]
  ------------------
  442|  3.35M|        {
  443|  3.35M|            WORD16 next_tile_ctb_y;
  444|  3.35M|            ps_tile_tmp = ps_pps->ps_tile + i * ps_pps->i1_num_tile_columns;
  445|  3.35M|            if((ps_pps->i1_num_tile_rows - 1) == i)
  ------------------
  |  Branch (445:16): [True: 227k, False: 3.12M]
  ------------------
  446|   227k|            {
  447|   227k|                next_tile_ctb_y = ps_sps->i2_pic_ht_in_ctb;
  448|   227k|            }
  449|  3.12M|            else
  450|  3.12M|            {
  451|  3.12M|                tile_t *ps_tile_next_tmp;
  452|  3.12M|                ps_tile_next_tmp = ps_pps->ps_tile + ((i + 1) * ps_pps->i1_num_tile_columns);
  453|  3.12M|                next_tile_ctb_y = ps_tile_next_tmp->u1_pos_y;
  454|  3.12M|            }
  455|  3.35M|            if((ctb_y >= ps_tile_tmp->u1_pos_y) && (ctb_y < next_tile_ctb_y))
  ------------------
  |  Branch (455:16): [True: 3.35M, False: 18.4E]
  |  Branch (455:52): [True: 656k, False: 2.69M]
  ------------------
  456|   656k|            {
  457|   656k|                tile_row = i;
  458|   656k|                break;
  459|   656k|            }
  460|       |
  461|  3.35M|        }
  462|   656k|        *pi4_ctb_tile_y = ctb_y - ps_tile_tmp->u1_pos_y;
  463|   656k|        *pi4_tile_idx = tile_row * ps_pps->i1_num_tile_columns
  464|   656k|                        + tile_col;
  465|   656k|    }
  466|  1.69M|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  467|  1.69M|}
ihevcd_pic_buf_mgr_add_bufs:
  491|  20.9k|{
  492|  20.9k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  493|  20.9k|    WORD32 i;
  494|  20.9k|    WORD32 max_dpb_size;
  495|  20.9k|    sps_t *ps_sps;
  496|  20.9k|    UWORD8 *pu1_buf;
  497|  20.9k|    pic_buf_t *ps_pic_buf;
  498|  20.9k|    WORD32 pic_buf_size_allocated;
  499|  20.9k|    WORD32 h_samp_factor, v_samp_factor;
  500|  20.9k|    WORD32 chroma_pixel_strd = 2;
  501|       |
  502|  20.9k|    WORD32 pixel_size_y;
  503|  20.9k|    WORD32 pixel_size_uv;
  504|       |
  505|       |    /* Derive the pixel size for luma and chroma */
  506|  20.9k|    pixel_size_y  = ps_codec->i4_pixel_size_y;
  507|  20.9k|    pixel_size_uv = ps_codec->i4_pixel_size_uv;
  508|       |
  509|       |
  510|       |    /* Initialize Pic buffer manager */
  511|  20.9k|    ps_sps = ps_codec->s_parse.ps_sps;
  512|       |
  513|  20.9k|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (513:21): [True: 0, False: 20.9k]
  ------------------
  514|  20.9k|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (514:21): [True: 16.6k, False: 4.34k]
  ------------------
  515|       |
  516|       |    /* Compute the number of Pic buffers needed */
  517|  20.9k|    max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
  518|       |
  519|  20.9k|    if(ps_codec->e_frm_out_mode != IVD_DECODE_FRAME_OUT)
  ------------------
  |  Branch (519:8): [True: 20.9k, False: 0]
  ------------------
  520|  20.9k|        max_dpb_size += ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
  521|       |
  522|       |    /* Allocate one extra picture to handle current frame
  523|       |     * In case of asynchronous parsing and processing, number of buffers should increase here
  524|       |     * based on when parsing and processing threads are synchronized
  525|       |     */
  526|  20.9k|    max_dpb_size++;
  527|       |
  528|       |
  529|  20.9k|    pu1_buf = (UWORD8 *)ps_codec->pu1_ref_pic_buf_base;
  530|       |
  531|  20.9k|    ps_pic_buf = (pic_buf_t *)ps_codec->ps_pic_buf;
  532|       |
  533|       |    /* In case of non-shared mode, add picture buffers to buffer manager
  534|       |     * In case of shared mode buffers are added in the run-time
  535|       |     */
  536|  20.9k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (536:8): [True: 20.9k, False: 0]
  ------------------
  537|  20.9k|    {
  538|  20.9k|        WORD32 buf_ret;
  539|  20.9k|        WORD32 luma_samples;
  540|  20.9k|        WORD32 chroma_samples;
  541|  20.9k|        pic_buf_size_allocated = ps_codec->i4_total_pic_buf_size;
  542|       |
  543|  20.9k|        luma_samples = (ps_codec->i4_strd * pixel_size_y) *
  544|  20.9k|                        (ps_sps->i2_pic_height_in_luma_samples + PAD_HT);
  ------------------
  |  |   95|  20.9k|#define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   72|  20.9k|#define PAD_TOP     80
  |  |  ------------------
  |  |               #define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   77|  20.9k|#define PAD_BOT     80
  |  |  ------------------
  ------------------
  545|       |
  546|  20.9k|        if(CHROMA_FMT_IDC_MONOCHROME == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (546:12): [True: 277, False: 20.6k]
  ------------------
  547|    277|        {
  548|    277|            chroma_samples = 0;
  549|    277|        }
  550|  20.6k|        else
  551|  20.6k|        {
  552|  20.6k|            chroma_samples = luma_samples * 2 / (h_samp_factor * v_samp_factor);
  553|  20.6k|        }
  554|       |
  555|       |        /* Try to add as many buffers as possible since memory is already allocated */
  556|       |        /* If the number of buffers that can be added is less than max_num_bufs
  557|       |         * return with an error.
  558|       |         */
  559|   107k|        for(i = 0; i < max_dpb_size; i++)
  ------------------
  |  Branch (559:20): [True: 86.3k, False: 20.8k]
  ------------------
  560|  86.3k|        {
  561|  86.3k|            pic_buf_size_allocated -= (luma_samples + chroma_samples);
  562|       |
  563|  86.3k|            if(pic_buf_size_allocated < 0)
  ------------------
  |  Branch (563:16): [True: 92, False: 86.2k]
  ------------------
  564|     92|            {
  565|     92|                ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_PICBUF;
  566|     92|                return IHEVCD_INSUFFICIENT_MEM_PICBUF;
  567|     92|            }
  568|       |
  569|  86.2k|            ps_pic_buf->pu1_luma = pu1_buf + (ps_codec->i4_strd * PAD_TOP + PAD_LEFT) * pixel_size_y;
  ------------------
  |  |   72|  86.2k|#define PAD_TOP     80
  ------------------
                          ps_pic_buf->pu1_luma = pu1_buf + (ps_codec->i4_strd * PAD_TOP + PAD_LEFT) * pixel_size_y;
  ------------------
  |  |   82|  86.2k|#define PAD_LEFT    80
  ------------------
  570|  86.2k|            pu1_buf += luma_samples;
  571|       |
  572|  86.2k|            if(chroma_samples)
  ------------------
  |  Branch (572:16): [True: 85.2k, False: 965]
  ------------------
  573|  85.2k|            {
  574|  85.2k|                ps_pic_buf->pu1_chroma = pu1_buf
  575|  85.2k|                                + ((ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor) * (PAD_TOP / v_samp_factor)
  ------------------
  |  |   72|  85.2k|#define PAD_TOP     80
  ------------------
  576|  85.2k|                                + (PAD_LEFT * chroma_pixel_strd / h_samp_factor)) * pixel_size_uv;
  ------------------
  |  |   82|  85.2k|#define PAD_LEFT    80
  ------------------
  577|  85.2k|                pu1_buf += chroma_samples;
  578|  85.2k|            }
  579|    965|            else
  580|    965|            {
  581|    965|                ps_pic_buf->pu1_chroma = NULL;
  582|    965|            }
  583|       |
  584|       |            /* Pad boundary pixels (one pixel on all sides) */
  585|       |            /* This ensures SAO does not read uninitialized pixels */
  586|       |            /* Note these are not used in actual processing */
  587|  86.2k|            {
  588|  86.2k|                UWORD8 *pu1_buf;
  589|  86.2k|                WORD32 strd, wd, ht;
  590|  86.2k|                WORD32 i;
  591|  86.2k|                strd = ps_codec->i4_strd;
  592|  86.2k|                wd = ps_codec->i4_wd;
  593|  86.2k|                ht = ps_codec->i4_ht;
  594|       |
  595|  86.2k|                pu1_buf = ps_pic_buf->pu1_luma;
  596|  37.3M|                for(i = 0; i < ht; i++)
  ------------------
  |  Branch (596:28): [True: 37.2M, False: 86.2k]
  ------------------
  597|  37.2M|                {
  598|  37.2M|                    pu1_buf[-1] = 0;
  599|  37.2M|                    pu1_buf[wd] = 0;
  600|  37.2M|                    pu1_buf += strd;
  601|  37.2M|                }
  602|  86.2k|                pu1_buf = ps_pic_buf->pu1_luma;
  603|  86.2k|                memset(pu1_buf - strd - 1, 0, wd + 2);
  604|       |
  605|  86.2k|                pu1_buf += strd * ht;
  606|  86.2k|                memset(pu1_buf - 1, 0, wd + 2);
  607|       |
  608|  86.2k|                if(ps_pic_buf->pu1_chroma)
  ------------------
  |  Branch (608:20): [True: 85.2k, False: 965]
  ------------------
  609|  85.2k|                {
  610|  85.2k|                    pu1_buf = ps_pic_buf->pu1_chroma;
  611|  85.2k|                    ht /= v_samp_factor;
  612|  85.2k|                    WORD32 chroma_strd_scale = chroma_pixel_strd / h_samp_factor;
  613|  20.8M|                    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (613:32): [True: 20.7M, False: 85.2k]
  ------------------
  614|  20.7M|                    {
  615|  20.7M|                        pu1_buf[-1] = 0;
  616|  20.7M|                        pu1_buf[-2] = 0;
  617|  20.7M|                        pu1_buf[wd * chroma_strd_scale] = 0;
  618|  20.7M|                        pu1_buf[wd * chroma_strd_scale + 1] = 0;
  619|  20.7M|                        pu1_buf += (strd * chroma_strd_scale);
  620|  20.7M|                    }
  621|  85.2k|                    pu1_buf = ps_pic_buf->pu1_chroma;
  622|  85.2k|                    memset(pu1_buf - (strd * chroma_strd_scale) - 2, 0, wd * chroma_strd_scale + 4);
  623|       |
  624|  85.2k|                    pu1_buf += (strd * chroma_strd_scale) * ht;
  625|  85.2k|                    memset(pu1_buf - 2, 0, wd * chroma_strd_scale + 4);
  626|  85.2k|                }
  627|  86.2k|            }
  628|       |
  629|  86.2k|            buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, ps_pic_buf, i);
  630|       |
  631|       |
  632|  86.2k|            if(0 != buf_ret)
  ------------------
  |  Branch (632:16): [True: 0, False: 86.2k]
  ------------------
  633|      0|            {
  634|      0|                ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR;
  635|      0|                return IHEVCD_BUF_MGR_ERROR;
  636|      0|            }
  637|  86.2k|            ps_pic_buf++;
  638|  86.2k|        }
  639|  20.9k|    }
  640|      0|    else
  641|      0|    {
  642|       |        /* In case of shared mode, buffers are added without adjusting for padding.
  643|       |           Update luma and chroma pointers here to account for padding as per stride.
  644|       |           In some cases stride might not be available when set_display_frame is called.
  645|       |           Hence updated luma and chroma pointers here */
  646|       |
  647|      0|        for(i = 0; i < BUF_MGR_MAX_CNT; i++)
  ------------------
  |  |   37|      0|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (647:20): [True: 0, False: 0]
  ------------------
  648|      0|        {
  649|      0|            ps_pic_buf = ihevc_buf_mgr_get_buf((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, i);
  650|      0|            if((NULL == ps_pic_buf) ||
  ------------------
  |  Branch (650:16): [True: 0, False: 0]
  ------------------
  651|      0|               (NULL == ps_pic_buf->pu1_luma) ||
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|               (NULL == ps_pic_buf->pu1_chroma))
  ------------------
  |  Branch (652:16): [True: 0, False: 0]
  ------------------
  653|      0|            {
  654|      0|                break;
  655|      0|            }
  656|      0|            ps_pic_buf->pu1_luma += (ps_codec->i4_strd * PAD_TOP + PAD_LEFT) * pixel_size_y;
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                          ps_pic_buf->pu1_luma += (ps_codec->i4_strd * PAD_TOP + PAD_LEFT) * pixel_size_y;
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  657|      0|            ps_pic_buf->pu1_chroma += ((ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor) * (PAD_TOP / v_samp_factor)
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
  658|      0|                            + (PAD_LEFT * chroma_pixel_strd / h_samp_factor)) * pixel_size_uv;
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  659|      0|        }
  660|      0|    }
  661|       |
  662|  20.8k|    return ret;
  663|  20.9k|}
ihevcd_mv_buf_mgr_add_bufs:
  685|  21.0k|{
  686|  21.0k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  687|  21.0k|    WORD32 i;
  688|  21.0k|    WORD32 max_dpb_size;
  689|  21.0k|    WORD32 mv_bank_size_allocated;
  690|  21.0k|    WORD32 pic_mv_bank_size;
  691|       |
  692|  21.0k|    sps_t *ps_sps;
  693|  21.0k|    UWORD8 *pu1_buf;
  694|  21.0k|    mv_buf_t *ps_mv_buf;
  695|       |
  696|       |
  697|       |    /* Initialize MV Bank buffer manager */
  698|  21.0k|    ps_sps = ps_codec->s_parse.ps_sps;
  699|       |
  700|       |
  701|       |    /* Compute the number of MV Bank buffers needed */
  702|  21.0k|    max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
  703|       |
  704|       |    /* Allocate one extra MV Bank to handle current frame
  705|       |     * In case of asynchronous parsing and processing, number of buffers should increase here
  706|       |     * based on when parsing and processing threads are synchronized
  707|       |     */
  708|  21.0k|    max_dpb_size++;
  709|       |
  710|  21.0k|    ps_codec->i4_max_dpb_size = max_dpb_size;
  711|       |
  712|  21.0k|    pu1_buf = (UWORD8 *)ps_codec->pv_mv_bank_buf_base;
  713|       |
  714|  21.0k|    ps_mv_buf = (mv_buf_t *)pu1_buf;
  715|  21.0k|    pu1_buf += max_dpb_size * sizeof(mv_buf_t);
  716|  21.0k|    ps_codec->ps_mv_buf = ps_mv_buf;
  717|  21.0k|    mv_bank_size_allocated = ps_codec->i4_total_mv_bank_size - max_dpb_size  * sizeof(mv_buf_t);
  718|       |
  719|       |    /* Compute MV bank size per picture */
  720|  21.0k|    pic_mv_bank_size = ihevcd_get_pic_mv_bank_size(ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  21.0k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  721|  21.0k|                                                   ALIGN64(ps_sps->i2_pic_height_in_luma_samples));
  ------------------
  |  |   50|  21.0k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  722|       |
  723|   104k|    for(i = 0; i < max_dpb_size; i++)
  ------------------
  |  Branch (723:16): [True: 83.9k, False: 20.9k]
  ------------------
  724|  83.9k|    {
  725|  83.9k|        WORD32 buf_ret;
  726|  83.9k|        WORD32 num_pu;
  727|  83.9k|        WORD32 num_ctb;
  728|  83.9k|        WORD32 pic_size;
  729|  83.9k|        pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  83.9k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  730|  83.9k|                        ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   50|  83.9k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  731|       |
  732|       |
  733|  83.9k|        num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  367|  83.9k|#define MIN_PU_SIZE         4
  ------------------
                      num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  367|  83.9k|#define MIN_PU_SIZE         4
  ------------------
  734|  83.9k|        num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  83.9k|#define MIN_CTB_SIZE        16
  ------------------
                      num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  83.9k|#define MIN_CTB_SIZE        16
  ------------------
  735|       |
  736|       |
  737|  83.9k|        mv_bank_size_allocated -= pic_mv_bank_size;
  738|       |
  739|  83.9k|        if(mv_bank_size_allocated < 0)
  ------------------
  |  Branch (739:12): [True: 91, False: 83.8k]
  ------------------
  740|     91|        {
  741|     91|            ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_MVBANK;
  742|     91|            return IHEVCD_INSUFFICIENT_MEM_MVBANK;
  743|     91|        }
  744|       |
  745|  83.8k|        ps_mv_buf->pu4_pic_pu_idx = (UWORD32 *)pu1_buf;
  746|  83.8k|        pu1_buf += (num_ctb + 1) * sizeof(WORD32);
  747|       |
  748|  83.8k|        ps_mv_buf->pu1_pic_pu_map = pu1_buf;
  749|  83.8k|        pu1_buf += num_pu;
  750|       |
  751|  83.8k|        ps_mv_buf->pu1_pic_slice_map = (UWORD16 *)pu1_buf;
  752|  83.8k|        pu1_buf += ALIGN4(num_ctb * sizeof(UWORD16));
  ------------------
  |  |   54|  83.8k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  753|       |
  754|  83.8k|        ps_mv_buf->ps_pic_pu = (pu_t *)pu1_buf;
  755|  83.8k|        pu1_buf += num_pu * sizeof(pu_t);
  756|       |
  757|  83.8k|        buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, ps_mv_buf, i);
  758|       |
  759|  83.8k|        if(0 != buf_ret)
  ------------------
  |  Branch (759:12): [True: 0, False: 83.8k]
  ------------------
  760|      0|        {
  761|      0|            ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR;
  762|      0|            return IHEVCD_BUF_MGR_ERROR;
  763|      0|        }
  764|       |
  765|  83.8k|        ps_mv_buf++;
  766|       |
  767|  83.8k|    }
  768|  20.9k|    return ret;
  769|  21.0k|}
ihevcd_check_out_buf_size:
  790|  70.8k|{
  791|  70.8k|    ivd_out_bufdesc_t *ps_out_buffer = ps_codec->ps_out_buffer;
  792|  70.8k|    UWORD32 au4_min_out_buf_size[IVD_VIDDEC_MAX_IO_BUFFERS];
  793|  70.8k|    UWORD32 u4_min_num_out_bufs = 0, i;
  794|  70.8k|    UWORD32 wd, ht;
  795|  70.8k|    UWORD32 aligned_wd, aligned_ht;
  796|  70.8k|    WORD32 pixel_size_y = ps_codec->i4_pixel_size_y;
  797|  70.8k|    WORD32 pixel_size_uv = ps_codec->i4_pixel_size_uv;
  798|       |
  799|  70.8k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (799:8): [True: 70.8k, False: 0]
  ------------------
  800|  70.8k|    {
  801|  70.8k|        wd = ps_codec->i4_disp_wd;
  802|  70.8k|        ht = ps_codec->i4_disp_ht;
  803|  70.8k|    }
  804|      0|    else
  805|      0|    {
  806|       |        /* In case of shared mode, do not check validity of ps_codec->ps_out_buffer */
  807|      0|        return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  808|      0|    }
  809|       |
  810|  70.8k|    if(ps_codec->i4_disp_strd > (WORD32)wd)
  ------------------
  |  Branch (810:8): [True: 0, False: 70.8k]
  ------------------
  811|      0|        wd = ps_codec->i4_disp_strd;
  812|       |
  813|  70.8k|    if(ps_codec->e_chroma_fmt == IV_YUV_420P)
  ------------------
  |  Branch (813:8): [True: 36.0k, False: 34.8k]
  ------------------
  814|  36.0k|        u4_min_num_out_bufs = MIN_OUT_BUFS_420;
  ------------------
  |  |  444|  36.0k|#define MIN_OUT_BUFS_420        3
  ------------------
  815|  34.8k|    else if(ps_codec->e_chroma_fmt == IV_YUV_444P)
  ------------------
  |  Branch (815:13): [True: 0, False: 34.8k]
  ------------------
  816|      0|        u4_min_num_out_bufs = MIN_OUT_BUFS_444;
  ------------------
  |  |  446|      0|#define MIN_OUT_BUFS_444        3
  ------------------
  817|  34.8k|    else if(ps_codec->e_chroma_fmt == IV_YUV_422P)
  ------------------
  |  Branch (817:13): [True: 1.62k, False: 33.2k]
  ------------------
  818|  1.62k|        u4_min_num_out_bufs = MIN_OUT_BUFS_422;
  ------------------
  |  |  445|  1.62k|#define MIN_OUT_BUFS_422        3
  ------------------
  819|  33.2k|    else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV)
  ------------------
  |  Branch (819:13): [True: 8.37k, False: 24.8k]
  ------------------
  820|  24.8k|                    || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU))
  ------------------
  |  Branch (820:24): [True: 10.5k, False: 14.2k]
  ------------------
  821|  18.9k|        u4_min_num_out_bufs = MIN_OUT_BUFS_420SP;
  ------------------
  |  |  447|  18.9k|#define MIN_OUT_BUFS_420SP      2
  ------------------
  822|  14.2k|    else if(ps_codec->e_chroma_fmt == IV_GRAY)
  ------------------
  |  Branch (822:13): [True: 14.2k, False: 0]
  ------------------
  823|  14.2k|        u4_min_num_out_bufs = MIN_OUT_BUFS_GRAY;
  ------------------
  |  |  448|  14.2k|#define MIN_OUT_BUFS_GRAY       1
  ------------------
  824|       |
  825|  70.8k|    aligned_wd = ALIGN2(wd);
  ------------------
  |  |   55|  70.8k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  826|  70.8k|    aligned_ht = ALIGN2(ht);
  ------------------
  |  |   55|  70.8k|#define ALIGN2(x)   ((((x) + 1) >> 1) << 1)
  ------------------
  827|  70.8k|    if(ps_codec->e_chroma_fmt == IV_YUV_420P)
  ------------------
  |  Branch (827:8): [True: 36.0k, False: 34.8k]
  ------------------
  828|  36.0k|    {
  829|  36.0k|        au4_min_out_buf_size[0] = (wd * ht) * pixel_size_y;
  830|  36.0k|        au4_min_out_buf_size[1] = ((aligned_wd * aligned_ht) >> 2) * pixel_size_uv;
  831|  36.0k|        au4_min_out_buf_size[2] = ((aligned_wd * aligned_ht) >> 2) * pixel_size_uv;
  832|  36.0k|    }
  833|  34.8k|    else if(ps_codec->e_chroma_fmt == IV_YUV_444P)
  ------------------
  |  Branch (833:13): [True: 0, False: 34.8k]
  ------------------
  834|      0|    {
  835|      0|        au4_min_out_buf_size[0] = (wd * ht) * pixel_size_y;
  836|      0|        au4_min_out_buf_size[1] = (wd * ht) * pixel_size_uv;
  837|      0|        au4_min_out_buf_size[2] = (wd * ht) * pixel_size_uv;
  838|      0|    }
  839|  34.8k|    else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV)
  ------------------
  |  Branch (839:13): [True: 8.37k, False: 26.4k]
  ------------------
  840|  26.4k|                    || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU))
  ------------------
  |  Branch (840:24): [True: 10.5k, False: 15.8k]
  ------------------
  841|  18.9k|    {
  842|  18.9k|        au4_min_out_buf_size[0] = (wd * ht) * pixel_size_y;
  843|  18.9k|        au4_min_out_buf_size[1] = ((aligned_wd * aligned_ht) >> 1) * pixel_size_uv;
  844|  18.9k|        au4_min_out_buf_size[2] = 0;
  845|  18.9k|    }
  846|  15.8k|    else if(ps_codec->e_chroma_fmt == IV_GRAY)
  ------------------
  |  Branch (846:13): [True: 14.2k, False: 1.62k]
  ------------------
  847|  14.2k|    {
  848|  14.2k|        au4_min_out_buf_size[0] = (wd * ht) * pixel_size_y;
  849|  14.2k|        au4_min_out_buf_size[1] = 0;
  850|  14.2k|        au4_min_out_buf_size[2] = 0;
  851|  14.2k|    }
  852|  1.62k|    else if(ps_codec->e_chroma_fmt == IV_YUV_422P)
  ------------------
  |  Branch (852:13): [True: 1.62k, False: 0]
  ------------------
  853|  1.62k|    {
  854|  1.62k|        au4_min_out_buf_size[0] = (wd * ht) * pixel_size_y;
  855|  1.62k|        au4_min_out_buf_size[1] = ((aligned_wd * ht) >> 1) * pixel_size_uv;
  856|  1.62k|        au4_min_out_buf_size[2] = ((aligned_wd * ht) >> 1) * pixel_size_uv;
  857|  1.62k|    }
  858|       |
  859|       |
  860|  70.8k|    if(ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs)
  ------------------
  |  Branch (860:8): [True: 0, False: 70.8k]
  ------------------
  861|      0|    {
  862|      0|        return (IHEVCD_ERROR_T)IV_FAIL;
  863|      0|    }
  864|       |
  865|   235k|    for (i = 0 ; i < u4_min_num_out_bufs; i++)
  ------------------
  |  Branch (865:18): [True: 164k, False: 70.5k]
  ------------------
  866|   164k|    {
  867|   164k|        if(ps_out_buffer->u4_min_out_buf_size[i] < au4_min_out_buf_size[i])
  ------------------
  |  Branch (867:12): [True: 335, False: 164k]
  ------------------
  868|    335|        {
  869|    335|            return (IHEVCD_ERROR_T)IV_FAIL;
  870|    335|        }
  871|   164k|    }
  872|       |
  873|  70.5k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  874|  70.8k|}
ihevcd_parse_pic_init:
  897|  71.0k|{
  898|  71.0k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  899|  71.0k|    mv_buf_t *ps_mv_buf;
  900|  71.0k|    sps_t *ps_sps;
  901|  71.0k|    WORD32 num_min_cu;
  902|  71.0k|    WORD32 cur_pic_buf_id;
  903|  71.0k|    WORD32 cur_mv_bank_buf_id;
  904|  71.0k|    pic_buf_t *ps_cur_pic;
  905|  71.0k|    slice_header_t *ps_slice_hdr;
  906|  71.0k|    UWORD8 *pu1_cur_pic_luma, *pu1_cur_pic_chroma;
  907|  71.0k|    WORD32 h_samp_factor, v_samp_factor;
  908|  71.0k|    WORD32 chroma_pixel_strd = 2;
  909|  71.0k|    WORD32 i;
  910|       |
  911|  71.0k|    ps_codec->s_parse.i4_error_code = IHEVCD_SUCCESS;
  912|  71.0k|    ps_sps = ps_codec->s_parse.ps_sps;
  913|  71.0k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  914|       |
  915|       |    /* Memset picture level intra map and transquant bypass map to zero */
  916|  71.0k|    num_min_cu = ((ps_sps->i2_pic_height_in_luma_samples + 7) / 8) * ((ps_sps->i2_pic_width_in_luma_samples + 63) / 64);
  917|  71.0k|    memset(ps_codec->s_parse.pu1_pic_intra_flag, 0, num_min_cu);
  918|  71.0k|    memset(ps_codec->s_parse.pu1_pic_no_loop_filter_flag, 0, num_min_cu);
  919|       |
  920|  71.0k|    h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2;
  ------------------
  |  Branch (920:21): [True: 0, False: 71.0k]
  ------------------
  921|  71.0k|    v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1;
  ------------------
  |  Branch (921:21): [True: 50.9k, False: 20.1k]
  ------------------
  922|       |
  923|  71.0k|    if(0 == ps_codec->s_parse.i4_first_pic_init)
  ------------------
  |  Branch (923:8): [True: 21.0k, False: 49.9k]
  ------------------
  924|  21.0k|    {
  925|  21.0k|        ret = ihevcd_mv_buf_mgr_add_bufs(ps_codec);
  926|  21.0k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  21.0k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 91, False: 20.9k]
  |  |  ------------------
  ------------------
  927|       |
  928|  20.9k|        ret = ihevcd_pic_buf_mgr_add_bufs(ps_codec);
  929|  20.9k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  20.9k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 92, False: 20.8k]
  |  |  ------------------
  ------------------
  930|       |
  931|  20.8k|        ps_codec->s_parse.i4_first_pic_init = 1;
  932|  20.8k|    }
  933|       |
  934|       |    /* Output buffer check */
  935|  70.8k|    ret = ihevcd_check_out_buf_size(ps_codec);
  936|  70.8k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  70.8k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 335, False: 70.5k]
  |  |  ------------------
  ------------------
  937|       |
  938|       |    /* Initialize all the slice headers' slice addresses to zero */
  939|  70.5k|    {
  940|  70.5k|        WORD32 slice_idx;
  941|  70.5k|        WORD32 slice_start_idx;
  942|       |
  943|  70.5k|        slice_start_idx = (ps_codec->i4_slice_error && !ps_slice_hdr->i1_first_slice_in_pic_flag) ? 2 : 1;
  ------------------
  |  Branch (943:28): [True: 6.56k, False: 63.9k]
  |  Branch (943:56): [True: 6.56k, False: 0]
  ------------------
  944|       |
  945|  18.0M|        for(slice_idx = slice_start_idx; slice_idx < MAX_SLICE_HDR_CNT; slice_idx++)
  ------------------
  |  |  153|  18.0M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  18.0M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (945:42): [True: 17.9M, False: 70.5k]
  ------------------
  946|  17.9M|        {
  947|  17.9M|            slice_header_t *ps_slice_hdr_tmp = ps_codec->ps_slice_hdr_base + slice_idx;
  948|  17.9M|            ps_slice_hdr_tmp->i2_ctb_x = -1;
  949|  17.9M|            ps_slice_hdr_tmp->i2_ctb_y = -1;
  950|       |
  951|  17.9M|        }
  952|  70.5k|    }
  953|       |
  954|       |    /* Get free MV Bank to hold current picture's motion vector data */
  955|  70.5k|    {
  956|  70.5k|        ps_mv_buf = (mv_buf_t *)ihevc_buf_mgr_get_next_free((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, &cur_mv_bank_buf_id);
  957|       |
  958|       |        /* If there are no free buffers then return with an error code.
  959|       |         * If the buffer is to be freed by another thread , change the
  960|       |         * following to call thread yield and wait for buffer to be freed
  961|       |         */
  962|  70.5k|        if(NULL == ps_mv_buf)
  ------------------
  |  Branch (962:12): [True: 610, False: 69.9k]
  ------------------
  963|    610|        {
  964|    610|            ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_MVBANK;
  965|    610|            ps_codec->i4_error_code = IHEVCD_NO_FREE_MVBANK;
  966|    610|            return IHEVCD_NO_FREE_MVBANK;
  967|    610|        }
  968|       |
  969|  69.9k|        ps_codec->s_parse.ps_cur_mv_buf = ps_mv_buf;
  970|       |        /* Set current ABS poc to ps_mv_buf, so that while freeing a reference buffer
  971|       |         * corresponding mv buffer can be found by looping through ps_codec->ps_mv_buf array
  972|       |         * and getting a buffer id to free
  973|       |         */
  974|  69.9k|        ps_mv_buf->i4_abs_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
  975|  69.9k|    }
  976|       |
  977|       |    /* Get free picture buffer to hold current picture recon data */
  978|       |    /* TODO: For asynchronous api the following initializations related to picture
  979|       |     * buffer should be moved to processing side
  980|       |     */
  981|      0|    {
  982|       |
  983|  69.9k|        UWORD8 *pu1_buf;
  984|  69.9k|        ps_cur_pic = (pic_buf_t *)ihevc_buf_mgr_get_next_free((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, &cur_pic_buf_id);
  985|       |
  986|       |        /* If there are no free buffers then return with an error code.
  987|       |         * TODO: If the buffer is to be freed by another thread , change the
  988|       |         * following to call thread yield and wait for buffer to be freed
  989|       |         */
  990|  69.9k|        if(NULL == ps_cur_pic)
  ------------------
  |  Branch (990:12): [True: 25, False: 69.8k]
  ------------------
  991|     25|        {
  992|     25|            ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_PICBUF;
  993|     25|            ps_codec->i4_error_code = IHEVCD_NO_FREE_PICBUF;
  994|     25|            return IHEVCD_NO_FREE_PICBUF;
  995|     25|        }
  996|       |
  997|       |        /* Store input timestamp sent with input buffer */
  998|  69.8k|        ps_cur_pic->u4_ts = ps_codec->u4_ts;
  999|  69.8k|        ps_cur_pic->i4_abs_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
 1000|  69.8k|        ps_cur_pic->i4_poc_lsb = ps_slice_hdr->i4_pic_order_cnt_lsb;
 1001|  69.8k|        pu1_buf = ps_cur_pic->pu1_luma;
 1002|  69.8k|        pu1_cur_pic_luma = pu1_buf;
 1003|       |
 1004|  69.8k|        pu1_buf = ps_cur_pic->pu1_chroma;
 1005|  69.8k|        pu1_cur_pic_chroma = pu1_buf;
 1006|       |
 1007|  69.8k|#ifndef DISABLE_SEI
 1008|  69.8k|        ps_cur_pic->s_sei_params.i1_sei_parameters_present_flag = 0;
 1009|  69.8k|        if(ps_codec->s_parse.s_sei_params.i1_sei_parameters_present_flag)
  ------------------
  |  Branch (1009:12): [True: 464, False: 69.4k]
  ------------------
 1010|    464|        {
 1011|    464|            sei_params_t *ps_sei = &ps_codec->s_parse.s_sei_params;
 1012|    464|            ps_cur_pic->s_sei_params = ps_codec->s_parse.s_sei_params;
 1013|       |
 1014|       |            /* Once sei_params is copied to pic_buf,
 1015|       |             * mark sei_params in s_parse as not present,
 1016|       |             * this ensures that future frames do not use this data again.
 1017|       |             */
 1018|    464|            ps_sei->i1_sei_parameters_present_flag = 0;
 1019|    464|            ps_sei->i1_user_data_registered_present_flag = 0;
 1020|    464|            ps_sei->i1_aud_present_flag = 0;
 1021|    464|            ps_sei->i1_time_code_present_flag = 0;
 1022|    464|            ps_sei->i1_buf_period_params_present_flag = 0;
 1023|    464|            ps_sei->i1_pic_timing_params_present_flag = 0;
 1024|    464|            ps_sei->i1_recovery_point_params_present_flag = 0;
 1025|    464|            ps_sei->i1_active_parameter_set = 0;
 1026|    464|            ps_sei->i4_sei_mastering_disp_colour_vol_params_present_flags = 0;
 1027|    464|        }
 1028|  69.8k|#endif
 1029|  69.8k|    }
 1030|       |
 1031|  69.8k|    if(0 == ps_codec->u4_pic_cnt)
  ------------------
  |  Branch (1031:8): [True: 20.5k, False: 49.3k]
  ------------------
 1032|  20.5k|    {
 1033|  20.5k|        WORD32 luma_samples = (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * ps_sps->i2_pic_height_in_luma_samples;
  ------------------
  |  |   91|  20.5k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  20.5k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  20.5k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1034|  20.5k|        if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_y)
  ------------------
  |  |  279|  20.5k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1034:12): [True: 14.9k, False: 5.66k]
  ------------------
 1035|  14.9k|        {
 1036|  14.9k|            memset(ps_cur_pic->pu1_luma, 128, luma_samples);
 1037|  14.9k|        }
 1038|  5.66k|        else
 1039|  5.66k|        {
 1040|  5.66k|            ps_codec->s_func_selector.ihevc_memset_16bit_fptr(
 1041|  5.66k|                (UWORD16 *)ps_cur_pic->pu1_luma,
 1042|  5.66k|                (1 << (ps_codec->i4_bit_depth_luma - 1)),
 1043|  5.66k|                luma_samples);
 1044|  5.66k|        }
 1045|       |
 1046|  20.5k|        if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME)
  ------------------
  |  Branch (1046:12): [True: 20.2k, False: 275]
  ------------------
 1047|  20.2k|        {
 1048|  20.2k|            WORD32 chroma_samples = (((ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor))
  ------------------
  |  |   91|  20.2k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  20.2k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  20.2k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
 1049|  20.2k|                                            * ps_sps->i2_pic_height_in_luma_samples / v_samp_factor);
 1050|  20.2k|            if(PIXEL_SIZE_1BYTE == ps_codec->i4_pixel_size_uv)
  ------------------
  |  |  279|  20.2k|#define PIXEL_SIZE_1BYTE    sizeof(UWORD8)
  ------------------
  |  Branch (1050:16): [True: 14.7k, False: 5.52k]
  ------------------
 1051|  14.7k|            {
 1052|  14.7k|                memset(ps_cur_pic->pu1_chroma, 128, chroma_samples);
 1053|  14.7k|            }
 1054|  5.52k|            else
 1055|  5.52k|            {
 1056|  5.52k|                ps_codec->s_func_selector.ihevc_memset_16bit_fptr(
 1057|  5.52k|                    (UWORD16 *)ps_cur_pic->pu1_chroma,
 1058|  5.52k|                    (1 << (ps_codec->i4_bit_depth_chroma - 1)),
 1059|  5.52k|                    chroma_samples);
 1060|  5.52k|            }
 1061|  20.2k|        }
 1062|  20.5k|    }
 1063|       |
 1064|       |    /* Fill the remaining entries of the reference lists with the nearest POC
 1065|       |     * This is done to handle cases where there is a corruption in the reference index */
 1066|  69.8k|    {
 1067|  69.8k|        pic_buf_t *ps_pic_buf_ref;
 1068|  69.8k|        mv_buf_t *ps_mv_buf_ref;
 1069|  69.8k|        WORD32 r_idx;
 1070|  69.8k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
 1071|  69.8k|        buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
 1072|       |
 1073|  69.8k|        ps_pic_buf_ref = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ps_slice_hdr->i4_abs_pic_order_cnt);
 1074|  69.8k|        if(NULL == ps_pic_buf_ref)
  ------------------
  |  Branch (1074:12): [True: 61.7k, False: 8.17k]
  ------------------
 1075|  61.7k|        {
 1076|  61.7k|            WORD32 size;
 1077|       |
 1078|  61.7k|            WORD32 num_pu;
 1079|  61.7k|            WORD32 num_ctb;
 1080|  61.7k|            WORD32 pic_size;
 1081|       |            /* In case current mv buffer itself is being used as reference mv buffer for colocated
 1082|       |             * calculations, then memset all the buffers to zero.
 1083|       |             */
 1084|  61.7k|            pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  61.7k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1085|  61.7k|                            ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   50|  61.7k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1086|       |
 1087|  61.7k|            num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  367|  61.7k|#define MIN_PU_SIZE         4
  ------------------
                          num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  367|  61.7k|#define MIN_PU_SIZE         4
  ------------------
 1088|  61.7k|            num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  61.7k|#define MIN_CTB_SIZE        16
  ------------------
                          num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  61.7k|#define MIN_CTB_SIZE        16
  ------------------
 1089|       |
 1090|  61.7k|            memset(ps_mv_buf->ai4_l0_collocated_poc, 0, sizeof(ps_mv_buf->ai4_l0_collocated_poc));
 1091|  61.7k|            memset(ps_mv_buf->ai1_l0_collocated_poc_lt, 0, sizeof(ps_mv_buf->ai1_l0_collocated_poc_lt));
 1092|  61.7k|            memset(ps_mv_buf->ai4_l1_collocated_poc, 0, sizeof(ps_mv_buf->ai4_l1_collocated_poc));
 1093|  61.7k|            memset(ps_mv_buf->ai1_l1_collocated_poc_lt, 0, sizeof(ps_mv_buf->ai1_l1_collocated_poc_lt));
 1094|       |
 1095|  61.7k|            size = (num_ctb + 1) * sizeof(WORD32);
 1096|  61.7k|            memset(ps_mv_buf->pu4_pic_pu_idx, 0, size);
 1097|       |
 1098|  61.7k|            size = num_pu;
 1099|  61.7k|            memset(ps_mv_buf->pu1_pic_pu_map, 0, size);
 1100|  61.7k|            size = ALIGN4(num_ctb * sizeof(UWORD16));
  ------------------
  |  |   54|  61.7k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1101|  61.7k|            memset(ps_mv_buf->pu1_pic_slice_map, 0, size);
 1102|  61.7k|            size = num_pu * sizeof(pu_t);
 1103|  61.7k|            memset(ps_mv_buf->ps_pic_pu, 0, size);
 1104|       |
 1105|  61.7k|            ps_pic_buf_ref = ps_cur_pic;
 1106|  61.7k|            ps_mv_buf_ref = ps_mv_buf;
 1107|  61.7k|        }
 1108|  8.17k|        else
 1109|  8.17k|        {
 1110|  8.17k|            ps_mv_buf_ref = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf_ref->i4_abs_poc);
 1111|  8.17k|        }
 1112|       |
 1113|   101k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (1113:24): [True: 31.3k, False: 69.8k]
  ------------------
 1114|  31.3k|        {
 1115|  31.3k|            if(NULL == ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1115:16): [True: 11.4k, False: 19.9k]
  ------------------
 1116|  11.4k|            {
 1117|  11.4k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1118|  11.4k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1119|  11.4k|            }
 1120|  31.3k|        }
 1121|       |
 1122|  1.15M|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|  1.15M|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1122:61): [True: 1.08M, False: 69.8k]
  ------------------
 1123|  1.08M|        {
 1124|  1.08M|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1125|  1.08M|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1126|  1.08M|        }
 1127|       |
 1128|   100k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (1128:24): [True: 30.1k, False: 69.8k]
  ------------------
 1129|  30.1k|        {
 1130|  30.1k|            if(NULL == ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1130:16): [True: 10.4k, False: 19.6k]
  ------------------
 1131|  10.4k|            {
 1132|  10.4k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1133|  10.4k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1134|  10.4k|            }
 1135|  30.1k|        }
 1136|       |
 1137|  1.15M|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  291|  1.15M|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1137:61): [True: 1.08M, False: 69.8k]
  ------------------
 1138|  1.08M|        {
 1139|  1.08M|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1140|  1.08M|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1141|  1.08M|        }
 1142|  69.8k|    }
 1143|       |
 1144|       |
 1145|       |    /* Reset the jobq to start of the jobq buffer */
 1146|  69.8k|    ihevcd_jobq_reset((jobq_t *)ps_codec->pv_proc_jobq);
 1147|       |
 1148|  69.8k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1148:8): [True: 69.8k, False: 0]
  ------------------
 1149|  69.8k|    {
 1150|  69.8k|        ps_codec->i4_break_threads = 0;
 1151|  69.8k|    }
 1152|  69.8k|    ps_codec->s_parse.i4_pic_pu_idx = 0;
 1153|  69.8k|    ps_codec->s_parse.i4_pic_tu_idx = 0;
 1154|       |
 1155|  69.8k|    ps_codec->s_parse.pu1_pic_pu_map = ps_mv_buf->pu1_pic_pu_map;
 1156|  69.8k|    ps_codec->s_parse.ps_pic_pu      = ps_mv_buf->ps_pic_pu;
 1157|  69.8k|    ps_codec->s_parse.pu4_pic_pu_idx = ps_mv_buf->pu4_pic_pu_idx;
 1158|  69.8k|    ps_codec->s_parse.pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map;
 1159|   629k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   629k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   629k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1159:16): [True: 559k, False: 69.8k]
  ------------------
 1160|   559k|    {
 1161|   559k|        ps_codec->as_process[i].pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map;
 1162|   559k|    }
 1163|  69.8k|    ps_codec->s_parse.pu1_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 1164|  69.8k|    ps_codec->s_parse.ps_pu = ps_codec->s_parse.ps_pic_pu;
 1165|       |
 1166|  69.8k|    {
 1167|  69.8k|        UWORD8 *pu1_buf;
 1168|  69.8k|        WORD32 ctb_luma_min_tu_cnt, ctb_chroma_min_tu_cnt, ctb_min_tu_cnt;
 1169|  69.8k|        WORD32 pic_size;
 1170|  69.8k|        WORD32 num_ctb;
 1171|       |
 1172|  69.8k|        pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  69.8k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1173|  69.8k|                        ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   50|  69.8k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1174|       |
 1175|  69.8k|        ctb_luma_min_tu_cnt = pic_size / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  358|  69.8k|#define MIN_TU_SIZE         4
  ------------------
                      ctb_luma_min_tu_cnt = pic_size / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  358|  69.8k|#define MIN_TU_SIZE         4
  ------------------
 1176|       |
 1177|  69.8k|        if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444)
  ------------------
  |  Branch (1177:12): [True: 0, False: 69.8k]
  ------------------
 1178|      0|        {
 1179|      0|            ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt << 1;
 1180|      0|        }
 1181|  69.8k|        else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 ||
  ------------------
  |  Branch (1181:17): [True: 19.2k, False: 50.6k]
  ------------------
 1182|  50.6k|                ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1182:17): [True: 49.7k, False: 885]
  ------------------
 1183|  69.0k|        {
 1184|  69.0k|            ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt >> 1;
 1185|  69.0k|        }
 1186|    885|        else
 1187|    885|        {
 1188|    885|            ctb_chroma_min_tu_cnt = 0;
 1189|    885|        }
 1190|       |
 1191|  69.8k|        ctb_min_tu_cnt = ctb_luma_min_tu_cnt + ctb_chroma_min_tu_cnt;
 1192|       |
 1193|  69.8k|        num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  69.8k|#define MIN_CTB_SIZE        16
  ------------------
                      num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  352|  69.8k|#define MIN_CTB_SIZE        16
  ------------------
 1194|  69.8k|        pu1_buf  = (UWORD8 *)ps_codec->pv_tu_data;
 1195|  69.8k|        ps_codec->s_parse.pu4_pic_tu_idx = (UWORD32 *)pu1_buf;
 1196|  69.8k|        pu1_buf += (num_ctb + 1) * sizeof(WORD32);
 1197|       |
 1198|  69.8k|        ps_codec->s_parse.pu1_pic_tu_map = pu1_buf;
 1199|  69.8k|        pu1_buf += ctb_min_tu_cnt;
 1200|       |
 1201|  69.8k|        ps_codec->s_parse.ps_pic_tu = (tu_t *)pu1_buf;
 1202|  69.8k|        pu1_buf += ctb_min_tu_cnt * sizeof(tu_t);
 1203|       |
 1204|  69.8k|        ps_codec->s_parse.pv_pic_tu_coeff_data = pu1_buf;
 1205|       |
 1206|  69.8k|        ps_codec->s_parse.pu1_tu_map = ps_codec->s_parse.pu1_pic_tu_map;
 1207|  69.8k|        ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu;
 1208|  69.8k|        ps_codec->s_parse.pv_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data;
 1209|  69.8k|    }
 1210|       |
 1211|  69.8k|    ps_codec->s_parse.s_bs_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 1212|  69.8k|    ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 1213|  69.8k|    ps_codec->s_parse.s_bs_ctxt.pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx;
 1214|       |
 1215|       |
 1216|       |    /* Set number of CTBs to be processed simultaneously */
 1217|  69.8k|    ps_codec->i4_proc_nctb = ihevcd_nctb_cnt(ps_codec, ps_sps);
 1218|       |
 1219|       |    /* Memset Parse Map and process map at the start of frame */
 1220|       |    //TODO: In case of asynchronous API proc_map can not be set to zero here
 1221|  69.8k|    {
 1222|  69.8k|        WORD32 num_ctb;
 1223|       |
 1224|  69.8k|        num_ctb = ps_sps->i4_pic_size_in_ctb;
 1225|       |
 1226|  69.8k|        memset(ps_codec->pu1_parse_map, 0, num_ctb);
 1227|       |
 1228|  69.8k|        memset(ps_codec->pu1_proc_map, 0, num_ctb);
 1229|  69.8k|    }
 1230|       |
 1231|       |
 1232|       |
 1233|       |    /* Initialize disp buf id to -1, this will be updated at the end of frame if there is
 1234|       |     * buffer to be displayed
 1235|       |     */
 1236|  69.8k|    ps_codec->i4_disp_buf_id = -1;
 1237|  69.8k|    ps_codec->ps_disp_buf = NULL;
 1238|       |
 1239|  69.8k|    ps_codec->i4_disable_deblk_pic  = 0;
 1240|  69.8k|    ps_codec->i4_disable_sao_pic    = 0;
 1241|  69.8k|    ps_codec->i4_fullpel_inter_pred = 0;
 1242|  69.8k|    ps_codec->i4_mv_frac_mask       = 0x7FFFFFFF;
 1243|       |
 1244|       |    /* If degrade is enabled, set the degrade flags appropriately */
 1245|  69.8k|    if(ps_codec->i4_degrade_type && ps_codec->i4_degrade_pics)
  ------------------
  |  Branch (1245:8): [True: 0, False: 69.8k]
  |  Branch (1245:37): [True: 0, False: 0]
  ------------------
 1246|      0|    {
 1247|      0|        WORD32 degrade_pic;
 1248|      0|        ps_codec->i4_degrade_pic_cnt++;
 1249|      0|        degrade_pic = 0;
 1250|       |
 1251|       |        /* If degrade is to be done in all frames, then do not check further */
 1252|      0|        switch(ps_codec->i4_degrade_pics)
  ------------------
  |  Branch (1252:16): [True: 0, False: 0]
  ------------------
 1253|      0|        {
 1254|      0|            case 4:
  ------------------
  |  Branch (1254:13): [True: 0, False: 0]
  ------------------
 1255|      0|            {
 1256|      0|                degrade_pic = 1;
 1257|      0|                break;
 1258|      0|            }
 1259|      0|            case 3:
  ------------------
  |  Branch (1259:13): [True: 0, False: 0]
  ------------------
 1260|      0|            {
 1261|      0|                if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1261:20): [True: 0, False: 0]
  ------------------
 1262|      0|                    degrade_pic = 1;
 1263|       |
 1264|      0|                break;
 1265|      0|            }
 1266|      0|            case 2:
  ------------------
  |  Branch (1266:13): [True: 0, False: 0]
  ------------------
 1267|      0|            {
 1268|       |
 1269|       |                /* If pic count hits non-degrade interval or it is an islice, then do not degrade */
 1270|      0|                if((ps_slice_hdr->i1_slice_type != ISLICE) &&
  ------------------
  |  Branch (1270:20): [True: 0, False: 0]
  ------------------
 1271|      0|                   (ps_codec->i4_degrade_pic_cnt != ps_codec->i4_nondegrade_interval))
  ------------------
  |  Branch (1271:20): [True: 0, False: 0]
  ------------------
 1272|      0|                    degrade_pic = 1;
 1273|       |
 1274|      0|                break;
 1275|      0|            }
 1276|      0|            case 1:
  ------------------
  |  Branch (1276:13): [True: 0, False: 0]
  ------------------
 1277|      0|            {
 1278|       |                /* Check if the current picture is non-ref */
 1279|      0|                if((ps_slice_hdr->i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1279:20): [True: 0, False: 0]
  ------------------
 1280|      0|                   (ps_slice_hdr->i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1280:20): [True: 0, False: 0]
  ------------------
 1281|      0|                {
 1282|      0|                    degrade_pic = 1;
 1283|      0|                }
 1284|      0|                break;
 1285|      0|            }
 1286|       |
 1287|       |
 1288|      0|        }
 1289|      0|        if(degrade_pic)
  ------------------
  |  Branch (1289:12): [True: 0, False: 0]
  ------------------
 1290|      0|        {
 1291|      0|            if(ps_codec->i4_degrade_type & 0x1)
  ------------------
  |  Branch (1291:16): [True: 0, False: 0]
  ------------------
 1292|      0|                ps_codec->i4_disable_sao_pic = 1;
 1293|       |
 1294|      0|            if(ps_codec->i4_degrade_type & 0x2)
  ------------------
  |  Branch (1294:16): [True: 0, False: 0]
  ------------------
 1295|      0|                ps_codec->i4_disable_deblk_pic = 1;
 1296|       |
 1297|       |            /* MC degrading is done only for non-ref pictures */
 1298|      0|            if((ps_slice_hdr->i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1298:16): [True: 0, False: 0]
  ------------------
 1299|      0|               (ps_slice_hdr->i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1299:16): [True: 0, False: 0]
  ------------------
 1300|      0|            {
 1301|      0|                if(ps_codec->i4_degrade_type & 0x4)
  ------------------
  |  Branch (1301:20): [True: 0, False: 0]
  ------------------
 1302|      0|                    ps_codec->i4_mv_frac_mask = 0;
 1303|       |
 1304|      0|                if(ps_codec->i4_degrade_type & 0x8)
  ------------------
  |  Branch (1304:20): [True: 0, False: 0]
  ------------------
 1305|      0|                    ps_codec->i4_mv_frac_mask = 0;
 1306|      0|            }
 1307|      0|        }
 1308|      0|        else
 1309|      0|            ps_codec->i4_degrade_pic_cnt = 0;
 1310|      0|    }
 1311|       |
 1312|       |
 1313|  69.8k|    {
 1314|  69.8k|        WORD32 i;
 1315|   629k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|   629k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|   629k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1315:20): [True: 559k, False: 69.8k]
  ------------------
 1316|   559k|        {
 1317|   559k|            ps_codec->as_process[i].pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 1318|   559k|            ps_codec->as_process[i].ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 1319|   559k|            ps_codec->as_process[i].pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 1320|   559k|            ps_codec->as_process[i].pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx;
 1321|   559k|            ps_codec->as_process[i].ps_pic_tu = ps_codec->s_parse.ps_pic_tu;
 1322|   559k|            ps_codec->as_process[i].pu1_pic_tu_map = ps_codec->s_parse.pu1_pic_tu_map;
 1323|   559k|            ps_codec->as_process[i].pv_pic_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data;
 1324|   559k|            ps_codec->as_process[i].i4_cur_mv_bank_buf_id = cur_mv_bank_buf_id;
 1325|   559k|            ps_codec->as_process[i].s_sao_ctxt.pu1_slice_idx = ps_codec->as_process[i].pu1_slice_idx;
 1326|   559k|            ps_codec->as_process[i].s_sao_ctxt.pu1_tile_idx = ps_codec->as_process[i].pu1_tile_idx;
 1327|       |
 1328|       |            /* TODO: For asynchronous api the following initializations related to picture
 1329|       |             * buffer should be moved to processing side
 1330|       |             */
 1331|   559k|            ps_codec->as_process[i].pu1_cur_pic_luma = pu1_cur_pic_luma;
 1332|   559k|            ps_codec->as_process[i].pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1333|   559k|            ps_codec->as_process[i].ps_cur_pic = ps_cur_pic;
 1334|   559k|            ps_codec->as_process[i].i4_cur_pic_buf_id = cur_pic_buf_id;
 1335|       |
 1336|   559k|            ps_codec->as_process[i].ps_out_buffer = ps_codec->ps_out_buffer;
 1337|   559k|            if(1 < ps_codec->i4_num_cores)
  ------------------
  |  Branch (1337:16): [True: 385k, False: 173k]
  ------------------
 1338|   385k|            {
 1339|   385k|                ps_codec->as_process[i].i4_check_parse_status = 1;
 1340|   385k|                ps_codec->as_process[i].i4_check_proc_status = 1;
 1341|   385k|            }
 1342|   173k|            else
 1343|   173k|            {
 1344|   173k|                ps_codec->as_process[i].i4_check_parse_status = 0;
 1345|   173k|                ps_codec->as_process[i].i4_check_proc_status = 0;
 1346|   173k|            }
 1347|   559k|            ps_codec->as_process[i].pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 1348|   559k|            ps_codec->as_process[i].pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1349|   559k|            ps_codec->as_process[i].i4_init_done = 0;
 1350|       |
 1351|   559k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_tu_idx = ps_codec->as_process[i].pu4_pic_tu_idx;
 1352|   559k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_pu_idx = ps_codec->as_process[i].pu4_pic_pu_idx;
 1353|   559k|            ps_codec->as_process[i].s_bs_ctxt.ps_pic_pu = ps_codec->as_process[i].ps_pic_pu;
 1354|   559k|            ps_codec->as_process[i].s_deblk_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1355|   559k|            ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1356|   559k|            ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1357|   559k|            ps_codec->as_process[i].s_sao_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1358|   559k|            ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1359|   559k|            ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1360|   559k|            if(i < (ps_codec->i4_num_cores - 1))
  ------------------
  |  Branch (1360:16): [True: 89.3k, False: 469k]
  ------------------
 1361|  89.3k|            {
 1362|  89.3k|                if (!ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1362:21): [True: 26.3k, False: 62.9k]
  ------------------
 1363|  26.3k|                {
 1364|  26.3k|                    ithread_create(ps_codec->apv_process_thread_handle[i], NULL,
 1365|  26.3k|                                (void *)ihevcd_process_thread,
 1366|  26.3k|                                (void *)&ps_codec->as_process[i]);
 1367|  26.3k|                    ps_codec->ai4_process_thread_created[i] = 1;
 1368|  26.3k|                }
 1369|  89.3k|                if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1369:20): [True: 89.3k, False: 0]
  ------------------
 1370|  89.3k|                {
 1371|  89.3k|                    ret = ithread_mutex_lock(ps_codec->apv_proc_start_mutex[i]);
 1372|  89.3k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  89.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 89.3k]
  |  |  ------------------
  ------------------
 1373|       |
 1374|  89.3k|                    ps_codec->ai4_process_start[i] = 1;
 1375|  89.3k|                    ithread_cond_signal(ps_codec->apv_proc_start_condition[i]);
 1376|       |
 1377|  89.3k|                    ret = ithread_mutex_unlock(ps_codec->apv_proc_start_mutex[i]);
 1378|  89.3k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  89.3k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 89.3k]
  |  |  ------------------
  ------------------
 1379|  89.3k|                }
 1380|  89.3k|            }
 1381|   469k|            else
 1382|   469k|            {
 1383|   469k|                ps_codec->ai4_process_thread_created[i] = 0;
 1384|   469k|            }
 1385|       |
 1386|   559k|        }
 1387|  69.8k|        if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (1387:12): [True: 0, False: 69.8k]
  ------------------
 1388|      0|        {
 1389|      0|            ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map =
 1390|      0|                ps_codec->pu1_qp_map_base + (cur_pic_buf_id * ps_codec->u4_num_8x8_blks);
 1391|      0|            ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_cu_type_map =
 1392|      0|                ps_codec->pu1_cu_type_map_base + (cur_pic_buf_id * ps_codec->u4_num_8x8_blks);
 1393|      0|            memset(ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map,
 1394|      0|                0, ps_codec->u4_num_8x8_blks);
 1395|      0|            memset(ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map,
 1396|      0|                0, ps_codec->u4_num_8x8_blks);
 1397|      0|        }
 1398|       |
 1399|  69.8k|        ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1400|  69.8k|        ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1401|       |
 1402|  69.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1403|  69.8k|        ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1404|  69.8k|    }
 1405|       |    /* Since any input bitstream buffer that contains slice data will be sent to output(even in
 1406|       |     * case of error, this buffer is added to display queue and next buffer in the display queue
 1407|       |     * will be returned as the display buffer.
 1408|       |     * Note: If format conversion (or frame copy) is used and is scheduled
 1409|       |     * in a different thread then it has to check if the processing for the current row is complete before
 1410|       |     * it copies/converts a given row. In case of low delay or in case of B pictures, current frame being decoded has to be
 1411|       |     * returned, which requires a status check to ensure that the current row is reconstructed before copying.
 1412|       |     */
 1413|       |    /* Add current picture to display manager */
 1414|      0|    {
 1415|  69.8k|        WORD32 abs_poc;
 1416|  69.8k|        slice_header_t *ps_slice_hdr;
 1417|  69.8k|        ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1418|  69.8k|        abs_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
 1419|  69.8k|        ihevc_disp_mgr_add((disp_mgr_t *)ps_codec->pv_disp_buf_mgr,
 1420|  69.8k|                           ps_codec->as_process[0].i4_cur_pic_buf_id,
 1421|  69.8k|                           abs_poc,
 1422|  69.8k|                           ps_codec->as_process[0].ps_cur_pic);
 1423|  69.8k|    }
 1424|  69.8k|    ps_codec->ps_disp_buf = NULL;
 1425|       |    /* Get picture to be displayed if number of pictures decoded is more than max allowed reorder */
 1426|       |    /* Since the current will be decoded, check is fore >= instead of > */
 1427|  69.8k|    if(((WORD32)(ps_codec->u4_pic_cnt - ps_codec->u4_disp_cnt) >= ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1]) ||
  ------------------
  |  Branch (1427:8): [True: 67.7k, False: 2.17k]
  ------------------
 1428|  2.17k|       (ps_codec->e_frm_out_mode == IVD_DECODE_FRAME_OUT))
  ------------------
  |  Branch (1428:8): [True: 0, False: 2.17k]
  ------------------
 1429|       |
 1430|  67.7k|    {
 1431|  67.7k|        ps_codec->ps_disp_buf = (pic_buf_t *)ihevc_disp_mgr_get((disp_mgr_t *)ps_codec->pv_disp_buf_mgr, &ps_codec->i4_disp_buf_id);
 1432|  67.7k|        ps_codec->u4_disp_cnt++;
 1433|  67.7k|    }
 1434|       |
 1435|  69.8k|    ps_codec->s_fmt_conv.i4_cur_row = 0;
 1436|       |    /* Set number of rows to be processed at a time */
 1437|  69.8k|    ps_codec->s_fmt_conv.i4_num_rows = 4;
 1438|       |
 1439|  69.8k|    if(ps_codec->u4_enable_fmt_conv_ahead && (ps_codec->i4_num_cores > 1))
  ------------------
  |  Branch (1439:8): [True: 0, False: 69.8k]
  |  Branch (1439:46): [True: 0, False: 0]
  ------------------
 1440|      0|    {
 1441|      0|        process_ctxt_t *ps_proc;
 1442|       |
 1443|       |        /* i4_num_cores - 1 contexts are currently being used by other threads */
 1444|      0|        ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1];
 1445|       |
 1446|       |        /* If the frame being decoded and displayed are different, schedule format conversion jobs
 1447|       |         * this will keep the proc threads busy and lets parse thread decode few CTBs ahead
 1448|       |         * If the frame being decoded and displayed are same, then format conversion is scheduled later.
 1449|       |         */
 1450|      0|        if((ps_codec->ps_disp_buf) && (ps_codec->i4_disp_buf_id != ps_proc->i4_cur_pic_buf_id) &&
  ------------------
  |  Branch (1450:12): [True: 0, False: 0]
  |  Branch (1450:39): [True: 0, False: 0]
  ------------------
 1451|      0|           ((0 == ps_codec->i4_share_disp_buf) || (IV_YUV_420P == ps_codec->e_chroma_fmt)))
  ------------------
  |  Branch (1451:13): [True: 0, False: 0]
  |  Branch (1451:51): [True: 0, False: 0]
  ------------------
 1452|      0|        {
 1453|       |
 1454|      0|            for(i = 0; i < ps_sps->i2_pic_ht_in_ctb; i++)
  ------------------
  |  Branch (1454:24): [True: 0, False: 0]
  ------------------
 1455|      0|            {
 1456|      0|                proc_job_t s_job;
 1457|      0|                IHEVCD_ERROR_T ret;
 1458|      0|                s_job.i4_cmd = CMD_FMTCONV;
 1459|      0|                s_job.i2_ctb_cnt = 0;
 1460|      0|                s_job.i2_ctb_x = 0;
 1461|      0|                s_job.i2_ctb_y = i;
 1462|      0|                s_job.i2_slice_idx = 0;
 1463|      0|                s_job.i4_tu_coeff_data_ofst = 0;
 1464|      0|                ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq,
 1465|      0|                                        &s_job, sizeof(proc_job_t), 1);
 1466|      0|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (1466:20): [True: 0, False: 0]
  ------------------
 1467|      0|                    return ret;
 1468|      0|            }
 1469|      0|        }
 1470|      0|    }
 1471|       |
 1472|       |    /* If parse_pic_init is called, then slice data is present in the input bitstrea stream */
 1473|  69.8k|    ps_codec->i4_pic_present = 1;
 1474|       |
 1475|  69.8k|    return ret;
 1476|  69.8k|}

ihevcd_fmt_conv_420sp_to_420p_ssse3:
   60|  12.7k|{
   61|  12.7k|    UWORD8 *pu1_src, *pu1_dst;
   62|  12.7k|    UWORD8 *pu1_u_src, *pu1_v_src;
   63|  12.7k|    WORD32 num_rows, num_cols, src_strd, dst_strd, cols, rows;
   64|  12.7k|    WORD32 i, j;
   65|       |
   66|  12.7k|    cols = 0;
   67|  12.7k|    pu1_u_src = (UWORD8 *)pu1_uv_src;
   68|  12.7k|    pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
   69|  12.7k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (69:8): [True: 0, False: 12.7k]
  ------------------
   70|      0|    {
   71|       |        /* copy luma */
   72|      0|        pu1_src = (UWORD8 *)pu1_y_src;
   73|      0|        pu1_dst = (UWORD8 *)pu1_y_dst;
   74|       |
   75|      0|        num_rows = ht;
   76|      0|        num_cols = wd;
   77|       |
   78|      0|        src_strd = src_y_strd;
   79|      0|        dst_strd = dst_y_strd;
   80|      0|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (80:20): [True: 0, False: 0]
  ------------------
   81|      0|        {
   82|      0|            memcpy(pu1_dst, pu1_src, num_cols);
   83|      0|            pu1_dst += dst_strd;
   84|      0|            pu1_src += src_strd;
   85|      0|        }
   86|      0|    }
   87|       |
   88|       |    /* de-interleave U and V and copy to destination */
   89|  12.7k|    if(!is_u_first)
  ------------------
  |  Branch (89:8): [True: 0, False: 12.7k]
  ------------------
   90|      0|    {
   91|      0|        UWORD8 *temp = pu1_u_dst;
   92|      0|        pu1_u_dst = pu1_v_dst;
   93|      0|        pu1_v_dst = temp;
   94|       |
   95|      0|        pu1_u_src = (UWORD8 *)pu1_uv_src + 1;
   96|      0|        pu1_v_src = (UWORD8 *)pu1_uv_src;
   97|      0|    }
   98|       |
   99|  12.7k|    {
  100|  12.7k|        __m128i src_uv0_8x16b, src_uv1_8x16b, src_u_8x16b, src_v_8x16b;
  101|  12.7k|        __m128i temp0_8x16b, temp1_8x16b, alt_first_mask;
  102|       |
  103|  12.7k|        UWORD8 FIRST_ALT_SHUFFLE[16] = {
  104|  12.7k|            0x00, 0x02, 0x04, 0x06,
  105|  12.7k|            0x08, 0x0A, 0x0C, 0x0E,
  106|  12.7k|            0x01, 0x03, 0x05, 0x07,
  107|  12.7k|            0x09, 0x0B, 0x0D, 0x0F };
  108|       |
  109|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (0 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  110|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (1 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  111|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (2 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  112|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (3 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  113|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (4 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  114|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (5 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  115|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (6 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  116|  12.7k|        PREFETCH((char const *)(pu1_uv_src + (7 * src_uv_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|  12.7k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  117|       |
  118|  12.7k|        num_rows = ht >> 1;
  119|  12.7k|        num_cols = wd >> 1;
  120|       |
  121|  12.7k|        src_strd = src_uv_strd;
  122|  12.7k|        dst_strd = dst_uv_strd;
  123|       |
  124|  12.7k|        alt_first_mask = _mm_loadu_si128((__m128i *)&FIRST_ALT_SHUFFLE[0]);
  125|       |
  126|  12.7k|        if(num_cols > 15)
  ------------------
  |  Branch (126:12): [True: 12.7k, False: 18.4E]
  ------------------
  127|  12.7k|        {
  128|  12.7k|            cols = num_cols >> 4;
  129|       |
  130|   254k|            for(i = 0; i < (num_rows >> 2); i++)
  ------------------
  |  Branch (130:24): [True: 241k, False: 12.7k]
  ------------------
  131|   241k|            {
  132|   241k|                UWORD8 *pu1_uv_src_temp, *pu1_u_dst_temp, *pu1_v_dst_temp;
  133|       |
  134|   241k|                PREFETCH((char const *)(pu1_uv_src + (8 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   241k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  135|   241k|                PREFETCH((char const *)(pu1_uv_src + (9 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   241k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  136|   241k|                PREFETCH((char const *)(pu1_uv_src + (10 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   241k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  137|   241k|                PREFETCH((char const *)(pu1_uv_src + (11 * src_strd)), _MM_HINT_T0)
  ------------------
  |  |  186|   241k|#define PREFETCH(ptr, type) _mm_prefetch(ptr, type);
  ------------------
  138|       |
  139|   241k|                pu1_uv_src_temp = pu1_uv_src;
  140|   241k|                pu1_u_dst_temp =  pu1_u_dst;
  141|   241k|                pu1_v_dst_temp =  pu1_v_dst;
  142|       |
  143|  5.44M|                for(j = 0; j < cols; j++)
  ------------------
  |  Branch (143:28): [True: 5.20M, False: 241k]
  ------------------
  144|  5.20M|                {
  145|       |
  146|       |                    /**** Row 0 ***/
  147|  5.20M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)pu1_uv_src_temp);
  148|  5.20M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + 16));
  149|       |
  150|  5.20M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  151|  5.20M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  152|       |
  153|  5.20M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  154|  5.20M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  155|       |
  156|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp), src_u_8x16b);
  157|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp), src_v_8x16b);
  158|       |
  159|       |                    /**** Row 1 ***/
  160|  5.20M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (1 * src_strd)));
  161|  5.20M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (1 * src_strd) + 16));
  162|       |
  163|  5.20M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  164|  5.20M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  165|       |
  166|  5.20M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  167|  5.20M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  168|       |
  169|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp + (1 * dst_strd)), src_u_8x16b);
  170|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp + (1 * dst_strd)), src_v_8x16b);
  171|       |
  172|       |                    /**** Row 2 ***/
  173|  5.20M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (2 * src_strd)));
  174|  5.20M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (2 * src_strd) + 16));
  175|       |
  176|  5.20M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  177|  5.20M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  178|       |
  179|  5.20M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  180|  5.20M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  181|       |
  182|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp + (2 * dst_strd)), src_u_8x16b);
  183|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp + (2 * dst_strd)), src_v_8x16b);
  184|       |
  185|       |                    /**** Row 3 ***/
  186|  5.20M|                    src_uv0_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (3 * src_strd)));
  187|  5.20M|                    src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + (3 * src_strd) + 16));
  188|       |
  189|  5.20M|                    temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  190|  5.20M|                    temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  191|       |
  192|  5.20M|                    src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  193|  5.20M|                    src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  194|       |
  195|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_u_dst_temp + (3 * dst_strd)), src_u_8x16b);
  196|  5.20M|                    _mm_storeu_si128((__m128i *)(pu1_v_dst_temp + (3 * dst_strd)), src_v_8x16b);
  197|       |
  198|  5.20M|                    pu1_u_dst_temp += 16;
  199|  5.20M|                    pu1_v_dst_temp += 16;
  200|  5.20M|                    pu1_uv_src_temp += 32;
  201|  5.20M|                }
  202|       |
  203|   241k|                pu1_u_dst += 4 * dst_strd;
  204|   241k|                pu1_v_dst += 4 * dst_strd;
  205|   241k|                pu1_uv_src += 4 * src_strd;
  206|       |                //pu1_v_src += src_strd;
  207|   241k|            }
  208|  12.7k|            rows = num_rows & 0x3;
  209|  12.7k|            if(rows)
  ------------------
  |  Branch (209:16): [True: 271, False: 12.4k]
  ------------------
  210|    271|            {
  211|    776|                for(i = 0; i < rows; i++)
  ------------------
  |  Branch (211:28): [True: 505, False: 271]
  ------------------
  212|    505|                {
  213|    505|                    UWORD8 *pu1_uv_src_temp, *pu1_u_dst_temp, *pu1_v_dst_temp;
  214|       |
  215|    505|                    pu1_uv_src_temp = pu1_uv_src;
  216|    505|                    pu1_u_dst_temp =  pu1_u_dst;
  217|    505|                    pu1_v_dst_temp =  pu1_v_dst;
  218|       |
  219|  3.58k|                    for(j = 0; j < cols; j++)
  ------------------
  |  Branch (219:32): [True: 3.08k, False: 505]
  ------------------
  220|  3.08k|                    {
  221|       |
  222|  3.08k|                        src_uv0_8x16b = _mm_loadu_si128((__m128i *)pu1_uv_src_temp);
  223|  3.08k|                        src_uv1_8x16b = _mm_loadu_si128((__m128i *)(pu1_uv_src_temp + 16));
  224|       |
  225|  3.08k|                        temp0_8x16b = _mm_shuffle_epi8(src_uv0_8x16b, alt_first_mask);
  226|  3.08k|                        temp1_8x16b = _mm_shuffle_epi8(src_uv1_8x16b, alt_first_mask);
  227|       |
  228|  3.08k|                        src_u_8x16b = _mm_unpacklo_epi64(temp0_8x16b, temp1_8x16b);
  229|  3.08k|                        src_v_8x16b = _mm_unpackhi_epi64(temp0_8x16b, temp1_8x16b);
  230|       |
  231|  3.08k|                        _mm_storeu_si128((__m128i *)(pu1_u_dst_temp), src_u_8x16b);
  232|  3.08k|                        _mm_storeu_si128((__m128i *)(pu1_v_dst_temp), src_v_8x16b);
  233|       |
  234|  3.08k|                        pu1_u_dst_temp += 16;
  235|  3.08k|                        pu1_v_dst_temp += 16;
  236|  3.08k|                        pu1_uv_src_temp += 32;
  237|  3.08k|                    }
  238|       |
  239|    505|                    pu1_u_dst += dst_strd;
  240|    505|                    pu1_v_dst += dst_strd;
  241|    505|                    pu1_uv_src += src_strd;
  242|    505|                }
  243|    271|            }
  244|  12.7k|            pu1_u_dst -= (num_rows * dst_strd);
  245|  12.7k|            pu1_v_dst -= (num_rows * dst_strd);
  246|  12.7k|            num_cols &= 0x0F;
  247|  12.7k|        }
  248|  12.7k|        if(num_cols)
  ------------------
  |  Branch (248:12): [True: 8.06k, False: 4.68k]
  ------------------
  249|  8.06k|        {
  250|  8.06k|            pu1_u_dst += (cols << 4);
  251|  8.06k|            pu1_v_dst += (cols << 4);
  252|  8.06k|            pu1_u_src += 2 * (cols << 4);
  253|  8.06k|            pu1_v_src += 2 * (cols << 4);
  254|   786k|            for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (254:24): [True: 778k, False: 8.06k]
  ------------------
  255|   778k|            {
  256|  3.95M|                for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (256:28): [True: 3.17M, False: 778k]
  ------------------
  257|  3.17M|                {
  258|  3.17M|                    pu1_u_dst[j] = pu1_u_src[j * 2];
  259|  3.17M|                    pu1_v_dst[j] = pu1_v_src[j * 2];
  260|  3.17M|                }
  261|       |
  262|   778k|                pu1_u_dst += dst_strd;
  263|   778k|                pu1_v_dst += dst_strd;
  264|   778k|                pu1_u_src += src_strd;
  265|   778k|                pu1_v_src += src_strd;
  266|   778k|            }
  267|  8.06k|        }
  268|  12.7k|    }
  269|  12.7k|    return;
  270|  12.7k|}

ihevcd_init_function_ptr:
   62|  52.1k|{
   63|  52.1k|    codec_t *ps_codec = (codec_t *)pv_codec;
   64|  52.1k|    ihevcd_init_function_ptr_generic(&ps_codec->s_func_selector);
   65|  52.1k|    switch(ps_codec->e_processor_arch)
   66|  52.1k|    {
   67|  6.05k|        case ARCH_X86_GENERIC:
  ------------------
  |  Branch (67:9): [True: 6.05k, False: 46.0k]
  ------------------
   68|  6.05k|            ihevcd_init_function_ptr_generic(&ps_codec->s_func_selector);
   69|  6.05k|            break;
   70|  2.72k|        case ARCH_X86_SSSE3:
  ------------------
  |  Branch (70:9): [True: 2.72k, False: 49.3k]
  ------------------
   71|  2.72k|            ihevcd_init_function_ptr_ssse3(&ps_codec->s_func_selector);
   72|  2.72k|            break;
   73|  30.1k|        case ARCH_X86_SSE42:
  ------------------
  |  Branch (73:9): [True: 30.1k, False: 21.9k]
  ------------------
   74|  30.1k|            ihevcd_init_function_ptr_sse42(&ps_codec->s_func_selector);
   75|  30.1k|            break;
   76|      0|        case ARCH_X86_AVX2:
  ------------------
  |  Branch (76:9): [True: 0, False: 52.1k]
  ------------------
   77|       |#ifndef DISABLE_AVX2
   78|       |            ihevcd_init_function_ptr_avx2(&ps_codec->s_func_selector);
   79|       |#else
   80|      0|            ihevcd_init_function_ptr_sse42(&ps_codec->s_func_selector);
   81|      0|#endif
   82|      0|            break;
   83|  13.2k|        default:
  ------------------
  |  Branch (83:9): [True: 13.2k, False: 38.9k]
  ------------------
   84|  13.2k|            ihevcd_init_function_ptr_ssse3(&ps_codec->s_func_selector);
   85|  13.2k|            break;
   86|  52.1k|    }
   87|  52.1k|}
ihevcd_init_arch:
   90|  27.6k|{
   91|  27.6k|    codec_t *ps_codec = (codec_t *)pv_codec;
   92|       |
   93|  27.6k|#ifdef DEFAULT_ARCH
   94|       |#if DEFAULT_ARCH == D_ARCH_X86_GENERIC
   95|       |    ps_codec->e_processor_arch = ARCH_X86_GENERIC;
   96|       |#elif DEFAULT_ARCH == D_ARCH_X86_SSE42
   97|       |    ps_codec->e_processor_arch = ARCH_X86_SSE42;
   98|       |#elif DEFAULT_ARCH == D_ARCH_X86_AVX2
   99|       |    ps_codec->e_processor_arch = ARCH_X86_AVX2;
  100|       |#else
  101|       |    ps_codec->e_processor_arch = ARCH_X86_SSSE3;
  102|       |#endif
  103|       |#else
  104|       |    ps_codec->e_processor_arch = ARCH_X86_SSSE3;
  105|       |#endif
  106|  27.6k|}

ihevcd_init_function_ptr_sse42:
   60|  30.1k|{
   61|  30.1k|    ps_func_selector->ihevc_deblk_chroma_horz_fptr                      =  &ihevc_deblk_chroma_horz_ssse3;
   62|  30.1k|    ps_func_selector->ihevc_deblk_chroma_vert_fptr                      =  &ihevc_deblk_chroma_vert_ssse3;
   63|  30.1k|    ps_func_selector->ihevc_deblk_luma_vert_fptr                        =  &ihevc_deblk_luma_vert_ssse3;
   64|  30.1k|    ps_func_selector->ihevc_deblk_luma_horz_fptr                        =  &ihevc_deblk_luma_horz_ssse3;
   65|  30.1k|    ps_func_selector->ihevc_deblk_422chroma_horz_fptr                   =  &ihevc_deblk_422chroma_horz;
   66|  30.1k|    ps_func_selector->ihevc_deblk_422chroma_vert_fptr                   =  &ihevc_deblk_422chroma_vert;
   67|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_copy_fptr                 =  &ihevc_inter_pred_chroma_copy_sse42;
   68|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr          =  &ihevc_inter_pred_chroma_copy_w16out_sse42;
   69|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_horz_fptr                 =  &ihevc_inter_pred_chroma_horz_ssse3;
   70|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr          =  &ihevc_inter_pred_chroma_horz_w16out_ssse3;
   71|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_fptr                 =  &ihevc_inter_pred_chroma_vert_ssse3;
   72|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr          =  &ihevc_inter_pred_chroma_vert_w16inp_ssse3;
   73|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr   =  &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3;
   74|  30.1k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr          =  &ihevc_inter_pred_chroma_vert_w16out_ssse3;
   75|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_horz_fptr                   =  &ihevc_inter_pred_luma_horz_ssse3;
   76|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_fptr                   =  &ihevc_inter_pred_luma_vert_ssse3;
   77|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr            =  &ihevc_inter_pred_luma_vert_w16out_ssse3;
   78|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr            =  &ihevc_inter_pred_luma_vert_w16inp_ssse3;
   79|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_copy_fptr                   =  &ihevc_inter_pred_luma_copy_ssse3;
   80|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr            =  &ihevc_inter_pred_luma_copy_w16out_sse42;
   81|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr            =  &ihevc_inter_pred_luma_horz_w16out_ssse3;
   82|  30.1k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr     =  &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3;
   83|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr     =  &ihevc_intra_pred_chroma_ref_substitution;
   84|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr       =  &ihevc_intra_pred_luma_ref_substitution;
   85|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr   =  &ihevc_intra_pred_luma_ref_subst_all_avlble;
   86|  30.1k|    ps_func_selector->ihevc_intra_pred_ref_filtering_fptr               =  &ihevc_intra_pred_ref_filtering_sse42;
   87|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr        =  &ihevc_intra_pred_chroma_ref_filtering;
   88|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_dc_fptr                   =  &ihevc_intra_pred_chroma_dc_sse42;
   89|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_horz_fptr                 =  &ihevc_intra_pred_chroma_horz_ssse3;
   90|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr                =  &ihevc_intra_pred_chroma_mode2_ssse3;
   91|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr           =  &ihevc_intra_pred_chroma_mode_18_34_ssse3;
   92|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr        =  &ihevc_intra_pred_chroma_mode_27_to_33_ssse3;
   93|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr          =  &ihevc_intra_pred_chroma_mode_3_to_9_ssse3;
   94|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_planar_fptr               =  &ihevc_intra_pred_chroma_planar_sse42;
   95|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_ver_fptr                  =  &ihevc_intra_pred_chroma_ver_ssse3;
   96|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr        =  &ihevc_intra_pred_chroma_mode_11_to_17_ssse3;
   97|  30.1k|    ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr        =  &ihevc_intra_pred_chroma_mode_19_to_25_ssse3;
   98|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr          =  &ihevc_intra_pred_luma_mode_11_to_17_sse42;
   99|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr          =  &ihevc_intra_pred_luma_mode_19_to_25_sse42;
  100|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_dc_fptr                     =  &ihevc_intra_pred_luma_dc_sse42;
  101|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_horz_fptr                   =  &ihevc_intra_pred_luma_horz_sse42;
  102|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_mode2_fptr                  =  &ihevc_intra_pred_luma_mode2_ssse3;
  103|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr             =  &ihevc_intra_pred_luma_mode_18_34_ssse3;
  104|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr          =  &ihevc_intra_pred_luma_mode_27_to_33_sse42;
  105|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr            =  &ihevc_intra_pred_luma_mode_3_to_9_sse42;
  106|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_planar_fptr                 =  &ihevc_intra_pred_luma_planar_ssse3;
  107|  30.1k|    ps_func_selector->ihevc_intra_pred_luma_ver_fptr                    =  &ihevc_intra_pred_luma_ver_sse42;
  108|  30.1k|    ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr                  =  &ihevc_itrans_res_4x4_ttype1;
  109|  30.1k|    ps_func_selector->ihevc_itrans_res_4x4_fptr                         =  &ihevc_itrans_res_4x4;
  110|  30.1k|    ps_func_selector->ihevc_itrans_res_8x8_fptr                         =  &ihevc_itrans_res_8x8;
  111|  30.1k|    ps_func_selector->ihevc_itrans_res_16x16_fptr                       =  &ihevc_itrans_res_16x16;
  112|  30.1k|    ps_func_selector->ihevc_itrans_res_32x32_fptr                       =  &ihevc_itrans_res_32x32;
  113|  30.1k|    ps_func_selector->ihevc_itrans_res_dc_fptr                          =  &ihevc_itrans_res_dc;
  114|  30.1k|    ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr                =  &ihevc_itrans_recon_4x4_ttype1_sse42;
  115|  30.1k|    ps_func_selector->ihevc_itrans_recon_4x4_fptr                       =  &ihevc_itrans_recon_4x4_sse42;
  116|  30.1k|    ps_func_selector->ihevc_itrans_recon_8x8_fptr                       =  &ihevc_itrans_recon_8x8_sse42;
  117|  30.1k|    ps_func_selector->ihevc_itrans_recon_16x16_fptr                     =  &ihevc_itrans_recon_16x16_ssse3;
  118|  30.1k|    ps_func_selector->ihevc_itrans_recon_32x32_fptr                     =  &ihevc_itrans_recon_32x32_sse42;
  119|  30.1k|    ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr                =  &ihevc_chroma_itrans_recon_4x4;
  120|  30.1k|    ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr                =  &ihevc_chroma_itrans_recon_8x8;
  121|  30.1k|    ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr              =  &ihevc_chroma_itrans_recon_16x16;
  122|  30.1k|    ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr              =  &ihevc_chroma_itrans_recon_32x32;
  123|  30.1k|    ps_func_selector->ihevc_recon_4x4_ttype1_fptr                       =  &ihevc_recon_4x4_ttype1;
  124|  30.1k|    ps_func_selector->ihevc_recon_4x4_fptr                              =  &ihevc_recon_4x4;
  125|  30.1k|    ps_func_selector->ihevc_recon_8x8_fptr                              =  &ihevc_recon_8x8;
  126|  30.1k|    ps_func_selector->ihevc_recon_16x16_fptr                            =  &ihevc_recon_16x16;
  127|  30.1k|    ps_func_selector->ihevc_recon_32x32_fptr                            =  &ihevc_recon_32x32;
  128|  30.1k|    ps_func_selector->ihevc_chroma_recon_4x4_fptr                       =  &ihevc_chroma_recon_4x4;
  129|  30.1k|    ps_func_selector->ihevc_chroma_recon_8x8_fptr                       =  &ihevc_chroma_recon_8x8;
  130|  30.1k|    ps_func_selector->ihevc_chroma_recon_16x16_fptr                     =  &ihevc_chroma_recon_16x16;
  131|  30.1k|    ps_func_selector->ihevc_chroma_recon_32x32_fptr                     =  &ihevc_chroma_recon_32x32;
  132|  30.1k|    ps_func_selector->ihevc_memset_16bit_fptr                           =  &ihevc_memset_16bit;
  133|  30.1k|    ps_func_selector->ihevc_pad_left_luma_fptr                          =  &ihevc_pad_left_luma;
  134|  30.1k|    ps_func_selector->ihevc_pad_left_chroma_fptr                        =  &ihevc_pad_left_chroma;
  135|  30.1k|    ps_func_selector->ihevc_pad_right_luma_fptr                         =  &ihevc_pad_right_luma;
  136|  30.1k|    ps_func_selector->ihevc_pad_right_chroma_fptr                       =  &ihevc_pad_right_chroma;
  137|  30.1k|    ps_func_selector->ihevc_weighted_pred_bi_fptr                       =  &ihevc_weighted_pred_bi_sse42;
  138|  30.1k|    ps_func_selector->ihevc_weighted_pred_bi_default_fptr               =  &ihevc_weighted_pred_bi_default_sse42;
  139|  30.1k|    ps_func_selector->ihevc_weighted_pred_uni_fptr                      =  &ihevc_weighted_pred_uni_sse42;
  140|  30.1k|    ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr                =  &ihevc_weighted_pred_chroma_bi_sse42;
  141|  30.1k|    ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr               =  &ihevc_weighted_pred_chroma_uni_sse42;
  142|  30.1k|    ps_func_selector->ihevc_sao_band_offset_luma_fptr                   =  &ihevc_sao_band_offset_luma_ssse3;
  143|  30.1k|    ps_func_selector->ihevc_sao_band_offset_chroma_fptr                 =  &ihevc_sao_band_offset_chroma_ssse3;
  144|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class0_fptr                 =  &ihevc_sao_edge_offset_class0_ssse3;
  145|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr          =  &ihevc_sao_edge_offset_class0_chroma_ssse3;
  146|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class1_fptr                 =  &ihevc_sao_edge_offset_class1_ssse3;
  147|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr          =  &ihevc_sao_edge_offset_class1_chroma_ssse3;
  148|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class2_fptr                 =  &ihevc_sao_edge_offset_class2_ssse3;
  149|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr          =  &ihevc_sao_edge_offset_class2_chroma_ssse3;
  150|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class3_fptr                 =  &ihevc_sao_edge_offset_class3_ssse3;
  151|  30.1k|    ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr          =  &ihevc_sao_edge_offset_class3_chroma_ssse3;
  152|  30.1k|    ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr               =  &ihevcd_fmt_conv_420sp_to_420sp;
  153|  30.1k|    ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr                =  &ihevcd_fmt_conv_420sp_to_420p_ssse3;
  154|  30.1k|    ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr                =  &ihevcd_fmt_conv_444sp_to_444p;
  155|  30.1k|    ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr                  =  &ihevcd_itrans_recon_dc_luma_sse42;
  156|  30.1k|    ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr                =  &ihevcd_itrans_recon_dc_chroma_sse42;
  157|  30.1k|}

ihevcd_init_function_ptr_ssse3:
   60|  15.9k|{
   61|  15.9k|    ps_func_selector->ihevc_deblk_chroma_horz_fptr                      =  &ihevc_deblk_chroma_horz_ssse3;
   62|  15.9k|    ps_func_selector->ihevc_deblk_chroma_vert_fptr                      =  &ihevc_deblk_chroma_vert_ssse3;
   63|  15.9k|    ps_func_selector->ihevc_deblk_luma_vert_fptr                        =  &ihevc_deblk_luma_vert_ssse3;
   64|  15.9k|    ps_func_selector->ihevc_deblk_luma_horz_fptr                        =  &ihevc_deblk_luma_horz_ssse3;
   65|  15.9k|    ps_func_selector->ihevc_deblk_422chroma_horz_fptr                   =  &ihevc_deblk_422chroma_horz;
   66|  15.9k|    ps_func_selector->ihevc_deblk_422chroma_vert_fptr                   =  &ihevc_deblk_422chroma_vert;
   67|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_copy_fptr                 =  &ihevc_inter_pred_chroma_copy_ssse3;
   68|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr          =  &ihevc_inter_pred_chroma_copy_w16out_ssse3;
   69|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_horz_fptr                 =  &ihevc_inter_pred_chroma_horz_ssse3;
   70|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr          =  &ihevc_inter_pred_chroma_horz_w16out_ssse3;
   71|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_vert_fptr                 =  &ihevc_inter_pred_chroma_vert_ssse3;
   72|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr          =  &ihevc_inter_pred_chroma_vert_w16inp_ssse3;
   73|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr   =  &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3;
   74|  15.9k|    ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr          =  &ihevc_inter_pred_chroma_vert_w16out_ssse3;
   75|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_horz_fptr                   =  &ihevc_inter_pred_luma_horz_ssse3;
   76|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_vert_fptr                   =  &ihevc_inter_pred_luma_vert_ssse3;
   77|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr            =  &ihevc_inter_pred_luma_vert_w16out_ssse3;
   78|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr            =  &ihevc_inter_pred_luma_vert_w16inp_ssse3;
   79|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_copy_fptr                   =  &ihevc_inter_pred_luma_copy_ssse3;
   80|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr            =  &ihevc_inter_pred_luma_copy_w16out_ssse3;
   81|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr            =  &ihevc_inter_pred_luma_horz_w16out_ssse3;
   82|  15.9k|    ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr     =  &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3;
   83|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr     =  &ihevc_intra_pred_chroma_ref_substitution;
   84|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr       =  &ihevc_intra_pred_luma_ref_substitution;
   85|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr   =  &ihevc_intra_pred_luma_ref_subst_all_avlble;
   86|  15.9k|    ps_func_selector->ihevc_intra_pred_ref_filtering_fptr               =  &ihevc_intra_pred_ref_filtering_ssse3;
   87|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr        =  &ihevc_intra_pred_chroma_ref_filtering;
   88|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_dc_fptr                   =  &ihevc_intra_pred_chroma_dc_ssse3;
   89|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_horz_fptr                 =  &ihevc_intra_pred_chroma_horz_ssse3;
   90|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr                =  &ihevc_intra_pred_chroma_mode2_ssse3;
   91|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr           =  &ihevc_intra_pred_chroma_mode_18_34_ssse3;
   92|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr        =  &ihevc_intra_pred_chroma_mode_27_to_33_ssse3;
   93|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr          =  &ihevc_intra_pred_chroma_mode_3_to_9_ssse3;
   94|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_planar_fptr               =  &ihevc_intra_pred_chroma_planar_ssse3;
   95|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_ver_fptr                  =  &ihevc_intra_pred_chroma_ver_ssse3;
   96|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr        =  &ihevc_intra_pred_chroma_mode_11_to_17_ssse3;
   97|  15.9k|    ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr        =  &ihevc_intra_pred_chroma_mode_19_to_25_ssse3;
   98|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr          =  &ihevc_intra_pred_luma_mode_11_to_17_ssse3;
   99|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr          =  &ihevc_intra_pred_luma_mode_19_to_25_ssse3;
  100|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_dc_fptr                     =  &ihevc_intra_pred_luma_dc_ssse3;
  101|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_horz_fptr                   =  &ihevc_intra_pred_luma_horz_ssse3;
  102|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_mode2_fptr                  =  &ihevc_intra_pred_luma_mode2_ssse3;
  103|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr             =  &ihevc_intra_pred_luma_mode_18_34_ssse3;
  104|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr          =  &ihevc_intra_pred_luma_mode_27_to_33_ssse3;
  105|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr            =  &ihevc_intra_pred_luma_mode_3_to_9_ssse3;
  106|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_planar_fptr                 =  &ihevc_intra_pred_luma_planar_ssse3;
  107|  15.9k|    ps_func_selector->ihevc_intra_pred_luma_ver_fptr                    =  &ihevc_intra_pred_luma_ver_ssse3;
  108|  15.9k|    ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr                  =  &ihevc_itrans_res_4x4_ttype1;
  109|  15.9k|    ps_func_selector->ihevc_itrans_res_4x4_fptr                         =  &ihevc_itrans_res_4x4;
  110|  15.9k|    ps_func_selector->ihevc_itrans_res_8x8_fptr                         =  &ihevc_itrans_res_8x8;
  111|  15.9k|    ps_func_selector->ihevc_itrans_res_16x16_fptr                       =  &ihevc_itrans_res_16x16;
  112|  15.9k|    ps_func_selector->ihevc_itrans_res_32x32_fptr                       =  &ihevc_itrans_res_32x32;
  113|  15.9k|    ps_func_selector->ihevc_itrans_res_dc_fptr                          =  &ihevc_itrans_res_dc;
  114|  15.9k|    ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr                =  &ihevc_itrans_recon_4x4_ttype1_ssse3;
  115|  15.9k|    ps_func_selector->ihevc_itrans_recon_4x4_fptr                       =  &ihevc_itrans_recon_4x4_ssse3;
  116|  15.9k|    ps_func_selector->ihevc_itrans_recon_8x8_fptr                       =  &ihevc_itrans_recon_8x8_ssse3;
  117|  15.9k|    ps_func_selector->ihevc_itrans_recon_16x16_fptr                     =  &ihevc_itrans_recon_16x16_ssse3;
  118|  15.9k|    ps_func_selector->ihevc_itrans_recon_32x32_fptr                     =  &ihevc_itrans_recon_32x32_ssse3;
  119|  15.9k|    ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr                =  &ihevc_chroma_itrans_recon_4x4;
  120|  15.9k|    ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr                =  &ihevc_chroma_itrans_recon_8x8;
  121|  15.9k|    ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr              =  &ihevc_chroma_itrans_recon_16x16;
  122|  15.9k|    ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr              =  &ihevc_chroma_itrans_recon_32x32;
  123|  15.9k|    ps_func_selector->ihevc_recon_4x4_ttype1_fptr                       =  &ihevc_recon_4x4_ttype1;
  124|  15.9k|    ps_func_selector->ihevc_recon_4x4_fptr                              =  &ihevc_recon_4x4;
  125|  15.9k|    ps_func_selector->ihevc_recon_8x8_fptr                              =  &ihevc_recon_8x8;
  126|  15.9k|    ps_func_selector->ihevc_recon_16x16_fptr                            =  &ihevc_recon_16x16;
  127|  15.9k|    ps_func_selector->ihevc_recon_32x32_fptr                            =  &ihevc_recon_32x32;
  128|  15.9k|    ps_func_selector->ihevc_chroma_recon_4x4_fptr                       =  &ihevc_chroma_recon_4x4;
  129|  15.9k|    ps_func_selector->ihevc_chroma_recon_8x8_fptr                       =  &ihevc_chroma_recon_8x8;
  130|  15.9k|    ps_func_selector->ihevc_chroma_recon_16x16_fptr                     =  &ihevc_chroma_recon_16x16;
  131|  15.9k|    ps_func_selector->ihevc_chroma_recon_32x32_fptr                     =  &ihevc_chroma_recon_32x32;
  132|  15.9k|    ps_func_selector->ihevc_memset_16bit_fptr                           =  &ihevc_memset_16bit;
  133|  15.9k|    ps_func_selector->ihevc_pad_left_luma_fptr                          =  &ihevc_pad_left_luma;
  134|  15.9k|    ps_func_selector->ihevc_pad_left_chroma_fptr                        =  &ihevc_pad_left_chroma;
  135|  15.9k|    ps_func_selector->ihevc_pad_right_luma_fptr                         =  &ihevc_pad_right_luma;
  136|  15.9k|    ps_func_selector->ihevc_pad_right_chroma_fptr                       =  &ihevc_pad_right_chroma;
  137|  15.9k|    ps_func_selector->ihevc_weighted_pred_bi_fptr                       =  &ihevc_weighted_pred_bi_ssse3;
  138|  15.9k|    ps_func_selector->ihevc_weighted_pred_bi_default_fptr               =  &ihevc_weighted_pred_bi_default_ssse3;
  139|  15.9k|    ps_func_selector->ihevc_weighted_pred_uni_fptr                      =  &ihevc_weighted_pred_uni_ssse3;
  140|  15.9k|    ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr                =  &ihevc_weighted_pred_chroma_bi_ssse3;
  141|  15.9k|    ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr               =  &ihevc_weighted_pred_chroma_uni_ssse3;
  142|  15.9k|    ps_func_selector->ihevc_sao_band_offset_luma_fptr                   =  &ihevc_sao_band_offset_luma_ssse3;
  143|  15.9k|    ps_func_selector->ihevc_sao_band_offset_chroma_fptr                 =  &ihevc_sao_band_offset_chroma_ssse3;
  144|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class0_fptr                 =  &ihevc_sao_edge_offset_class0_ssse3;
  145|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr          =  &ihevc_sao_edge_offset_class0_chroma_ssse3;
  146|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class1_fptr                 =  &ihevc_sao_edge_offset_class1_ssse3;
  147|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr          =  &ihevc_sao_edge_offset_class1_chroma_ssse3;
  148|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class2_fptr                 =  &ihevc_sao_edge_offset_class2_ssse3;
  149|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr          =  &ihevc_sao_edge_offset_class2_chroma_ssse3;
  150|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class3_fptr                 =  &ihevc_sao_edge_offset_class3_ssse3;
  151|  15.9k|    ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr          =  &ihevc_sao_edge_offset_class3_chroma_ssse3;
  152|  15.9k|    ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr               =  &ihevcd_fmt_conv_420sp_to_420sp;
  153|  15.9k|    ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr                =  &ihevcd_fmt_conv_420sp_to_420p;
  154|  15.9k|    ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr                =  &ihevcd_fmt_conv_444sp_to_444p;
  155|  15.9k|    ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr                  =  &ihevcd_itrans_recon_dc_luma_ssse3;
  156|  15.9k|    ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr                =  &ihevcd_itrans_recon_dc_chroma_ssse3;
  157|  15.9k|}

ihevcd_itrans_recon_dc_luma_sse42:
   49|  77.7k|{
   50|  77.7k|    __m128i m_temp_reg_0;
   51|  77.7k|    __m128i m_temp_reg_1;
   52|  77.7k|    __m128i m_temp_reg_2;
   53|  77.7k|    __m128i m_temp_reg_3;
   54|  77.7k|    __m128i m_temp_reg_4;
   55|  77.7k|    __m128i m_temp_reg_5;
   56|  77.7k|    __m128i m_temp_reg_6;
   57|  77.7k|    __m128i m_temp_reg_7;
   58|  77.7k|    __m128i m_temp_reg_8;
   59|  77.7k|    __m128i m_temp_reg_9;
   60|  77.7k|    __m128i m_temp_reg_10;
   61|  77.7k|    __m128i m_temp_reg_11;
   62|  77.7k|    __m128i m_temp_reg_12;
   63|  77.7k|    __m128i m_temp_reg_13;
   64|  77.7k|    __m128i m_temp_reg_14;
   65|  77.7k|    __m128i m_temp_reg_15;
   66|  77.7k|    __m128i m_temp_reg_20, zero_8x16b;
   67|  77.7k|    __m128i *pi4_dst = (__m128i *)pu1_dst;
   68|       |
   69|       |
   70|       |    //WORD32 row,col;
   71|  77.7k|    WORD32 add, shift;
   72|  77.7k|    WORD32 dc_value, quant_out;
   73|  77.7k|    WORD32 trans_size;
   74|       |
   75|       |
   76|       |
   77|       |
   78|  77.7k|    trans_size = (1 << log2_trans_size);
   79|       |
   80|  77.7k|    quant_out = i2_coeff_value;
   81|       |
   82|  77.7k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  77.7k|#define IT_SHIFT_STAGE_1 7
  ------------------
   83|  77.7k|    add = 1 << (shift - 1);
   84|  77.7k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|  77.7k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  77.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 77.7k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 77.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|  77.7k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  77.7k|#define IT_SHIFT_STAGE_2 12
  ------------------
   86|  77.7k|    add = 1 << (shift - 1);
   87|  77.7k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|  77.7k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  77.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 77.7k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 77.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|       |
   89|       |    /*Replicate the DC value within 16 bits in 128 bit register*/
   90|  77.7k|    m_temp_reg_20 = _mm_set1_epi16(dc_value);
   91|  77.7k|    zero_8x16b = _mm_setzero_si128();
   92|       |
   93|  77.7k|    if(trans_size == 4)
  ------------------
  |  Branch (93:8): [True: 4.25k, False: 73.4k]
  ------------------
   94|  4.25k|    {
   95|  4.25k|        WORD32 *pi4_dst = (WORD32 *)pu1_dst;
   96|       |
   97|  4.25k|        m_temp_reg_0 = _mm_loadl_epi64((__m128i *)(pu1_pred));
   98|  4.25k|        m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_pred + pred_strd));
   99|  4.25k|        m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_pred + 2 * pred_strd));
  100|  4.25k|        m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_pred + 3 * pred_strd));
  101|       |
  102|  4.25k|        m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_0, m_temp_reg_1);
  103|  4.25k|        m_temp_reg_5 = _mm_unpacklo_epi32(m_temp_reg_2, m_temp_reg_3);
  104|       |
  105|  4.25k|        m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, zero_8x16b);
  106|  4.25k|        m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, zero_8x16b);
  107|       |
  108|  4.25k|        m_temp_reg_6 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  109|  4.25k|        m_temp_reg_7 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  110|       |
  111|  4.25k|        m_temp_reg_8 = _mm_packus_epi16(m_temp_reg_6, m_temp_reg_7);
  112|       |
  113|       |
  114|  4.25k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_8);
  115|  4.25k|        m_temp_reg_1 = _mm_srli_si128(m_temp_reg_8, 4);
  116|  4.25k|        m_temp_reg_2 = _mm_srli_si128(m_temp_reg_8, 8);
  117|  4.25k|        m_temp_reg_3 = _mm_srli_si128(m_temp_reg_8, 12);
  118|  4.25k|        pu1_dst += dst_strd;
  119|  4.25k|        pi4_dst = (WORD32 *)(pu1_dst);
  120|       |
  121|  4.25k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  122|  4.25k|        pu1_dst += dst_strd;
  123|  4.25k|        pi4_dst = (WORD32 *)(pu1_dst);
  124|       |
  125|  4.25k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  126|  4.25k|        pu1_dst += dst_strd;
  127|  4.25k|        pi4_dst = (WORD32 *)(pu1_dst);
  128|       |
  129|  4.25k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  130|  4.25k|    }
  131|  73.4k|    else
  132|  73.4k|    {
  133|  73.4k|        WORD32 i, j;
  134|       |
  135|   462k|        for(i = 1; i <= trans_size; i += 4)
  ------------------
  |  Branch (135:20): [True: 388k, False: 73.4k]
  ------------------
  136|   388k|        {
  137|  1.64M|            for(j = 1; j <= trans_size; j += 8)
  ------------------
  |  Branch (137:24): [True: 1.26M, False: 388k]
  ------------------
  138|  1.26M|            {
  139|       |
  140|  1.26M|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  141|  1.26M|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_pred + pred_strd));
  142|  1.26M|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_pred + 2 * pred_strd));
  143|  1.26M|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_pred + 3 * pred_strd));
  144|       |
  145|       |
  146|  1.26M|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_0, zero_8x16b);
  147|  1.26M|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_1, zero_8x16b);
  148|  1.26M|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_2, zero_8x16b);
  149|  1.26M|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_3, zero_8x16b);
  150|       |
  151|  1.26M|                m_temp_reg_8 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  152|  1.26M|                m_temp_reg_9 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  153|  1.26M|                m_temp_reg_10 = _mm_add_epi16(m_temp_reg_6, m_temp_reg_20);
  154|  1.26M|                m_temp_reg_11 = _mm_add_epi16(m_temp_reg_7, m_temp_reg_20);
  155|       |
  156|  1.26M|                pi4_dst = (__m128i *)(pu1_dst);
  157|       |
  158|  1.26M|                m_temp_reg_12 = _mm_packus_epi16(m_temp_reg_8, m_temp_reg_9);
  159|  1.26M|                _mm_storel_epi64(pi4_dst, m_temp_reg_12);
  160|       |
  161|  1.26M|                pi4_dst = (__m128i *)(pu1_dst + dst_strd);
  162|       |
  163|  1.26M|                m_temp_reg_13 = _mm_srli_si128(m_temp_reg_12, 8);
  164|  1.26M|                _mm_storel_epi64(pi4_dst, m_temp_reg_13);
  165|       |
  166|  1.26M|                pi4_dst = (__m128i *)(pu1_dst + 2 * dst_strd);
  167|       |
  168|  1.26M|                m_temp_reg_14 = _mm_packus_epi16(m_temp_reg_10, m_temp_reg_11);
  169|  1.26M|                _mm_storel_epi64(pi4_dst, m_temp_reg_14);
  170|       |
  171|  1.26M|                pi4_dst = (__m128i *)(pu1_dst + 3 * dst_strd);
  172|       |
  173|  1.26M|                m_temp_reg_15 = _mm_srli_si128(m_temp_reg_14, 8);
  174|  1.26M|                _mm_storel_epi64(pi4_dst, m_temp_reg_15);
  175|       |
  176|  1.26M|                pu1_pred += 8;
  177|  1.26M|                pu1_dst += 8;
  178|  1.26M|            }
  179|   388k|            pu1_pred += 4 * pred_strd - trans_size;
  180|   388k|            pu1_dst += 4 * dst_strd - trans_size;
  181|   388k|        }
  182|  73.4k|    }
  183|       |
  184|       |
  185|  77.7k|}
ihevcd_itrans_recon_dc_chroma_sse42:
  189|  91.6k|{
  190|  91.6k|    __m128i m_temp_reg_0;
  191|  91.6k|    __m128i m_temp_reg_1;
  192|  91.6k|    __m128i m_temp_reg_2;
  193|  91.6k|    __m128i m_temp_reg_3;
  194|  91.6k|    __m128i m_temp_reg_4;
  195|  91.6k|    __m128i m_temp_reg_5;
  196|  91.6k|    __m128i m_temp_reg_6;
  197|  91.6k|    __m128i m_temp_reg_7;
  198|  91.6k|    __m128i m_temp_reg_8;
  199|  91.6k|    __m128i m_temp_reg_9;
  200|  91.6k|    __m128i m_temp_reg_10;
  201|  91.6k|    __m128i m_temp_reg_11;
  202|  91.6k|    __m128i m_temp_reg_12;
  203|  91.6k|    __m128i m_temp_reg_13;
  204|  91.6k|    __m128i m_temp_reg_14;
  205|  91.6k|    __m128i m_temp_reg_15;
  206|  91.6k|    __m128i m_temp_reg_20, zero_8x16b;
  207|  91.6k|    __m128i *pi4_dst = (__m128i *)pu1_dst;
  208|       |
  209|       |
  210|       |    //WORD32 row,col;
  211|  91.6k|    WORD32 add, shift;
  212|  91.6k|    WORD32 dc_value, quant_out;
  213|  91.6k|    WORD32 trans_size;
  214|       |
  215|       |
  216|  91.6k|    WORD32 shuffle_mask_4x4 = 0x06040200;
  217|  91.6k|    WORD32 unchanged_mask_4x4 = 0x07050301;
  218|  91.6k|    LWORD64 shuffle_mask = 0x0E0C0A0806040200LL;
  219|  91.6k|    LWORD64 unchanged_mask = 0x0F0D0B0907050301LL;
  220|       |
  221|  91.6k|    trans_size = (1 << log2_trans_size);
  222|       |
  223|  91.6k|    quant_out = i2_coeff_value;
  224|       |
  225|  91.6k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|  91.6k|#define IT_SHIFT_STAGE_1 7
  ------------------
  226|  91.6k|    add = 1 << (shift - 1);
  227|  91.6k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|  91.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  91.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 91.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 91.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|  91.6k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|  91.6k|#define IT_SHIFT_STAGE_2 12
  ------------------
  229|  91.6k|    add = 1 << (shift - 1);
  230|  91.6k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|  91.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  91.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 91.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 91.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|       |    /*Replicate the DC value within 16 bits in 128 bit register*/
  233|  91.6k|    m_temp_reg_20 = _mm_set1_epi16(dc_value);
  234|  91.6k|    zero_8x16b = _mm_setzero_si128();
  235|       |
  236|  91.6k|    if(trans_size == 4)
  ------------------
  |  Branch (236:8): [True: 24.4k, False: 67.1k]
  ------------------
  237|  24.4k|    {
  238|  24.4k|        __m128i chroma_shuffle_mask_16x8b;
  239|  24.4k|        __m128i chroma_unchanged_mask_16x8b;
  240|  24.4k|        chroma_shuffle_mask_16x8b = _mm_cvtsi32_si128(shuffle_mask_4x4);
  241|  24.4k|        chroma_unchanged_mask_16x8b = _mm_cvtsi32_si128(unchanged_mask_4x4);
  242|       |
  243|       |        /*Load the prediction data*/
  244|  24.4k|        m_temp_reg_0 = _mm_loadl_epi64((__m128i *)(pu1_pred));
  245|  24.4k|        m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_pred + pred_strd));
  246|  24.4k|        m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_pred + 2 * pred_strd));
  247|  24.4k|        m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_pred + 3 * pred_strd));
  248|       |
  249|  24.4k|        m_temp_reg_10  = _mm_shuffle_epi8(m_temp_reg_0, chroma_shuffle_mask_16x8b);
  250|  24.4k|        m_temp_reg_11  = _mm_shuffle_epi8(m_temp_reg_1, chroma_shuffle_mask_16x8b);
  251|  24.4k|        m_temp_reg_12  = _mm_shuffle_epi8(m_temp_reg_2, chroma_shuffle_mask_16x8b);
  252|  24.4k|        m_temp_reg_13  = _mm_shuffle_epi8(m_temp_reg_3, chroma_shuffle_mask_16x8b);
  253|       |
  254|  24.4k|        m_temp_reg_14 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
  255|  24.4k|        m_temp_reg_15 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
  256|       |
  257|  24.4k|        m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_14, zero_8x16b);
  258|  24.4k|        m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_15, zero_8x16b);
  259|       |
  260|  24.4k|        m_temp_reg_6 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  261|  24.4k|        m_temp_reg_7 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  262|       |
  263|       |        /*Load the recon data to make sure that 'v' is not corrupted when 'u' is called and vice versa*/
  264|  24.4k|        m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_dst);
  265|  24.4k|        m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
  266|  24.4k|        m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_dst + 2 * dst_strd));
  267|  24.4k|        m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_dst + 3 * dst_strd));
  268|       |
  269|  24.4k|        m_temp_reg_0  = _mm_shuffle_epi8(m_temp_reg_0, chroma_unchanged_mask_16x8b);
  270|  24.4k|        m_temp_reg_1  = _mm_shuffle_epi8(m_temp_reg_1, chroma_unchanged_mask_16x8b);
  271|  24.4k|        m_temp_reg_2  = _mm_shuffle_epi8(m_temp_reg_2, chroma_unchanged_mask_16x8b);
  272|  24.4k|        m_temp_reg_3  = _mm_shuffle_epi8(m_temp_reg_3, chroma_unchanged_mask_16x8b);
  273|       |
  274|       |
  275|  24.4k|        m_temp_reg_8 = _mm_packus_epi16(m_temp_reg_6, m_temp_reg_7);
  276|  24.4k|        m_temp_reg_9 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_0);
  277|  24.4k|        m_temp_reg_8 = _mm_srli_si128(m_temp_reg_8, 4);
  278|  24.4k|        m_temp_reg_10 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_1);
  279|  24.4k|        m_temp_reg_8 = _mm_srli_si128(m_temp_reg_8, 4);
  280|  24.4k|        m_temp_reg_11 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_2);
  281|  24.4k|        m_temp_reg_8 = _mm_srli_si128(m_temp_reg_8, 4);
  282|  24.4k|        m_temp_reg_12 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_3);
  283|       |
  284|       |        /*Store the result in the destination*/
  285|  24.4k|        _mm_storel_epi64(pi4_dst, m_temp_reg_9);
  286|  24.4k|        pu1_dst += dst_strd;
  287|  24.4k|        pi4_dst = (__m128i *)(pu1_dst);
  288|       |
  289|       |
  290|  24.4k|        _mm_storel_epi64(pi4_dst, m_temp_reg_10);
  291|  24.4k|        pu1_dst += dst_strd;
  292|  24.4k|        pi4_dst = (__m128i *)(pu1_dst);
  293|       |
  294|  24.4k|        _mm_storel_epi64(pi4_dst, m_temp_reg_11);
  295|  24.4k|        pu1_dst += dst_strd;
  296|  24.4k|        pi4_dst = (__m128i *)(pu1_dst);
  297|       |
  298|  24.4k|        _mm_storel_epi64(pi4_dst, m_temp_reg_12);
  299|  24.4k|    }
  300|  67.1k|    else
  301|  67.1k|    {
  302|  67.1k|        WORD32 i, j;
  303|  67.1k|        __m128i chroma_shuffle_mask_16x8b;
  304|  67.1k|        __m128i chroma_unchanged_mask_16x8b;
  305|  67.1k|        chroma_shuffle_mask_16x8b = _mm_loadl_epi64((__m128i *)(&shuffle_mask));
  306|  67.1k|        chroma_unchanged_mask_16x8b =
  307|  67.1k|                        _mm_loadl_epi64((__m128i *)(&unchanged_mask));
  308|       |
  309|   282k|        for(i = 0; i < trans_size; i += 4)
  ------------------
  |  Branch (309:20): [True: 215k, False: 67.1k]
  ------------------
  310|   215k|        {
  311|   593k|            for(j = 0; j < trans_size; j += 8)
  ------------------
  |  Branch (311:24): [True: 377k, False: 215k]
  ------------------
  312|   377k|            {
  313|       |
  314|   377k|                m_temp_reg_0 = _mm_loadu_si128((__m128i *)pu1_pred);
  315|   377k|                m_temp_reg_1 = _mm_loadu_si128((__m128i *)(pu1_pred + pred_strd));
  316|   377k|                m_temp_reg_2 = _mm_loadu_si128((__m128i *)(pu1_pred + 2 * pred_strd));
  317|   377k|                m_temp_reg_3 = _mm_loadu_si128((__m128i *)(pu1_pred + 3 * pred_strd));
  318|       |
  319|       |                /*Retain only one chroma component*/
  320|   377k|                m_temp_reg_4  = _mm_shuffle_epi8(m_temp_reg_0, chroma_shuffle_mask_16x8b);
  321|   377k|                m_temp_reg_5  = _mm_shuffle_epi8(m_temp_reg_1, chroma_shuffle_mask_16x8b);
  322|   377k|                m_temp_reg_6  = _mm_shuffle_epi8(m_temp_reg_2, chroma_shuffle_mask_16x8b);
  323|   377k|                m_temp_reg_7  = _mm_shuffle_epi8(m_temp_reg_3, chroma_shuffle_mask_16x8b);
  324|       |
  325|   377k|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, zero_8x16b);
  326|   377k|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, zero_8x16b);
  327|   377k|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, zero_8x16b);
  328|   377k|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, zero_8x16b);
  329|       |
  330|   377k|                m_temp_reg_8 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  331|   377k|                m_temp_reg_9 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  332|   377k|                m_temp_reg_10 = _mm_add_epi16(m_temp_reg_6, m_temp_reg_20);
  333|   377k|                m_temp_reg_11 = _mm_add_epi16(m_temp_reg_7, m_temp_reg_20);
  334|       |
  335|       |
  336|       |                /*Load the recon data to make sure that 'v' is not corrupted when 'u' is called and vice versa*/
  337|   377k|                m_temp_reg_0 = _mm_loadu_si128((__m128i *)pu1_dst);
  338|   377k|                m_temp_reg_1 = _mm_loadu_si128((__m128i *)(pu1_dst + dst_strd));
  339|   377k|                m_temp_reg_2 = _mm_loadu_si128((__m128i *)(pu1_dst + 2 * dst_strd));
  340|   377k|                m_temp_reg_3 = _mm_loadu_si128((__m128i *)(pu1_dst + 3 * dst_strd));
  341|       |
  342|   377k|                m_temp_reg_0  = _mm_shuffle_epi8(m_temp_reg_0, chroma_unchanged_mask_16x8b);
  343|   377k|                m_temp_reg_1  = _mm_shuffle_epi8(m_temp_reg_1, chroma_unchanged_mask_16x8b);
  344|   377k|                m_temp_reg_2  = _mm_shuffle_epi8(m_temp_reg_2, chroma_unchanged_mask_16x8b);
  345|   377k|                m_temp_reg_3  = _mm_shuffle_epi8(m_temp_reg_3, chroma_unchanged_mask_16x8b);
  346|       |
  347|   377k|                m_temp_reg_4 = _mm_packus_epi16(m_temp_reg_8, m_temp_reg_9);
  348|   377k|                m_temp_reg_5 = _mm_packus_epi16(m_temp_reg_10, m_temp_reg_11);
  349|       |
  350|   377k|                m_temp_reg_12 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_0);
  351|   377k|                m_temp_reg_4 = _mm_srli_si128(m_temp_reg_4, 8);
  352|   377k|                m_temp_reg_13 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_1);
  353|       |
  354|   377k|                m_temp_reg_14 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_2);
  355|   377k|                m_temp_reg_5 = _mm_srli_si128(m_temp_reg_5, 8);
  356|   377k|                m_temp_reg_15 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_3);
  357|       |
  358|       |                /*Store the result in the destination*/
  359|   377k|                pi4_dst = (__m128i *)(pu1_dst);
  360|       |
  361|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_12);
  362|   377k|                m_temp_reg_8 = _mm_srli_si128(m_temp_reg_12, 8);
  363|       |
  364|   377k|                pi4_dst = (__m128i *)(pu1_dst + 8);
  365|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_8);
  366|       |
  367|   377k|                pi4_dst = (__m128i *)(pu1_dst + dst_strd);
  368|       |
  369|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_13);
  370|   377k|                m_temp_reg_9 = _mm_srli_si128(m_temp_reg_13, 8);
  371|       |
  372|   377k|                pi4_dst = (__m128i *)(pu1_dst + dst_strd + 8);
  373|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_9);
  374|       |
  375|   377k|                pi4_dst = (__m128i *)(pu1_dst + 2 * dst_strd);
  376|       |
  377|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_14);
  378|   377k|                m_temp_reg_10 = _mm_srli_si128(m_temp_reg_14, 8);
  379|       |
  380|   377k|                pi4_dst = (__m128i *)(pu1_dst + 2 * dst_strd + 8);
  381|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_10);
  382|       |
  383|   377k|                pi4_dst = (__m128i *)(pu1_dst + 3 * dst_strd);
  384|       |
  385|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_15);
  386|   377k|                m_temp_reg_11 = _mm_srli_si128(m_temp_reg_15, 8);
  387|       |
  388|   377k|                pi4_dst = (__m128i *)(pu1_dst + 3 * dst_strd + 8);
  389|   377k|                _mm_storel_epi64(pi4_dst, m_temp_reg_11);
  390|       |
  391|   377k|                pu1_pred += 16;
  392|   377k|                pu1_dst += 16;
  393|   377k|            }
  394|       |
  395|   215k|            pu1_pred += 4 * pred_strd - 2 * trans_size;
  396|   215k|            pu1_dst += 4 * dst_strd - 2 * trans_size;
  397|   215k|        }
  398|  67.1k|    }
  399|       |
  400|       |
  401|  91.6k|}

ihevcd_itrans_recon_dc_luma_ssse3:
   51|   225k|{
   52|   225k|    __m128i m_temp_reg_0;
   53|   225k|    __m128i m_temp_reg_1;
   54|   225k|    __m128i m_temp_reg_2;
   55|   225k|    __m128i m_temp_reg_3;
   56|   225k|    __m128i m_temp_reg_4;
   57|   225k|    __m128i m_temp_reg_5;
   58|   225k|    __m128i m_temp_reg_6;
   59|   225k|    __m128i m_temp_reg_7;
   60|   225k|    __m128i m_temp_reg_8;
   61|   225k|    __m128i m_temp_reg_9;
   62|   225k|    __m128i m_temp_reg_10;
   63|   225k|    __m128i m_temp_reg_11;
   64|   225k|    __m128i m_temp_reg_12;
   65|   225k|    __m128i m_temp_reg_13;
   66|   225k|    __m128i m_temp_reg_14;
   67|   225k|    __m128i m_temp_reg_15;
   68|   225k|    __m128i m_temp_reg_20, zero_8x16b;
   69|   225k|    __m128i *pi4_dst = (__m128i *)pu1_dst;
   70|       |
   71|       |
   72|       |
   73|   225k|    WORD32 add, shift;
   74|   225k|    WORD32 dc_value, quant_out;
   75|   225k|    WORD32 trans_size;
   76|       |
   77|       |
   78|       |
   79|   225k|    trans_size = (1 << log2_trans_size);
   80|       |
   81|   225k|    quant_out = i2_coeff_value;
   82|       |
   83|   225k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   225k|#define IT_SHIFT_STAGE_1 7
  ------------------
   84|   225k|    add = 1 << (shift - 1);
   85|   225k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   225k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   225k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 225k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 225k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   86|   225k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   225k|#define IT_SHIFT_STAGE_2 12
  ------------------
   87|   225k|    add = 1 << (shift - 1);
   88|   225k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   225k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   225k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 225k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 225k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|       |
   90|       |    /*Replicate the DC value within 16 bits in 128 bit register*/
   91|   225k|    m_temp_reg_20 = _mm_set1_epi16(dc_value);
   92|   225k|    zero_8x16b = _mm_setzero_si128();
   93|       |
   94|   225k|    if(trans_size == 4)
  ------------------
  |  Branch (94:8): [True: 4.18k, False: 221k]
  ------------------
   95|  4.18k|    {
   96|  4.18k|        WORD32 *pi4_dst = (WORD32 *)pu1_dst;
   97|       |
   98|  4.18k|        m_temp_reg_0 = _mm_loadl_epi64((__m128i *)(pu1_pred));
   99|  4.18k|        m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_pred + pred_strd));
  100|  4.18k|        m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_pred + 2 * pred_strd));
  101|  4.18k|        m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_pred + 3 * pred_strd));
  102|       |
  103|  4.18k|        m_temp_reg_4 = _mm_unpacklo_epi32(m_temp_reg_0, m_temp_reg_1);
  104|  4.18k|        m_temp_reg_5 = _mm_unpacklo_epi32(m_temp_reg_2, m_temp_reg_3);
  105|       |
  106|  4.18k|        m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, zero_8x16b);
  107|  4.18k|        m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, zero_8x16b);
  108|       |
  109|  4.18k|        m_temp_reg_6 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  110|  4.18k|        m_temp_reg_7 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  111|       |
  112|  4.18k|        m_temp_reg_8 = _mm_packus_epi16(m_temp_reg_6, m_temp_reg_7);
  113|       |
  114|       |
  115|  4.18k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_8);
  116|  4.18k|        m_temp_reg_1 = _mm_srli_si128(m_temp_reg_8, 4);
  117|  4.18k|        m_temp_reg_2 = _mm_srli_si128(m_temp_reg_8, 8);
  118|  4.18k|        m_temp_reg_3 = _mm_srli_si128(m_temp_reg_8, 12);
  119|  4.18k|        pu1_dst += dst_strd;
  120|  4.18k|        pi4_dst = (WORD32 *)(pu1_dst);
  121|       |
  122|  4.18k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_1);
  123|  4.18k|        pu1_dst += dst_strd;
  124|  4.18k|        pi4_dst = (WORD32 *)(pu1_dst);
  125|       |
  126|  4.18k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_2);
  127|  4.18k|        pu1_dst += dst_strd;
  128|  4.18k|        pi4_dst = (WORD32 *)(pu1_dst);
  129|       |
  130|  4.18k|        *pi4_dst = _mm_cvtsi128_si32(m_temp_reg_3);
  131|  4.18k|    }
  132|   221k|    else
  133|   221k|    {
  134|   221k|        WORD32 i, j;
  135|       |
  136|  1.28M|        for(i = 1; i <= trans_size; i += 4)
  ------------------
  |  Branch (136:20): [True: 1.06M, False: 221k]
  ------------------
  137|  1.06M|        {
  138|  4.18M|            for(j = 1; j <= trans_size; j += 8)
  ------------------
  |  Branch (138:24): [True: 3.11M, False: 1.06M]
  ------------------
  139|  3.11M|            {
  140|       |
  141|  3.11M|                m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_pred);
  142|  3.11M|                m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_pred + pred_strd));
  143|  3.11M|                m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_pred + 2 * pred_strd));
  144|  3.11M|                m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_pred + 3 * pred_strd));
  145|       |
  146|       |
  147|  3.11M|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_0, zero_8x16b);
  148|  3.11M|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_1, zero_8x16b);
  149|  3.11M|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_2, zero_8x16b);
  150|  3.11M|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_3, zero_8x16b);
  151|       |
  152|  3.11M|                m_temp_reg_8 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  153|  3.11M|                m_temp_reg_9 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  154|  3.11M|                m_temp_reg_10 = _mm_add_epi16(m_temp_reg_6, m_temp_reg_20);
  155|  3.11M|                m_temp_reg_11 = _mm_add_epi16(m_temp_reg_7, m_temp_reg_20);
  156|       |
  157|  3.11M|                pi4_dst = (__m128i *)(pu1_dst);
  158|       |
  159|  3.11M|                m_temp_reg_12 = _mm_packus_epi16(m_temp_reg_8, m_temp_reg_9);
  160|  3.11M|                _mm_storel_epi64(pi4_dst, m_temp_reg_12);
  161|       |
  162|  3.11M|                pi4_dst = (__m128i *)(pu1_dst + dst_strd);
  163|       |
  164|  3.11M|                m_temp_reg_13 = _mm_srli_si128(m_temp_reg_12, 8);
  165|  3.11M|                _mm_storel_epi64(pi4_dst, m_temp_reg_13);
  166|       |
  167|  3.11M|                pi4_dst = (__m128i *)(pu1_dst + 2 * dst_strd);
  168|       |
  169|  3.11M|                m_temp_reg_14 = _mm_packus_epi16(m_temp_reg_10, m_temp_reg_11);
  170|  3.11M|                _mm_storel_epi64(pi4_dst, m_temp_reg_14);
  171|       |
  172|  3.11M|                pi4_dst = (__m128i *)(pu1_dst + 3 * dst_strd);
  173|       |
  174|  3.11M|                m_temp_reg_15 = _mm_srli_si128(m_temp_reg_14, 8);
  175|  3.11M|                _mm_storel_epi64(pi4_dst, m_temp_reg_15);
  176|       |
  177|  3.11M|                pu1_pred += 8;
  178|  3.11M|                pu1_dst += 8;
  179|  3.11M|            }
  180|  1.06M|            pu1_pred += 4 * pred_strd - trans_size;
  181|  1.06M|            pu1_dst += 4 * dst_strd - trans_size;
  182|  1.06M|        }
  183|   221k|    }
  184|       |
  185|       |
  186|   225k|}
ihevcd_itrans_recon_dc_chroma_ssse3:
  190|   723k|{
  191|   723k|    __m128i m_temp_reg_0;
  192|   723k|    __m128i m_temp_reg_1;
  193|   723k|    __m128i m_temp_reg_2;
  194|   723k|    __m128i m_temp_reg_3;
  195|   723k|    __m128i m_temp_reg_4;
  196|   723k|    __m128i m_temp_reg_5;
  197|   723k|    __m128i m_temp_reg_6;
  198|   723k|    __m128i m_temp_reg_7;
  199|   723k|    __m128i m_temp_reg_8;
  200|   723k|    __m128i m_temp_reg_9;
  201|   723k|    __m128i m_temp_reg_10;
  202|   723k|    __m128i m_temp_reg_11;
  203|   723k|    __m128i m_temp_reg_12;
  204|   723k|    __m128i m_temp_reg_13;
  205|   723k|    __m128i m_temp_reg_14;
  206|   723k|    __m128i m_temp_reg_15;
  207|   723k|    __m128i m_temp_reg_20, zero_8x16b;
  208|   723k|    __m128i *pi4_dst = (__m128i *)pu1_dst;
  209|       |
  210|       |
  211|   723k|    WORD32 add, shift;
  212|   723k|    WORD32 dc_value, quant_out;
  213|   723k|    WORD32 trans_size;
  214|       |
  215|       |
  216|   723k|    WORD32 shuffle_mask_4x4 = 0x06040200;
  217|   723k|    WORD32 unchanged_mask_4x4 = 0x07050301;
  218|   723k|    LWORD64 shuffle_mask = 0x0E0C0A0806040200LL;
  219|   723k|    LWORD64 unchanged_mask = 0x0F0D0B0907050301LL;
  220|       |
  221|   723k|    trans_size = (1 << log2_trans_size);
  222|       |
  223|   723k|    quant_out = i2_coeff_value;
  224|       |
  225|   723k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  435|   723k|#define IT_SHIFT_STAGE_1 7
  ------------------
  226|   723k|    add = 1 << (shift - 1);
  227|   723k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   723k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   723k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 723k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 723k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  228|   723k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  436|   723k|#define IT_SHIFT_STAGE_2 12
  ------------------
  229|   723k|    add = 1 << (shift - 1);
  230|   723k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   723k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   723k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 723k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 723k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|       |    /*Replicate the DC value within 16 bits in 128 bit register*/
  233|   723k|    m_temp_reg_20 = _mm_set1_epi16(dc_value);
  234|   723k|    zero_8x16b = _mm_setzero_si128();
  235|       |
  236|   723k|    if(trans_size == 4)
  ------------------
  |  Branch (236:8): [True: 131k, False: 592k]
  ------------------
  237|   131k|    {
  238|   131k|        __m128i chroma_shuffle_mask_16x8b;
  239|   131k|        __m128i chroma_unchanged_mask_16x8b;
  240|   131k|        chroma_shuffle_mask_16x8b = _mm_cvtsi32_si128(shuffle_mask_4x4);
  241|   131k|        chroma_unchanged_mask_16x8b = _mm_cvtsi32_si128(unchanged_mask_4x4);
  242|       |
  243|       |        /*Load the prediction data*/
  244|   131k|        m_temp_reg_0 = _mm_loadl_epi64((__m128i *)(pu1_pred));
  245|   131k|        m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_pred + pred_strd));
  246|   131k|        m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_pred + 2 * pred_strd));
  247|   131k|        m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_pred + 3 * pred_strd));
  248|       |
  249|   131k|        m_temp_reg_10  = _mm_shuffle_epi8(m_temp_reg_0, chroma_shuffle_mask_16x8b);
  250|   131k|        m_temp_reg_11  = _mm_shuffle_epi8(m_temp_reg_1, chroma_shuffle_mask_16x8b);
  251|   131k|        m_temp_reg_12  = _mm_shuffle_epi8(m_temp_reg_2, chroma_shuffle_mask_16x8b);
  252|   131k|        m_temp_reg_13  = _mm_shuffle_epi8(m_temp_reg_3, chroma_shuffle_mask_16x8b);
  253|       |
  254|   131k|        m_temp_reg_14 = _mm_unpacklo_epi32(m_temp_reg_10, m_temp_reg_11);
  255|   131k|        m_temp_reg_15 = _mm_unpacklo_epi32(m_temp_reg_12, m_temp_reg_13);
  256|       |
  257|   131k|        m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_14, zero_8x16b);
  258|   131k|        m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_15, zero_8x16b);
  259|       |
  260|   131k|        m_temp_reg_6 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  261|   131k|        m_temp_reg_7 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  262|       |
  263|       |        /*Load the recon data to make sure that 'v' is not corrupted when 'u' is called and vice versa*/
  264|   131k|        m_temp_reg_0 = _mm_loadl_epi64((__m128i *)pu1_dst);
  265|   131k|        m_temp_reg_1 = _mm_loadl_epi64((__m128i *)(pu1_dst + dst_strd));
  266|   131k|        m_temp_reg_2 = _mm_loadl_epi64((__m128i *)(pu1_dst + 2 * dst_strd));
  267|   131k|        m_temp_reg_3 = _mm_loadl_epi64((__m128i *)(pu1_dst + 3 * dst_strd));
  268|       |
  269|   131k|        m_temp_reg_0  = _mm_shuffle_epi8(m_temp_reg_0, chroma_unchanged_mask_16x8b);
  270|   131k|        m_temp_reg_1  = _mm_shuffle_epi8(m_temp_reg_1, chroma_unchanged_mask_16x8b);
  271|   131k|        m_temp_reg_2  = _mm_shuffle_epi8(m_temp_reg_2, chroma_unchanged_mask_16x8b);
  272|   131k|        m_temp_reg_3  = _mm_shuffle_epi8(m_temp_reg_3, chroma_unchanged_mask_16x8b);
  273|       |
  274|       |
  275|   131k|        m_temp_reg_8 = _mm_packus_epi16(m_temp_reg_6, m_temp_reg_7);
  276|   131k|        m_temp_reg_9 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_0);
  277|   131k|        m_temp_reg_8 = _mm_srli_si128(m_temp_reg_8, 4);
  278|   131k|        m_temp_reg_10 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_1);
  279|   131k|        m_temp_reg_8 = _mm_srli_si128(m_temp_reg_8, 4);
  280|   131k|        m_temp_reg_11 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_2);
  281|   131k|        m_temp_reg_8 = _mm_srli_si128(m_temp_reg_8, 4);
  282|   131k|        m_temp_reg_12 = _mm_unpacklo_epi8(m_temp_reg_8, m_temp_reg_3);
  283|       |
  284|       |        /*Store the result in the destination*/
  285|   131k|        _mm_storel_epi64(pi4_dst, m_temp_reg_9);
  286|   131k|        pu1_dst += dst_strd;
  287|   131k|        pi4_dst = (__m128i *)(pu1_dst);
  288|       |
  289|       |
  290|   131k|        _mm_storel_epi64(pi4_dst, m_temp_reg_10);
  291|   131k|        pu1_dst += dst_strd;
  292|   131k|        pi4_dst = (__m128i *)(pu1_dst);
  293|       |
  294|   131k|        _mm_storel_epi64(pi4_dst, m_temp_reg_11);
  295|   131k|        pu1_dst += dst_strd;
  296|   131k|        pi4_dst = (__m128i *)(pu1_dst);
  297|       |
  298|   131k|        _mm_storel_epi64(pi4_dst, m_temp_reg_12);
  299|   131k|    }
  300|   592k|    else
  301|   592k|    {
  302|   592k|        WORD32 i, j;
  303|   592k|        __m128i chroma_shuffle_mask_16x8b;
  304|   592k|        __m128i chroma_unchanged_mask_16x8b;
  305|   592k|        chroma_shuffle_mask_16x8b = _mm_loadl_epi64((__m128i *)(&shuffle_mask));
  306|   592k|        chroma_unchanged_mask_16x8b =
  307|   592k|                        _mm_loadl_epi64((__m128i *)(&unchanged_mask));
  308|       |
  309|  2.63M|        for(i = 0; i < trans_size; i += 4)
  ------------------
  |  Branch (309:20): [True: 2.04M, False: 592k]
  ------------------
  310|  2.04M|        {
  311|  5.79M|            for(j = 0; j < trans_size; j += 8)
  ------------------
  |  Branch (311:24): [True: 3.75M, False: 2.04M]
  ------------------
  312|  3.75M|            {
  313|       |
  314|  3.75M|                m_temp_reg_0 = _mm_loadu_si128((__m128i *)pu1_pred);
  315|  3.75M|                m_temp_reg_1 = _mm_loadu_si128((__m128i *)(pu1_pred + pred_strd));
  316|  3.75M|                m_temp_reg_2 = _mm_loadu_si128((__m128i *)(pu1_pred + 2 * pred_strd));
  317|  3.75M|                m_temp_reg_3 = _mm_loadu_si128((__m128i *)(pu1_pred + 3 * pred_strd));
  318|       |
  319|       |                /*Retain only one chroma component*/
  320|  3.75M|                m_temp_reg_4  = _mm_shuffle_epi8(m_temp_reg_0, chroma_shuffle_mask_16x8b);
  321|  3.75M|                m_temp_reg_5  = _mm_shuffle_epi8(m_temp_reg_1, chroma_shuffle_mask_16x8b);
  322|  3.75M|                m_temp_reg_6  = _mm_shuffle_epi8(m_temp_reg_2, chroma_shuffle_mask_16x8b);
  323|  3.75M|                m_temp_reg_7  = _mm_shuffle_epi8(m_temp_reg_3, chroma_shuffle_mask_16x8b);
  324|       |
  325|  3.75M|                m_temp_reg_4 = _mm_unpacklo_epi8(m_temp_reg_4, zero_8x16b);
  326|  3.75M|                m_temp_reg_5 = _mm_unpacklo_epi8(m_temp_reg_5, zero_8x16b);
  327|  3.75M|                m_temp_reg_6 = _mm_unpacklo_epi8(m_temp_reg_6, zero_8x16b);
  328|  3.75M|                m_temp_reg_7 = _mm_unpacklo_epi8(m_temp_reg_7, zero_8x16b);
  329|       |
  330|  3.75M|                m_temp_reg_8 = _mm_add_epi16(m_temp_reg_4, m_temp_reg_20);
  331|  3.75M|                m_temp_reg_9 = _mm_add_epi16(m_temp_reg_5, m_temp_reg_20);
  332|  3.75M|                m_temp_reg_10 = _mm_add_epi16(m_temp_reg_6, m_temp_reg_20);
  333|  3.75M|                m_temp_reg_11 = _mm_add_epi16(m_temp_reg_7, m_temp_reg_20);
  334|       |
  335|       |
  336|       |                /*Load the recon data to make sure that 'v' is not corrupted when 'u' is called and vice versa*/
  337|  3.75M|                m_temp_reg_0 = _mm_loadu_si128((__m128i *)pu1_dst);
  338|  3.75M|                m_temp_reg_1 = _mm_loadu_si128((__m128i *)(pu1_dst + dst_strd));
  339|  3.75M|                m_temp_reg_2 = _mm_loadu_si128((__m128i *)(pu1_dst + 2 * dst_strd));
  340|  3.75M|                m_temp_reg_3 = _mm_loadu_si128((__m128i *)(pu1_dst + 3 * dst_strd));
  341|       |
  342|  3.75M|                m_temp_reg_0  = _mm_shuffle_epi8(m_temp_reg_0, chroma_unchanged_mask_16x8b);
  343|  3.75M|                m_temp_reg_1  = _mm_shuffle_epi8(m_temp_reg_1, chroma_unchanged_mask_16x8b);
  344|  3.75M|                m_temp_reg_2  = _mm_shuffle_epi8(m_temp_reg_2, chroma_unchanged_mask_16x8b);
  345|  3.75M|                m_temp_reg_3  = _mm_shuffle_epi8(m_temp_reg_3, chroma_unchanged_mask_16x8b);
  346|       |
  347|  3.75M|                m_temp_reg_4 = _mm_packus_epi16(m_temp_reg_8, m_temp_reg_9);
  348|  3.75M|                m_temp_reg_5 = _mm_packus_epi16(m_temp_reg_10, m_temp_reg_11);
  349|       |
  350|  3.75M|                m_temp_reg_12 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_0);
  351|  3.75M|                m_temp_reg_4 = _mm_srli_si128(m_temp_reg_4, 8);
  352|  3.75M|                m_temp_reg_13 = _mm_unpacklo_epi8(m_temp_reg_4, m_temp_reg_1);
  353|       |
  354|  3.75M|                m_temp_reg_14 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_2);
  355|  3.75M|                m_temp_reg_5 = _mm_srli_si128(m_temp_reg_5, 8);
  356|  3.75M|                m_temp_reg_15 = _mm_unpacklo_epi8(m_temp_reg_5, m_temp_reg_3);
  357|       |
  358|       |                /*Store the result in the destination*/
  359|  3.75M|                pi4_dst = (__m128i *)(pu1_dst);
  360|       |
  361|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_12);
  362|  3.75M|                m_temp_reg_8 = _mm_srli_si128(m_temp_reg_12, 8);
  363|       |
  364|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + 8);
  365|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_8);
  366|       |
  367|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + dst_strd);
  368|       |
  369|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_13);
  370|  3.75M|                m_temp_reg_9 = _mm_srli_si128(m_temp_reg_13, 8);
  371|       |
  372|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + dst_strd + 8);
  373|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_9);
  374|       |
  375|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + 2 * dst_strd);
  376|       |
  377|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_14);
  378|  3.75M|                m_temp_reg_10 = _mm_srli_si128(m_temp_reg_14, 8);
  379|       |
  380|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + 2 * dst_strd + 8);
  381|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_10);
  382|       |
  383|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + 3 * dst_strd);
  384|       |
  385|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_15);
  386|  3.75M|                m_temp_reg_11 = _mm_srli_si128(m_temp_reg_15, 8);
  387|       |
  388|  3.75M|                pi4_dst = (__m128i *)(pu1_dst + 3 * dst_strd + 8);
  389|  3.75M|                _mm_storel_epi64(pi4_dst, m_temp_reg_11);
  390|       |
  391|  3.75M|                pu1_pred += 16;
  392|  3.75M|                pu1_dst += 16;
  393|  3.75M|            }
  394|       |
  395|  2.04M|            pu1_pred += 4 * pred_strd - 2 * trans_size;
  396|  2.04M|            pu1_dst += 4 * dst_strd - 2 * trans_size;
  397|  2.04M|        }
  398|   592k|    }
  399|       |
  400|       |
  401|   723k|}

_Z17iv_aligned_mallocPvii:
   55|   945k|void *iv_aligned_malloc(void *ctxt, WORD32 alignment, WORD32 size) {
   56|   945k|  void *buf = NULL;
   57|   945k|  (void)ctxt;
   58|   945k|  if (0 != posix_memalign(&buf, alignment, size)) {
  ------------------
  |  Branch (58:7): [True: 0, False: 945k]
  ------------------
   59|      0|      return NULL;
   60|      0|  }
   61|   945k|  return buf;
   62|   945k|}
_Z15iv_aligned_freePvS_:
   64|   889k|void iv_aligned_free(void *ctxt, void *buf) {
   65|   889k|  (void)ctxt;
   66|   889k|  free(buf);
   67|   889k|}
_ZN5CodecC2ER18FuzzedDataProvider:
   95|  24.4k|Codec::Codec(FuzzedDataProvider &fdp) {
   96|  24.4k|  mColorFormat =
   97|  24.4k|      (IV_COLOR_FORMAT_T)fdp.PickValueInArray(supportedColorFormats);
   98|  24.4k|  mCodec = nullptr;
   99|  24.4k|  mWidth = 0;
  100|  24.4k|  mHeight = 0;
  101|  24.4k|  mBitDepth = 8;
  102|       |
  103|  24.4k|  memset(&mOutBufHandle, 0, sizeof(mOutBufHandle));
  104|  24.4k|}
_ZN5CodecD2Ev:
  106|  24.4k|Codec::~Codec() {}
_ZN5Codec11createCodecER18FuzzedDataProvider:
  108|  24.4k|void Codec::createCodec(FuzzedDataProvider &fdp) {
  109|  24.4k|  IV_API_CALL_STATUS_T ret;
  110|  24.4k|  ihevcd_cxa_create_ip_t create_ip{};
  111|  24.4k|  ihevcd_cxa_create_op_t create_op{};
  112|  24.4k|  void *fxns = (void *)&ivd_api_function;
  ------------------
  |  |   38|  24.4k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  113|       |
  114|  24.4k|  create_ip.s_ivd_create_ip_t.e_cmd = IVD_CMD_CREATE;
  115|  24.4k|  create_ip.s_ivd_create_ip_t.u4_share_disp_buf = 0;
  116|  24.4k|  create_ip.s_ivd_create_ip_t.e_output_format = mColorFormat;
  117|  24.4k|  create_ip.u4_keep_threads_active = 1;
  118|  24.4k|  create_ip.s_ivd_create_ip_t.pf_aligned_alloc = iv_aligned_malloc;
  119|  24.4k|  create_ip.s_ivd_create_ip_t.pf_aligned_free = iv_aligned_free;
  120|  24.4k|  create_ip.s_ivd_create_ip_t.pv_mem_ctxt = NULL;
  121|  24.4k|  create_ip.u4_enable_yuv_formats = 0b1111; // Enable 400, 420, 422 and 444
  122|  24.4k|  create_ip.u4_enable_hbd = 1;
  123|  24.4k|  create_ip.s_ivd_create_ip_t.u4_size = sizeof(ihevcd_cxa_create_ip_t);
  124|  24.4k|  create_op.s_ivd_create_op_t.u4_size = sizeof(ihevcd_cxa_create_op_t);
  125|       |
  126|  24.4k|  ret = ivd_api_function(NULL, (void *)&create_ip, (void *)&create_op);
  ------------------
  |  |   38|  24.4k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  127|  24.4k|  if (ret != IV_SUCCESS) {
  ------------------
  |  Branch (127:7): [True: 0, False: 24.4k]
  ------------------
  128|      0|    return;
  129|      0|  }
  130|  24.4k|  mCodec = (iv_obj_t *)create_op.s_ivd_create_op_t.pv_handle;
  131|  24.4k|  mCodec->pv_fxns = fxns;
  132|  24.4k|  mCodec->u4_size = sizeof(iv_obj_t);
  133|  24.4k|}
_ZN5Codec11deleteCodecEv:
  135|  24.4k|void Codec::deleteCodec() {
  136|  24.4k|  ivd_delete_ip_t delete_ip{};
  137|  24.4k|  ivd_delete_op_t delete_op{};
  138|       |
  139|  24.4k|  delete_ip.e_cmd = IVD_CMD_DELETE;
  140|  24.4k|  delete_ip.u4_size = sizeof(ivd_delete_ip_t);
  141|  24.4k|  delete_op.u4_size = sizeof(ivd_delete_op_t);
  142|       |
  143|  24.4k|  ivd_api_function(mCodec, (void *)&delete_ip, (void *)&delete_op);
  ------------------
  |  |   38|  24.4k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  144|  24.4k|}
_ZN5Codec10resetCodecEv:
  146|  2.69k|void Codec::resetCodec() {
  147|  2.69k|  ivd_ctl_reset_ip_t s_ctl_ip{};
  148|  2.69k|  ivd_ctl_reset_op_t s_ctl_op{};
  149|       |
  150|  2.69k|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  151|  2.69k|  s_ctl_ip.e_sub_cmd = IVD_CMD_CTL_RESET;
  152|  2.69k|  s_ctl_ip.u4_size = sizeof(ivd_ctl_reset_ip_t);
  153|  2.69k|  s_ctl_op.u4_size = sizeof(ivd_ctl_reset_op_t);
  154|       |
  155|  2.69k|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   38|  2.69k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  156|  2.69k|}
_ZN5Codec8setCoresER18FuzzedDataProvider:
  158|  24.4k|void Codec::setCores(FuzzedDataProvider &fdp) {
  159|  24.4k|  ihevcd_cxa_ctl_set_num_cores_ip_t s_ctl_ip{};
  160|  24.4k|  ihevcd_cxa_ctl_set_num_cores_op_t s_ctl_op{};
  161|  24.4k|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  162|  24.4k|  s_ctl_ip.e_sub_cmd =
  163|  24.4k|      (IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_NUM_CORES;
  164|  24.4k|  s_ctl_ip.u4_num_cores = (fdp.ConsumeIntegral<uint8_t>() % kMaxCores) + 1;
  165|  24.4k|  s_ctl_ip.u4_size = sizeof(ihevcd_cxa_ctl_set_num_cores_ip_t);
  166|  24.4k|  s_ctl_op.u4_size = sizeof(ihevcd_cxa_ctl_set_num_cores_op_t);
  167|       |
  168|  24.4k|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   38|  24.4k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  169|  24.4k|}
_ZN5Codec9setParamsE23IVD_VIDEO_DECODE_MODE_T:
  171|  48.8k|void Codec::setParams(IVD_VIDEO_DECODE_MODE_T mode) {
  172|  48.8k|  ivd_ctl_set_config_ip_t s_ctl_ip{};
  173|  48.8k|  ivd_ctl_set_config_op_t s_ctl_op{};
  174|       |
  175|  48.8k|  s_ctl_ip.u4_disp_wd = 0;
  176|  48.8k|  s_ctl_ip.e_frm_skip_mode = IVD_SKIP_NONE;
  177|  48.8k|  s_ctl_ip.e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
  178|  48.8k|  s_ctl_ip.e_vid_dec_mode = mode;
  179|  48.8k|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  180|  48.8k|  s_ctl_ip.e_sub_cmd = IVD_CMD_CTL_SETPARAMS;
  181|  48.8k|  s_ctl_ip.u4_size = sizeof(ivd_ctl_set_config_ip_t);
  182|  48.8k|  s_ctl_op.u4_size = sizeof(ivd_ctl_set_config_op_t);
  183|       |
  184|  48.8k|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   38|  48.8k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  185|  48.8k|}
_ZN5Codec15setArchitectureE9IV_ARCH_T:
  187|  24.4k|void Codec::setArchitecture(IV_ARCH_T arch) {
  188|  24.4k|  ihevcd_cxa_ctl_set_processor_ip_t s_ctl_ip{};
  189|  24.4k|  ihevcd_cxa_ctl_set_processor_op_t s_ctl_op{};
  190|  24.4k|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  191|  24.4k|  s_ctl_ip.e_sub_cmd =
  192|  24.4k|      (IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_PROCESSOR;
  193|  24.4k|  s_ctl_ip.u4_arch = arch;
  194|  24.4k|  s_ctl_ip.u4_soc = SOC_GENERIC;
  195|  24.4k|  s_ctl_ip.u4_size = sizeof(ihevcd_cxa_ctl_set_processor_ip_t);
  196|  24.4k|  s_ctl_op.u4_size = sizeof(ihevcd_cxa_ctl_set_processor_op_t);
  197|       |
  198|  24.4k|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   38|  24.4k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  199|  24.4k|}
_ZN5Codec9freeFrameEv:
  201|  50.0k|void Codec::freeFrame() {
  202|   106k|  for (int i = 0; i < mOutBufHandle.u4_num_bufs; i++) {
  ------------------
  |  Branch (202:19): [True: 56.7k, False: 50.0k]
  ------------------
  203|  56.7k|    if (mOutBufHandle.pu1_bufs[i]) {
  ------------------
  |  Branch (203:9): [True: 56.7k, False: 0]
  ------------------
  204|  56.7k|      free(mOutBufHandle.pu1_bufs[i]);
  205|  56.7k|      mOutBufHandle.pu1_bufs[i] = nullptr;
  206|  56.7k|    }
  207|  56.7k|  }
  208|  50.0k|}
_ZN5Codec10allocFrameEv:
  210|  25.5k|void Codec::allocFrame() {
  211|  25.5k|  size_t sizes[4] = {0};
  212|  25.5k|  size_t num_bufs = 0;
  213|       |
  214|  25.5k|  freeFrame();
  215|       |
  216|  25.5k|  memset(&mOutBufHandle, 0, sizeof(mOutBufHandle));
  217|       |
  218|  25.5k|  size_t aligned_wd = (mWidth + 1) & ~1;
  219|  25.5k|  size_t aligned_ht = (mHeight + 1) & ~1;
  220|  25.5k|  size_t pixelSize = (mBitDepth > 8) ? 2 : 1;
  ------------------
  |  Branch (220:22): [True: 5.74k, False: 19.8k]
  ------------------
  221|  25.5k|  switch (mColorFormat) {
  222|  4.90k|    case IV_YUV_420SP_UV:
  ------------------
  |  Branch (222:5): [True: 4.90k, False: 20.6k]
  ------------------
  223|  4.90k|      [[fallthrough]];
  224|  9.06k|    case IV_YUV_420SP_VU:
  ------------------
  |  Branch (224:5): [True: 4.16k, False: 21.4k]
  ------------------
  225|  9.06k|      sizes[0] = mWidth * mHeight * pixelSize;
  226|  9.06k|      sizes[1] = ((aligned_wd * aligned_ht) >> 1) * pixelSize;
  227|  9.06k|      num_bufs = 2;
  228|  9.06k|      break;
  229|  5.48k|    case IV_GRAY:
  ------------------
  |  Branch (229:5): [True: 5.48k, False: 20.1k]
  ------------------
  230|  5.48k|      sizes[0] = mWidth * mHeight * pixelSize;
  231|  5.48k|      num_bufs = 1;
  232|  5.48k|      break;
  233|    175|    case IV_YUV_444P:
  ------------------
  |  Branch (233:5): [True: 175, False: 25.4k]
  ------------------
  234|    175|      sizes[0] = (mWidth * mHeight) * pixelSize;
  235|    175|      sizes[1] = (mWidth * mHeight) * pixelSize;
  236|    175|      sizes[2] = (mWidth * mHeight) * pixelSize;
  237|    175|      num_bufs = 3;
  238|    175|      break;
  239|    750|    case IV_YUV_422P:
  ------------------
  |  Branch (239:5): [True: 750, False: 24.8k]
  ------------------
  240|    750|      sizes[0] = (mWidth * mHeight) * pixelSize;
  241|    750|      sizes[1] = ((aligned_wd * mHeight) >> 1) * pixelSize;
  242|    750|      sizes[2] = ((aligned_wd * mHeight) >> 1) * pixelSize;
  243|    750|      num_bufs = 3;
  244|    750|      break;
  245|  10.1k|    case IV_YUV_420P:
  ------------------
  |  Branch (245:5): [True: 10.1k, False: 15.4k]
  ------------------
  246|  10.1k|      [[fallthrough]];
  247|  10.1k|    default:
  ------------------
  |  Branch (247:5): [True: 0, False: 25.5k]
  ------------------
  248|  10.1k|      sizes[0] = mWidth * mHeight * pixelSize;
  249|  10.1k|      sizes[1] = ((aligned_wd * aligned_ht) >> 2) * pixelSize;
  250|  10.1k|      sizes[2] = ((aligned_wd * aligned_ht) >> 2) * pixelSize;
  251|  10.1k|      num_bufs = 3;
  252|  10.1k|      break;
  253|  25.5k|  }
  254|  25.5k|  mOutBufHandle.u4_num_bufs = num_bufs;
  255|  82.3k|  for (int i = 0; i < num_bufs; i++) {
  ------------------
  |  Branch (255:19): [True: 56.7k, False: 25.5k]
  ------------------
  256|  56.7k|    mOutBufHandle.u4_min_out_buf_size[i] = sizes[i];
  257|       |    mOutBufHandle.pu1_bufs[i] = (UWORD8 *)iv_aligned_malloc(NULL, 16, sizes[i]);
  258|  56.7k|  }
  259|  25.5k|}
_ZN5Codec12decodeHeaderEPKhm:
  261|  24.4k|void Codec::decodeHeader(const uint8_t *data, size_t size) {
  262|  24.4k|  setParams(IVD_DECODE_HEADER);
  263|       |
  264|  24.4k|  size_t numDecodeCalls = 0;
  265|       |
  266|   116k|  while (size > 0 && numDecodeCalls < kMaxNumDecodeCalls) {
  ------------------
  |  Branch (266:10): [True: 114k, False: 2.77k]
  |  Branch (266:22): [True: 114k, False: 59]
  ------------------
  267|   114k|    IV_API_CALL_STATUS_T ret;
  268|   114k|    ivd_video_decode_ip_t dec_ip{};
  269|   114k|    ivd_video_decode_op_t dec_op{};
  270|   114k|    size_t bytes_consumed;
  271|       |
  272|   114k|    memset(&dec_ip, 0, sizeof(dec_ip));
  273|   114k|    memset(&dec_op, 0, sizeof(dec_op));
  274|       |
  275|   114k|    dec_ip.e_cmd = IVD_CMD_VIDEO_DECODE;
  276|   114k|    dec_ip.u4_ts = 0;
  277|   114k|    dec_ip.pv_stream_buffer = (void *)data;
  278|   114k|    dec_ip.u4_num_Bytes = size;
  279|   114k|    dec_ip.u4_size = sizeof(ivd_video_decode_ip_t);
  280|   114k|    dec_op.u4_size = sizeof(ivd_video_decode_op_t);
  281|       |
  282|   114k|    ret = ivd_api_function(mCodec, (void *)&dec_ip, (void *)&dec_op);
  ------------------
  |  |   38|   114k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  283|       |
  284|   114k|    bytes_consumed = dec_op.u4_num_bytes_consumed;
  285|       |    /* If no bytes are consumed, then consume 4 bytes to ensure fuzzer proceeds
  286|       |     * to feed next data */
  287|   114k|    if (!bytes_consumed) bytes_consumed = 4;
  ------------------
  |  Branch (287:9): [True: 63.6k, False: 50.4k]
  ------------------
  288|       |
  289|   114k|    bytes_consumed = std::min(size, bytes_consumed);
  290|       |
  291|   114k|    data += bytes_consumed;
  292|   114k|    size -= bytes_consumed;
  293|   114k|    numDecodeCalls++;
  294|       |
  295|   114k|    mWidth = std::min(dec_op.u4_pic_wd, (UWORD32)10240);
  296|   114k|    mHeight = std::min(dec_op.u4_pic_ht, (UWORD32)10240);
  297|   114k|    mBitDepth = dec_op.u4_bit_depth;
  298|   114k|    if (mBitDepth == 0) mBitDepth = 8;
  ------------------
  |  Branch (298:9): [True: 92.4k, False: 21.6k]
  ------------------
  299|       |
  300|       |    /* Break after successful header decode */
  301|   114k|    if (mWidth && mHeight) {
  ------------------
  |  Branch (301:9): [True: 21.6k, False: 92.4k]
  |  Branch (301:19): [True: 21.6k, False: 0]
  ------------------
  302|  21.6k|      break;
  303|  21.6k|    }
  304|   114k|  }
  305|       |  /* if width / height are invalid, set them to defaults */
  306|  24.4k|  if (!mWidth) mWidth = 1920;
  ------------------
  |  Branch (306:7): [True: 2.83k, False: 21.6k]
  ------------------
  307|  24.4k|  if (!mHeight) mHeight = 1088;
  ------------------
  |  Branch (307:7): [True: 2.83k, False: 21.6k]
  ------------------
  308|  24.4k|}
_ZN5Codec11decodeFrameEPKhmPm:
  311|   165k|                                        size_t *bytesConsumed) {
  312|   165k|  IV_API_CALL_STATUS_T ret;
  313|   165k|  ivd_video_decode_ip_t dec_ip{};
  314|   165k|  ivd_video_decode_op_t dec_op{};
  315|       |
  316|   165k|  memset(&dec_ip, 0, sizeof(dec_ip));
  317|   165k|  memset(&dec_op, 0, sizeof(dec_op));
  318|       |
  319|   165k|  dec_ip.e_cmd = IVD_CMD_VIDEO_DECODE;
  320|   165k|  dec_ip.u4_ts = 0;
  321|   165k|  dec_ip.pv_stream_buffer = (void *)data;
  322|   165k|  dec_ip.u4_num_Bytes = size;
  323|   165k|  dec_ip.u4_size = sizeof(ivd_video_decode_ip_t);
  324|   165k|  dec_ip.s_out_buffer = mOutBufHandle;
  325|       |
  326|   165k|  dec_op.u4_size = sizeof(ivd_video_decode_op_t);
  327|       |
  328|   165k|  ret = ivd_api_function(mCodec, (void *)&dec_ip, (void *)&dec_op);
  ------------------
  |  |   38|   165k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  329|       |
  330|       |  /* In case of change in resolution, reset codec and feed the same data again
  331|       |   */
  332|   165k|  if (IVD_RES_CHANGED == (dec_op.u4_error_code & 0xFF)) {
  ------------------
  |  Branch (332:7): [True: 2.69k, False: 162k]
  ------------------
  333|  2.69k|    resetCodec();
  334|  2.69k|    ret = ivd_api_function(mCodec, (void *)&dec_ip, (void *)&dec_op);
  ------------------
  |  |   38|  2.69k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  335|  2.69k|  }
  336|   165k|  *bytesConsumed = dec_op.u4_num_bytes_consumed;
  337|       |
  338|       |  /* If no bytes are consumed, then consume 4 bytes to ensure fuzzer proceeds
  339|       |   * to feed next data */
  340|   165k|  if (!*bytesConsumed) *bytesConsumed = 4;
  ------------------
  |  Branch (340:7): [True: 672, False: 164k]
  ------------------
  341|       |
  342|   165k|  if (dec_op.u4_pic_wd && dec_op.u4_pic_ht &&
  ------------------
  |  Branch (342:7): [True: 144k, False: 20.4k]
  |  Branch (342:27): [True: 144k, False: 0]
  ------------------
  343|   144k|      (mWidth != dec_op.u4_pic_wd || mHeight != dec_op.u4_pic_ht ||
  ------------------
  |  Branch (343:8): [True: 354, False: 144k]
  |  Branch (343:38): [True: 772, False: 143k]
  ------------------
  344|   143k|       (dec_op.u4_bit_depth && mBitDepth != dec_op.u4_bit_depth))) {
  ------------------
  |  Branch (344:9): [True: 143k, False: 0]
  |  Branch (344:32): [True: 18, False: 143k]
  ------------------
  345|  1.14k|    mWidth = std::min(dec_op.u4_pic_wd, (UWORD32)10240);
  346|  1.14k|    mHeight = std::min(dec_op.u4_pic_ht, (UWORD32)10240);
  347|  1.14k|    if (dec_op.u4_bit_depth) mBitDepth = dec_op.u4_bit_depth;
  ------------------
  |  Branch (347:9): [True: 1.14k, False: 0]
  ------------------
  348|  1.14k|    allocFrame();
  349|  1.14k|  }
  350|       |
  351|   165k|  return ret;
  352|   165k|}
LLVMFuzzerTestOneInput:
  354|  24.4k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  355|  24.4k|  if (size < 1) {
  ------------------
  |  Branch (355:7): [True: 0, False: 24.4k]
  ------------------
  356|      0|    return 0;
  357|      0|  }
  358|  24.4k|  FuzzedDataProvider fdp(data, size);
  359|       |
  360|  24.4k|  size_t numDecodeCalls = 0;
  361|  24.4k|  Codec *codec = new Codec(fdp);
  362|  24.4k|  codec->createCodec(fdp);
  363|       |
  364|  24.4k|  IV_ARCH_T arch = (IV_ARCH_T)fdp.PickValueInArray(supportedArchitectures);
  365|  24.4k|  codec->setArchitecture(arch);
  366|       |
  367|  24.4k|  uint64_t maxDecodeCalls;
  368|  24.4k|  if ((arch == ARCH_ARM_NONEON) || (arch == ARCH_X86_GENERIC)) {
  ------------------
  |  Branch (368:7): [True: 4.66k, False: 19.7k]
  |  Branch (368:36): [True: 6.05k, False: 13.7k]
  ------------------
  369|  10.7k|    maxDecodeCalls = kMaxNumDecodeCallsNoSimd;
  370|  13.7k|  } else {
  371|  13.7k|    maxDecodeCalls = kMaxNumDecodeCalls;
  372|  13.7k|  }
  373|       |
  374|  24.4k|  codec->setCores(fdp);
  375|  24.4k|  codec->decodeHeader(data, size);
  376|  24.4k|  codec->setParams(IVD_DECODE_FRAME);
  377|  24.4k|  codec->allocFrame();
  378|       |
  379|   189k|  while (size > 0 && numDecodeCalls < maxDecodeCalls) {
  ------------------
  |  Branch (379:10): [True: 165k, False: 24.0k]
  |  Branch (379:22): [True: 165k, False: 373]
  ------------------
  380|   165k|    IV_API_CALL_STATUS_T ret;
  381|   165k|    size_t bytesConsumed;
  382|   165k|    ret = codec->decodeFrame(data, size, &bytesConsumed);
  383|       |
  384|   165k|    bytesConsumed = std::min(size, bytesConsumed);
  385|   165k|    data += bytesConsumed;
  386|   165k|    size -= bytesConsumed;
  387|   165k|    numDecodeCalls++;
  388|   165k|  }
  389|       |
  390|  24.4k|  codec->freeFrame();
  391|  24.4k|  codec->deleteCodec();
  392|  24.4k|  delete codec;
  393|  24.4k|  return 0;
  394|  24.4k|}

